[maven-release-plugin] copy for tag wamblee-utils-0.2.2
[utils] / support / general / src / test / java / org / wamblee / test / AssertionUtils.java
index 9487f22a1d267f56402c011cbf1093f0873506ee..8c25fc13f6963646653ee3cab510c6d622899b2e 100644 (file)
@@ -1,30 +1,30 @@
 /*
- * Copyright 2006 the original author or authors.
- *
+ * Copyright 2005-2010 the original author or authors.
+ * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ * 
  *      http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */
+ */ 
 package org.wamblee.test;
 
+import java.util.Arrays;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
 import junit.framework.TestCase;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
 /**
  * Useful assertions for use in test cases.
  * 
@@ -112,14 +112,14 @@ public final class AssertionUtils {
         TestCase.assertEquals("Map sizes differ", aExpectedMap.size(), aActual
             .size());
 
-        Set keys = aExpectedMap.keySet();
+        Set<Entry<Key,Value>> expectedEntries = aExpectedMap.entrySet();
 
-        for (Iterator i = keys.iterator(); i.hasNext();) {
-            String key = (String) i.next();
+        for (Entry<Key,Value> entry: expectedEntries) {
+            Key key = entry.getKey();
             TestCase.assertTrue("Map does not containg entry for key:" + key,
                 aActual.containsKey(key));
             AssertionUtils.assertEquals("Value of key " + key + " of map",
-                aExpectedMap.get(key), aActual.get(key));
+                entry.getValue(), aActual.get(key));
         }
     }