geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r611911 - /geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyConfigTest.java
Date Mon, 14 Jan 2008 20:03:06 GMT
Author: gawor
Date: Mon Jan 14 12:03:02 2008
New Revision: 611911

URL: http://svn.apache.org/viewvc?rev=611911&view=rev
Log:
compare dom objects instead of strings

Modified:
    geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyConfigTest.java

Modified: geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyConfigTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyConfigTest.java?rev=611911&r1=611910&r2=611911&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyConfigTest.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyConfigTest.java
Mon Jan 14 12:03:02 2008
@@ -20,22 +20,23 @@
 
 package org.apache.geronimo.system.plugin;
 
-import java.io.InputStream;
 import java.io.ByteArrayInputStream;
+import java.io.InputStream;
 import java.io.Reader;
 import java.io.StringReader;
-import java.io.StringWriter;
-import java.io.Serializable;
 import java.util.List;
 
 import junit.framework.TestCase;
-import org.apache.geronimo.system.plugin.model.PluginType;
-import org.apache.geronimo.system.plugin.model.GbeanType;
-import org.apache.geronimo.system.plugin.model.PluginArtifactType;
-import org.apache.geronimo.system.plugin.model.AttributeType;
-import org.apache.geronimo.system.configuration.GBeanOverride;
+
 import org.apache.geronimo.system.configuration.AttributesXmlUtil;
+import org.apache.geronimo.system.configuration.GBeanOverride;
 import org.apache.geronimo.system.configuration.condition.JexlExpressionParser;
+import org.apache.geronimo.system.plugin.model.AttributeType;
+import org.apache.geronimo.system.plugin.model.GbeanType;
+import org.apache.geronimo.system.plugin.model.PluginArtifactType;
+import org.apache.geronimo.system.plugin.model.PluginType;
+import org.apache.geronimo.testsupport.DOMUtils;
+import org.w3c.dom.Document;
 
 /**
  * @version $Rev$ $Date$
@@ -167,8 +168,11 @@
         assertEquals(2, gbeans.size());
         GBeanOverride override = new GBeanOverride(gbeans.get(0), new JexlExpressionParser());
         String attributeValue = override.getAttribute("defaultEnvironment");
-        assertEquals(ATTRIBUTE_VALUE, attributeValue);
-
+        
+        Document expectedDoc = DOMUtils.load(ATTRIBUTE_VALUE);
+        Document actualDoc = DOMUtils.load(attributeValue);
+        
+        DOMUtils.compareNodes(expectedDoc, actualDoc);
     }
 
     private static final String INSTANCE = "                        <plugin-artifact>\n"
+
@@ -261,6 +265,10 @@
         assertEquals(2, contents.size());
         AttributeType attr = (AttributeType) contents.get(1);
         String value = AttributesXmlUtil.extractAttributeValue(attr);
-        assertEquals(VALUE, value);
+        
+        Document expectedDoc = DOMUtils.load(VALUE);
+        Document actualDoc = DOMUtils.load(value);
+        
+        DOMUtils.compareNodes(expectedDoc, actualDoc);
     }
 }



Mime
View raw message