Package io.quarkus.test.junit
Class AbstractJvmQuarkusTestExtension
java.lang.Object
io.quarkus.test.junit.AbstractTestWithCallbacksExtension
io.quarkus.test.junit.AbstractQuarkusTestWithContextExtension
io.quarkus.test.junit.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 Summary
FieldsModifier and TypeFieldDescriptionprotected static Class<?> protected static Class<? extends QuarkusTestProfile> protected static io.quarkus.bootstrap.app.RunningQuarkusApplicationprotected static final Stringprotected static final Stringprotected static final StringFields inherited from class io.quarkus.test.junit.AbstractQuarkusTestWithContextExtension
IO_QUARKUS_TESTING_TYPE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractJvmQuarkusTestExtension may be loaded by different ClassLoaders. -
Method Summary
Modifier and TypeMethodDescriptionorg.junit.jupiter.api.extension.ConditionEvaluationResultevaluateExecutionCondition(org.junit.jupiter.api.extension.ExtensionContext context) static Optional<Class<? extends QuarkusTestProfile>> getQuarkusTestProfile(Class<?> testClass, org.junit.jupiter.api.extension.ExtensionContext extensionContext) protected Optional<Class<? extends QuarkusTestProfile>> getQuarkusTestProfile(org.junit.jupiter.api.extension.ExtensionContext extensionContext) protected booleanisNewApplication(QuarkusTestExtensionState state, Class<?> currentJUnitTestClass) protected booleanisWrongProfile(org.junit.jupiter.api.extension.ExtensionContext extensionContext) Methods inherited from class io.quarkus.test.junit.AbstractQuarkusTestWithContextExtension
getState, getStoreFromContext, handleAfterAllMethodExecutionException, handleAfterEachMethodExecutionException, handleBeforeAllMethodExecutionException, handleBeforeEachMethodExecutionException, handleTestExecutionException, markTestAsFailed, setState, testFailedMethods inherited from class io.quarkus.test.junit.AbstractTestWithCallbacksExtension
clearCallbacks, getTestingType, invokeAfterAllCallbacks, invokeAfterAllCallbacks, invokeAfterConstructCallbacks, invokeAfterConstructCallbacks, invokeAfterEachCallbacks, invokeAfterEachCallbacks, invokeAfterTestExecutionCallbacks, invokeAfterTestExecutionCallbacks, invokeBeforeClassCallbacks, invokeBeforeClassCallbacks, invokeBeforeEachCallbacks, invokeBeforeEachCallbacks, invokeBeforeTestExecutionCallbacks, invokeBeforeTestExecutionCallbacks, isAfterAllCallbacksEmpty, isAfterEachCallbacksEmpty, isAfterTestCallbacksEmpty, isBeforeEachCallbacksEmpty, isBeforeTestCallbacksEmpty, populateCallbacksMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.junit.jupiter.api.extension.TestWatcher
testAborted, testDisabled, testSuccessful
-
Field Details
-
TEST_LOCATION
- See Also:
-
TEST_CLASS
- See Also:
-
TEST_PROFILE
- See Also:
-
runningQuarkusApplication
protected static io.quarkus.bootstrap.app.RunningQuarkusApplication runningQuarkusApplication -
quarkusTestProfile
-
currentTestClassStack
-
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
-
evaluateExecutionCondition
public org.junit.jupiter.api.extension.ConditionEvaluationResult evaluateExecutionCondition(org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
evaluateExecutionConditionin interfaceorg.junit.jupiter.api.extension.ExecutionCondition
-