org.opencms.test
Class OpenCmsTestProperties

java.lang.Object
  extended by org.opencms.test.OpenCmsTestProperties

public final class OpenCmsTestProperties
extends Object

Reads and manages the test.properties file.

Since:
6.0.0

Field Summary
static org.apache.commons.logging.Log LOG
          The log object for this class.
static String PROP_DB_PRODUCT
          Property / Environmant name for "db.product".
static String PROP_TEST_DATA_PATH
          Property / Environmant name for "test.data.path".
static String PROP_TEST_WEBAPP_PATH
          Property / Environmant name for "test.webapp.path".
 
Method Summary
 String getBasePath()
           
 CmsParameterConfiguration getConfiguration()
           
 String getDbProduct()
           
static OpenCmsTestProperties getInstance()
           
static String getResourcePathFromClassloader(String fileName)
          Returns the absolute path name for the given relative path name if it was found by the context Classloader of the current Thread.
 String getTestDataPath()
           
 String getTestWebappPath()
           
static void initialize(String basePath)
          Reads property file test.properties and fills singleton members.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG
The log object for this class.


PROP_DB_PRODUCT

public static final String PROP_DB_PRODUCT
Property / Environmant name for "db.product".

See Also:
Constant Field Values

PROP_TEST_DATA_PATH

public static final String PROP_TEST_DATA_PATH
Property / Environmant name for "test.data.path".

See Also:
Constant Field Values

PROP_TEST_WEBAPP_PATH

public static final String PROP_TEST_WEBAPP_PATH
Property / Environmant name for "test.webapp.path".

See Also:
Constant Field Values
Method Detail

getInstance

public static OpenCmsTestProperties getInstance()
Returns:
the singleton instance

getResourcePathFromClassloader

public static String getResourcePathFromClassloader(String fileName)
Returns the absolute path name for the given relative path name if it was found by the context Classloader of the current Thread.

The argument has to denote a resource within the Classloaders scope. A URLClassLoader implementation for example would try to match a given path name to some resource under it's URL entries.

As the result is internally obtained as an URL it is reduced to a file path by the call to URL.getFile(). Therefore the returned String will start with a '/' (no problem for java.io).

Parameters:
fileName - the filename to return the path from the Classloader for
Returns:
the absolute path name for the given relative path name if it was found by the context Classloader of the current Thread or an empty String if it was not found
See Also:
Thread.getContextClassLoader()

initialize

public static void initialize(String basePath)
Reads property file test.properties and fills singleton members.

Parameters:
basePath - the path where to find the test.properties file

getBasePath

public String getBasePath()
Returns:
Returns the path to the test.properties file

getConfiguration

public CmsParameterConfiguration getConfiguration()
Returns:
the parsed configuration file ('test.properties')

getDbProduct

public String getDbProduct()
Returns:
the name of the db product used

getTestDataPath

public String getTestDataPath()
Returns:
the path to the data test directory

getTestWebappPath

public String getTestWebappPath()
Returns:
the path to the webapp test directory