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 class
static class
Contains 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 - noQuarkusTestResourceLifecycleManager
is ever touched at this stage. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
void
void
setTestErrorCause
(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 extra basic information about which test resources a test class will requirestatic 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 differentMATCHING_RESOURCE
scoped 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 - noQuarkusTestResourceLifecycleManager
is ever touched at this stage.
-
-
Method Details
-
setTestErrorCause
-
init
-
start
-
inject
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getConfigProperties
-
testResourceComparisonInfo
public static Set<TestResourceManager.TestResourceComparisonInfo> testResourceComparisonInfo(Class<?> testClass, Path testClassLocation, List<TestResourceManager.TestResourceClassEntry> entriesFromProfile) Allows Quarkus to extra 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_RESOURCE
scoped test resources are being used
-