Class SystemPropertiesInvariantRule
- java.lang.Object
-
- com.carrotsearch.randomizedtesting.rules.SystemPropertiesInvariantRule
-
- All Implemented Interfaces:
org.junit.rules.TestRule
public class SystemPropertiesInvariantRule extends java.lang.Object implements org.junit.rules.TestRule
ATestRule
that ensures system properties remain unmodified by the nestedStatement
. 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:
SystemPropertiesRestoreRule
,ClassRule
,Rule
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.HashSet<java.lang.String>
ignoredProperties
Ignored property keys.
-
Constructor Summary
Constructors Constructor Description SystemPropertiesInvariantRule()
Cares about all properties.SystemPropertiesInvariantRule(java.lang.String... ignoredProperties)
Don't care about the given set of properties.SystemPropertiesInvariantRule(java.util.Set<java.lang.String> ignoredProperties)
Don't care about the given set of properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.junit.runners.model.Statement
apply(org.junit.runners.model.Statement s, org.junit.runner.Description d)
-
-
-
Constructor Detail
-
SystemPropertiesInvariantRule
public SystemPropertiesInvariantRule()
Cares about all properties.
-
SystemPropertiesInvariantRule
public SystemPropertiesInvariantRule(java.lang.String... ignoredProperties)
Don't care about the given set of properties.
-
SystemPropertiesInvariantRule
public SystemPropertiesInvariantRule(java.util.Set<java.lang.String> ignoredProperties)
Don't care about the given set of properties.
-
-