MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / asXml

Method asXml

src/test/java/org/htmlunit/html/DomCommentTest.java:45–53  ·  view source on GitHub ↗

Test the comment correctness. @throws Exception if the test fails

()

Source from the content-addressed store, hash-verified

43 * @throws Exception if the test fails
44 */
45 @Test
46 public void asXml() throws Exception {
47 final String comment = "<!-- a comment -->";
48 final String content = DOCTYPE_HTML + "<html><body><span id='foo'>" + comment + "</span></body></html>";
49 final HtmlPage page = loadPage(content);
50 final HtmlElement elt = page.getHtmlElementById("foo");
51 final DomNode node = elt.getFirstChild();
52 assertEquals(comment, node.asXml());
53 }
54
55 /**
56 * Test comment and character data sibling correctness.

Callers

nothing calls this directly

Calls 5

getHtmlElementByIdMethod · 0.95
asXmlMethod · 0.95
loadPageMethod · 0.45
getFirstChildMethod · 0.45
assertEqualsMethod · 0.45

Tested by

no test coverage detected