Commits

Anonymous committed 224bede

Improve the xml tests a bit

git-svn-id: http://svn.opensymphony.com/svn/propertyset/trunk@164bf3cbcdd-1c1a-0410-9a68-d6f521e3fa7b

Comments (0)

Files changed (1)

src/test/com/opensymphony/module/propertyset/AbstractPropertySetTest.java

     public void testGetTypeForXml() throws ParserConfigurationException {
         if (ps.supportsType(PropertySet.XML)) {
             Document doc = XMLUtils.newDocument();
+            doc.appendChild(doc.createElement("root"));
             ps.setXML("testXml", doc);
-            assertEquals(PropertySet.XML, ps.getType("testXml"));
+            assertEquals(doc.getFirstChild().getNodeName(), ps.getXML("testXml").getFirstChild().getNodeName());
         }
     }
 
     public void testSetAsActualTypeGetAsActualTypeForXml() throws ParserConfigurationException {
         if (ps.supportsType(PropertySet.XML)) {
             Document doc = XMLUtils.newDocument();
+            doc.appendChild(doc.createElement("root"));
             ps.setAsActualType("testXml", doc);
-            assertEquals(doc, ps.getAsActualType("testXml"));
+            assertEquals(doc.getFirstChild().getNodeName(), ps.getXML("testXml").getFirstChild().getNodeName());
         }
     }
 
     public void testSetXmlGetXml() throws ParserConfigurationException {
         if (ps.supportsType(PropertySet.XML)) {
             Document doc = XMLUtils.newDocument();
+            doc.appendChild(doc.createElement("root"));
             ps.setXML("testXml", doc);
-            assertEquals(doc, ps.getXML("testXml"));
+            assertEquals(doc.getFirstChild().getNodeName(), ps.getXML("testXml").getFirstChild().getNodeName());
         }
     }
 }