Skip to content

Commit cdcde8d

Browse files
aamotharaldslawekjaranowski
authored andcommitted
Documented deprecation of the JUnit4 testing approach
# Conflicts: # maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java
1 parent e9d9bf7 commit cdcde8d

File tree

6 files changed

+40
-0
lines changed

6 files changed

+40
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,22 @@
7979
import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
8080

8181
/**
82+
* TODO: add a way to use the plugin POM for the lookup so that the user doesn't have to provide the a:g:v:goal
83+
* as the role hint for the mojo lookup.
84+
* TODO: standardize the execution of the mojo and looking at the results, but could simply have a template method
85+
* for verifying the state of the mojo post execution
86+
* TODO: need a way to look at the state of the mojo without adding getters, this could be where we finally specify
87+
* the expressions which extract values from the mojo.
88+
* TODO: create a standard directory structure for picking up POMs to make this even easier, we really just need a testing
89+
* descriptor and make this entirely declarative!
90+
*
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+
*
8295
* @author jesse
8396
*/
97+
@Deprecated
8498
public abstract class AbstractMojoTestCase extends PlexusTestCase {
8599
private static final DefaultArtifactVersion MAVEN_VERSION;
86100

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)