Search in sources :

Example 6 with NamespaceContext

use of org.custommonkey.xmlunit.NamespaceContext in project wcomponents by BorderTech.

the class ValidatorApp method main.

/**
 * Main entry method.
 *
 * @param args the program command-line arguments (ignored).
 */
public static void main(final String[] args) {
    // Need to register the "ui" prefix with XMLUnit so that we can use it in XPath expressions
    NamespaceContext context = XMLUnit.getXpathNamespaceContext();
    context = new XmlLayoutTestNamespaceContext(context);
    XMLUnit.setXpathNamespaceContext(context);
    new ValidatorApp();
}
Also used : NamespaceContext(org.custommonkey.xmlunit.NamespaceContext)

Example 7 with NamespaceContext

use of org.custommonkey.xmlunit.NamespaceContext in project wcomponents by BorderTech.

the class AbstractWebXmlRendererTestCase method registerUINamespace.

/**
 * We need to register the "ui" prefix with XMLUnit so that we can use it in XPath expressions.
 */
@BeforeClass
public static void registerUINamespace() {
    NamespaceContext context = XMLUnit.getXpathNamespaceContext();
    context = new XmlLayoutTestNamespaceContext(context);
    XMLUnit.setXpathNamespaceContext(context);
}
Also used : NamespaceContext(org.custommonkey.xmlunit.NamespaceContext) BeforeClass(org.junit.BeforeClass)

Example 8 with NamespaceContext

use of org.custommonkey.xmlunit.NamespaceContext 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

NamespaceContext (org.custommonkey.xmlunit.NamespaceContext)8 HashMap (java.util.HashMap)6 SimpleNamespaceContext (org.custommonkey.xmlunit.SimpleNamespaceContext)6 BeforeClass (org.junit.BeforeClass)5 NameValuePairList (org.apache.sling.commons.testing.integration.NameValuePairList)1 Before (org.junit.Before)1 Matchers.anyString (org.mockito.Matchers.anyString)1