edu.rice.cs.util
Class XMLConfigTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by edu.rice.cs.util.XMLConfigTest
All Implemented Interfaces:
Test

public class XMLConfigTest
extends TestCase

XML configuration management tests.

Author:
Mathias Ricken

Nested Class Summary
 
Nested classes/interfaces inherited from class junit.framework.TestCase
TestCase.WrappedException
 
Field Summary
static java.lang.String NL
          Newline string.
 
Constructor Summary
XMLConfigTest()
           
 
Method Summary
 void getNodePath1()
           
 void getNodePath1Delegate()
           
private  java.lang.String remove16XML(java.lang.String s)
           
private  void subTestGet(java.lang.String pathToTest, XMLConfig xc)
          Expectes "concutest" to be the root node of passed XMLConfig.
 void testAttrs()
           
 void testAttrsDelegate()
           
 void testAttrsStarEnd()
           
 void testAttrsStarEndDelegate()
           
 void testConstructorWithFileName()
          Tests XMLConfig(String filename)
 void testExceptions()
           
 void testExceptionsDelegate()
           
 void testGet()
           
 void testGetBool()
           
 void testGetInt()
           
 void testGetMultipleExcludesComments()
           
 void testGetNodePath()
          Test getNodePath(Node n)
 void testGetNodesExceptions()
          Tests for exceptions thrown when getNodes() is passed malformed paths
 void testMultipleNodes()
           
 void testMultipleNodesAttr()
           
 void testMultipleNodesAttrDelegate()
           
 void testMultipleNodesDelegate()
           
 void testNodes()
           
 void testNodesDelegate()
           
 void testNodesStarEnd()
           
 void testNodesStarEndDelegate()
           
 void testNodesStarMiddle()
           
 void testNodesStarMiddleDelegate()
           
 void testNodeStarAttrsStar()
           
 void testNodeStarAttrsStarDelegate()
           
 void testNullParamsinConstructor()
          Tests is XMLConfig constructor rejects null as parameters
 void testSave()
           
 void testSaveAndLoadConstructors()
          Test save(File f)
 void testSaveDelegate()
           
 void testSetAttrFromEmpty()
           
 void testSetAttrFromEmptyDelegate()
           
 void testSetAttrNoOverwrite()
           
 void testSetAttrNoOverwriteDelegate()
           
 void testSetAttrOverwrite()
           
 void testSetAttrOverwriteDelegate()
           
 void testSetFromNode()
           
 void testSetFromNodeDelegate()
           
 void testSetNodeFromEmpty()
           
 void testSetNodeFromEmptyDelegate()
           
 void testSetNodeNoOverwrite()
           
 void testSetNodeNoOverwriteDelegate()
           
 void testSetNodeOverwrite()
           
 void testSetNodeOverwriteDelegate()
           
 void testXMLConfigException()
          Test that construction of XMLConfigException's will succeed Kind of pointless really.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, 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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NL

public static final java.lang.String NL
Newline string.

Constructor Detail

XMLConfigTest

public XMLConfigTest()
Method Detail

testNodes

public void testNodes()
               throws java.lang.Exception
Throws:
java.lang.Exception

testAttrs

public void testAttrs()
               throws java.lang.Exception
Throws:
java.lang.Exception

testExceptions

public void testExceptions()
                    throws java.lang.Exception
Throws:
java.lang.Exception

remove16XML

private java.lang.String remove16XML(java.lang.String s)

testSave

public void testSave()
              throws java.lang.Exception
Throws:
java.lang.Exception

testSetNodeFromEmpty

public void testSetNodeFromEmpty()
                          throws java.lang.Exception
Throws:
java.lang.Exception

testSetNodeOverwrite

public void testSetNodeOverwrite()
                          throws java.lang.Exception
Throws:
java.lang.Exception

testSetAttrFromEmpty

public void testSetAttrFromEmpty()
                          throws java.lang.Exception
Throws:
java.lang.Exception

testSetAttrOverwrite

public void testSetAttrOverwrite()
                          throws java.lang.Exception
Throws:
java.lang.Exception

testSetNodeNoOverwrite

public void testSetNodeNoOverwrite()
                            throws java.lang.Exception
Throws:
java.lang.Exception

testSetAttrNoOverwrite

public void testSetAttrNoOverwrite()
                            throws java.lang.Exception
Throws:
java.lang.Exception

testSetFromNode

public void testSetFromNode()
                     throws java.lang.Exception
Throws:
java.lang.Exception

testMultipleNodes

public void testMultipleNodes()
                       throws java.lang.Exception
Throws:
java.lang.Exception

testMultipleNodesAttr

