Package io.quarkus.test.junit.util
Class QuarkusTestProfileAwareClassOrderer
java.lang.Object
io.quarkus.test.junit.util.QuarkusTestProfileAwareClassOrderer
- All Implemented Interfaces:
org.junit.jupiter.api.ClassOrderer
public class QuarkusTestProfileAwareClassOrderer
extends Object
implements org.junit.jupiter.api.ClassOrderer
A
Internally, ordering is based on prefixes that are prepended to a secondary order suffix (by default the fully qualified name of the respective test class), with the fully qualified class name of the
ClassOrderer that orders QuarkusTest, QuarkusIntegrationTest and QuarkusMainTest classes
for minimum Quarkus
restarts by grouping them by their TestProfile, WithTestResource, and QuarkusTestResource
annotation(s).
By default, QuarkusTests not using any profile come first, then QuarkusMainTests, then QuarkusIntegrationTests, then all
other
non-Quarkus tests (e.g. plain unit tests).Internally, ordering is based on prefixes that are prepended to a secondary order suffix (by default the fully qualified name of the respective test class), with the fully qualified class name of the
QuarkusTestProfile as an infix (if present).
The default prefixes are defined by DEFAULT_ORDER_PREFIX_* and can be overridden in application.properties
via CFGKEY_ORDER_PREFIX_*, e.g. non-Quarkus tests can be run first (not last) by setting
CFGKEY_ORDER_PREFIX_NON_QUARKUS_TEST to 10_.
The secondary order suffix can be changed via "quarkus.test.class-orderer" or
"junit.quarkus.orderer.secondary-orderer", e.g. a value of
org.junit.jupiter.api.ClassOrderer$Random will order the test classes
within one group randomly instead by class name.
That order will also generally be maintained across groups, with each group running according to the position of its earliest
entry.
Limitations:
- Only JUnit5 test classes are subject to ordering, e.g. ArchUnit test classes are not passed to this orderer.
- This orderer does not handle
Nestedtest classes.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.junit.jupiter.api.ClassOrderer
org.junit.jupiter.api.ClassOrderer.ClassName, org.junit.jupiter.api.ClassOrderer.Default, org.junit.jupiter.api.ClassOrderer.DisplayName, org.junit.jupiter.api.ClassOrderer.OrderAnnotation, org.junit.jupiter.api.ClassOrderer.Random -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final StringFields inherited from interface org.junit.jupiter.api.ClassOrderer
DEFAULT_ORDER_PROPERTY_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidorderClasses(org.junit.jupiter.api.ClassOrdererContext context)
-
Field Details
-
DEFAULT_ORDER_PREFIX_QUARKUS_TEST
- See Also:
-
DEFAULT_ORDER_PREFIX_QUARKUS_MAIN_TEST
- See Also:
-
DEFAULT_ORDER_PREFIX_QUARKUS_INTEGRATION_TEST
- See Also:
-
DEFAULT_ORDER_PREFIX_QUARKUS_COMPONENT_TEST
- See Also:
-
DEFAULT_ORDER_PREFIX_NON_QUARKUS_TEST
- See Also:
-
CFGKEY_ORDER_PREFIX_QUARKUS_TEST
- See Also:
-
CFGKEY_ORDER_PREFIX_QUARKUS_INTEGRATION_TEST
- See Also:
-
CFGKEY_ORDER_PREFIX_QUARKUS_MAIN_TEST
- See Also:
-
CFGKEY_ORDER_PREFIX_QUARKUS_COMPONENT_TEST
- See Also:
-
CFGKEY_ORDER_PREFIX_NON_QUARKUS_TEST
- See Also:
-
CFGKEY_UNDOCUMENTED_SECONDARY_ORDERER
- See Also:
-
CFGKEY_DOCUMENTED_SECONDARY_ORDERER
- See Also:
-
-
Constructor Details
-
QuarkusTestProfileAwareClassOrderer
public QuarkusTestProfileAwareClassOrderer() -
QuarkusTestProfileAwareClassOrderer
-
-
Method Details
-
orderClasses
public void orderClasses(org.junit.jupiter.api.ClassOrdererContext context) - Specified by:
orderClassesin interfaceorg.junit.jupiter.api.ClassOrderer
-