/** * Test method for {@link * org.jenkinsci.plugins.neoload_integration.supporting.XMLUtilities#createNodeFromText(java.lang.String)}. * * @throws IOException * @throws SAXException * @throws ParserConfigurationException */ @Test public void testCreateNodeFromText() throws ParserConfigurationException, SAXException, IOException { final String content = "weeeeeeeeeee"; final Node n = XMLUtilities.createNodeFromText("<test>" + content + "</test>"); assertTrue(content.equals(n.getTextContent())); }
/** * Test method for {@link * org.jenkinsci.plugins.neoload_integration.supporting.XMLUtilities#findFirstByExpression(java.lang.String, * org.w3c.dom.Node)}. * * @throws XPathExpressionException * @throws DOMException * @throws IOException * @throws SAXException * @throws ParserConfigurationException */ @Test public void testFindFirstByExpression() throws XPathExpressionException, ParserConfigurationException, SAXException, IOException { assertTrue( "Everyday Italian" .equals( XMLUtilities.findFirstByExpression("/bookstore/book/title", d).getTextContent())); assertTrue( XMLUtilities.findFirstByExpression( "/bookstore/book/title", XMLUtilities.createNodeFromText("<empty></empty>")) == null); }