Skip to content

Commit 22b9fab

Browse files
committedJan 27, 2019
For #939: Upgrade to Junit 5
1 parent 93f22f1 commit 22b9fab

File tree

26 files changed

+116
-57
lines changed

26 files changed

+116
-57
lines changed
 

‎pom.xml

+11
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,17 @@
134134
<artifactId>commons-lang3</artifactId>
135135
<version>3.7</version>
136136
</dependency>
137+
<dependency>
138+
<groupId>org.junit.jupiter</groupId>
139+
<artifactId>junit-jupiter-api</artifactId>
140+
<version>5.3.1</version>
141+
</dependency>
142+
<dependency>
143+
<groupId>org.junit.jupiter</groupId>
144+
<artifactId>junit-jupiter-engine</artifactId>
145+
<version>5.1.0</version>
146+
<scope>test</scope>
147+
</dependency>
137148
</dependencies>
138149
</dependencyManagement>
139150
<build>

‎qulice-ant/pom.xml

+13-6
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,26 @@
8989
<artifactId>jcabi-aspects</artifactId>
9090
<scope>provided</scope>
9191
</dependency>
92-
<dependency>
93-
<groupId>org.apache.ant</groupId>
94-
<artifactId>ant</artifactId>
95-
<version>1.9.4</version>
96-
</dependency>
92+
<dependency>
93+
<groupId>org.apache.ant</groupId>
94+
<artifactId>ant</artifactId>
95+
<version>1.9.4</version>
96+
</dependency>
9797
<dependency>
9898
<groupId>commons-io</groupId>
9999
<artifactId>commons-io</artifactId>
100100
</dependency>
101+
<dependency>
102+
<groupId>org.junit.jupiter</groupId>
103+
<artifactId>junit-jupiter-api</artifactId>
104+
</dependency>
105+
<dependency>
106+
<groupId>org.junit.jupiter</groupId>
107+
<artifactId>junit-jupiter-engine</artifactId>
108+
</dependency>
101109
</dependencies>
102110
<build>
103111
<plugins>
104-
105112
<plugin>
106113
<artifactId>maven-invoker-plugin</artifactId>
107114
<configuration combine.children="append">

‎qulice-ant/src/test/java/com/qulice/ant/AntEnvironmentTest.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
*/
3030
package com.qulice.ant;
3131

32-
import org.junit.Ignore;
33-
import org.junit.Test;
32+
import org.junit.jupiter.api.Disabled;
33+
import org.junit.jupiter.api.Test;
3434

