org.apache.commons.configuration.tree
Class TestDefaultExpressionEngine

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

public class TestDefaultExpressionEngine
extends Object

Test class for DefaultExpressionEngine.

Version:
$Id: TestDefaultExpressionEngine.java 1225918 2011-12-30 20:54:47Z oheger $
Author:
Commons Configuration team

Constructor Summary
TestDefaultExpressionEngine()
           
 
Method Summary
 void setUp()
           
protected  ConfigurationNode setUpNodes()
          Creates a node hierarchy for testing that consists of tables, their fields, and some additional data: tables table name fields field name field name
 void testNodeKey()
          Tests obtaining keys for nodes.
 void testNodeKeyWithAlternativeSyntax()
          Tests obtaining node keys when a different syntax is set.
 void testNodeKeyWithAttribute()
          Tests obtaining keys for attribute nodes.
 void testNodeKeyWithEscapedDelimiters()
          Tests obtaining keys for nodes that contain the delimiter character.
 void testNodeKeyWithRoot()
          Tests obtaining keys when the root node is involved.
 void testPrepareAddAttribute()
          Tests adding new attributes.
 void testPrepareAddDirectly()
          Tests adding direct child nodes to the existing hierarchy.
 void testPrepareAddEmptyKey()
           
 void testPrepareAddInvalidKey()
          Tests using invalid keys, e.g. if something should be added to attributes.
 void testPrepareAddInvalidKeyAttribute()
           
 void testPrepareAddNullKey()
           
 void testPrepareAddWithAlternativeSyntax()
          Tests add operations when an alternative syntax is set.
 void testPrepareAddWithIndex()
          Tests adding when indices are involved.
 void testPrepareAddWithPath()
          Tests add operations where complete paths are added.
 void testPrepareAddWithSameAttributeDelimiter()
          Tests add operations when property and attribute delimiters are equal.
 void testQueryAlternativeSyntax()
          Tests a different query syntax.
 void testQueryAttributeEmulation()
          Tests some queries when the same delimiter is used for properties and attributes.
 void testQueryEscapedKeys()
          Tests querying nodes whose names contain a delimiter.
 void testQueryKeys()
          Tests some simple queries.
 void testQueryNodes()
          Performs some queries and evaluates the values of the result nodes.
 void testQueryNonExistingKeys()
          Tests querying keys that do not exist.
 void testQueryRootNode()
          Tests accessing the root node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestDefaultExpressionEngine

public TestDefaultExpressionEngine()
Method Detail

setUp

public void setUp()
           throws Exception
Throws:
Exception

testQueryKeys

public void testQueryKeys()
Tests some simple queries.


testQueryNodes

public void testQueryNodes()
Performs some queries and evaluates the values of the result nodes.


testQueryNonExistingKeys

public void testQueryNonExistingKeys()
Tests querying keys that do not exist.


testQueryEscapedKeys

public void testQueryEscapedKeys()
Tests querying nodes whose names contain a delimiter.


testQueryAttributeEmulation

public void testQueryAttributeEmulation()
Tests some queries when the same delimiter is used for properties and attributes.


testQueryRootNode

public void testQueryRootNode()
Tests accessing the root node.


testQueryAlternativeSyntax

public void testQueryAlternativeSyntax()
Tests a different query syntax. Sets other strings for the typical tokens used by the expression engine.


testNodeKey

public void testNodeKey()
Tests obtaining keys for nodes.


testNodeKeyWithRoot

public void testNodeKeyWithRoot()
Tests obtaining keys when the root node is involved.


testNodeKeyWithAttribute

public void testNodeKeyWithAttribute()
Tests obtaining keys for attribute nodes.


testNodeKeyWithEscapedDelimiters

public void testNodeKeyWithEscapedDelimiters()
Tests obtaining keys for nodes that contain the delimiter character.


testNodeKeyWithAlternativeSyntax

public void testNodeKeyWithAlternativeSyntax()
Tests obtaining node keys when a different syntax is set.


testPrepareAddDirectly

public void testPrepareAddDirectly()
Tests adding direct child nodes to the existing hierarchy.


testPrepareAddWithIndex

public void testPrepareAddWithIndex()
Tests adding when indices are involved.


testPrepareAddAttribute

public void testPrepareAddAttribute()
Tests adding new attributes.


testPrepareAddWithPath

public void testPrepareAddWithPath()
Tests add operations where complete paths are added.


testPrepareAddWithSameAttributeDelimiter

public void testPrepareAddWithSameAttributeDelimiter()
Tests add operations when property and attribute delimiters are equal. Then it is not possible to add new attribute nodes.


testPrepareAddWithAlternativeSyntax

public void testPrepareAddWithAlternativeSyntax()
Tests add operations when an alternative syntax is set.


testPrepareAddInvalidKey

public void testPrepareAddInvalidKey()
Tests using invalid keys, e.g. if something should be added to attributes.


testPrepareAddInvalidKeyAttribute

public void testPrepareAddInvalidKeyAttribute()

testPrepareAddNullKey

public void testPrepareAddNullKey()

testPrepareAddEmptyKey

public void testPrepareAddEmptyKey()

setUpNodes

protected ConfigurationNode setUpNodes()
Creates a node hierarchy for testing that consists of tables, their fields, and some additional data:
  tables
       table
          name
          fields
              field
                  name
              field
                  name
 

Returns:
the root of the test node hierarchy


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