mirror of
https://github.com/apache/struts.git
synced 2026-08-07 23:57:03 +00:00
WW-1836 Order of the entries in the entry set is not guaranteed.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@564485 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
+14
-4
@@ -96,12 +96,22 @@ public class PortletRequestMapTest extends MockObjectTestCase {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+15
-4
@@ -99,12 +99,23 @@ public class PortletSessionMapTest extends TestCase {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user