org.apache.commons.betwixt.xmlunit
Class XmlTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.betwixt.xmlunit.XmlTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractTestCase, TestBeanToXml, TestIntrospection, TestXmlTestCase, TestXmlToBean

public class XmlTestCase
extends junit.framework.TestCase

Provides xml test utilities. Hopefully, these might be moved into [xmlunit] sometime.

Author:
Robert Burrell Donkin, Khaled Noaman, IBM (some portions derived from test code originally contributed to the Apache Xerces project)

Field Summary
protected static boolean debug
           
 
Constructor Summary
XmlTestCase(java.lang.String testName)
           
 
Method Summary
protected  javax.xml.parsers.DocumentBuilder createDocumentBuilder()
           
protected  javax.xml.parsers.DocumentBuilderFactory getDomFactory()
           
 boolean isValid(org.xml.sax.InputSource documentSource, org.xml.sax.InputSource schemaSource)
           
protected  org.w3c.dom.Document parseFile(java.lang.String path)
           
protected  org.w3c.dom.Document parseString(java.lang.String string)
           
protected  org.w3c.dom.Document parseString(java.io.StringWriter writer)
           
 void validateWithSchema(org.xml.sax.InputSource documentSource, org.xml.sax.InputSource schemaSource)
           
 void xmlAssertIsomorphic(org.w3c.dom.Node rootOne, org.w3c.dom.Node rootTwo)
           
 void xmlAssertIsomorphic(org.w3c.dom.Node rootOne, org.w3c.dom.Node rootTwo, boolean orderIndependent)
           
 void xmlAssertIsomorphic(java.lang.String message, org.w3c.dom.Node rootOne, org.w3c.dom.Node rootTwo)
           
 void xmlAssertIsomorphic(java.lang.String message, org.w3c.dom.Node rootOne, org.w3c.dom.Node rootTwo, boolean orderIndependent)
           
 void xmlAssertIsomorphicContent(org.w3c.dom.Document documentOne, org.w3c.dom.Document documentTwo)
           
 void xmlAssertIsomorphicContent(org.w3c.dom.Document documentOne, org.w3c.dom.Document documentTwo, boolean orderIndependent)
           
 void xmlAssertIsomorphicContent(java.lang.String message, org.w3c.dom.Document documentOne, org.w3c.dom.Document documentTwo)
           
 void xmlAssertIsomorphicContent(java.lang.String message, org.w3c.dom.Document documentOne, org.w3c.dom.Document documentTwo, boolean orderIndependent)
           
 void xmlAssertIsValid(org.xml.sax.InputSource documentSource, org.xml.sax.InputSource schemaSource)
           
 void xmlAssertIsValid(java.lang.String document, java.lang.String schema)
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debug

protected static boolean debug
Constructor Detail

XmlTestCase

public XmlTestCase(java.lang.String testName)
Method Detail

xmlAssertIsomorphicContent

public void xmlAssertIsomorphicContent(org.w3c.dom.Document documentOne,
                                       org.w3c.dom.Document documentTwo)
                                throws junit.framework.AssertionFailedError
Throws:
junit.framework.AssertionFailedError

xmlAssertIsomorphicContent

public void xmlAssertIsomorphicContent(org.w3c.dom.Document documentOne,
                                       org.w3c.dom.Document documentTwo,
                                       boolean orderIndependent)
                                throws junit.framework.AssertionFailedError
Throws:
junit.framework.AssertionFailedError

xmlAssertIsomorphicContent

public void xmlAssertIsomorphicContent(java.lang.String message,
                                       org.w3c.dom.Document documentOne,
                                       org.w3c.dom.Document documentTwo)
                                throws junit.framework.AssertionFailedError
Throws:
junit.framework.AssertionFailedError

xmlAssertIsomorphicContent

public void xmlAssertIsomorphicContent(java.lang.String message,
                                       org.w3c.dom.Document documentOne,
                                       org.w3c.dom.Document documentTwo,
                                       boolean orderIndependent)
                                throws junit.framework.AssertionFailedError
Throws:
junit.framework.AssertionFailedError

xmlAssertIsomorphic

public void xmlAssertIsomorphic(org.w3c.dom.Node rootOne,
                                org.w3c.dom.Node rootTwo)
                         throws junit.framework.AssertionFailedError
Throws:
junit.framework.AssertionFailedError

xmlAssertIsomorphic

public void xmlAssertIsomorphic(org.w3c.dom.Node rootOne,
                                org.w3c.dom.Node rootTwo,
                                boolean orderIndependent)
                         throws junit.framework.AssertionFailedError
Throws:
junit.framework.AssertionFailedError

xmlAssertIsomorphic

public void xmlAssertIsomorphic(java.lang.String message,
                                org.w3c.dom.Node rootOne,
                                org.w3c.dom.Node rootTwo)

xmlAssertIsomorphic

public void xmlAssertIsomorphic(java.lang.String message,
                                org.w3c.dom.Node rootOne,
                                org.w3c.dom.Node rootTwo,
                                boolean orderIndependent)
                         throws junit.framework.AssertionFailedError
Throws:
junit.framework.AssertionFailedError

createDocumentBuilder

protected javax.xml.parsers.DocumentBuilder createDocumentBuilder()

getDomFactory

protected javax.xml.parsers.DocumentBuilderFactory getDomFactory()

parseString

protected org.w3c.dom.Document parseString(java.io.StringWriter writer)

parseString

protected org.w3c.dom.Document parseString(java.lang.String string)

parseFile

protected org.w3c.dom.Document parseFile(java.lang.String path)

validateWithSchema

public void validateWithSchema(org.xml.sax.InputSource documentSource,
                               org.xml.sax.InputSource schemaSource)
                        throws javax.xml.parsers.ParserConfigurationException,
                               org.xml.sax.SAXException,
                               java.io.IOException
Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException

isValid

public boolean isValid(org.xml.sax.InputSource documentSource,
                       org.xml.sax.InputSource schemaSource)
                throws javax.xml.parsers.ParserConfigurationException,
                       java.io.IOException
Throws:
javax.xml.parsers.ParserConfigurationException
java.io.IOException

xmlAssertIsValid

public void xmlAssertIsValid(java.lang.String document,
                             java.lang.String schema)
                      throws javax.xml.parsers.ParserConfigurationException,
                             java.io.IOException
Throws:
javax.xml.parsers.ParserConfigurationException
java.io.IOException

xmlAssertIsValid

public void xmlAssertIsValid(org.xml.sax.InputSource documentSource,
                             org.xml.sax.InputSource schemaSource)
                      throws javax.xml.parsers.ParserConfigurationException,
                             java.io.IOException
Throws:
javax.xml.parsers.ParserConfigurationException
java.io.IOException


Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.