com.atlassian.sal.core.features
Class ClearSystemPropertyRule

java.lang.Object
  extended by org.junit.rules.TestWatcher
      extended by 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.


Constructor Summary
ClearSystemPropertyRule()
           
 
Method Summary
protected  void finished(org.junit.runner.Description description)
           
 void setProperty(String key, String value)
          Set a system property key to the given value.
 void setPropertyWithDarkFeaturePrefix(String key, String value)
          Set a system property key to the given value.
 
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
 

Constructor Detail

ClearSystemPropertyRule

public ClearSystemPropertyRule()
Method Detail

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 set
value - 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 + key
value - 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.