Package net.cscott.jdoctest
Class JDoctestEngine
java.lang.Object
net.cscott.jdoctest.JDoctestEngine
- All Implemented Interfaces:
org.junit.platform.engine.TestEngine
JUnit Platform test engine which runs the doctests of classes annotated
with
Doctests. It is registered as a service, so it is found
automatically whenever JDoctest is on the test classpath. Its engine ID
is "jdoctest".
Each annotated class becomes a container, with one test for each of the
@doc.test tags in its documentation and the documentation of
its members (and of any nested classes which are not annotated
themselves). The tests of a class are run together, by running javadoc
on the class's source file; a doctest marked (EXPECT FAIL)
which fails is reported as aborted. The engine handles
class, package, classpath root and module selectors, so annotated classes
are found however the build tool or IDE asks for them. Since the
annotation marks the classes to test explicitly, class name patterns
(such as the default "*Test" patterns of the console
launcher and @Suite) are ignored, but package name
filters are honored.
-
Field Details
-
ENGINE_ID
The ID of this test engine.- See Also:
-
SRC_ROOT_PARAMETER
JUnit configuration parameter giving the default source directory forDoctestsclasses which don't specify one.- See Also:
-
-
Constructor Details
-
JDoctestEngine
public JDoctestEngine()
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceorg.junit.platform.engine.TestEngine
-
getGroupId
- Specified by:
getGroupIdin interfaceorg.junit.platform.engine.TestEngine
-
getVersion
- Specified by:
getVersionin interfaceorg.junit.platform.engine.TestEngine
-
discover
public org.junit.platform.engine.TestDescriptor discover(org.junit.platform.engine.EngineDiscoveryRequest request, org.junit.platform.engine.UniqueId uniqueId) - Specified by:
discoverin interfaceorg.junit.platform.engine.TestEngine
-
execute
public void execute(org.junit.platform.engine.ExecutionRequest request) - Specified by:
executein interfaceorg.junit.platform.engine.TestEngine
-