Package io.quarkus.test.common
Class TestResourceManager
java.lang.Object
io.quarkus.test.common.TestResourceManager
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classstatic classContains all the metadata that is needed to handle the lifecycle and perform all the bookkeeping associated with a Test Resource.static final record -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTestResourceManager(Class<?> testClass) TestResourceManager(Class<?> testClass, Class<?> profileClass, List<TestResourceManager.TestResourceClassEntry> additionalTestResources, boolean disableGlobalTestResources) TestResourceManager(Class<?> testClass, Class<?> profileClass, List<TestResourceManager.TestResourceClassEntry> additionalTestResources, boolean disableGlobalTestResources, Map<String, String> devServicesProperties, Optional<String> containerNetworkId) TestResourceManager(Class<?> testClass, Class<?> profileClass, List<TestResourceManager.TestResourceClassEntry> additionalTestResources, boolean disableGlobalTestResources, Map<String, String> devServicesProperties, Optional<String> containerNetworkId, Path testClassLocation) This is safe to call as it doesn't do anything other than create state - noQuarkusTestResourceLifecycleManageris ever touched at this stage. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static StringvoidvoidvoidsetTestErrorCause(Throwable testErrorCause) start()Provides the basic information needed for comparing the test resources currently in usetestResourceComparisonInfo(Class<?> testClass, Path testClassLocation, List<TestResourceManager.TestResourceClassEntry> entriesFromProfile) Allows Quarkus to extract basic information about which test resources a test class will requirestatic booleantestResourcesRequireReload(Set<TestResourceManager.TestResourceComparisonInfo> existing, Set<TestResourceManager.TestResourceComparisonInfo> next) Quarkus needs to restart if one of the following is true: at least one the existing test resources is restricted to the test class at least one the next test resources is restricted to the test class differentMATCHING_RESOURCEscoped test resources are being used
-
Field Details
-
CLOSEABLE_NAME
-
-
Constructor Details
-
TestResourceManager
-
TestResourceManager
public TestResourceManager(Class<?> testClass, Class<?> profileClass, List<TestResourceManager.TestResourceClassEntry> additionalTestResources, boolean disableGlobalTestResources) -
TestResourceManager
-
TestResourceManager
public TestResourceManager(Class<?> testClass, Class<?> profileClass, List<TestResourceManager.TestResourceClassEntry> additionalTestResources, boolean disableGlobalTestResources, Map<String, String> devServicesProperties, Optional<String> containerNetworkId, Path testClassLocation) This is safe to call as it doesn't do anything other than create state - noQuarkusTestResourceLifecycleManageris ever touched at this stage.
-
-
Method Details
-
setTestErrorCause
-
init
-
start
-
inject
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getConfigProperties
-
testResourceComparisonInfo
public static Set<TestResourceManager.TestResourceComparisonInfo> testResourceComparisonInfo(Class<?> testClass, Path testClassLocation, List<TestResourceManager.TestResourceClassEntry> entriesFromProfile) Allows Quarkus to extract basic information about which test resources a test class will require -
testResourceComparisonInfo
Provides the basic information needed for comparing the test resources currently in use -
testResourcesRequireReload
public static boolean testResourcesRequireReload(Set<TestResourceManager.TestResourceComparisonInfo> existing, Set<TestResourceManager.TestResourceComparisonInfo> next) Quarkus needs to restart if one of the following is true:- at least one the existing test resources is restricted to the test class
- at least one the next test resources is restricted to the test class
- different
MATCHING_RESOURCEscoped test resources are being used
-
getReloadGroupIdentifier
public static String getReloadGroupIdentifier(Set<TestResourceManager.TestResourceComparisonInfo> existing)
-