ca.quine.jcommons.transform.test
Class DigesterTest

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--ca.quine.jcommons.transform.test.DigesterTest
All Implemented Interfaces:
junit.framework.Test

public class DigesterTest
extends junit.framework.TestCase


Constructor Summary
DigesterTest(String testName)
           
 
Method Summary
 void testFileTypes()
          Ensures that the right file type is found for a given input file.
 void testImports()
          Ensures that class imports in the configuration file work as expected.
 void testInvalidTransformGraph()
          This test case ensures the right exception is thrown when an invalid file is loaded.
 void testTransformGraph()
          This test case shows the most straightforward way to convert a filename into a desired output type.
 void testTransformGraphEdi2()
          Ensures that "edi2" files are correctly transformed (which should catch bugs in StructuredXMLTransform as well).
 void testTransformGraphEdi2Sample2()
          Ensures that the second sample "edi2" file is correctly transformed (which should catch bugs in StructuredXMLTransform as well).
 void testTransformGraphInvalidEdi()
          Ensures that an invalid file won't cause a NullPointerException.
 void testTransformGraphManual()
          This test case shows how to deconstruct performing each step of a transformation manually (for extra flexibility).
 
Methods inherited from class junit.framework.TestCase
countTestCases, createDefault, getName, name, 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, assertFalse, assertNotNull, assertNotNull, 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

DigesterTest

public DigesterTest(String testName)
Method Detail

testImports

public void testImports()
                 throws JDOMException,
                        IOException
Ensures that class imports in the configuration file work as expected.

Throws:
JDOMException
IOException

testFileTypes

public void testFileTypes()
                   throws JDOMException,
                          IOException
Ensures that the right file type is found for a given input file.

Throws:
JDOMException
IOException

testTransformGraph

public void testTransformGraph()
                        throws JDOMException,
                               IOException,
                               GraphException
This test case shows the most straightforward way to convert a filename into a desired output type. It is more for pedagogical purposes than an actual test case.

Throws:
JDOMException
IOException
GraphException

testTransformGraphManual

public void testTransformGraphManual()
                              throws JDOMException,
                                     IOException,
                                     GraphException
This test case shows how to deconstruct performing each step of a transformation manually (for extra flexibility).
  1. construct the TransformConfig object from a file,
  2. find a TransformGraph by name,
  3. and directly perform transformations from a specific input type to a specific output type.

Throws:
JDOMException
IOException
GraphException

testTransformGraphEdi2

public void testTransformGraphEdi2()
                            throws JDOMException,
                                   IOException,
                                   GraphException
Ensures that "edi2" files are correctly transformed (which should catch bugs in StructuredXMLTransform as well).

Throws:
JDOMException
IOException
GraphException

testTransformGraphEdi2Sample2

public void testTransformGraphEdi2Sample2()
                                   throws JDOMException,
                                          IOException,
                                          GraphException
Ensures that the second sample "edi2" file is correctly transformed (which should catch bugs in StructuredXMLTransform as well).

Throws:
JDOMException
IOException
GraphException

testInvalidTransformGraph

public void testInvalidTransformGraph()
                               throws JDOMException,
                                      IOException,
                                      GraphException
This test case ensures the right exception is thrown when an invalid file is loaded.

Throws:
JDOMException
IOException
GraphException

testTransformGraphInvalidEdi

public void testTransformGraphInvalidEdi()
                                  throws JDOMException,
                                         IOException,
                                         GraphException
Ensures that an invalid file won't cause a NullPointerException.

Throws:
JDOMException
IOException
GraphException