Class JmcTestEngine
java.lang.Object
org.mpi_sws.jmc.integrations.junit5.engine.JmcTestEngine
- All Implemented Interfaces:
org.junit.platform.engine.TestEngine
A custom JUnit 5 test engine for running JMC tests.
This engine discovers and executes tests annotated with JmcCheck or JmcCheckConfiguration in the classpath, packages, or specific classes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.junit.platform.engine.TestDescriptordiscover(org.junit.platform.engine.EngineDiscoveryRequest request, org.junit.platform.engine.UniqueId uniqueId) Discovers tests based on the provided discovery request and unique ID.voidexecute(org.junit.platform.engine.ExecutionRequest request) Executes the discovered tests in the JMC test engine.getId()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.junit.platform.engine.TestEngine
getArtifactId, getGroupId, getVersion
-
Constructor Details
-
JmcTestEngine
public JmcTestEngine()
-
-
Method Details
-
getId
- Specified by:
getIdin 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) Discovers tests based on the provided discovery request and unique ID.This method scans the classpath, packages, and specific classes for JMC tests annotated with
JmcCheckorJmcCheckConfiguration. It creates a test descriptor for the JMC test engine and adds discovered tests as children of the engine descriptor.- Specified by:
discoverin interfaceorg.junit.platform.engine.TestEngine- Parameters:
request- The discovery request containing selectors for classpath roots, packages, and classes.uniqueId- The unique ID for the test engine descriptor.- Returns:
- A
TestDescriptorrepresenting the discovered tests in the JMC test engine.
-
execute
public void execute(org.junit.platform.engine.ExecutionRequest request) Executes the discovered tests in the JMC test engine.This method starts the execution of the root test descriptor and recursively executes all child descriptors, handling any exceptions that may occur during execution.
- Specified by:
executein interfaceorg.junit.platform.engine.TestEngine- Parameters:
request- The execution request containing the root test descriptor and engine execution listener.
-