Package org.custommonkey.xmlunit

Examples of org.custommonkey.xmlunit.SimpleNamespaceContext


        callUri("", HttpHeaders.ACCEPT, HttpContentType.APPLICATION_XML + "; charset=iso-latin-1",
            HttpStatusCodes.NOT_ACCEPTABLE);
    final String body = getBody(response);
    Map<String, String> prefixMap = new HashMap<String, String>();
    prefixMap.put("a", Edm.NAMESPACE_M_2007_08);
    XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(prefixMap));
    assertXpathExists("/a:error", body);
    assertXpathExists("/a:error/a:code", body);
    assertXpathExists("/a:error/a:message", body);
  }
View Full Code Here


    assertEquals(HttpStatusCodes.NOT_FOUND.getStatusCode(), response.getStatusLine().getStatusCode());

    final String content = StringHelper.inputStreamToString(response.getEntity().getContent());
    Map<String, String> prefixMap = new HashMap<String, String>();
    prefixMap.put("a", Edm.NAMESPACE_M_2007_08);
    XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(prefixMap));
    assertXpathExists("/a:error/a:code", content);
    assertXpathValuesEqual("\"" + MessageService.getMessage(Locale.ENGLISH, ODataNotFoundException.ENTITY).getText()
        + "\"", "/a:error/a:message", content);
  }
View Full Code Here

          oDataException.getHttpStatus().getStatusCode(), response.getStatusLine().getStatusCode());

      final String content = StringHelper.inputStreamToString(response.getEntity().getContent());
      Map<String, String> prefixMap = new HashMap<String, String>();
      prefixMap.put("a", Edm.NAMESPACE_M_2007_08);
      XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(prefixMap));
      assertXpathExists("/a:error/a:code", content);
    }

  }
View Full Code Here

  @BeforeClass
  public static void setup() throws Exception {
    Map<String, String> prefixMap = new HashMap<String, String>();
    prefixMap.put("a", Edm.NAMESPACE_M_2007_08);
    XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(prefixMap));
  }
View Full Code Here

  public void before() {
    super.before();

    Map<String, String> prefixMap = new HashMap<String, String>();
    prefixMap.put("m", Edm.NAMESPACE_M_2007_08);
    XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(prefixMap));

    disableLogging();
  }
View Full Code Here

    prefixMap.put("m", Edm.NAMESPACE_M_2007_08);
    prefixMap.put("xml", Edm.NAMESPACE_XML_1998);
    prefixMap.put("ру", "http://localhost");
    prefixMap.put("custom", "http://localhost");
    prefixMap.put("at", TombstoneCallback.NAMESPACE_TOMBSTONE);
    XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(prefixMap));
  }
View Full Code Here

    servlet.setBeanConverters(new BeanJsonConverter(injector),
        new BeanXStreamConverter(new XStream081Configuration(injector)),
        new BeanXStreamAtomConverter(new XStream081Configuration(injector)));

    res = EasyMock.createMock(HttpServletResponse.class);
    NamespaceContext ns = new SimpleNamespaceContext(ImmutableMap.of("", "http://ns.opensocial.org/2008/opensocial"));
    XMLUnit.setXpathNamespaceContext(ns);
    xp = XMLUnit.newXpathEngine();
  }
View Full Code Here

  private void assertXpathEvaluatesTo(String msg, String expected, String xpath, String xmlDoc) throws Exception {
    Map<String, String> namespaces = new HashMap<String, String>();
    namespaces.put("tns", "http://samples.springframework.org/flight");
    namespaces.put("xsi", "http://www.w3.org/2001/XMLSchema-instance");

    NamespaceContext ctx = new SimpleNamespaceContext(namespaces);
    XpathEngine engine = XMLUnit.newXpathEngine();
    engine.setNamespaceContext(ctx);

    Document doc = XMLUnit.buildControlDocument(xmlDoc);
    NodeList node = engine.getMatchingNodes(xpath, doc);
View Full Code Here

    public void setUp() throws Exception {
        Map<String, String> nsMap = new HashMap<String, String>();
        nsMap.put("foxml", "info:fedora/fedora-system:def/foxml#");
        nsMap.put("METS", "http://www.loc.gov/METS/");
        nsMap.put("", "http://www.w3.org/2005/Atom");
        NamespaceContext ctx = new SimpleNamespaceContext(nsMap);
        XMLUnit.setXpathNamespaceContext(ctx);
    }
View Full Code Here

    @Before
    public void setUp() throws Exception {
        Map<String, String> nsMap = new HashMap<String, String>();
        nsMap.put("management", "http://www.fedora.info/definitions/1/0/management/");
        NamespaceContext ctx = new SimpleNamespaceContext(nsMap);
        XMLUnit.setXpathNamespaceContext(ctx);
        client = getFedoraClient();
    }
View Full Code Here

TOP

Related Classes of org.custommonkey.xmlunit.SimpleNamespaceContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.