org.apache.commons.configuration.tree
Class TestDefaultConfigurationNode

java.lang.Object
  extended by org.apache.commons.configuration.tree.TestDefaultConfigurationNode

public class TestDefaultConfigurationNode
extends Object

Test class for DefaultConfigurationNode.

Version:
$Id: TestDefaultConfigurationNode.java 1225917 2011-12-30 20:42:09Z oheger $
Author:
Commons Configuration team

Nested Class Summary
static class TestDefaultConfigurationNode.CountNodeVisitor
          A test visitor implementation that is able to count the number of visits.
 
Constructor Summary
TestDefaultConfigurationNode()
           
 
Method Summary
 void setUp()
           
 void testAddAttribute()
          Tests adding a new attribute node.
 void testAddChild()
          Tests adding a new child node.
 void testAddChildNull()
          Tries to add a null child node.
 void testAddUndefinedChild()
          Tries to add a node without a name.
 void testChangeAttributeState()
          Tests changing a node's attribute state.
 void testClone()
          Tests cloning a node.
 void testGetAttributeNonExisting()
          Tries to access an attribute using an invalid index.
 void testGetAttributes()
          Tests accessing the node's attributes.
 void testGetAttributesByName()
          Tests accessing the node's attributes by name.
 void testGetChild()
          Tests accessing a child by its index.
 void testGetChildInvalidIndex()
          Tests accessing child nodes with invalid indices.
 void testGetChildren()
          Tests accessing the node's children.
 void testGetChildrenByName()
          Tests accessing the node's children by name.
 void testGetReference()
          Tests accessing a node's reference.
 void testNewNode()
          Tests a newly created, uninitialized node.
 void testRemoveAttribute()
          Tests removing an attribute node.
 void testRemoveAttributeByName()
          Tests removing attributes by their names.
 void testRemoveAttributes()
          Tests removing all attributes.
 void testRemoveChild()
          Tests removing a child node.
 void testRemoveChildByName()
          Tests removing children by their name.
 void testRemoveChildren()
          Tests removing all children at once.
 void testRemoveNonExistingChild()
          Tests removing a child node that does not belong to this node.
 void testVisit()
          Tests the visit() method using a simple visitor.
 void testVisitWithNullVisitor()
          Tests the visit() method when null is passed in.
 void testVisitWithTerminate()
          Tests the visit() method with a visitor that terminates the visit process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestDefaultConfigurationNode

public TestDefaultConfigurationNode()
Method Detail

setUp

public void setUp()
           throws Exception
Throws:
Exception

testNewNode

public void testNewNode()
Tests a newly created, uninitialized node.


testGetAttributeNonExisting

public void testGetAttributeNonExisting()
Tries to access an attribute using an invalid index.


testGetReference

public void testGetReference()
Tests accessing a node's reference.


testGetChildren

public void testGetChildren()
Tests accessing the node's children.


testGetChildrenByName

public void testGetChildrenByName()
Tests accessing the node's children by name.


testAddChild

public void testAddChild()
Tests adding a new child node.


testAddChildNull

public void testAddChildNull()
Tries to add a null child node.


testAddUndefinedChild

public void testAddUndefinedChild()
Tries to add a node without a name.


testRemoveChild

public void testRemoveChild()
Tests removing a child node.


testRemoveNonExistingChild

public void testRemoveNonExistingChild()
Tests removing a child node that does not belong to this node.


testRemoveChildByName

public void testRemoveChildByName()
Tests removing children by their name.


testRemoveChildren

public void testRemoveChildren()
Tests removing all children at once.


testGetChild

public void testGetChild()
Tests accessing a child by its index.


testGetChildInvalidIndex

public void testGetChildInvalidIndex()
Tests accessing child nodes with invalid indices.


testGetAttributes

public void testGetAttributes()
Tests accessing the node's attributes.


testGetAttributesByName

public void testGetAttributesByName()
Tests accessing the node's attributes by name.


testAddAttribute

public void testAddAttribute()
Tests adding a new attribute node.


testRemoveAttribute

public void testRemoveAttribute()
Tests removing an attribute node.


testRemoveAttributeByName

public void testRemoveAttributeByName()
Tests removing attributes by their names.


testRemoveAttributes

public void testRemoveAttributes()
Tests removing all attributes.


testChangeAttributeState

public void testChangeAttributeState()
Tests changing a node's attribute state.


testVisit

public void testVisit()
Tests the visit() method using a simple visitor.


testVisitWithTerminate

public void testVisitWithTerminate()
Tests the visit() method with a visitor that terminates the visit process.


testVisitWithNullVisitor

public void testVisitWithNullVisitor()
Tests the visit() method when null is passed in. This should throw an exception.


testClone

public void testClone()
Tests cloning a node.



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