| java.lang.Object net.sourceforge.groboutils.junit.v1.SysPropertiesUtil
SysPropertiesUtil | public class SysPropertiesUtil (Code) | | Utility that allows for easy setting and reseting of System properties.
Some classes that need testing may depend upon a System property setting,
and this class will help testing that. This is JDK 1.1 and above
compatible.
Each instance of this utility should be created in the setUp()
method of the test case, then the utility should have its reset()
method called in the tearDown() method. This ensures that the
standard system properties have been set correctly.
author: Matt Albrecht groboclown@users.sourceforge.net version: $Date: 2003/07/21 13:57:54 $ since: December 26, 2002 |
Constructor Summary | |
public | SysPropertiesUtil() Each instance should be an instance variable for a test class, and
it should be created in the setUp() method. |
Method Summary | |
public synchronized void | reset() Resets the system properties to the way they were when this class was
created. | public void | setValue(String key, String newVal) Sets the system property. |
SysPropertiesUtil | public SysPropertiesUtil()(Code) | | Each instance should be an instance variable for a test class, and
it should be created in the setUp() method.
|
reset | public synchronized void reset()(Code) | | Resets the system properties to the way they were when this class was
created.
|
setValue | public void setValue(String key, String newVal)(Code) | | Sets the system property. If the new value is null, then
the property, if it exists, will be removed. If the key is
null, then an IllegalArgumentException will be thrown.
|
|
|