Annotation Interface SetSystemProperty
@SetSystemProperty is an annotation that is used to set the value of
a JVM system property for test execution.
The key and value of the system property must be specified via the
key and value attributes.
This annotation can be used both at the type level and the method level.
It is repeatable and @Inherited from
higher-level containers — for example, a test method inherits a
@SetSystemProperty declaration from the test class in which the test
is declared. If this annotation is declared on a test class (or implemented
interface), the configured property will be set before every test inside that
class. After a test has completed, the original value of the system property
(or the value configured via @SetSystemProperty at a higher level) will
be restored. Note that method-level configuration always overrides class-level
configuration.
During
parallel test execution, all tests annotated with
@SetSystemProperty,
@ClearSystemProperty,
@ReadsSystemProperty, and
@WritesSystemProperty are scheduled in a way that
guarantees correctness under mutation of shared global state.
For further details and examples, see the documentation on all JVM system property annotations in the User Guide.
- Since:
- 6.1
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interface@SetSystemPropertiesis a container for one or moreSetSystemPropertydeclarations. -
Required Element Summary
Required Elements