org.apache.commons.configuration
Class TestCombinedConfiguration

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

public class TestCombinedConfiguration
extends Object

Test class for CombinedConfiguration.

Version:
$Id: TestCombinedConfiguration.java 1327061 2012-04-17 12:18:27Z rgoers $

Field Summary
 org.junit.rules.TemporaryFolder folder
          Helper object for managing temporary files.
 
Constructor Summary
TestCombinedConfiguration()
           
 
Method Summary
 void setUp()
           
 void testAccessPropertyEmpty()
          Tests accessing properties if no configurations have been added.
 void testAccessPropertyMulti()
          Tests accessing properties if multiple configurations have been added.
 void testAddConfiguration()
          Tests adding a configuration (without further information).
 void testAddConfigurationAt()
          Tests adding a configuration and specifying an at position.
 void testAddConfigurationComplexAt()
          Tests adding a configuration with a complex at position.
 void testAddConfigurationWithName()
          Tests adding a configuration with a name.
 void testAddConfigurationWithNameTwice()
          Tests adding a configuration with a name when this name already exists.
 void testAddNullConfiguration()
          Tests adding a null configuration.
 void testClear()
          Tests clearing a combined configuration.
 void testClone()
          Tests cloning a combined configuration.
 void testCloneModify()
          Tests if the cloned configuration is decoupled from the original.
 void testCombinedCopyToXML()
          Tests whether a combined configuration can be copied to an XML configuration.
 void testConcurrentGetAndReload()
           
 void testConversionExpressionEngine()
          Tests using a conversion expression engine for child configurations with strange keys.
 void testDeadlockWithReload()
          Tests whether reload operations can cause a deadlock when the combined configuration is accessed concurrently.
 void testEscapeListDelimiters()
          Tests whether escaped list delimiters are treated correctly.
 void testGetConfigurationNameList()
           
 void testGetConfigurations()
           
 void testGetSourceCombined()
          Tests the getSource() method when the passed in key belongs to the combined configuration itself.
 void testGetSourceHierarchical()
          Tests the gestSource() method when the source property is defined in a hierarchical configuration.
 void testGetSourceMulti()
          Tests the getSource() method when the passed in key refers to multiple values, which are all defined in the same source configuration.
 void testGetSourceMultiSources()
          Tests the getSource() method when the passed in key refers to multiple values defined by different sources.
 void testGetSourceNonHierarchical()
          Tests whether the source configuration can be detected for non hierarchical configurations.
 void testGetSourceNull()
          Tests the getSource() method when a null key is passed in.
 void testGetSourceUnknown()
          Tests the getSource() method when the passed in key is not contained.
 void testInit()
          Tests accessing a newly created combined configuration.
 void testInvalidateAfterChange()
          Tests whether an invalidate event is fired only after a change.
 void testReloading()
          Tests if file-based configurations can be reloaded.
 void testReloadingNestedCC()
          Tests whether reloading works for a combined configuration nested in another combined configuration.
 void testReloadingSubnodeConfig()
          Tests whether the reload check works with a subnode configuration.
 void testReloadWithSubNodeConfig()
          Tests whether changes on a sub node configuration that is part of a combined configuration are detected.
 void testRemoveConfiguration()
          Tests removing a configuration.
 void testRemoveConfigurationAt()
          Tests removing a configuration by index.
 void testRemoveConfigurationByName()
          Tests removing a configuration by name.
 void testRemoveConfigurationByUnknownName()
          Tests removing a configuration by name, which is not contained.
 void testRemoveNamedConfiguration()
          Tests removing a configuration with a name.
 void testRemoveNamedConfigurationAt()
          Tests removing a named configuration by index.
 void testRemoveNonContainedConfiguration()
          Tests removing a configuration that was not added prior.
 void testSetNodeCombiner()
          Tests if setting a node combiner causes an invalidation.
 void testSetNullNodeCombiner()
          Tests setting a null node combiner.
 void testUpdateContainedConfiguration()
          Tests if an update of a contained configuration leeds to an invalidation of the combined configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

folder

public org.junit.rules.TemporaryFolder folder
Helper object for managing temporary files.

Constructor Detail

TestCombinedConfiguration

public TestCombinedConfiguration()
Method Detail

setUp

public void setUp()
           throws Exception
Throws:
Exception

testInit

public void testInit()
Tests accessing a newly created combined configuration.


testAddConfiguration

public void testAddConfiguration()
Tests adding a configuration (without further information).


testAddConfigurationWithName

public void testAddConfigurationWithName()
Tests adding a configuration with a name.


testAddConfigurationWithNameTwice

public void testAddConfigurationWithNameTwice()
Tests adding a configuration with a name when this name already exists. This should cause an exception.


testAddConfigurationAt

public void testAddConfigurationAt()
Tests adding a configuration and specifying an at position.


testAddConfigurationComplexAt

public void testAddConfigurationComplexAt()
Tests adding a configuration with a complex at position. Here the at path contains a dot, which must be escaped.


