org.apache.commons.configuration
Class ConfigurationAssert

java.lang.Object
  extended by org.apache.commons.configuration.ConfigurationAssert

public class ConfigurationAssert
extends Object

Assertions on configurations for the unit tests. This class also provides access to test files.

Version:
$Id: ConfigurationAssert.java 1221893 2011-12-21 21:34:38Z oheger $
Author:
Emmanuel Bourg

Field Summary
static File OUT_DIR
          The directory with the output files.
static String OUT_DIR_NAME
          Constant for the name of the directory with the output files.
static File TEST_DIR
          The directory with the test files.
static String TEST_DIR_NAME
          Constant for the name of the directory with the test files.
 
Constructor Summary
ConfigurationAssert()
           
 
Method Summary
static void assertEquals(Configuration expected, Configuration actual)
          Checks the content of a configuration.
static File getOutFile(String name)
          Returns a File object for the specified out file.
static URL getOutURL(String name)
          Returns a URL pointing to the specified output file.
static File getTestFile(String name)
          Returns a File object for the specified test file.
static URL getTestURL(String name)
          Returns a URL pointing to the specified test file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEST_DIR_NAME

public static final String TEST_DIR_NAME
Constant for the name of the directory with the test files.

See Also:
Constant Field Values

OUT_DIR_NAME

public static final String OUT_DIR_NAME
Constant for the name of the directory with the output files.

See Also:
Constant Field Values

TEST_DIR

public static final File TEST_DIR
The directory with the test files.


OUT_DIR

public static final File OUT_DIR
The directory with the output files.

Constructor Detail

ConfigurationAssert

public ConfigurationAssert()
Method Detail

assertEquals

public static void assertEquals(Configuration expected,
                                Configuration actual)
Checks the content of a configuration.

Parameters:
expected - the expected properties
actual - the configuration to check

getTestFile

public static File getTestFile(String name)
Returns a File object for the specified test file.

Parameters:
name - the name of the test file
Returns:
a File object pointing to that test file

getOutFile

public static File getOutFile(String name)
Returns a File object for the specified out file.

Parameters:
name - the name of the out file
Returns:
a File object pointing to that out file

getTestURL

public static URL getTestURL(String name)
Returns a URL pointing to the specified test file. If the URL cannot be constructed, a runtime exception is thrown.

Parameters:
name - the name of the test file
Returns:
the corresponding URL

getOutURL

public static URL getOutURL(String name)
Returns a URL pointing to the specified output file. If the URL cannot be constructed, a runtime exception is thrown.

Parameters:
name - the name of the output file
Returns:
the corresponding URL


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.