JUnit-addons
version 1.4

junitx.util
Class PropertyManager

java.lang.Object
  |
  +--junitx.util.PropertyManager

public class PropertyManager
extends java.lang.Object

The PropertyManager class represents a persistent set of properties loaded from a standard Property file.

Usage

The location of the property file loaded by the PropertyManager class is defined by the PropertyManager.file JVM environment variable. For example, to initialize the PropertyManager with a file located at c:\project\props.properties:

    java -DPropertyManager.file=c:\project\props.properties junit.textui.TestRunner AllTests
 

Format of the file

    propname=propvalue
 

Version:
$Revision: 1.4 $ $Date: 2003/03/23 01:25:24 $
Author:
Vladimir R. Bossicard

Method Summary
static java.lang.String getProperty(java.lang.String key)
          Searches for the property with the specified key in this property list.
static java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
          Searches for the property with the specified key in this property list.
static java.lang.Object setProperty(java.lang.String key, java.lang.String value)
          Maps the specified key to the specified value in this property list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setProperty

public static java.lang.Object setProperty(java.lang.String key,
                                           java.lang.String value)
                                    throws java.lang.NullPointerException
Maps the specified key to the specified value in this property list.

Parameters:
key - the hashtable key.
value - a value.
Returns:
the previous value of the specified key in this property list, or null if it did not have one.
java.lang.NullPointerException

getProperty

public static java.lang.String getProperty(java.lang.String key)
Searches for the property with the specified key in this property list. The method returns null if the property is not found.

Parameters:
key - the hashtable key.
Returns:
the value in this property list with the specified key value.
See Also:
getProperty(String, String)

getProperty

public static java.lang.String getProperty(java.lang.String key,
                                           java.lang.String defaultValue)
Searches for the property with the specified key in this property list. The method returns the default value argument if the property is not found.

Parameters:
key - the hashtable key.
defaultValue - a default value.
Returns:
the value in this property list with the specified key value.

JUnit-addons
version 1.4

Copyright © 2002-2003 Vladimir R. Bossicard. All Rights Reserved.