3535
/**
3636
* Test for AntEnvironment.
@@ -45,7 +45,7 @@ public class AntEnvironmentTest {
4545
* @throws Exception If something wrong happens inside
4646
*/
4747
@Test
48-
@Ignore
48+
@Disabled
4949
@SuppressWarnings("PMD.UncommentedEmptyMethodBody")
5050
public void buildsClassloader() throws Exception {
5151
}
@@ -55,7 +55,7 @@ public void buildsClassloader() throws Exception {
5555
* @throws Exception If something wrong happens inside
5656
*/
5757
@Test
58-
@Ignore
58+
@Disabled
5959
@SuppressWarnings("PMD.UncommentedEmptyMethodBody")
6060
public void returnsFiles() throws Exception {
6161
}
@@ -65,7 +65,7 @@ public void returnsFiles() throws Exception {
6565
* @throws Exception If something wrong happens inside
6666
*/
6767
@Test
68-
@Ignore
68+
@Disabled
6969
@SuppressWarnings("PMD.UncommentedEmptyMethodBody")
7070
public void excludesFiles() throws Exception {
7171
}

‎qulice-checkstyle/pom.xml

+8
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@
9494
<groupId>org.apache.commons</groupId>
9595
<artifactId>commons-lang3</artifactId>
9696
</dependency>
97+
<dependency>
98+
<groupId>org.junit.jupiter</groupId>
99+
<artifactId>junit-jupiter-api</artifactId>
100+
</dependency>
101+
<dependency>
102+
<groupId>org.junit.jupiter</groupId>
103+
<artifactId>junit-jupiter-engine</artifactId>
104+
</dependency>
97105
</dependencies>
98106
<build>
99107
<plugins>

‎qulice-checkstyle/src/test/java/com/qulice/checkstyle/ChecksTest.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@
4545
import org.apache.commons.lang3.StringUtils;
4646
import org.hamcrest.MatcherAssert;
4747
import org.hamcrest.Matchers;
48-
import org.junit.Test;
49-
import org.junit.runner.RunWith;
48+
import org.junit.jupiter.api.Test;
49+
import org.junit.jupiter.api.extension.ExtendWith;
50+
import org.junit.jupiter.api.extension.ParameterResolver;
5051
import org.junit.runners.Parameterized;
5152
import org.mockito.Mockito;
5253
import org.mockito.invocation.InvocationOnMock;
@@ -57,7 +58,7 @@
5758
* Integration test case for all checkstyle checks.
5859
* @since 0.3
5960
*/
60-
@RunWith(Parameterized.class)
61+
@ExtendWith(ParameterResolver.class)
6162
public final class ChecksTest {
6263

6364
/**

‎qulice-checkstyle/src/test/java/com/qulice/checkstyle/CheckstyleValidatorTest.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646
import org.hamcrest.Matchers;
4747
import org.hamcrest.TypeSafeMatcher;
4848
import org.hamcrest.collection.IsIterableContainingInOrder;
49-
import org.junit.Ignore;
5049
import org.junit.Rule;
51-
import org.junit.Test;
50+
import org.junit.jupiter.api.Disabled;
51+
import org.junit.jupiter.api.Test;
5252

5353
/**
5454
* Test case for {@link CheckstyleValidator} class.
@@ -430,7 +430,7 @@ public void allowsOnlyProperlyOrderedAtClauses() throws Exception {
430430
* @throws Exception If something wrong happens inside
431431
*/
432432
@Test
433-
@Ignore
433+
@Disabled
434434
public void passesWindowsEndsOfLineWithoutException() throws Exception {
435435
this.validate("WindowsEol.java", false, "LICENSE found:");
436436
}
@@ -444,7 +444,7 @@ public void passesWindowsEndsOfLineWithoutException() throws Exception {
444444
* correctly. (see changes done in #61)
445445
*/
446446
@Test
447-
@Ignore
447+
@Disabled
448448
public void testWindowsEndsOfLineWithLinuxSources() throws Exception {
449449
this.runValidation("WindowsEolLinux.java", false);
450450
}
@@ -689,7 +689,7 @@ public void allowsUppercaseAbbreviationExceptions() throws Exception {
689689
* being placed at end of lines. Correct this behavior and uncomment test
690690
* below.
691691
*/
692-
@Ignore
692+
@Disabled
693693
@Test
694694
public void checkLambdaAndGenericsAtEndOfLine() throws Exception {
695695
this.runValidation("ValidLambdaAndGenericsAtEndOfLine.java", true);

‎qulice-findbugs/pom.xml

+8
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@
173173
</exclusion>
174174
</exclusions>
175175
</dependency>
176+
<dependency>
177+
<groupId>org.junit.jupiter</groupId>
178+
<artifactId>junit-jupiter-api</artifactId>
179+
</dependency>
180+
<dependency>
181+
<groupId>org.junit.jupiter</groupId>
182+
<artifactId>junit-jupiter-engine</artifactId>
183+
</dependency>
176184
</dependencies>
177185
<build>
178186
<plugins>

‎qulice-findbugs/src/test/java/com/qulice/findbugs/FindBugsValidatorTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import com.qulice.spi.Environment;
3434
import com.qulice.spi.ValidationException;
3535
import org.junit.Ignore;
36-
import org.junit.Test;
36+
import org.junit.jupiter.api.Test;
3737

3838
/**
3939
* Test case for {@link FindBugsValidator}.
@@ -59,7 +59,7 @@ public void passesCorrectFilesWithNoExceptions() throws Exception {
5959
* @throws Exception If something wrong happens inside
6060
*/
6161
@Ignore
62-
@Test(expected = ValidationException.class)
62+
@org.junit.Test(expected = ValidationException.class)
6363
public void reportsIncorrectlyAddedThrows() throws Exception {
6464
final byte[] bytecode = new BytecodeMocker()
6565
.withSource(
@@ -107,7 +107,7 @@ public void ignoresCorrectlyAddedThrows() throws Exception {
107107
* FindbugsValidator throw exception for invalid file.
108108
* @throws Exception If something wrong happens inside
109109
*/
110-
@Test(expected = ValidationException.class)
110+
@org.junit.Test(expected = ValidationException.class)
111111
public void throwsExceptionOnViolation() throws Exception {
112112
final byte[] bytecode = new BytecodeMocker()
113113
.withSource("class Foo { public Foo clone() { return this; } }")

‎qulice-maven-plugin/pom.xml

+8-6
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,6 @@
178178
<artifactId>maven-plugin-testing-harness</artifactId>
179179
<version>3.1.0</version>
180180
<scope>test</scope>
181-
<exclusions>
182-
<exclusion>
183-
<groupId>junit</groupId>
184-
<artifactId>junit</artifactId>
185-
</exclusion>
186-
</exclusions>
187181
</dependency>
188182
<dependency>
189183
<groupId>org.codehaus.plexus</groupId>
@@ -224,6 +218,14 @@
224218
<version>5.0.0.Final</version>
225219
<scope>runtime</scope>
226220
</dependency>
221+
<dependency>
222+
<groupId>org.junit.jupiter</groupId>
223+
<artifactId>junit-jupiter-api</artifactId>
224+
</dependency>
225+
<dependency>
226+
<groupId>org.junit.jupiter</groupId>
227+
<artifactId>junit-jupiter-engine</artifactId>
228+
</dependency>
227229
</dependencies>
228230
<build>
229231
<plugins>

‎qulice-maven-plugin/src/test/java/com/qulice/maven/CheckMojoTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import org.apache.maven.plugin.logging.Log;
3636
import org.apache.maven.project.MavenProject;
3737
import org.codehaus.plexus.context.Context;
38-
import org.junit.Test;
38+
import org.junit.jupiter.api.Test;
3939
import org.mockito.Mockito;
4040

4141
/**

‎qulice-maven-plugin/src/test/java/com/qulice/maven/DefaultMavenEnvironmentTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import org.apache.maven.project.MavenProject;
3535
import org.hamcrest.MatcherAssert;
3636
import org.hamcrest.Matchers;
37-
import org.junit.Test;
37+
import org.junit.jupiter.api.Test;
3838
import org.mockito.Mockito;
3939

4040
/**

‎qulice-maven-plugin/src/test/java/com/qulice/maven/DefaultValidatorsProviderTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import com.qulice.spi.Environment;
3333
import org.hamcrest.MatcherAssert;
3434
import org.hamcrest.Matchers;
35-
import org.junit.Test;
35+
import org.junit.jupiter.api.Test;
3636

3737
/**
3838
* Test case for {@link ValidatorsProvider} class.

‎qulice-maven-plugin/src/test/java/com/qulice/maven/DependenciesValidatorTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import org.apache.maven.project.MavenProject;
4040
import org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalysis;
4141
import org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalyzer;
42-
import org.junit.Test;
42+
import org.junit.jupiter.api.Test;
4343
import org.mockito.Mockito;
4444

4545
/**
@@ -89,7 +89,7 @@ public void passesIfNoDependencyProblemsFound() throws Exception {
8989
* DependencyValidator can catch dependency problems.
9090
* @throws Exception If something wrong happens inside
9191
*/
92-
@Test(expected = ValidationException.class)
92+
@org.junit.Test(expected = ValidationException.class)
9393
public void catchesDependencyProblemsAndThrowsException() throws Exception {
9494
final ProjectDependencyAnalysis analysis =
9595
Mockito.mock(ProjectDependencyAnalysis.class);

‎qulice-maven-plugin/src/test/java/com/qulice/maven/PomXpathValidatorTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import org.apache.commons.io.FileUtils;
3636
import org.cactoos.io.ResourceOf;
3737
import org.cactoos.text.TextOf;
38-
import org.junit.Test;
38+
import org.junit.jupiter.api.Test;
3939

4040
/**
4141
* Test case for {@link PomXpathValidator} class.

‎qulice-maven-plugin/src/test/java/com/qulice/maven/SvnPropertiesValidatorTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
*/
3030
package com.qulice.maven;
3131

32-
import org.junit.Test;
32+
33+
import org.junit.jupiter.api.Test;
3334

3435
/**
3536
* Test case for {@link SvnPropertiesValidator}.

‎qulice-pmd/pom.xml

+8
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@
8686
<groupId>commons-io</groupId>
8787
<artifactId>commons-io</artifactId>
8888
</dependency>
89+
<dependency>
90+
<groupId>org.junit.jupiter</groupId>
91+
<artifactId>junit-jupiter-api</artifactId>
92+
</dependency>
93+
<dependency>
94+
<groupId>org.junit.jupiter</groupId>
95+
<artifactId>junit-jupiter-engine</artifactId>
96+
</dependency>
8997
</dependencies>
9098
<build>
9199
<plugins>

‎qulice-pmd/src/test/java/com/qulice/pmd/LocalVariableCouldBeFinalRuleTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
import org.hamcrest.core.IsEqual;
3333
import org.hamcrest.core.StringStartsWith;
34-
import org.junit.Test;
34+
import org.junit.jupiter.api.Test;
3535

3636
/**
3737
* Test case for LocalVariableCouldBeFinal.

‎qulice-pmd/src/test/java/com/qulice/pmd/PmdDisabledRulesTest.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,16 @@
3232
import java.util.Arrays;
3333
import java.util.Collection;
3434
import org.hamcrest.Matchers;
35-
import org.junit.Test;
36-
import org.junit.runner.RunWith;
35+
import org.junit.jupiter.api.Test;
36+
import org.junit.jupiter.api.extension.ExtendWith;
37+
import org.junit.jupiter.api.extension.ParameterResolver;
3738
import org.junit.runners.Parameterized;
3839

3940
/**
4041
* Tests for disabled rules.
4142
* @since 0.16
4243
*/
43-
@RunWith(Parameterized.class)
44+
@ExtendWith(ParameterResolver.class)
4445
public final class PmdDisabledRulesTest {
4546

4647
/**

‎qulice-pmd/src/test/java/com/qulice/pmd/PmdEmptyTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
package com.qulice.pmd;
3131

3232
import org.hamcrest.Matchers;
33-
import org.junit.Test;
33+
import org.junit.jupiter.api.Test;
3434

3535
/**
3636
* Test case for {@link PmdValidator} class.

‎qulice-pmd/src/test/java/com/qulice/pmd/PmdValidatorTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
import org.hamcrest.Matchers;
4242
import org.hamcrest.core.IsEqual;
4343
import org.hamcrest.core.IsNot;
44-
import org.junit.Test;
44+
import org.junit.jupiter.api.Test;
4545

4646
/**
4747
* Test case for {@link PmdValidator} class.

‎qulice-pmd/src/test/java/com/qulice/pmd/UnusedImportsRuleTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
import org.hamcrest.core.IsEqual;
3333
import org.hamcrest.core.StringStartsWith;
34-
import org.junit.Test;
34+
import org.junit.jupiter.api.Test;
3535

3636
/**
3737
* Test case for LocalVariableCouldBeFinal.

0 commit comments

Comments
 (0)
Please sign in to comment.