struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nil...@apache.org
Subject svn commit: r564485 - in /struts/struts2/trunk/plugins/portlet/src/test/java/org/apache/struts2/portlet: PortletRequestMapTest.java PortletSessionMapTest.java
Date Fri, 10 Aug 2007 06:37:08 GMT
Author: nilsga
Date: Thu Aug  9 23:37:07 2007
New Revision: 564485

URL: http://svn.apache.org/viewvc?view=rev&rev=564485
Log:
WW-1836 Order of the entries in the entry set is not guaranteed.

Modified:
    struts/struts2/trunk/plugins/portlet/src/test/java/org/apache/struts2/portlet/PortletRequestMapTest.java
    struts/struts2/trunk/plugins/portlet/src/test/java/org/apache/struts2/portlet/PortletSessionMapTest.java

Modified: struts/struts2/trunk/plugins/portlet/src/test/java/org/apache/struts2/portlet/PortletRequestMapTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/portlet/src/test/java/org/apache/struts2/portlet/PortletRequestMapTest.java?view=diff&rev=564485&r1=564484&r2=564485
==============================================================================
--- struts/struts2/trunk/plugins/portlet/src/test/java/org/apache/struts2/portlet/PortletRequestMapTest.java
(original)
+++ struts/struts2/trunk/plugins/portlet/src/test/java/org/apache/struts2/portlet/PortletRequestMapTest.java
Thu Aug  9 23:37:07 2007
@@ -96,12 +96,22 @@
         assertEquals(2, entries.size());
         Iterator it = entries.iterator();
         Map.Entry entry = (Map.Entry)it.next();
-        assertEquals("testAttribute1", entry.getKey());
-        assertEquals("testValue1", entry.getValue());
+        checkEntry(entry);
         entry = (Map.Entry)it.next();
-        assertEquals("testAttribute2", entry.getKey());
-        assertEquals("testValue2", entry.getValue());
+        checkEntry(entry);
 
     }
+    
+	private void checkEntry(Map.Entry entry) {
+		if(entry.getKey().equals("testAttribute1")) {
+        	assertEquals("testValue1", entry.getValue());
+        }
+        else if(entry.getKey().equals("testAttribute2")) {
+        	assertEquals("testValue2", entry.getValue());
+        }
+        else {
+        	fail("Unexpected entry in etry set: " + entry);
+        }
+	}
 
 }

Modified: struts/struts2/trunk/plugins/portlet/src/test/java/org/apache/struts2/portlet/PortletSessionMapTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/portlet/src/test/java/org/apache/struts2/portlet/PortletSessionMapTest.java?view=diff&rev=564485&r1=564484&r2=564485
==============================================================================
--- struts/struts2/trunk/plugins/portlet/src/test/java/org/apache/struts2/portlet/PortletSessionMapTest.java
(original)
+++ struts/struts2/trunk/plugins/portlet/src/test/java/org/apache/struts2/portlet/PortletSessionMapTest.java
Thu Aug  9 23:37:07 2007
@@ -99,12 +99,23 @@
         assertEquals(2, entries.size());
         Iterator it = entries.iterator();
         Map.Entry entry = (Map.Entry)it.next();
-        assertEquals("testAttribute1", entry.getKey());
-        assertEquals("testValue1", entry.getValue());
+        checkEntry(entry);
         entry = (Map.Entry)it.next();
-        assertEquals("testAttribute2", entry.getKey());
-        assertEquals("testValue2", entry.getValue());
+        checkEntry(entry);
 
     }
+
+	private void checkEntry(Map.Entry entry) {
+		if(entry.getKey().equals("testAttribute1")) {
+        	assertEquals("testValue1", entry.getValue());
+        }
+        else if(entry.getKey().equals("testAttribute2")) {
+        	assertEquals("testValue2", entry.getValue());
+        }
+        else {
+        	fail("Unexpected entry in etry set: " + entry);
+        }
+	}
+
 
 }



Mime
View raw message