public void testMultipleNodesAttr()
                           throws java.lang.Exception
Throws:
java.lang.Exception

testNodesStarEnd

public void testNodesStarEnd()
                      throws java.lang.Exception
Throws:
java.lang.Exception

testNodesStarMiddle

public void testNodesStarMiddle()
                         throws java.lang.Exception
Throws:
java.lang.Exception

testAttrsStarEnd

public void testAttrsStarEnd()
                      throws java.lang.Exception
Throws:
java.lang.Exception

testNodeStarAttrsStar

public void testNodeStarAttrsStar()
                           throws java.lang.Exception
Throws:
java.lang.Exception

getNodePath1

public void getNodePath1()
                  throws java.lang.Exception
Throws:
java.lang.Exception

testNodesDelegate

public void testNodesDelegate()
                       throws java.lang.Exception
Throws:
java.lang.Exception

testAttrsDelegate

public void testAttrsDelegate()
                       throws java.lang.Exception
Throws:
java.lang.Exception

testExceptionsDelegate

public void testExceptionsDelegate()
                            throws java.lang.Exception
Throws:
java.lang.Exception

testSaveDelegate

public void testSaveDelegate()
                      throws java.lang.Exception
Throws:
java.lang.Exception

testSetNodeFromEmptyDelegate

public void testSetNodeFromEmptyDelegate()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

testSetNodeOverwriteDelegate

public void testSetNodeOverwriteDelegate()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

testSetAttrFromEmptyDelegate

public void testSetAttrFromEmptyDelegate()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

testSetAttrOverwriteDelegate

public void testSetAttrOverwriteDelegate()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

testSetNodeNoOverwriteDelegate

public void testSetNodeNoOverwriteDelegate()
                                    throws java.lang.Exception
Throws:
java.lang.Exception

testSetAttrNoOverwriteDelegate

public void testSetAttrNoOverwriteDelegate()
                                    throws java.lang.Exception
Throws:
java.lang.Exception

testSetFromNodeDelegate

public void testSetFromNodeDelegate()
                             throws java.lang.Exception
Throws:
java.lang.Exception

testMultipleNodesDelegate

public void testMultipleNodesDelegate()
                               throws java.lang.Exception
Throws:
java.lang.Exception

testMultipleNodesAttrDelegate

public void testMultipleNodesAttrDelegate()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

testNodesStarEndDelegate

public void testNodesStarEndDelegate()
                              throws java.lang.Exception
Throws:
java.lang.Exception

testNodesStarMiddleDelegate

public void testNodesStarMiddleDelegate()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

testAttrsStarEndDelegate

public void testAttrsStarEndDelegate()
                              throws java.lang.Exception
Throws:
java.lang.Exception

testNodeStarAttrsStarDelegate

public void testNodeStarAttrsStarDelegate()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

getNodePath1Delegate

public void getNodePath1Delegate()
                          throws java.lang.Exception
Throws:
java.lang.Exception

testGet

public void testGet()
             throws java.lang.Exception
Throws:
java.lang.Exception

subTestGet

private void subTestGet(java.lang.String pathToTest,
                        XMLConfig xc)
                 throws java.lang.Exception
Expectes "concutest" to be the root node of passed XMLConfig.

Throws:
java.lang.Exception

testGetInt

public void testGetInt()
                throws java.lang.Exception
Throws:
java.lang.Exception

testGetMultipleExcludesComments

public void testGetMultipleExcludesComments()
                                     throws java.lang.Exception
Throws:
java.lang.Exception

testGetNodesExceptions

public void testGetNodesExceptions()
                            throws java.lang.Exception
Tests for exceptions thrown when getNodes() is passed malformed paths

Throws:
java.lang.Exception

testGetBool

public void testGetBool()
                 throws java.lang.Exception
Throws:
java.lang.Exception

testGetNodePath

public void testGetNodePath()
                     throws java.lang.Exception
Test getNodePath(Node n)

Throws:
java.lang.Exception

testXMLConfigException

public void testXMLConfigException()
                            throws java.lang.Exception
Test that construction of XMLConfigException's will succeed Kind of pointless really.

Throws:
java.lang.Exception

testSaveAndLoadConstructors

public void testSaveAndLoadConstructors()
                                 throws java.lang.Exception
Test save(File f)

Throws:
java.lang.Exception

testNullParamsinConstructor

public void testNullParamsinConstructor()
                                 throws java.lang.Exception
Tests is XMLConfig constructor rejects null as parameters

Throws:
java.lang.Exception

testConstructorWithFileName

public void testConstructorWithFileName()
                                 throws java.lang.Exception
Tests XMLConfig(String filename)

Throws:
java.lang.Exception