Skip to content

Commit 3a1f4f4

Browse files
committed
revert parameterized changes
1 parent b99df58 commit 3a1f4f4

File tree

3 files changed

+20
-35
lines changed

3 files changed

+20
-35
lines changed

log4j-1.2-api/src/test/java/org/apache/log4j/config/AbstractLog4j1ConfigurationConverterTest.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,18 @@
2929
import java.util.List;
3030
import javax.xml.parsers.DocumentBuilderFactory;
3131
import javax.xml.parsers.ParserConfigurationException;
32-
// import org.junit.jupiter.params.ParameterizedTest;
33-
// import org.junit.jupiter.params.provider.MethodSource;
34-
import org.junit.jupiter.api.Test;
35-
36-
// import org.junit.runner.RunWith;
37-
// import org.junit.runners.Parameterized;
32+
// import org.junit.jupiter.api.Test;
33+
import org.junit.Test;
34+
import org.junit.runner.RunWith;
35+
import org.junit.runners.Parameterized;
3836
import org.xml.sax.SAXException;
3937
// import org.junit.jupiter.params.ParameterizedTest;
4038
// import org.junit.jupiter.params.provider.MethodSource;
4139

4240
// import org.junit.runner.RunWith;
4341
// import org.junit.runners.Parameterized;
4442

43+
@RunWith(Parameterized.class)
4544
public abstract class AbstractLog4j1ConfigurationConverterTest {
4645

4746
protected static List<Path> getPaths(final String root) throws IOException {
@@ -56,15 +55,14 @@ public FileVisitResult visitFile(final Path file, final BasicFileAttributes attr
5655
return paths;
5756
}
5857

59-
protected final Path pathIn;
58+
private final Path pathIn;
6059

6160
public AbstractLog4j1ConfigurationConverterTest(final Path path) {
6261
this.pathIn = path;
6362
}
6463

65-
// @ParameterizedTest
66-
// @MethodSource("data")
67-
public void test(final Path path) throws Exception {
64+
@Test
65+
public void test() throws Exception {
6866
final Path tempFile = Files.createTempFile("log4j2", ".xml");
6967
try {
7068
final Log4j1ConfigurationConverter.CommandLineArguments cla =

log4j-1.2-api/src/test/java/org/apache/log4j/config/Log4j1ConfigurationConverterHadoopTest.java

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,20 @@
1919
import java.io.IOException;
2020
import java.nio.file.Path;
2121
import java.util.List;
22-
import org.junit.jupiter.params.ParameterizedTest;
23-
import org.junit.jupiter.params.provider.MethodSource;
22+
import org.junit.runner.RunWith;
23+
import org.junit.runners.Parameterized;
24+
// import org.junit.jupiter.params.ParameterizedTest;
25+
// import org.junit.jupiter.params.provider.MethodSource;
2426

27+
@RunWith(Parameterized.class)
2528
public class Log4j1ConfigurationConverterHadoopTest extends AbstractLog4j1ConfigurationConverterTest {
2629

27-
// @Parameterized.Parameters(name = "{0}")
30+
@Parameterized.Parameters(name = "{0}")
2831
public static List<Path> data() throws IOException {
2932
return getPaths("src/test/resources/config-1.2/hadoop");
3033
}
3134

3235
public Log4j1ConfigurationConverterHadoopTest(final Path path) {
3336
super(path);
3437
}
35-
36-
// ParameterizedTest replacing the JUnit 4 @Test in abstract class
37-
@ParameterizedTest
38-
@MethodSource("data")
39-
// @Override
40-
public void test(Path path) throws Exception {
41-
super.test(path);
42-
}
4338
}

log4j-1.2-api/src/test/java/org/apache/log4j/config/Log4j1ConfigurationConverterSparkTest.java

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,20 @@
1919
import java.io.IOException;
2020
import java.nio.file.Path;
2121
import java.util.List;
22-
import org.junit.jupiter.params.ParameterizedTest;
23-
import org.junit.jupiter.params.provider.MethodSource;
22+
import org.junit.runner.RunWith;
23+
import org.junit.runners.Parameterized;
24+
// import org.junit.jupiter.params.provider.MethodSource;
25+
// import org.junit.jupiter.params.ParameterizedTest;
2426

25-
// import org.junit.runner.RunWith;
26-
// import org.junit.runners.Parameterized;
27-
28-
// @RunWith(Parameterized.class)
27+
@RunWith(Parameterized.class)
2928
public class Log4j1ConfigurationConverterSparkTest extends AbstractLog4j1ConfigurationConverterTest {
3029

30+
@Parameterized.Parameters(name = "{0}")
3131
public static List<Path> data() throws IOException {
3232
return getPaths("src/test/resources/config-1.2/spark");
3333
}
3434

3535
public Log4j1ConfigurationConverterSparkTest(final Path path) {
3636
super(path);
3737
}
38-
39-
// ParameterizedTest replacing the JUnit 4 @Test in abstract class
40-
@ParameterizedTest
41-
@MethodSource("data")
42-
// @Override
43-
public void test(Path path) throws Exception {
44-
super.test(path);
45-
}
4638
}

0 commit comments

Comments
 (0)