net.sf.xolite.utils
Class XMLSerializationTester
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XMLSerializationTester
public XMLSerializationTester()
XMLSerializationTester
public XMLSerializationTester(InputStream xmlSourceStream,
XMLSerializable rootObject)
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.