Skip to content

Commit dfeddc8

Browse files
committed
Use JUnit 5 convention for test method visibility
1 parent 0ea7402 commit dfeddc8

17 files changed

Lines changed: 27 additions & 27 deletions

src/test/java/org/apache/bcel/PLSETest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ void testBCEL79() throws ClassNotFoundException {
144144
*/
145145
@ParameterizedTest
146146
@ValueSource(booleans = { true, false })
147-
public void testCoverage(final boolean compress) throws ClassNotFoundException, java.io.IOException {
147+
void testCoverage(final boolean compress) throws ClassNotFoundException, java.io.IOException {
148148
// load a class with a wide variety of byte codes - including tableswitch and lookupswitch
149149
final JavaClass clazz = getTestJavaClass(PACKAGE_BASE_NAME + ".data.ConstantPoolX");
150150
for (final Method m : clazz.getMethods()) {

src/test/java/org/apache/bcel/classfile/ConstantPoolModuleAccessTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static Stream<URL> testJREModules() throws IOException {
4747

4848
@ParameterizedTest
4949
@MethodSource
50-
public void testJREModules(final URL url) throws Exception {
50+
void testJREModules(final URL url) throws Exception {
5151
try (InputStream inputStream = url.openStream()) {
5252
final ClassParser classParser = new ClassParser(inputStream, "module-info.class");
5353
final JavaClass javaClass = classParser.parse();

src/test/java/org/apache/bcel/classfile/ConstantPoolModuleToStringTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ void test() throws Exception {
497497
"src/test/resources/jpms/java18/commons-io/module-info.class",
498498
"src/test/resources/jpms/java19-ea/commons-io/module-info.class"})
499499
// @formatter:on
500-
public void test(final String first) throws Exception {
500+
void test(final String first) throws Exception {
501501
try (InputStream inputStream = Files.newInputStream(Paths.get(first))) {
502502
test(inputStream);
503503
}
@@ -517,7 +517,7 @@ public void test(final String first) throws Exception {
517517
"javax.annotation.ManagedBean", // contains attribute AnnotationDefault
518518
"javax.management.remote.rmi.RMIConnectionImpl_Stub"}) // contains attribute Synthetic
519519
// @formatter:on
520-
public void testClass(final String className) throws Exception {
520+
void testClass(final String className) throws Exception {
521521
testJavaClass(SyntheticRepository.getInstance().loadClass(className));
522522
}
523523
}

src/test/java/org/apache/bcel/classfile/InvalidMethodSigantureTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void testLoadClass() throws Exception {
7474

7575
@Test
7676
//@Disabled("TODO?")
77-
public void testMethodWithParens() throws Exception {
77+
void testMethodWithParens() throws Exception {
7878
try (InputStream inputStream = Files.newInputStream(Paths.get(SRC_TEST_RESOURCES_KOTLIN, CLASS_NAME + ".class"))) {
7979
final ClassParser classParser = new ClassParser(inputStream, CLASS_NAME);
8080
final JavaClass javaClass = classParser.parse();

src/test/java/org/apache/bcel/classfile/JDKClassDumpTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private void testJar(final Path path) throws Exception {
7777

7878
@ParameterizedTest
7979
@MethodSource("org.apache.bcel.generic.JavaHome#streamJarPath")
80-
public void testPerformance(final Path path) throws Exception {
80+
void testPerformance(final Path path) throws Exception {
8181
assertDoesNotThrow(() -> testJar(path));
8282
}
8383

src/test/java/org/apache/bcel/generic/EmptyVisitorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ final class EmptyVisitorTest {
7070
"org.apache.commons.lang.SerializationUtils" // contains instruction JSR
7171
// @formatter:on
7272
})
73-
public void test(final String className) throws ClassNotFoundException {
73+
void test(final String className) throws ClassNotFoundException {
7474
// "java.io.Bits" is not in Java 21.
7575
assumeFalse(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_21) && className.equals("java.io.Bits"));
7676
final JavaClass javaClass = SyntheticRepository.getInstance().loadClass(className);

src/test/java/org/apache/bcel/generic/FieldGenTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class FieldGenTest {
3535

3636
@Test
3737
@Disabled
38-
public void testBCELComparator() throws Exception {
38+
void testBCELComparator() throws Exception {
3939
final ConstantLong[] constantPool = { new ConstantLong(0), new ConstantLong(0) };
4040
final FieldGen obj = new FieldGen(new Field(0, 0, 0, null, new ConstantPool(constantPool)), new ConstantPoolGen(constantPool));
4141
assertTrue(FieldGen.getComparator().equals(null, null));

src/test/java/org/apache/bcel/generic/JdkGenericDumpTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,20 +173,20 @@ private void testJar(final Path file) throws Exception {
173173

174174
@ParameterizedTest
175175
@MethodSource("org.apache.bcel.generic.JavaHome#streamJarPath")
176-
public void testJdkJars(final Path jarPath) throws Exception {
176+
void testJdkJars(final Path jarPath) throws Exception {
177177
testJar(jarPath);
178178
}
179179

180180
@ParameterizedTest
181181
@MethodSource("org.apache.bcel.generic.JavaHome#streamModulePath")
182182
@DisabledOnJre(value = JRE.JAVA_8)
183-
public void testJdkModules(final Path jmodPath) throws Exception {
183+
void testJdkModules(final Path jmodPath) throws Exception {
184184
testJar(jmodPath);
185185
}
186186

187187
@ParameterizedTest
188188
@MethodSource("org.apache.bcel.generic.JavaHome#streamJavaHome")
189-
public void testJreModules(final JavaHome javaHome) throws Exception {
189+
void testJreModules(final JavaHome javaHome) throws Exception {
190190
assumeTrue(SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9));
191191
try (ModularRuntimeImage mri = javaHome.getModularRuntimeImage()) {
192192
for (final Path path : mri.modules()) {

src/test/java/org/apache/bcel/generic/TypeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void testInternalTypeNametoSignature() {
8484
"org/apache/bcel/generic/MethodGen",
8585
"com/foo/Foo"})
8686
// @formatter:on
87-
public void testLDC(final String className) throws Exception {
87+
void testLDC(final String className) throws Exception {
8888
final JavaClass jc = Repository.lookupClass(className);
8989
final ConstantPoolGen cpg = new ConstantPoolGen(jc.getConstantPool());
9090
for (final Method method : jc.getMethods()) {

src/test/java/org/apache/bcel/util/BCELifierTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private String exec(final File workDir, final String... args) throws Exception {
111111
"drem 3 2 = 1.0"
112112
// @formatter:on
113113
})
114-
public void testBinaryOp(final String exp) throws Exception {
114+
void testBinaryOp(final String exp) throws Exception {
115115
BinaryOpCreator.main(new String[] {});
116116
final File workDir = new File("target");
117117
final Pattern pattern = Pattern.compile("([a-z]{3,5}) ([-+]?\\d*\\.?\\d+) ([-+]?\\d*\\.?\\d+) = ([-+]?\\d*\\.?\\d+)");
@@ -193,7 +193,7 @@ void testHelloWorld() throws Exception {
193193
"target/test-classes/Java4Example.class"
194194
// @formatter:on
195195
})
196-
public void testJavapCompare(final String pathToClass) throws Exception {
196+
void testJavapCompare(final String pathToClass) throws Exception {
197197
testClassOnPath(pathToClass);
198198
}
199199

@@ -213,7 +213,7 @@ void testMainNoArg() throws Exception {
213213

214214
@ParameterizedTest
215215
@ValueSource(strings = { "StackMapExample", "StackMapExample2" })
216-
public void testStackMap(final String className) throws Exception {
216+
void testStackMap(final String className) throws Exception {
217217
testJavapCompare(className);
218218
final File workDir = new File("target");
219219
assertEquals("Hello World" + EOL, exec(workDir, "java", "-cp", CLASSPATH, className, "Hello"));

0 commit comments

Comments
 (0)