Class Z2JupiterTestEngine

java.lang.Object
com.zfabrik.dev.z2jupiter.internal.engine.Z2JupiterTestEngine
All Implemented Interfaces:
org.junit.platform.engine.TestEngine

public class Z2JupiterTestEngine extends Object implements 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 Details

    • Z2_JUPITER

      public static final String Z2_JUPITER
      Test engine id
      See Also:
      Constant Field Values
    • Z2_JUPITER_DISPLAY_PREFIX

      public static final String Z2_JUPITER_DISPLAY_PREFIX
      Display name prefix for remoted tests.
      See Also:
      Constant Field Values
    • SEGMENT_TYPE_TEST

      public static final String SEGMENT_TYPE_TEST
      See Also:
      Constant Field Values
    • LOG

      public static final Logger 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

      public static final Predicate<Method> isTestOrTestFactoryOrTestTemplateMethod
  • Constructor Details

    • Z2JupiterTestEngine

      public Z2JupiterTestEngine()
  • Method Details

    • enable

      public static void enable()
    • disable

      public static void disable()
    • isEnabled

      public static boolean isEnabled()
    • withoutTestEngine

      public static <T> T withoutTestEngine(Supplier<T> get)
    • withoutTestEngine

      public static void withoutTestEngine(Runnable run)
    • getId

      public String getId()
      Specified by:
      getId in interface org.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 interface org.junit.platform.engine.TestEngine
    • execute

      public void execute(org.junit.platform.engine.ExecutionRequest request)
      Specified by:
      execute in interface org.junit.platform.engine.TestEngine