Skip to content

Commit 43842d9

Browse files
committed
chore: migrate junit3/4 to junit 5
AbstractMojoTestCase based test will be migrate in a seperate PR Signed-off-by: Sandra Parsick <[email protected]>
1 parent 92f4a09 commit 43842d9

File tree

25 files changed

+228
-405
lines changed

25 files changed

+228
-405
lines changed

pom.xml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,15 @@ under the License.
206206
<artifactId>commons-lang3</artifactId>
207207
<version>3.19.0</version>
208208
</dependency>
209-
210209
<!-- test -->
211210
<dependency>
212-
<groupId>junit</groupId>
213-
<artifactId>junit</artifactId>
214-
<version>4.13.2</version>
211+
<groupId>org.junit.jupiter</groupId>
212+
<artifactId>junit-jupiter-api</artifactId>
213+
<scope>test</scope>
214+
</dependency>
215+
<dependency>
216+
<groupId>org.junit.vintage</groupId>
217+
<artifactId>junit-vintage-engine</artifactId>
215218
<scope>test</scope>
216219
</dependency>
217220
<dependency>

src/it/MCHECKSTYLE-129/pom.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ under the License.
2525
<version>1.0-SNAPSHOT</version>
2626
<name>checkstyle-new</name>
2727
<url>http://maven.apache.org</url>
28-
<dependencies>
29-
<dependency>
30-
<groupId>junit</groupId>
31-
<artifactId>junit</artifactId>
32-
<version>3.8.1</version>
33-
<scope>test</scope>
34-
</dependency>
35-
</dependencies>
3628
<build>
3729
<plugins>
3830
<plugin>

src/it/MCHECKSTYLE-129/src/test/java/com/example/AppTest.java

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,8 @@
1919
* under the License.
2020
*/
2121

22-
import junit.framework.Test;
23-
import junit.framework.TestCase;
24-
import junit.framework.TestSuite;
2522

26-
/**
27-
* Unit test for simple App.
28-
*/
23+
2924
public class AppTest
30-
extends TestCase
3125
{
32-
/**
33-
* Create the test case
34-
*
35-
* @param testName name of the test case
36-
*/
37-
public AppTest( String testName )
38-
{
39-
super( testName );
40-
}
41-
42-
/**
43-
* @return the suite of tests being tested
44-
*/
45-
public static Test suite()
46-
{
47-
return new TestSuite( AppTest.class );
48-
}
49-
50-
/**
51-
* Rigourous Test :-)
52-
*/
53-
public void testApp()
54-
{
55-
assertTrue( true );
56-
}
5726
}

src/it/MCHECKSTYLE-131/pom.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ under the License.
2626
<version>1.0-SNAPSHOT</version>
2727
<name>Example</name>
2828
<url>http://maven.apache.org</url>
29-
<dependencies>
30-
<dependency>
31-
<groupId>junit</groupId>
32-
<artifactId>junit</artifactId>
33-
<version>3.8.1</version>
34-
<scope>test</scope>
35-
</dependency>
36-
</dependencies>
3729
<modules>
3830
<module>module</module>
3931
</modules>

src/it/MCHECKSTYLE-99-custom-xref-test-location/pom.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ under the License.
2525
<version>1.0-SNAPSHOT</version>
2626
<name>checkstyle-new</name>
2727
<url>http://maven.apache.org</url>
28-
<dependencies>
29-
<dependency>
30-
<groupId>junit</groupId>
31-
<artifactId>junit</artifactId>
32-
<version>3.8.1</version>
33-
<scope>test</scope>
34-
</dependency>
35-
</dependencies>
3628
<build>
3729
<pluginManagement>
3830
<plugins>

src/it/MCHECKSTYLE-99-custom-xref-test-location/src/test/java/com/example/AppTest.java

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,6 @@
1919
* under the License.
2020
*/
2121

22-
import junit.framework.Test;
23-
import junit.framework.TestCase;
24-
import junit.framework.TestSuite;
25-
26-
/**
27-
* Unit test for simple App.
28-
*/
29-
public class AppTest
30-
extends TestCase
22+
public class AppTest
3123
{
32-
/**
33-
* Create the test case
34-
*
35-
* @param testName name of the test case
36-
*/
37-
public AppTest( String testName )
38-
{
39-
super( testName );
40-
}
41-
42-
/**
43-
* @return the suite of tests being tested
44-
*/
45-
public static Test suite()
46-
{
47-
return new TestSuite( AppTest.class );
48-
}
49-
50-
/**
51-
* Rigourous Test :-)
52-
*/
53-
public void testApp()
54-
{
55-
assertTrue( true );
56-
}
57-
}
24+
}

src/it/MCHECKSTYLE-99-custom-xref-test-location/verify.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
report = new File( basedir, 'target/reports/checkstyle.html' )
2222
assert report.exists();
2323
assert report.text.contains( '<a href="./xref/com/example/App.html#L26">' )
24-
assert report.text.contains( '<a href="./custom-xref-test-location/com/example/AppTest.html#L32">' )
24+
assert report.text.contains( '<a href="./custom-xref-test-location/com/example/AppTest.html#L23">' )
2525

2626
return true;

src/it/MCHECKSTYLE-99/pom.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ under the License.
2525
<version>1.0-SNAPSHOT</version>
2626
<name>checkstyle-new</name>
2727
<url>http://maven.apache.org</url>
28-
<dependencies>
29-
<dependency>
30-
<groupId>junit</groupId>
31-
<artifactId>junit</artifactId>
32-
<version>3.8.1</version>
33-
<scope>test</scope>
34-
</dependency>
35-
</dependencies>
3628
<build>
3729
<pluginManagement>
3830
<plugins>

src/it/MCHECKSTYLE-99/src/test/java/com/example/AppTest.java

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,6 @@
1919
* under the License.
2020
*/
2121

22-
import junit.framework.Test;
23-
import junit.framework.TestCase;
24-
import junit.framework.TestSuite;
25-
26-
/**
27-
* Unit test for simple App.
28-
*/
29-
public class AppTest
30-
extends TestCase
22+
public class AppTest
3123
{
32-
/**
33-
* Create the test case
34-
*
35-
* @param testName name of the test case
36-
*/
37-
public AppTest( String testName )
38-
{
39-
super( testName );
40-
}
41-
42-
/**
43-
* @return the suite of tests being tested
44-
*/
45-
public static Test suite()
46-
{
47-
return new TestSuite( AppTest.class );
48-
}
49-
50-
/**
51-
* Rigourous Test :-)
52-
*/
53-
public void testApp()
54-
{
55-
assertTrue( true );
56-
}
5724
}

src/it/MCHECKSTYLE-99/verify.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
report = new File( basedir, 'target/reports/checkstyle.html' )
2222
assert report.exists();
2323
assert report.text.contains( '<a href="./xref/com/example/App.html#L26">' )
24-
assert report.text.contains( '<a href="./xref-test/com/example/AppTest.html#L32">' )
24+
assert report.text.contains( '<a href="./xref-test/com/example/AppTest.html#L23">' )
2525

2626
return true;

0 commit comments

Comments
 (0)