testAddNullConfiguration

public void testAddNullConfiguration()
Tests adding a null configuration. This should cause an exception to be thrown.


testAccessPropertyEmpty

public void testAccessPropertyEmpty()
Tests accessing properties if no configurations have been added.


testAccessPropertyMulti

public void testAccessPropertyMulti()
Tests accessing properties if multiple configurations have been added.


testRemoveConfiguration

public void testRemoveConfiguration()
Tests removing a configuration.


testRemoveConfigurationAt

public void testRemoveConfigurationAt()
Tests removing a configuration by index.


testRemoveConfigurationByName

public void testRemoveConfigurationByName()
Tests removing a configuration by name.


testRemoveNamedConfiguration

public void testRemoveNamedConfiguration()
Tests removing a configuration with a name.


testRemoveNamedConfigurationAt

public void testRemoveNamedConfigurationAt()
Tests removing a named configuration by index.


testRemoveNonContainedConfiguration

public void testRemoveNonContainedConfiguration()
Tests removing a configuration that was not added prior.


testRemoveConfigurationByUnknownName

public void testRemoveConfigurationByUnknownName()
Tests removing a configuration by name, which is not contained.


testUpdateContainedConfiguration

public void testUpdateContainedConfiguration()
Tests if an update of a contained configuration leeds to an invalidation of the combined configuration.


testSetNodeCombiner

public void testSetNodeCombiner()
Tests if setting a node combiner causes an invalidation.


testSetNullNodeCombiner

public void testSetNullNodeCombiner()
Tests setting a null node combiner. This should cause an exception.


testClone

public void testClone()
Tests cloning a combined configuration.


testCloneModify

public void testCloneModify()
Tests if the cloned configuration is decoupled from the original.


testClear

public void testClear()
Tests clearing a combined configuration. This should remove all contained configurations.


testReloading

public void testReloading()
                   throws Exception
Tests if file-based configurations can be reloaded.

Throws:
Exception

testReloadingSubnodeConfig

public void testReloadingSubnodeConfig()
                                throws IOException,
                                       ConfigurationException
Tests whether the reload check works with a subnode configuration. This test is related to CONFIGURATION-341.

Throws:
IOException
ConfigurationException

testReloadingNestedCC

public void testReloadingNestedCC()
                           throws IOException,
                                  ConfigurationException
Tests whether reloading works for a combined configuration nested in another combined configuration.

Throws:
IOException
ConfigurationException

testGetSourceHierarchical

public void testGetSourceHierarchical()
Tests the gestSource() method when the source property is defined in a hierarchical configuration.


testGetSourceNonHierarchical

public void testGetSourceNonHierarchical()
Tests whether the source configuration can be detected for non hierarchical configurations.


testGetSourceUnknown

public void testGetSourceUnknown()
Tests the getSource() method when the passed in key is not contained. Result should be null in this case.


testGetSourceNull

public void testGetSourceNull()
Tests the getSource() method when a null key is passed in. This should cause an exception.


testGetSourceCombined

public void testGetSourceCombined()
Tests the getSource() method when the passed in key belongs to the combined configuration itself.


testGetSourceMulti

public void testGetSourceMulti()
Tests the getSource() method when the passed in key refers to multiple values, which are all defined in the same source configuration.


testGetSourceMultiSources

public void testGetSourceMultiSources()
Tests the getSource() method when the passed in key refers to multiple values defined by different sources. This should cause an exception.


testEscapeListDelimiters

public void testEscapeListDelimiters()
Tests whether escaped list delimiters are treated correctly.


testInvalidateAfterChange

public void testInvalidateAfterChange()
Tests whether an invalidate event is fired only after a change. This test is related to CONFIGURATION-315.


testConversionExpressionEngine

public void testConversionExpressionEngine()
Tests using a conversion expression engine for child configurations with strange keys. This test is related to CONFIGURATION-336.


testDeadlockWithReload

public void testDeadlockWithReload()
                            throws ConfigurationException,
                                   InterruptedException
Tests whether reload operations can cause a deadlock when the combined configuration is accessed concurrently. This test is related to CONFIGURATION-344.

Throws:
ConfigurationException
InterruptedException

testGetConfigurations

public void testGetConfigurations()
                           throws Exception
Throws:
Exception

testGetConfigurationNameList

public void testGetConfigurationNameList()
                                  throws Exception
Throws:
Exception

testReloadWithSubNodeConfig

public void testReloadWithSubNodeConfig()
                                 throws Exception
Tests whether changes on a sub node configuration that is part of a combined configuration are detected. This test is related to CONFIGURATION-368.

Throws:
Exception

testConcurrentGetAndReload

public void testConcurrentGetAndReload()
                                throws Exception
Throws:
Exception

testCombinedCopyToXML

public void testCombinedCopyToXML()
                           throws ConfigurationException
Tests whether a combined configuration can be copied to an XML configuration. This test is related to CONFIGURATION-445.

Throws:
ConfigurationException


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