net.sf.xolite.utils
Class XMLSerializationTester

java.lang.Object
  extended by net.sf.xolite.utils.XMLSerializationTester

public class XMLSerializationTester
extends Object

Helper class to test your XML serialization.
Give it an input stream containing a serialized XML and a XMLSerializable representing the same XML. When you call testXMLSerialization(), this tester class will try several transformations (using X-O lite APIs and standard DOM APIs) from both sources and check that the result are matching.

Note: for the purpose of the test this class will create several copies of the initial document in memory (as objects, DOM and byte[]). So it's not suited for very big documents.

Author:
Olivier Berlanger

Constructor Summary
XMLSerializationTester()
           
XMLSerializationTester(InputStream xmlSourceStream, XMLSerializable rootObject)
           
 
Method Summary
 void setComparisonFlags(int newComparisonFlags)
           
 void setRootObject(XMLSerializable rootObject)
           
 void setSchemaLocations(String newSchemaLocations)
           
 void setXMLObjectFactory(XMLObjectFactory newFactory)
           
 void setXmlSource(InputStream xmlSourceStream)
           
 void setXmlSource(String xmlSourceString)
           
 void setXmlSource(String xmlSourceString, String encoding)
           
 void testXMLSerialization()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLSerializationTester

public XMLSerializationTester()

XMLSerializationTester

public XMLSerializationTester(InputStream xmlSourceStream,
                              XMLSerializable rootObject)
Method Detail

setRootObject

public void setRootObject(XMLSerializable rootObject)

setXmlSource

public void setXmlSource(InputStream xmlSourceStream)

setXmlSource

public void setXmlSource(String xmlSourceString)

setXmlSource

public void setXmlSource(String xmlSourceString,
                         String encoding)

setSchemaLocations

public void setSchemaLocations(String newSchemaLocations)

setXMLObjectFactory

public void setXMLObjectFactory(XMLObjectFactory newFactory)

setComparisonFlags

public void setComparisonFlags(int newComparisonFlags)

testXMLSerialization

public void testXMLSerialization()
                          throws Exception
Throws:
Exception


Copyright © 2012. All Rights Reserved.