Class Z2JupiterTestEngine
java.lang.Object
com.zfabrik.dev.z2jupiter.internal.engine.Z2JupiterTestEngine
- All Implemented Interfaces:
org.junit.platform.engine.TestEngine
A
TestEngine
that remote tests test classes that are annotated with Z2JupiterTestable
.
When resolving such an annotated test class, this engine resolves to a Z2JupiterRemoteTestDescriptor
. We
run a remote discovery for the same class and bind the complete hierarchy beneath the local test descriptor
with correspondingly prefixed unique ids of Z2JupiterClientTestDescriptor
.
This is based on the remote serialization implemented with Z2JupiterTestPlanDto
and
related.
At execution, we invoke remote execution and translate events back to the prefixed and nested hierarchy.
NOTE: An alternative execution mode could ignore all test descriptors above the test class level and
reproduce the hierarchy only starting with the test class.-
Field Summary
Modifier and TypeFieldDescriptionstatic org.junit.jupiter.engine.discovery.predicates.IsTestFactoryMethod
static org.junit.jupiter.engine.discovery.predicates.IsTestMethod
static org.junit.jupiter.engine.discovery.predicates.IsTestTemplateMethod
static Logger
static String
static String
Test engine idstatic String
Display name prefix for remoted tests. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
disable()
org.junit.platform.engine.TestDescriptor
discover(org.junit.platform.engine.EngineDiscoveryRequest discoveryRequest, org.junit.platform.engine.UniqueId uniqueId)
static void
enable()
void
execute(org.junit.platform.engine.ExecutionRequest request)
getId()
static boolean
static void
withoutTestEngine(Runnable run)
static <T> T
withoutTestEngine(Supplier<T> get)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.junit.platform.engine.TestEngine
getArtifactId, getGroupId, getVersion
-
Field Details
-
Z2_JUPITER
Test engine id- See Also:
- Constant Field Values
-
Z2_JUPITER_DISPLAY_PREFIX
Display name prefix for remoted tests.- See Also:
- Constant Field Values
-
SEGMENT_TYPE_TEST
- See Also:
- Constant Field Values
-
LOG
-
isTestMethod
public static final org.junit.jupiter.engine.discovery.predicates.IsTestMethod isTestMethod -
isTestFactoryMethod
public static final org.junit.jupiter.engine.discovery.predicates.IsTestFactoryMethod isTestFactoryMethod -
isTestTemplateMethod
public static final org.junit.jupiter.engine.discovery.predicates.IsTestTemplateMethod isTestTemplateMethod -
isTestOrTestFactoryOrTestTemplateMethod
-
-
Constructor Details
-
Z2JupiterTestEngine
public Z2JupiterTestEngine()
-
-
Method Details
-
enable
public static void enable() -
disable
public static void disable() -
isEnabled
public static boolean isEnabled() -
withoutTestEngine
-
withoutTestEngine
-
getId
- Specified by:
getId
in interfaceorg.junit.platform.engine.TestEngine
-
discover
public org.junit.platform.engine.TestDescriptor discover(org.junit.platform.engine.EngineDiscoveryRequest discoveryRequest, org.junit.platform.engine.UniqueId uniqueId)- Specified by:
discover
in interfaceorg.junit.platform.engine.TestEngine
-
execute
public void execute(org.junit.platform.engine.ExecutionRequest request)- Specified by:
execute
in interfaceorg.junit.platform.engine.TestEngine
-