MCPcopy Create free account
hub / github.com/HtmlUnit/htmlunit / namespace

Method namespace

src/test/java/org/htmlunit/xml/XmlPageTest.java:128–144  ·  view source on GitHub ↗

Tests namespace. @throws Exception if the test fails

()

Source from the content-addressed store, hash-verified

126 * @throws Exception if the test fails
127 */
128 @Test
129 public void namespace() throws Exception {
130 final String content
131 = "<?xml version='1.0'?>\n"
132 + "<RDF xmlns='http://www.w3.org/1999/02/22-rdf-syntax-ns#' "
133 + "xmlns:em='http://www.mozilla.org/2004/em-rdf#'>"
134 + "<Description about='urn:mozilla:install-manifest'>"
135 + "<em:name>My Plugin</em:name>"
136 + "</Description>\n"
137 + "</RDF>";
138
139 final XmlPage xmlPage = testDocument(content, MimeType.TEXT_XML);
140 final Node node = xmlPage.getXmlDocument().getFirstChild().getFirstChild().getFirstChild();
141 assertEquals("em:name", node.getNodeName());
142 assertEquals("name", node.getLocalName());
143 assertEquals("http://www.mozilla.org/2004/em-rdf#", node.getNamespaceURI());
144 }
145
146 /**
147 * Tests a simple valid XML document.

Callers 12

ext-air.jsFile · 0.45
DateTimeField.jsFile · 0.45
ext-air-debug.jsFile · 0.45
ext-air.jsFile · 0.45
ext-air-adapter.jsFile · 0.45
yui-utilities.jsFile · 0.45
StartMenu.jsFile · 0.45
languages.jsFile · 0.45
dutch-provinces.jsFile · 0.45
states.jsFile · 0.45
ComponentLoader.jsFile · 0.45

Calls 7

testDocumentMethod · 0.95
getXmlDocumentMethod · 0.95
getNodeNameMethod · 0.95
getLocalNameMethod · 0.95
getNamespaceURIMethod · 0.95
getFirstChildMethod · 0.45
assertEqualsMethod · 0.45

Tested by

no test coverage detected