public class JAXBTestUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
JAXBTestUtil.XMLObjectAssert<S extends JAXBTestUtil.XMLObjectAssert<S,A>,A> |
static class |
JAXBTestUtil.XMLStringAssert |
| Modifier and Type | Field and Description |
|---|---|
static Consumer<org.xmlunit.builder.DiffBuilder> |
IGNORE_ELEMENT_ORDER |
| Constructor and Description |
|---|
JAXBTestUtil() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
assertNoDifferences(org.xmlunit.diff.Diff diff,
byte[] input,
byte[] expected) |
static JAXBTestUtil.XMLStringAssert |
assertThatXml(byte[] o) |
static JAXBTestUtil.XMLStringAssert |
assertThatXml(ByteArrayOutputStream o) |
static JAXBTestUtil.XMLStringAssert |
assertThatXml(String o) |
static <S extends JAXBTestUtil.XMLObjectAssert<S,T>,T> |
assertThatXml(T o) |
static <T> String |
marshal(T object) |
static <T> Element |
marshalToElement(T object) |
static String |
pretty(byte[] xml) |
static String |
pretty(String xml) |
static <T> T |
roundTrip(T input) |
static <T> T |
roundTrip(T input,
String contains)
Deprecated.
unfeasible for different java versions. (tests which used this where often failing with java 8). Use e.g {#link roundTripContains}
|
static <T> T |
roundTripAndSimilar(InputStream input,
Class<? extends T> inputClazz,
Consumer<org.xmlunit.builder.DiffBuilder>... build) |
static <T> T |
roundTripAndSimilar(String input,
Class<? extends T> inputClazz,
Consumer<org.xmlunit.builder.DiffBuilder>... build) |
static <T> T |
roundTripAndSimilar(T input,
InputStream expected) |
static <T> T |
roundTripAndSimilar(T input,
String expected)
Marshalls input and checks if it is similar to given string.
|
static <T> T |
roundTripAndSimilarAndEquals(T input,
String expected) |
static <T> T |
roundTripAndSimilarValue(T input,
String expected) |
static <T> T |
roundTripAndValidateAndSimilar(T input,
URL xsd,
InputStream expected) |
static <T> T |
roundTripAndValidateAndSimilar(T input,
URL xsd,
String expected) |
static <T> T |
roundTripContains(T input,
boolean namespaceAware,
String... contains)
Checks whether the
|
static <T> T |
roundTripContains(T input,
String... contains)
Checks whether marshalled version of an object contains a certain piece of xml.
|
static void |
similar(byte[] input,
byte[] expected,
Consumer<org.xmlunit.builder.DiffBuilder>... build) |
static void |
similar(InputStream input,
InputStream expected,
Consumer<org.xmlunit.builder.DiffBuilder>... build) |
static void |
similar(InputStream input,
String expected,
Consumer<org.xmlunit.builder.DiffBuilder>... build) |
static void |
similar(String input,
InputStream expected,
Consumer<org.xmlunit.builder.DiffBuilder>... build) |
static <T> T |
similar(String input,
String expected,
Class<T> result) |
static void |
similar(String input,
String expected,
Consumer<org.xmlunit.builder.DiffBuilder>... build) |
static <T> T |
unmarshal(String xml,
Class<? extends T> clazz) |
public static final Consumer<org.xmlunit.builder.DiffBuilder> IGNORE_ELEMENT_ORDER
public static <T> String marshal(T object)
public static <T> Element marshalToElement(T object)
public static <T> T roundTrip(T input)
@Deprecated public static <T> T roundTrip(T input, String contains)
public static <T> T roundTripContains(T input,
boolean namespaceAware,
String... contains)
public static <T> T roundTripContains(T input,
String... contains)
@SafeVarargs public static <T> T roundTripAndSimilar(String input, Class<? extends T> inputClazz, Consumer<org.xmlunit.builder.DiffBuilder>... build)
@SafeVarargs public static <T> T roundTripAndSimilar(InputStream input, Class<? extends T> inputClazz, Consumer<org.xmlunit.builder.DiffBuilder>... build) throws IOException
IOExceptionpublic static <T> T roundTripAndSimilar(T input,
String expected)
public static <T> T roundTripAndValidateAndSimilar(T input,
URL xsd,
InputStream expected)
throws IOException,
SAXException
IOExceptionSAXExceptionpublic static <T> T roundTripAndValidateAndSimilar(T input,
URL xsd,
String expected)
throws IOException,
SAXException
IOExceptionSAXExceptionpublic static <T> T roundTripAndSimilar(T input,
InputStream expected)
throws IOException
IOExceptionpublic static <T> T roundTripAndSimilarAndEquals(T input,
String expected)
public static <T> T roundTripAndSimilarValue(T input,
String expected)
throws JAXBException
JAXBException@SafeVarargs public static void similar(String input, String expected, Consumer<org.xmlunit.builder.DiffBuilder>... build)
@SafeVarargs public static void similar(byte[] input, byte[] expected, Consumer<org.xmlunit.builder.DiffBuilder>... build)
@SafeVarargs public static void similar(InputStream input, String expected, Consumer<org.xmlunit.builder.DiffBuilder>... build)
@SafeVarargs public static void similar(String input, InputStream expected, Consumer<org.xmlunit.builder.DiffBuilder>... build)
@SafeVarargs public static void similar(InputStream input, InputStream expected, Consumer<org.xmlunit.builder.DiffBuilder>... build)
public static <S extends JAXBTestUtil.XMLObjectAssert<S,T>,T> JAXBTestUtil.XMLObjectAssert<S,T> assertThatXml(T o)
public static JAXBTestUtil.XMLStringAssert assertThatXml(String o)
public static JAXBTestUtil.XMLStringAssert assertThatXml(ByteArrayOutputStream o)
public static JAXBTestUtil.XMLStringAssert assertThatXml(byte[] o)
protected static void assertNoDifferences(org.xmlunit.diff.Diff diff,
byte[] input,
byte[] expected)
public static String pretty(byte[] xml)
Copyright © 2022. All rights reserved.