commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r190314 - /jakarta/commons/proper/betwixt/branches/RELEASE_0_6_1_BRANCH/src/test/org/apache/commons/betwixt/io/read/TestMaps.java
Date Sun, 12 Jun 2005 20:33:24 GMT
Author: rdonkin
Date: Sun Jun 12 13:33:23 2005
New Revision: 190314

URL: http://svn.apache.org/viewcvs?rev=190314&view=rev
Log:
Improved consistency across JVMs.

Modified:
    jakarta/commons/proper/betwixt/branches/RELEASE_0_6_1_BRANCH/src/test/org/apache/commons/betwixt/io/read/TestMaps.java

Modified: jakarta/commons/proper/betwixt/branches/RELEASE_0_6_1_BRANCH/src/test/org/apache/commons/betwixt/io/read/TestMaps.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/betwixt/branches/RELEASE_0_6_1_BRANCH/src/test/org/apache/commons/betwixt/io/read/TestMaps.java?rev=190314&r1=190313&r2=190314&view=diff
==============================================================================
--- jakarta/commons/proper/betwixt/branches/RELEASE_0_6_1_BRANCH/src/test/org/apache/commons/betwixt/io/read/TestMaps.java
(original)
+++ jakarta/commons/proper/betwixt/branches/RELEASE_0_6_1_BRANCH/src/test/org/apache/commons/betwixt/io/read/TestMaps.java
Sun Jun 12 13:33:23 2005
@@ -19,6 +19,7 @@
 
 import java.io.StringReader;
 import java.io.StringWriter;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
@@ -48,20 +49,43 @@
         bean.addSomeThingy("Thorkell", "The Tall");
         writer.write(bean);
         String xml = out.getBuffer().toString();
-        String expected = "<?xml version='1.0'?><BeanWithConcreteMap>" +
-            "<entry>" +
-            "<key>Swein</key>" +
-            "<value>Forkbeard</value>" +
-            "</entry>" +
-            "<entry>" +
-            "<key>Thorkell</key>" +
-            "<value>The Tall</value>" +
-            "</entry>" +
-            "<entry>" +
-            "<key>Aethelred</key>" +
-            "<value>The Unready</value>" +
-            "</entry>" +
-            "</BeanWithConcreteMap>";
+        
+        StringBuffer buffer = new StringBuffer("<?xml version='1.0'?><BeanWithConcreteMap>");
+        for (Iterator it=bean.getSomeThingies().keySet().iterator(); it.hasNext();)
+        {
+            String key = (String) it.next();
+            if ("Aethelred".equals(key))
+            {
+                buffer.append(
+                        "<entry>" +
+                        "<key>Aethelred</key>" +
+                        "<value>The Unready</value>" +
+                        "</entry>");
+                
+            }
+            else if ("Swein".equals(key))
+            {
+                buffer.append(
+                        "<entry>" +
+                        "<key>Swein</key>" +
+                        "<value>Forkbeard</value>" +
+                        "</entry>");
+                
+            }
+            else if ("Thorkell".equals(key))
+            {
+                buffer.append(
+                        "<entry>" +
+                        "<key>Thorkell</key>" +
+                        "<value>The Tall</value>" +
+                        "</entry>");
+                
+            }
+        }
+        buffer.append("</BeanWithConcreteMap>");
+        
+        String expected = buffer.toString();
+        
         xmlAssertIsomorphicContent(parseString(expected), parseString(xml), true);
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message