org.apache.commons.configuration.tree
Class TestDefaultConfigurationNode

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.configuration.tree.TestDefaultConfigurationNode
All Implemented Interfaces:
junit.framework.Test

public class TestDefaultConfigurationNode
extends junit.framework.TestCase

Test class for DefaultConfigurationNode.

Author:
Oliver Heger

Constructor Summary
TestDefaultConfigurationNode()
           
 
Method Summary
protected  void setUp()
           
 void testAddAttribute()
          Tests adding a new attribute node.
 void testAddChild()
          Tests adding a new child node.
 void testAddUndefinedChild()
          Tests adding invalid child nodes.
 void testChangeAttributeState()
          Tests changing a node's attribute state.
 void testClone()
          Tests cloning a node.
 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 junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestDefaultConfigurationNode

public TestDefaultConfigurationNode()
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

testNewNode

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


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.


testAddUndefinedChild

public void testAddUndefinedChild()
Tests adding invalid child nodes.


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-2008 The Apache Software Foundation. All Rights Reserved.