Skip to content

Commit c564d7d

Browse files
committed
Documented deprecation of the JUnit4 testing approach
1 parent 6b0d067 commit c564d7d

File tree

6 files changed

+31
-0
lines changed

6 files changed

+31
-0
lines changed

maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,13 @@
8888
* TODO: create a standard directory structure for picking up POMs to make this even easier, we really just need a testing
8989
* descriptor and make this entirely declarative!
9090
*
91+
* @deprected As of version 3.4.0, it is advised to work with JUnit5 tests which do not
92+
* use this class but {@link org.apache.maven.plugin.testing.junit5.MojoTest}
93+
* instead.
94+
*
9195
* @author jesse
9296
*/
97+
@Deprecated
9398
public abstract class AbstractMojoTestCase extends PlexusTestCase {
9499
private static final DefaultArtifactVersion MAVEN_VERSION;
95100

maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/MojoLogWrapper.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@
2525

2626
/**
2727
* @author jdcasey
28+
*
29+
* @deprected As of version 3.4.0, it is advised to work with JUnit5 tests which do not
30+
* use this class but {@link javax.inject.Inject} to inject a Log instance
31+
* instead.
32+
*
2833
*/
34+
@Deprecated
2935
public class MojoLogWrapper implements Log {
3036
private final Logger logger;
3137

maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/MojoParameters.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@
2323
/**
2424
* Static helpers to create and manipulate mojo execution configuration parameters
2525
*
26+
* @deprected As of version 3.4.0, it is advised to work with JUnit5 tests which do not
27+
* use this class but {@link org.apache.maven.plugin.testing.junit5.MojoParameters}
28+
* instead.
29+
*
2630
* @since 3.2.0
2731
*/
32+
@Deprecated
2833
public class MojoParameters {
2934
public static Xpp3Dom newParameter(String name, String value) {
3035
Xpp3Dom child = new Xpp3Dom(name);

maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/MojoRule.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,14 @@
5252
* exhibited as {@code public} in the rule. You may annotate single tests methods with
5353
* {@link WithoutMojo} to prevent the rule from firing.
5454
*
55+
* @deprected As of version 3.4.0, it is advised to work with JUnit5 tests which do not
56+
* use rules but extensions {@link org.apache.maven.plugin.testing.junit5.MojoExtension}
57+
* instead.
58+
*
5559
* @author Mirko Friedenhagen
5660
* @since 2.2
5761
*/
62+
@Deprecated
5863
public class MojoRule implements TestRule {
5964
private final AbstractMojoTestCase testCase;
6065

maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/WithoutMojo.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@
2929
*
3030
* An annotation for test methods that do not require the {@link MojoRule} to create and tear down the instance.
3131
*
32+
* @deprected As of version 3.4.0, it is advised to work with JUnit5 tests which do not
33+
* use rules but extensions {@link org.apache.maven.plugin.testing.junit5.MojoExtension}
34+
* instead.
35+
*
3236
* @author Mirko Friedenhagen
3337
*/
38+
@Deprecated
3439
@Retention(RUNTIME)
3540
@Documented
3641
@Target(METHOD)

maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/resources/TestResources.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@
3434
/**
3535
* Junit4 test {@link Rule} to extract and assert test resources.
3636
*
37+
* @deprected As of version 3.4.0, it is advised to work with JUnit5 tests which do not
38+
* use rules but extensions {@link org.apache.maven.plugin.testing.junit5.MojoExtension}
39+
* instead.
40+
*
3741
* @since 3.1.0
3842
*/
43+
@Deprecated
3944
public class TestResources extends TestWatcher {
4045

4146
private final String projectsDir;

0 commit comments

Comments
 (0)