Class AbstractJvmQuarkusTestExtension

All Implemented Interfaces:
org.junit.jupiter.api.extension.ExecutionCondition, org.junit.jupiter.api.extension.Extension, org.junit.jupiter.api.extension.LifecycleMethodExecutionExceptionHandler, org.junit.jupiter.api.extension.TestExecutionExceptionHandler, org.junit.jupiter.api.extension.TestWatcher
Direct Known Subclasses:
QuarkusMainTestExtension, QuarkusTestExtension

public class AbstractJvmQuarkusTestExtension extends AbstractQuarkusTestWithContextExtension implements org.junit.jupiter.api.extension.ExecutionCondition
  • Field Details

    • TEST_LOCATION

      protected static final String TEST_LOCATION
      See Also:
    • TEST_CLASS

      protected static final String TEST_CLASS
      See Also:
    • TEST_PROFILE

      protected static final String TEST_PROFILE
      See Also:
    • runningQuarkusApplication

      protected static io.quarkus.bootstrap.app.RunningQuarkusApplication runningQuarkusApplication
    • quarkusTestProfile

      protected static Class<? extends QuarkusTestProfile> quarkusTestProfile
    • currentTestClassStack

      protected static final Deque<Class<?>> currentTestClassStack
    • currentJUnitTestClass

      protected static Class<?> currentJUnitTestClass
  • Constructor Details

    • AbstractJvmQuarkusTestExtension

      protected AbstractJvmQuarkusTestExtension()
      AbstractJvmQuarkusTestExtension may be loaded by different ClassLoaders.

      To access Config, we need to access ConfigProviderResolver, which is registered very early in the test launch process in ConfigLauncherSession. At this stage, the Config is registered in the SystemClassLoader. The ClassLoader of AbstractJvmQuarkusTestExtension may not support parent delegation, which prevents ConfigProviderResolver from being initialized. Therefore, we initialize it here if the ClassLoader is not the SystemClassLoader, and associate it with the SystemClassLoader. Lookups to the test Config, must always use the SystemClassLoader.

  • Method Details

    • getQuarkusTestProfile

      public static Optional<Class<? extends QuarkusTestProfile>> getQuarkusTestProfile(Class<?> testClass, org.junit.jupiter.api.extension.ExtensionContext extensionContext)
    • getQuarkusTestProfile

      protected Optional<Class<? extends QuarkusTestProfile>> getQuarkusTestProfile(org.junit.jupiter.api.extension.ExtensionContext extensionContext)
    • isWrongProfile

      protected boolean isWrongProfile(org.junit.jupiter.api.extension.ExtensionContext extensionContext)
    • isNewApplication

      protected boolean isNewApplication(QuarkusTestExtensionState state, Class<?> currentJUnitTestClass)
    • evaluateExecutionCondition

      public org.junit.jupiter.api.extension.ConditionEvaluationResult evaluateExecutionCondition(org.junit.jupiter.api.extension.ExtensionContext context)
      Specified by:
      evaluateExecutionCondition in interface org.junit.jupiter.api.extension.ExecutionCondition