public abstract class XmlTest<T> extends Object
Constructor and Description |
---|
XmlTest(T sampleObject,
Object sampleXml,
String schemaFile) |
Modifier and Type | Method and Description |
---|---|
protected void |
_assertXmlEquals(String expectedXml,
String actualXml) |
static void |
assertDepthEquals(Object expected,
Object actual) |
static void |
assertXmlEquals(String expectedXml,
String actualXml) |
static void |
assertXpathDoesNotMatch(String xml,
String expression) |
static void |
assertXpathDoesNotMatch(String description,
String xml,
String expression) |
static void |
assertXpathMatches(String xml,
String expression) |
static void |
assertXpathMatches(String description,
String xml,
String expression) |
protected List<org.custommonkey.xmlunit.Difference> |
getDifferences(String xmlA,
String xmlB) |
static List<org.custommonkey.xmlunit.Difference> |
getDifferences(String xmlA,
String xmlB,
java.util.function.Predicate<String> ignoreNamespace,
java.util.function.Predicate<String> ignorePrefix,
java.util.function.Predicate<org.custommonkey.xmlunit.Difference> ignoreDifference) |
static List<org.custommonkey.xmlunit.Difference> |
getDifferencesSimple(String xmlA,
String xmlB) |
protected T |
getSampleObject() |
protected String |
getSampleXml() |
protected ByteArrayInputStream |
getSampleXmlInputStream() |
protected String |
getSchemaFile() |
protected boolean |
ignoreDifference(org.custommonkey.xmlunit.Difference d) |
protected boolean |
ignoreNamespace(String namespace) |
protected boolean |
ignorePrefix(String prefix) |
static void |
initXmlUnit() |
void |
marshalJaxbAndCompareToXml() |
void |
marshalJaxbUnmarshalJaxb() |
protected String |
marshalToXmlWithJaxb() |
static <T> String |
marshalToXmlWithJaxb(T sampleObject) |
void |
setUp() |
static <T> T |
unmarshalFromXmlWithJaxb(String xml,
Class<T> type) |
void |
unmarshalJaxbMarshalJaxb() |
void |
unmarshalXmlAndCompareToJaxb() |
void |
validateJaxbXmlAgainstSchema() |
protected void |
validateXmlString(String xml) |
protected static NodeList |
xpathGetNodesMatching(String xml,
String expression) |
public static void initXmlUnit()
public void setUp()
protected T getSampleObject()
protected String getSampleXml() throws IOException
IOException
protected ByteArrayInputStream getSampleXmlInputStream() throws IOException
IOException
protected String getSchemaFile()
protected boolean ignoreNamespace(String namespace)
protected boolean ignorePrefix(String prefix)
protected boolean ignoreDifference(org.custommonkey.xmlunit.Difference d)
protected String marshalToXmlWithJaxb()
public void marshalJaxbAndCompareToXml() throws Exception
Exception
public void marshalJaxbUnmarshalJaxb()
public void unmarshalXmlAndCompareToJaxb() throws Exception
Exception
public void validateJaxbXmlAgainstSchema() throws Exception
Exception
public static <T> String marshalToXmlWithJaxb(T sampleObject)
public static void assertXpathDoesNotMatch(String xml, String expression) throws XPathExpressionException
XPathExpressionException
public static void assertXpathDoesNotMatch(String description, String xml, String expression) throws XPathExpressionException
XPathExpressionException
public static void assertXpathMatches(String xml, String expression) throws XPathExpressionException
XPathExpressionException
public static void assertXpathMatches(String description, String xml, String expression) throws XPathExpressionException
XPathExpressionException
protected List<org.custommonkey.xmlunit.Difference> getDifferences(String xmlA, String xmlB)
public static List<org.custommonkey.xmlunit.Difference> getDifferencesSimple(String xmlA, String xmlB)
public static List<org.custommonkey.xmlunit.Difference> getDifferences(String xmlA, String xmlB, java.util.function.Predicate<String> ignoreNamespace, java.util.function.Predicate<String> ignorePrefix, java.util.function.Predicate<org.custommonkey.xmlunit.Difference> ignoreDifference)
protected static NodeList xpathGetNodesMatching(String xml, String expression) throws XPathExpressionException
XPathExpressionException
Copyright © 2020. All rights reserved.