@@ -0,0 +1,2214 @@
+/*%0A * Copyright(C)  2017 %E5%A4%A7%E5%89%8D%E8%89%AF%E4%BB%8B(OHMAE Ryosuke)%0A *%0A * This software is released under the MIT License.%0A * http://opensource.org/licenses/MIT%0A */%0A%0Apackage net.mm2d.util;%0A%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.JUnit4;%0Aimport org.w3c.dom.Document;%0Aimport org.w3c.dom.Element;%0A%0Aimport static org.hamcrest.Matchers.*;%0Aimport static org.junit.Assert.*;%0A%0A/**%0A * @author %3Ca href=%22mailto:ryo@mm2d.net%22%3E%E5%A4%A7%E5%89%8D%E8%89%AF%E4%BB%8B(OHMAE Ryosuke)%3C/a%3E%0A */%0A@RunWith(JUnit4.class)%0Apublic class XmlUtilsTest %7B%0A    @Test%0A    public void getDocumentBuilder_NS_not_aware() throws Exception %7B%0A        final String xml = TestUtils.getResourceAsString(%22propchange.xml%22);%0A        final Document document = XmlUtils.newDocument(false, xml);%0A        final Element root = document.getDocumentElement();%0A        assertThat(root.getTagName(), is(%22e:propertyset%22));%0A        assertThat(root.getNamespaceURI(), is(nullValue()));%0A    %7D%0A%0A    @Test%0A    public void getDocumentBuilder_NS_aware() throws Exception %7B%0A        final String xml = TestUtils.getResourceAsString(%22propchange.xml%22);%0A        final Document document = XmlUtils.newDocument(true, xml);%0A        final Element root = document.getDocumentElement();%0A        assertThat(root.getTagName(), is(%22e:propertyset%22));%0A        assertThat(root.getNamespaceURI(), is(%22urn:schemas-upnp-org:event-1-0%22));%0A    %7D%0A%0A    @Test%0A    public void findChildElementByLocalName() throws Exception %7B%0A        final String xml = TestUtils.getResourceAsString(%22propchange.xml%22);%0A        final Document document = XmlUtils.newDocument(true, xml);%0A        final Element root = document.getDocumentElement();%0A        final Element element = XmlUtils.findChildElementByLocalName(root, %22property%22);%0A        assertThat(element.getTagName(), is(%22e:property%22));%0A    %7D%0A%0A    @Test%0A    public void findChildElementByLocalName_not_found() throws Exception %7B%0A        final String xml = TestUtils.getResourceAsString(%22propchange.xml%22);%0A        final Document document = XmlUtils.newDocument(true, xml);%0A        final Element root = document.getDocumentElement();%0A        final Element element = XmlUtils.findChildElementByLocalName(root, %22propertys%22);%0A        assertThat(element, is(nullValue()));%0A    %7D%0A%7D%0A

add XmlUtilsTest