com.atlassian.sal.core.features
Class ClearSystemPropertyRule
java.lang.Object
org.junit.rules.TestWatcher
com.atlassian.sal.core.features.ClearSystemPropertyRule
- All Implemented Interfaces:
- org.junit.rules.TestRule
public class ClearSystemPropertyRule
- extends org.junit.rules.TestWatcher
All system properties set through this rule are guaranteed to be cleaned up after the test method has finished.
| Methods inherited from class org.junit.rules.TestWatcher |
apply, failed, skipped, starting, succeeded |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClearSystemPropertyRule
public ClearSystemPropertyRule()
setProperty
public void setProperty(String key,
String value)
- Set a system property key to the given value. The system property will be cleared when the test finishes.
- Parameters:
key - the system property to be setvalue - the value to be associated with the system property
setPropertyWithDarkFeaturePrefix
public void setPropertyWithDarkFeaturePrefix(String key,
String value)
- Set a system property key to the given value. Will always put the
DarkFeatureManager.ATLASSIAN_DARKFEATURE_PREFIX
in for you.
- Parameters:
key - the system property to be set. Will be effectively: DarkFeatureManager.ATLASSIAN_DARKFEATURE_PREFIX + keyvalue - the value to be set
finished
protected void finished(org.junit.runner.Description description)
- Overrides:
finished in class org.junit.rules.TestWatcher
Copyright © 2015 Atlassian. All rights reserved.