org.apache.commons.configuration.tree
Class TestOverrideCombiner

java.lang.Object
  extended by org.apache.commons.configuration.tree.AbstractCombinerTest
      extended by org.apache.commons.configuration.tree.TestOverrideCombiner

public class TestOverrideCombiner
extends AbstractCombinerTest

Test class for OverrideCombiner.

Version:
$Id: TestOverrideCombiner.java 1225911 2011-12-30 20:19:10Z oheger $

Field Summary
 
Fields inherited from class org.apache.commons.configuration.tree.AbstractCombinerTest
combiner
 
Constructor Summary
TestOverrideCombiner()
           
 
Method Summary
protected  NodeCombiner createCombiner()
          Creates the combiner.
 void testAttributes()
          Tests combination of attributes.
 void testCombinedTableList()
          Tests the combination of the table structure when the table node is declared as a list node.
 void testCombinedTableNoList()
          Tests the combination of the table structure.
 void testListFromFirstStructure()
          Tests if a list from the first node structure overrides a list in the second structure.
 void testListFromSecondStructure()
          Tests if a list from the second structure is added if it is not defined in the first structure.
 void testOverrideValues()
          Tests whether property values are correctly overridden.
 void testSimpleValues()
          Tests combination of simple elements.
 
Methods inherited from class org.apache.commons.configuration.tree.AbstractCombinerTest
createCombinedConfiguration, setUp, testInit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestOverrideCombiner

public TestOverrideCombiner()
Method Detail

createCombiner

protected NodeCombiner createCombiner()
Creates the combiner.

Specified by:
createCombiner in class AbstractCombinerTest
Returns:
the combiner

testSimpleValues

public void testSimpleValues()
                      throws ConfigurationException
Tests combination of simple elements.

Throws:
ConfigurationException

testAttributes

public void testAttributes()
                    throws ConfigurationException
Tests combination of attributes.

Throws:
ConfigurationException

testOverrideValues

public void testOverrideValues()
                        throws ConfigurationException
Tests whether property values are correctly overridden.

Throws:
ConfigurationException

testListFromFirstStructure

public void testListFromFirstStructure()
                                throws ConfigurationException
Tests if a list from the first node structure overrides a list in the second structure.

Throws:
ConfigurationException

testListFromSecondStructure

public void testListFromSecondStructure()
                                 throws ConfigurationException
Tests if a list from the second structure is added if it is not defined in the first structure.

Throws:
ConfigurationException

testCombinedTableNoList

public void testCombinedTableNoList()
                             throws ConfigurationException
Tests the combination of the table structure. Because the table node is not declared as a list node the structures will be combined. But this won't make any difference because the values in the first table override the values in the second table. Only the node for the table element will be a ViewNode.

Throws:
ConfigurationException

testCombinedTableList

public void testCombinedTableList()
                           throws ConfigurationException
Tests the combination of the table structure when the table node is declared as a list node. In this case the first table structure completely overrides the second and will be directly added to the resulting structure.

Throws:
ConfigurationException


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