diff --git a/maven-plugin-testing-harness/src/site/fml/faq.fml b/maven-plugin-testing-harness/src/site/fml/faq.fml deleted file mode 100644 index d07aa76..0000000 --- a/maven-plugin-testing-harness/src/site/fml/faq.fml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - What is a Mojo Testing Harness? - -

- A unit test attempts to verify a mojo as an isolated unit, by mocking out the rest of the Maven environment. - A mojo unit test does not attempt to run your plugin in the context of a real Maven build. - Unit tests are designed to be fast. -

-

- This testing library is NOT designed for integration or functional testing: - maven-invoker-plugin is the way to go if you need it, - which gives you a complete Maven environment at the cost of more resources and time consumption. -

-
-
- - What kind of unit tests are supported? - -

-

-
JUnit 5 Extension - @MojoTest annotation
-
The preferred way to test Mojos is to use the JUnit 5 extension provided by the - maven-plugin-testing-harness. You can annotate your test class with @MojoTest - to have the extension set up the necessary Maven components for you. You can then inject your Mojo - and any required Maven components directly into your test class. - See javadocs for examples. -
-
TestCase from JUnit - deprecated
-
You could use the JUnit framework to test your plugin in - the same way you'd write any other JUnit test cases, i.e. by writing a test class which extends - TestCase.
-
TestCase from Plexus - deprecated
-
Mojos are written to take specific advantage of the Plexus container. - If you need Plexus container services, you could write your class which extends PlexusTestCase, - instead of TestCase.
-
TestCase from Testing Harness - deprecated
-
If you need to inject Maven objects into your mojo, you could use the maven-plugin-testing-harness. - The maven-plugin-testing-harness is explicitly intended to test the - org.apache.maven.reporting.AbstractMavenReport#execute() implementation.
-
-

-
-
-
-
diff --git a/maven-plugin-testing-harness/src/site/markdown/faq.md b/maven-plugin-testing-harness/src/site/markdown/faq.md new file mode 100644 index 0000000..bafc7b2 --- /dev/null +++ b/maven-plugin-testing-harness/src/site/markdown/faq.md @@ -0,0 +1,62 @@ +title: Frequently Asked Questions + + + + + + + + + + + + + + + + + + + + +# Frequently Asked Questions + +1. [What is a Mojo Testing Harness?](#What_is_a_Mojo_Testing_Harness) +2. [What kind of unit tests are supported?](#What_kinds_of_unit_tests_are_supported) + + + +### What is a Mojo Testing Harness? + +A unit test attempts to verify a mojo as an isolated unit, by mocking out the rest of the Maven environment. +A mojo unit test does not attempt to run your plugin in the context of a real Maven build. +Unit tests are designed to be fast. + +This testing library is **NOT** designed for integration or functional testing: +[`maven-invoker-plugin`](/plugins/maven-invoker-plugin/) is the way to go if you need it, +which gives you a complete Maven environment at the cost of more resources and time consumption. + + + +### What kind of unit tests are supported? + +
+
JUnit 5 Extension - @MojoTest annotation
+
The preferred way to test Mojos is to use the JUnit 5 extension provided by the +maven-plugin-testing-harness. You can annotate your test class with @MojoTest +to have the extension set up the necessary Maven components for you. You can then inject your Mojo +and any required Maven components directly into your test class. +See javadocs for examples.
+
TestCase from JUnit - deprecated
+
You could use the JUnit framework to test your plugin in +the same way you'd write any other JUnit test cases, i.e. by writing a test class which extends +TestCase.
+
TestCase from Plexus - deprecated
+
Mojos are written to take specific advantage of the Plexus container. +If you need Plexus container services, you could write your class which extends PlexusTestCase, +instead of TestCase.
+
TestCase from Testing Harness - deprecated
+
If you need to inject Maven objects into your mojo, you could use the maven-plugin-testing-harness. +The maven-plugin-testing-harness is explicitly intended to test the +org.apache.maven.reporting.AbstractMavenReport#execute() implementation.
+