Node n = nodes.get(i); Node n2 = nodes2.get(i); XMLUtil.assertEquivalent(n, n2);
Node n = nodes.get(i); Node n2 = nodes2.get(i); XMLUtil.assertEquivalent(n, n2);
Node n = nodes.get(i); Node n2 = nodes2.get(i); XMLUtil.assertEquivalent(n, n2);
Node n = nodes.get(i); Node n2 = nodes2.get(i); XMLUtil.assertEquivalent(n, n2);
Node n = nodes.get(i); Node n2 = nodes2.get(i); XMLUtil.assertEquivalent(n, n2);
Node n = nodes.get(i); Node n2 = nodes2.get(i); XMLUtil.assertEquivalent(n, n2);
Node n = nodes.get(i); Node n2 = nodes2.get(i); XMLUtil.assertEquivalent(n, n2);
@Test public void testEquivalent_4() throws Exception { String s = "<a attr1=\"val1\" attr2=\"val2\"/>"; String s2 = "<a attr2=\"val2\" attr1=\"val1\"/>"; XMLUtil.assertEquivalent(XMLUtil.stringToElement(s), XMLUtil.stringToElement(s2)); }
@Test public void testEquivalent_2() throws Exception { String s = "<a></a>"; String s2 = "<a/>"; XMLUtil.assertEquivalent(XMLUtil.stringToElement(s), XMLUtil.stringToElement(s2)); }
@Test public void testEquivalent_1() throws Exception { String s = "<a/>"; String s2 = "<a/>"; XMLUtil.assertEquivalent(XMLUtil.stringToElement(s), XMLUtil.stringToElement(s2)); }
@Test public void testEquivalent_5() throws Exception { String s = "<a><b/></a>"; String s2 = "<a><b/></a>"; XMLUtil.assertEquivalent(XMLUtil.stringToElement(s), XMLUtil.stringToElement(s2)); }
@Test public void testEquivalent_6() throws Exception { String s = "<enclosing><a attr1=\"val1\" attr2=\"val2\"/></enclosing>"; String s2 = "<enclosing><a attr2=\"val2\" attr1=\"val1\"/></enclosing>"; XMLUtil.assertEquivalent(XMLUtil.stringToElement(s), XMLUtil.stringToElement(s2)); }
@Test public void testEquivalent_7() throws Exception { String s = "<a><b/><c/></a>"; String s2 = "<a><c/><b/></a>"; try { XMLUtil.assertEquivalent(XMLUtil.stringToElement(s), XMLUtil.stringToElement(s2)); Assert.fail("this should throw exception"); } catch (IllegalArgumentException e) { // OK e.printStackTrace(); } }
@Test public void testEquivalent_8() throws Exception { String s = "<a><!-- some comment --><b/><!--some other comment --><c/><!-- blah --></a>"; String s2 = "<a><b/><!--blah blah--><c/></a>"; XMLUtil.assertEquivalent(XMLUtil.stringToElement(s), XMLUtil.stringToElement(s2)); }
@Test public void testElementToString_4() throws Exception { String s = "<a><![CDATA[somedata]]></a>"; Element e = XMLUtil.stringToElement(s); String tostring = XMLUtil.elementToString(e); Element convertedAgain = XMLUtil.stringToElement(tostring); XMLUtil.assertEquivalent(e, convertedAgain); }
@Test public void testElementToString_2() throws Exception { String s = "<a b=\"something\"></a>"; Element e = XMLUtil.stringToElement(s); String tostring = XMLUtil.elementToString(e); Element convertedAgain = XMLUtil.stringToElement(tostring); XMLUtil.assertEquivalent(e, convertedAgain); }
@Test public void testElementToString_1() throws Exception { String s = "<a b=\"something\">somethingelse</a>"; Element e = XMLUtil.stringToElement(s); String tostring = XMLUtil.elementToString(e); Element convertedAgain = XMLUtil.stringToElement(tostring); XMLUtil.assertEquivalent(e, convertedAgain); }
@Test public void testEquivalent_3() throws Exception { String s = "<a attr1=\"val1\" attr2=\"val2\"/>"; String s2 = "<a attr2=\"val2\"/>"; try { XMLUtil.assertEquivalent(XMLUtil.stringToElement(s), XMLUtil.stringToElement(s2)); Assert.fail("this should throw exception"); } catch (IllegalArgumentException e) { // expected } }
@Test public void testElementToString_3() throws Exception { String s = "<a b=\"something\"/>"; Element e = XMLUtil.stringToElement(s); String tostring = XMLUtil.elementToString(e); Element convertedAgain = XMLUtil.stringToElement(tostring); XMLUtil.assertEquivalent(e, convertedAgain); }