Search in sources :

Example 6 with SimpleNamespaceContext

use of org.custommonkey.xmlunit.SimpleNamespaceContext in project ddf by codice.

the class AbstractTestCompositeGeometry method setupTestClass.

@BeforeClass
public static void setupTestClass() {
    HashMap map = new HashMap();
    map.put("gml", "http://www.opengis.net/gml");
    map.put("georss", "http://www.georss.org/georss");
    NamespaceContext ctx = new SimpleNamespaceContext(map);
    XMLUnit.setXpathNamespaceContext(ctx);
    XMLUnit.setIgnoreWhitespace(true);
}
Also used : HashMap(java.util.HashMap) NamespaceContext(org.custommonkey.xmlunit.NamespaceContext) SimpleNamespaceContext(org.custommonkey.xmlunit.SimpleNamespaceContext) SimpleNamespaceContext(org.custommonkey.xmlunit.SimpleNamespaceContext) BeforeClass(org.junit.BeforeClass)

Example 7 with SimpleNamespaceContext

use of org.custommonkey.xmlunit.SimpleNamespaceContext in project ddf by codice.

the class TestXmlResponseQueueTransformer method setupTestClass.

@BeforeClass
public static void setupTestClass() {
    // makes xpaths easier to write when prefixes are declared beforehand.
    HashMap<String, String> map = new HashMap<>();
    map.put("gml", "http://www.opengis.net/gml");
    map.put("mc", "urn:catalog:metacard");
    NamespaceContext ctx = new SimpleNamespaceContext(map);
    XMLUnit.setXpathNamespaceContext(ctx);
}
Also used : HashMap(java.util.HashMap) NamespaceContext(org.custommonkey.xmlunit.NamespaceContext) SimpleNamespaceContext(org.custommonkey.xmlunit.SimpleNamespaceContext) Matchers.anyString(org.mockito.Matchers.anyString) SimpleNamespaceContext(org.custommonkey.xmlunit.SimpleNamespaceContext) BeforeClass(org.junit.BeforeClass)

Example 8 with SimpleNamespaceContext

use of org.custommonkey.xmlunit.SimpleNamespaceContext in project ddf by codice.

the class TestAtomTransformer method setupTestClass.

@BeforeClass
public static void setupTestClass() {
    // makes xpaths easier to write when prefixes are declared beforehand.
    HashMap map = new HashMap();
    map.put("gml", "http://www.opengis.net/gml");
    map.put("georss", "http://www.georss.org/georss");
    map.put("", "http://www.w3.org/2005/Atom");
    map.put("atom", "http://www.w3.org/2005/Atom");
    map.put("relevance", "http://a9.com/-/opensearch/extensions/relevance/1.0/");
    map.put("os", "http://a9.com/-/spec/opensearch/1.1/");
    map.put("fs", "http://a9.com/-/opensearch/extensions/federation/1.0/");
    NamespaceContext ctx = new SimpleNamespaceContext(map);
    XMLUnit.setXpathNamespaceContext(ctx);
}
Also used : HashMap(java.util.HashMap) NamespaceContext(org.custommonkey.xmlunit.NamespaceContext) SimpleNamespaceContext(org.custommonkey.xmlunit.SimpleNamespaceContext) SimpleNamespaceContext(org.custommonkey.xmlunit.SimpleNamespaceContext) BeforeClass(org.junit.BeforeClass)

Aggregations

SimpleNamespaceContext (org.custommonkey.xmlunit.SimpleNamespaceContext)8 HashMap (java.util.HashMap)7 NamespaceContext (org.custommonkey.xmlunit.NamespaceContext)6 BeforeClass (org.junit.BeforeClass)4 Response (javax.ws.rs.core.Response)1 XPath (javax.xml.xpath.XPath)1 RuntimeCamelException (org.apache.camel.RuntimeCamelException)1 NameValuePairList (org.apache.sling.commons.testing.integration.NameValuePairList)1 Diff (org.custommonkey.xmlunit.Diff)1 XpathEngine (org.custommonkey.xmlunit.XpathEngine)1 SimpleNamespaceResolver (org.glassfish.jersey.internal.util.SimpleNamespaceResolver)1 Before (org.junit.Before)1 Matchers.anyString (org.mockito.Matchers.anyString)1 Document (org.w3c.dom.Document)1