public class SystemPropertyTestSetup
extends junit.extensions.TestSetup
Modifier and Type | Field and Description |
---|---|
protected java.util.Properties |
newValues |
private java.util.Properties |
oldValues |
private boolean |
staticProperties |
Constructor and Description |
---|
SystemPropertyTestSetup(junit.framework.Test test,
java.util.Properties newValues)
Create a test decorator that sets and restores
System properties.
|
SystemPropertyTestSetup(junit.framework.Test test,
java.util.Properties newValues,
boolean staticProperties)
Create a test decorator that sets and restores the passed
in properties.
|
Modifier and Type | Method and Description |
---|---|
private void |
restoreOldPropertyValues() |
private void |
setProperties(java.util.Properties values) |
protected void |
setUp()
For each property store the current value and
replace it with the new value, unless there is no change.
|
static junit.framework.Test |
singleProperty(junit.framework.Test test,
java.lang.String property,
java.lang.String value)
Decorate a test so that it sets a single system property in
setUp() and resets it in tearDown() . |
static junit.framework.Test |
singleProperty(junit.framework.Test test,
java.lang.String property,
java.lang.String value,
boolean staticProperty)
Decorate a test so that it sets a single system property in
setUp() and resets it in tearDown() . |
protected void |
tearDown()
Revert the properties to their values prior to the setUp call.
|
basicRun, countTestCases, getTest, toString
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
protected java.util.Properties newValues
private java.util.Properties oldValues
private boolean staticProperties
public SystemPropertyTestSetup(junit.framework.Test test, java.util.Properties newValues, boolean staticProperties)
test
- test to be decoratednewValues
- properties to be setpublic SystemPropertyTestSetup(junit.framework.Test test, java.util.Properties newValues)
test
- newValues
- public static junit.framework.Test singleProperty(junit.framework.Test test, java.lang.String property, java.lang.String value)
setUp()
and resets it in tearDown()
. The engine is
not shut down after the property is set.public static junit.framework.Test singleProperty(junit.framework.Test test, java.lang.String property, java.lang.String value, boolean staticProperty)
setUp()
and resets it in tearDown()
. The engine is
shut down after the property is set if staticProperty
is
true
.protected void setUp() throws java.lang.Exception
setUp
in class junit.extensions.TestSetup
java.lang.Exception
protected void tearDown() throws java.lang.Exception
tearDown
in class junit.extensions.TestSetup
java.lang.Exception
private void restoreOldPropertyValues() throws java.lang.Exception
java.lang.Exception
private void setProperties(java.util.Properties values) throws java.security.PrivilegedActionException
java.security.PrivilegedActionException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.