public final class JAXBAssert extends Object
Modifier and Type | Method and Description |
---|---|
static void |
assertEqualXmlMarshalUnmarshal(Object objectToMarshal,
String expectedXml,
Class<?>... classesToBeBound)
Performs the following steps and assertions:
Creates a new JAXBContext with the given list of classesToBeBound.
Marshals the provided objectToMarshall to XML.
Unmarshals the marshaled XML to recreate the original object.
Asserts that the newly unmarhsaled object and the original provided object are equal by invoking
Object.equals(Object) .
Unmarshals the given expectedXml to an object and asserts that it is equal with the original unmarshaled object by invoking Object.equals(Object) .
|
static void |
assertEqualXmlMarshalUnmarshalWithResource(Object objectToMarshal,
InputStream expectedXml,
Class<?>... classesToBeBound) |
public static void assertEqualXmlMarshalUnmarshal(Object objectToMarshal, String expectedXml, Class<?>... classesToBeBound)
Object.equals(Object)
.Object.equals(Object)
.objectToMarshal
- the object to marshal to XML using JAXBexpectedXml
- an XML string that will be unmarshaled to an Object and compared with objectToMarshal using Object.equals(Object)
classesToBeBound
- - list of java classes to be recognized by the created JAXBContextpublic static void assertEqualXmlMarshalUnmarshalWithResource(Object objectToMarshal, InputStream expectedXml, Class<?>... classesToBeBound) throws IOException
IOException
Copyright © 2005–2015 The Kuali Foundation. All rights reserved.