Class EnvironmentVariablesRule
java.lang.Object
uk.org.webcompere.systemstubs.resource.SingularTestResource
uk.org.webcompere.systemstubs.environment.EnvironmentVariables
uk.org.webcompere.systemstubs.rules.EnvironmentVariablesRule
- All Implemented Interfaces:
org.junit.rules.TestRule,Executable,NameValuePairSetter<EnvironmentVariables>,TestResource,SystemStubTestRule
JUnit 4 rule which sets up the environment variables around whatever JUnit 4 is running
- Since:
- 1.0.0
-
Field Summary
Fields inherited from class uk.org.webcompere.systemstubs.environment.EnvironmentVariables
variables -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor provides restoration of the environment and the ability to set valuesEnvironmentVariablesRule(String name, String value, String... others) Construct with variables that will be set when the rule is activeEnvironmentVariablesRule(Map<String, String> variables) Construct with some variables to apply when activeEnvironmentVariablesRule(Properties properties) Construct with some variables to apply when active -
Method Summary
Modifier and TypeMethodDescriptionMethods inherited from class uk.org.webcompere.systemstubs.environment.EnvironmentVariables
doSetup, doTeardown, getVariablesMethods inherited from class uk.org.webcompere.systemstubs.resource.SingularTestResource
isActive, setup, teardownMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface uk.org.webcompere.systemstubs.resource.Executable
executeMethods inherited from interface uk.org.webcompere.systemstubs.resource.NameValuePairSetter
setMethods inherited from interface uk.org.webcompere.systemstubs.rules.internal.SystemStubTestRule
applyMethods inherited from interface uk.org.webcompere.systemstubs.resource.TestResource
execute, setup, teardown
-
Constructor Details
-
EnvironmentVariablesRule
public EnvironmentVariablesRule()Default constructor provides restoration of the environment and the ability to set values -
EnvironmentVariablesRule
Construct with some variables to apply when active- Parameters:
properties- map of variables to apply when active
-
EnvironmentVariablesRule
Construct with variables that will be set when the rule is active- Parameters:
name- name of the first variablevalue- value of the first variableothers- pairs of name/values as Strings
-
EnvironmentVariablesRule
Construct with some variables to apply when active- Parameters:
variables- map of variables to apply when active
-
-
Method Details
-
and
- Overrides:
andin classEnvironmentVariables
-
set
- Specified by:
setin interfaceNameValuePairSetter<EnvironmentVariables>- Overrides:
setin classEnvironmentVariables
-
set
- Specified by:
setin interfaceNameValuePairSetter<EnvironmentVariables>
-