Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
<email>ggregory at apache.org</email>
<url>https://www.garygregory.com</url>
<organization>The Apache Software Foundation</organization>
<organizationUrl>https://www.apache.org/</organizationUrl>
<organizationUrl>https://www.apache.org/</organizationUrl>
<roles>
<role>PMC Member</role>
</roles>
Expand Down Expand Up @@ -345,9 +345,15 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.7.2</version>
<scope>test</scope>
</dependency>
<dependency>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JUnit 4 should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I thought we'd have to keep the JUnit 4 dependency until all tests were migrated to JUnit 5.
I guess junit-vintage-engine doesn't require that.

At least that's the impression the docs gave me.

The JUnit Platform can run JUnit 4 based tests as long as you configure a testImplementation dependency on JUnit 4 and a testRuntimeOnly dependency on the JUnit Vintage TestEngine implementation similar to the following.

dependencies {
    testImplementation("junit:junit:4.13")
    testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.7.2")
}

- https://junit.org/junit5/docs/current/user-guide/#running-tests-build-gradle-engines-configure

Just tried now and it worked perfectly fine without the JUnit 4 dependency, though. 🤔

<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.7.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -522,9 +528,9 @@
</file>
</newVersion>
<parameter>
<!--
to support "mvn site" (no japicmp report)
as well as "mvn package site" (with japicmp report)
<!--
to support "mvn site" (no japicmp report)
as well as "mvn package site" (with japicmp report)
-->
<ignoreMissingNewVersion>true</ignoreMissingNewVersion>
</parameter>
Expand Down
34 changes: 0 additions & 34 deletions src/test/java/org/apache/commons/beanutils2/A.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/
package org.apache.commons.beanutils2;

import java.io.OutputStream;
import java.io.PrintStream;
import static org.junit.jupiter.api.Assertions.assertAll;

import java.lang.reflect.Method;
import java.lang.reflect.Modifier;

Expand Down Expand Up @@ -570,16 +570,18 @@ public void testPublicSub() throws Exception {
}

public void testParentMethod() throws Exception {
final OutputStream os = new PrintStream(System.out);
final PrintStream ps = new PrintStream(System.out);

A a = new A();
MethodUtils.invokeMethod(a, "foo", os);
assertTrue("Method Invoked(1)", a.called);

a = new A();
MethodUtils.invokeMethod(a, "foo", ps);
assertTrue("Method Invoked(2)", a.called);
final String a = "A";

assertAll(
() -> {
final String actual1 = (String) MethodUtils.invokeMethod(a, "toLowerCase", null);
assertEquals("a", actual1);
},
() -> {
final char actual2 = (char) MethodUtils.invokeMethod(a, "charAt", 0);
assertEquals('A', actual2);
}
);
}

/**
Expand Down
Loading