@@ -32,7 +32,7 @@ under the License.
3232 <p >
3333 This testing library is <b >NOT</b > designed for integration or functional testing:
3434 <a href =" /plugins/maven-invoker-plugin/" ><code >maven-invoker-plugin</code ></a > is the way to go if you need it,
35- which gives you a complete Maven environment at the cost of more resources and time consuptions .
35+ which gives you a complete Maven environment at the cost of more resources and time consumption .
3636 </p >
3737 </answer >
3838 </faq >
@@ -41,32 +41,28 @@ under the License.
4141 <answer >
4242 <p >
4343 <dl >
44- <dt >TestCase from JUnit</dt >
44+ <dt >JUnit 5 Extension - <i >@MojoTest</i > annotation</dt >
45+ <dd >The preferred way to test Mojos is to use the JUnit 5 extension provided by the
46+ <i >maven-plugin-testing-harness</i >. You can annotate your test class with <code >@MojoTest</code >
47+ to have the extension set up the necessary Maven components for you. You can then inject your Mojo
48+ and any required Maven components directly into your test class.
49+ See <a href =" ./apidocs/org/apache/maven/api/plugin/testing/package-summary.html" >javadocs</a > for examples.
50+ </dd >
51+ <dt >TestCase from JUnit - deprecated</dt >
4552 <dd >You could use the <a href =" http://junit.org/" >JUnit framework</a > to test your plugin in
4653 the same way you'd write any other JUnit test cases, i.e. by writing a test class which extends
4754 <i >TestCase</i >.</dd >
48- <dt >TestCase from Plexus</dt >
49- <dd >Mojos are written to take specific advantage of the <a href = " http://plexus.codehaus.org/plexus-containers/ " >Plexus
50- container</ a >. If you need Plexus container services, you could write your class which extends <i >PlexusTestCase</i >,
55+ <dt >TestCase from Plexus - deprecated </dt >
56+ <dd >Mojos are written to take specific advantage of the <i >Plexus container</ i >.
57+ If you need Plexus container services, you could write your class which extends <i >PlexusTestCase</i >,
5158 instead of <i >TestCase</i >.</dd >
52- <dt >TestCase from Testing Harness</dt >
59+ <dt >TestCase from Testing Harness - deprecated </dt >
5360 <dd >If you need to inject Maven objects into your mojo, you could use the <i >maven-plugin-testing-harness</i >.
5461 The <i >maven-plugin-testing-harness</i > is explicitly intended to test the
5562 <i >org.apache.maven.reporting.AbstractMavenReport#execute()</i > implementation.</dd >
5663 </dl >
5764 </p >
5865 </answer >
5966 </faq >
60- <faq id =" Maven 2.x compatibility" >
61- <question >Is Mojo Testing Harness 2.x compatible with Maven 2.x?</question >
62- <answer >
63- <p >
64- Mojo Testing Harness 2.0+ requires Maven 3.0. This does not necessary mean that your mojos will be
65- incompatible with Maven 2.x, it only means that mojo unit tests use Maven 3.x libraries to mock Maven
66- environment. Still, if you want to be absolutely sure your mojo is compatible with Maven 2.x, then you probably want
67- to use Mojo Testing Harness 1.x.
68- </p >
69- </answer >
70- </faq >
7167 </part >
7268</faqs >
0 commit comments