org.apache.commons.configuration
Class TestConfigurationUtils

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

public class TestConfigurationUtils
extends Object

Tests the ConfigurationUtils class

Version:
$Id: TestConfigurationUtils.java 1301996 2012-03-17 20:30:39Z sebb $

Field Summary
protected  Configuration config
           
 
Constructor Summary
TestConfigurationUtils()
           
 
Method Summary
 void testAppend()
           
 void testCloneConfiguration()
          Tests cloning a configuration that supports this operation.
 void testCloneConfigurationNotSupported()
          Tests cloning a configuration that does not support this operation.
 void testCloneConfigurationNull()
          Tests cloning a null configuration.
 void testConvertHierarchicalToHierarchical()
          Tests converting a configuration into a hierarchical one that is already hierarchical.
 void testConvertHierarchicalToHierarchicalEngine()
          Tests converting an already hierarchical configuration using an expression engine.
 void testConvertHierarchicalToHierarchicalNullEngine()
          Tests converting an already hierarchical configuration using a null expression engine.
 void testConvertNullToHierarchical()
          Tests converting a null configuration to a hierarchical one.
 void testConvertToHierarchical()
          Tests converting a configuration into a hierarchical one.
 void testConvertToHierarchicalDelimiters()
          Tests converting a configuration into a hierarchical one if some of its properties contain escaped list delimiter characters.
 void testConvertToHierarchicalEngine()
          Tests converting a configuration to a hierarchical one using a specific expression engine.
 void testConvertToHierarchicalMultiValues()
          Tests converting a configuration to a hierarchical one that contains a property with multiple values.
 void testCopy()
           
 void testEnableRuntimeExceptions()
          Tests whether runtime exceptions can be enabled.
 void testEnableRuntimeExceptionsInvalid()
          Tries to enable runtime exceptions for a configuration that does not inherit from EventSource.
 void testEnableRuntimeExceptionsNull()
          Tries to enable runtime exceptions for a null configuration.
 void testFileFromURLNull()
          Tests whether fileFromURL() handles null URLs correctly.
 void testFileFromURLWithPlus()
          Tests whether a "+" character in the file name is handled correctly by fileFromURL().
 void testGetBasePath()
           
 void testGetFile()
           
 void testGetFileName()
           
 void testGetURL()
           
 void testLocateWithNullTCCL()
           
 void testToString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected Configuration config
Constructor Detail

TestConfigurationUtils

public TestConfigurationUtils()
Method Detail

testToString

public void testToString()

testGetURL

public void testGetURL()
                throws Exception
Throws:
Exception

testGetBasePath

public void testGetBasePath()
                     throws Exception
Throws:
Exception

testGetFileName

public void testGetFileName()
                     throws Exception
Throws:
Exception

testCopy

public void testCopy()

testAppend

public void testAppend()

testGetFile

public void testGetFile()
                 throws Exception
Throws:
Exception

testFileFromURLWithPlus

public void testFileFromURLWithPlus()
                             throws MalformedURLException
Tests whether a "+" character in the file name is handled correctly by fileFromURL(). This test is related to CONFIGURATION-415.

Throws:
MalformedURLException

testFileFromURLNull

public void testFileFromURLNull()
                         throws Exception
Tests whether fileFromURL() handles null URLs correctly.

Throws:
Exception

testLocateWithNullTCCL

public void testLocateWithNullTCCL()
                            throws Exception
Throws:
Exception

testConvertToHierarchical

public void testConvertToHierarchical()
Tests converting a configuration into a hierarchical one.


testConvertHierarchicalToHierarchical

public void testConvertHierarchicalToHierarchical()
Tests converting a configuration into a hierarchical one that is already hierarchical.


testConvertNullToHierarchical

public void testConvertNullToHierarchical()
Tests converting a null configuration to a hierarchical one. The result should be null, too.


testConvertToHierarchicalDelimiters

public void testConvertToHierarchicalDelimiters()
Tests converting a configuration into a hierarchical one if some of its properties contain escaped list delimiter characters.


testConvertToHierarchicalEngine

public void testConvertToHierarchicalEngine()
Tests converting a configuration to a hierarchical one using a specific expression engine.


testConvertHierarchicalToHierarchicalEngine

public void testConvertHierarchicalToHierarchicalEngine()
Tests converting an already hierarchical configuration using an expression engine. The new engine should be set.


testConvertHierarchicalToHierarchicalNullEngine

public void testConvertHierarchicalToHierarchicalNullEngine()
Tests converting an already hierarchical configuration using a null expression engine. In this case the expression engine of the configuration should not be touched.


testConvertToHierarchicalMultiValues

public void testConvertToHierarchicalMultiValues()
Tests converting a configuration to a hierarchical one that contains a property with multiple values. This test is related to CONFIGURATION-346.


testCloneConfiguration

public void testCloneConfiguration()
Tests cloning a configuration that supports this operation.


testCloneConfigurationNotSupported

public void testCloneConfigurationNotSupported()
Tests cloning a configuration that does not support this operation. This should cause an exception.


testCloneConfigurationNull

public void testCloneConfigurationNull()
Tests cloning a null configuration.


testEnableRuntimeExceptions

public void testEnableRuntimeExceptions()
Tests whether runtime exceptions can be enabled.


testEnableRuntimeExceptionsInvalid

public void testEnableRuntimeExceptionsInvalid()
Tries to enable runtime exceptions for a configuration that does not inherit from EventSource. This should cause an exception.


testEnableRuntimeExceptionsNull

public void testEnableRuntimeExceptionsNull()
Tries to enable runtime exceptions for a null configuration. This should cause an exception.



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