Class SystemPropertiesInvariantRule
java.lang.Object
com.carrotsearch.randomizedtesting.rules.SystemPropertiesInvariantRule
- All Implemented Interfaces:
org.junit.rules.TestRule
A
TestRule
that ensures system properties remain unmodified by the nested
Statement
. This can be applied both at suite level and at test level.
This rule requires appropriate security permission to read and write
system properties (System.getProperties()
) if running under a security
manager.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionIgnored property keys. -
Constructor Summary
ConstructorsConstructorDescriptionCares about all properties.SystemPropertiesInvariantRule
(String... ignoredProperties) Don't care about the given set of properties.SystemPropertiesInvariantRule
(Set<String> ignoredProperties) Don't care about the given set of properties. -
Method Summary
Modifier and TypeMethodDescriptionorg.junit.runners.model.Statement
apply
(org.junit.runners.model.Statement s, org.junit.runner.Description d)
-
Field Details
-
ignoredProperties
Ignored property keys.
-
-
Constructor Details
-
SystemPropertiesInvariantRule
public SystemPropertiesInvariantRule()Cares about all properties. -
SystemPropertiesInvariantRule
Don't care about the given set of properties. -
SystemPropertiesInvariantRule
Don't care about the given set of properties.
-
-
Method Details
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement s, org.junit.runner.Description d) - Specified by:
apply
in interfaceorg.junit.rules.TestRule
-