Skip to content

Commit 96c8d1d

Browse files
committed
Replace JUnit 4 parameterised tests with subclasses that override the constructor of DefaultRouteScriptAppenderTest
1 parent e1715dc commit 96c8d1d

File tree

5 files changed

+93
-16
lines changed

5 files changed

+93
-16
lines changed

log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/routing/DefaultRouteScriptAppenderTest.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,11 @@
3232
import org.junit.BeforeClass;
3333
import org.junit.Rule;
3434
import org.junit.Test;
35-
import org.junit.runner.RunWith;
36-
import org.junit.runners.Parameterized;
3735

3836
/**
3937
*
4038
*/
41-
@RunWith(Parameterized.class)
42-
public class DefaultRouteScriptAppenderTest {
43-
44-
@Parameterized.Parameters(name = "{0} {1}")
45-
public static Object[][] getParameters() {
46-
// @formatter:off
47-
return new Object[][] {
48-
{"log4j-routing-default-route-script-groovy.xml", false},
49-
{"log4j-routing-default-route-script-javascript.xml", false},
50-
{"log4j-routing-script-staticvars-javascript.xml", true},
51-
{"log4j-routing-script-staticvars-groovy.xml", true},
52-
};
53-
// @formatter:on
54-
}
39+
public abstract class DefaultRouteScriptAppenderTest {
5540

5641
@BeforeClass
5742
public static void beforeClass() {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to you under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package org.apache.logging.log4j.core.appender.routing;
18+
19+
public class DefaultRouteScriptGroovyAppenderTest extends DefaultRouteScriptAppenderTest {
20+
public DefaultRouteScriptGroovyAppenderTest() {
21+
super("log4j-routing-default-route-script-groovy.xml", false);
22+
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to you under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package org.apache.logging.log4j.core.appender.routing;
18+
19+
public class DefaultRouteScriptJavaScriptAppenderTest extends DefaultRouteScriptAppenderTest {
20+
public DefaultRouteScriptJavaScriptAppenderTest() {
21+
super("log4j-routing-default-route-script-javascript.xml", false);
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to you under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package org.apache.logging.log4j.core.appender.routing;
18+
19+
public class ScriptStaticVarsGroovyAppenderTest extends DefaultRouteScriptAppenderTest {
20+
public ScriptStaticVarsGroovyAppenderTest() {
21+
super("log4j-routing-script-staticvars-groovy.xml", true);
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to you under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package org.apache.logging.log4j.core.appender.routing;
18+
19+
public class ScriptStaticVarsJavaScriptAppenderTest extends DefaultRouteScriptAppenderTest {
20+
public ScriptStaticVarsJavaScriptAppenderTest() {
21+
super("log4j-routing-script-staticvars-javascript.xml", true);
22+
}
23+
}

0 commit comments

Comments
 (0)