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:
junit.framework.Test

public class XMLConfigTest
extends junit.framework.TestCase

XML configuration management tests.

Author:
Mathias Ricken

Nested Class Summary
 
Nested classes/interfaces inherited from class junit.framework.TestCase
junit.framework.TestCase.WrappedException
 
Field Summary
static String NL
          Newline string.
 
Constructor Summary
XMLConfigTest()
           
 
Method Summary
 void getNodePath1()
           
 void getNodePath1Delegate()
           
private  String remove16XML(String s)
           
private  void subTestGet(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 String NL
Newline string.

Constructor Detail

XMLConfigTest

public XMLConfigTest()
Method Detail

testNodes

public void testNodes()
               throws Exception
Throws:
Exception

testAttrs

public void testAttrs()
               throws Exception
Throws:
Exception

testExceptions

public void testExceptions()
                    throws Exception
Throws:
Exception

remove16XML

private String remove16XML(String s)

testSave

public void testSave()
              throws Exception
Throws:
Exception

testSetNodeFromEmpty

public void testSetNodeFromEmpty()
                          throws Exception
Throws:
Exception

testSetNodeOverwrite

public void testSetNodeOverwrite()
                          throws Exception
Throws:
Exception

testSetAttrFromEmpty

public void testSetAttrFromEmpty()
                          throws Exception
Throws:
Exception

testSetAttrOverwrite

public void testSetAttrOverwrite()
                          throws Exception
Throws:
Exception

testSetNodeNoOverwrite

public void testSetNodeNoOverwrite()
                            throws Exception
Throws:
Exception

testSetAttrNoOverwrite

public void testSetAttrNoOverwrite()
                            throws Exception
Throws:
Exception

testSetFromNode

public void testSetFromNode()
                     throws Exception
Throws:
Exception

testMultipleNodes

public void testMultipleNodes()
                       throws Exception
Throws:
Exception

testMultipleNodesAttr

public void testMultipleNodesAttr()
                           throws Exception
Throws:
Exception

testNodesStarEnd

public void testNodesStarEnd()
                      throws Exception
Throws:
Exception

testNodesStarMiddle

public void testNodesStarMiddle()
                         throws Exception
Throws:
Exception

testAttrsStarEnd

public void testAttrsStarEnd()
                      throws Exception
Throws:
Exception

testNodeStarAttrsStar

public void testNodeStarAttrsStar()
                           throws Exception
Throws:
Exception

getNodePath1

public void getNodePath1()
                  throws Exception
Throws:
Exception

testNodesDelegate

public void testNodesDelegate()
                       throws Exception
Throws:
Exception

testAttrsDelegate

public void testAttrsDelegate()
                       throws Exception
Throws:
Exception

testExceptionsDelegate

public void testExceptionsDelegate()
                            throws Exception
Throws:
Exception

testSaveDelegate

public void testSaveDelegate()
                      throws Exception
Throws:
Exception

testSetNodeFromEmptyDelegate

public void testSetNodeFromEmptyDelegate()
                                  throws Exception
Throws:
Exception

testSetNodeOverwriteDelegate

public void testSetNodeOverwriteDelegate()
                                  throws Exception
Throws:
Exception

testSetAttrFromEmptyDelegate

public void testSetAttrFromEmptyDelegate()
                                  throws Exception
Throws:
Exception

testSetAttrOverwriteDelegate

public void testSetAttrOverwriteDelegate()
                                  throws Exception
Throws:
Exception

testSetNodeNoOverwriteDelegate

public void testSetNodeNoOverwriteDelegate()
                                    throws Exception
Throws:
Exception

testSetAttrNoOverwriteDelegate

public void testSetAttrNoOverwriteDelegate()
                                    throws Exception
Throws:
Exception

testSetFromNodeDelegate

public void testSetFromNodeDelegate()
                             throws Exception
Throws:
Exception

testMultipleNodesDelegate

public void testMultipleNodesDelegate()
                               throws Exception
Throws:
Exception

testMultipleNodesAttrDelegate

public void testMultipleNodesAttrDelegate()
                                   throws Exception
Throws:
Exception

testNodesStarEndDelegate

public void testNodesStarEndDelegate()
                              throws Exception
Throws:
Exception

testNodesStarMiddleDelegate

public void testNodesStarMiddleDelegate()
                                 throws Exception
Throws:
Exception

testAttrsStarEndDelegate

public void testAttrsStarEndDelegate()
                              throws Exception
Throws:
Exception

testNodeStarAttrsStarDelegate

public void testNodeStarAttrsStarDelegate()
                                   throws Exception
Throws:
Exception

getNodePath1Delegate

public void getNodePath1Delegate()
                          throws Exception
Throws:
Exception

testGet

public void testGet()
             throws Exception
Throws:
Exception

subTestGet

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

Throws:
Exception

testGetInt

public void testGetInt()
                throws Exception
Throws:
Exception

testGetMultipleExcludesComments

public void testGetMultipleExcludesComments()
                                     throws Exception
Throws:
Exception

testGetNodesExceptions

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

Throws:
Exception

testGetBool

public void testGetBool()
                 throws Exception
Throws:
Exception

testGetNodePath

public void testGetNodePath()
                     throws Exception
Test getNodePath(Node n)

Throws:
Exception

testXMLConfigException

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

Throws:
Exception

testSaveAndLoadConstructors

public void testSaveAndLoadConstructors()
                                 throws Exception
Test save(File f)

Throws:
Exception

testNullParamsinConstructor

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

Throws:
Exception

testConstructorWithFileName

public void testConstructorWithFileName()
                                 throws Exception
Tests XMLConfig(String filename)

Throws:
Exception