Author: bayard
Date: Tue Sep 15 05:57:37 2009
New Revision: 815132
URL: http://svn.apache.org/viewvc?rev=815132&view=rev
Log:
Merging from -r468106:814127 of collections_jdk5_branch - namely where this
code was generified; mostly in r738956.
Also see the following revisions:
------------------------------------------------------------------------
r740150 | mbenson | 2009-02-02 15:24:00 -0800 (Mon, 02 Feb 2009) | 1 line
make all [collections] maps implement IterableMap
------------------------------------------------------------------------
Modified:
commons/proper/collections/trunk/src/test/org/apache/commons/collections/map/TestStaticBucketMap.java
Modified:
commons/proper/collections/trunk/src/test/org/apache/commons/collections/map/TestStaticBucketMap.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/org/apache/commons/collections/map/TestStaticBucketMap.java?rev=815132&r1=815131&r2=815132&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/test/org/apache/commons/collections/map/TestStaticBucketMap.java
(original)
+++
commons/proper/collections/trunk/src/test/org/apache/commons/collections/map/TestStaticBucketMap.java
Tue Sep 15 05:57:37 2009
@@ -16,8 +16,6 @@
*/
package org.apache.commons.collections.map;
-import java.util.Map;
-
import junit.framework.Test;
import org.apache.commons.collections.BulkTest;
@@ -30,7 +28,7 @@
*
* @author Michael A. Smith
*/
-public class TestStaticBucketMap extends AbstractTestMap {
+public class TestStaticBucketMap<K, V> extends AbstractTestIterableMap<K, V> {
public TestStaticBucketMap(String name) {
super(name);
@@ -45,8 +43,16 @@
junit.textui.TestRunner.main(testCaseName);
}
- public Map makeEmptyMap() {
- return new StaticBucketMap(30);
+ public StaticBucketMap<K, V> makeObject() {
+ return new StaticBucketMap<K, V>(30);
+ }
+
+ /**
+ * {...@inheritdoc}
+ */
+ @Override
+ public boolean isFailFastExpected() {
+ return false;
}
public String[] ignoredTests() {
@@ -60,9 +66,10 @@
}
// Bugzilla 37567
+ @SuppressWarnings("unchecked")
public void test_get_nullMatchesIncorrectly() {
- StaticBucketMap map = new StaticBucketMap(17);
- map.put(null, "A");
+ StaticBucketMap<K, V> map = new StaticBucketMap<K, V>(17);
+ map.put(null, (V) "A");
assertEquals("A", map.get(null));
// loop so we find a string that is in the same bucket as the null
for (int i = 'A'; i <= 'Z'; i++) {
@@ -71,9 +78,10 @@
}
}
+ @SuppressWarnings("unchecked")
public void test_containsKey_nullMatchesIncorrectly() {
- StaticBucketMap map = new StaticBucketMap(17);
- map.put(null, "A");
+ StaticBucketMap<K, V> map = new StaticBucketMap<K, V>(17);
+ map.put(null, (V) "A");
assertEquals(true, map.containsKey(null));
// loop so we find a string that is in the same bucket as the null
for (int i = 'A'; i <= 'Z'; i++) {
@@ -82,9 +90,10 @@
}
}
+ @SuppressWarnings("unchecked")
public void test_containsValue_nullMatchesIncorrectly() {
- StaticBucketMap map = new StaticBucketMap(17);
- map.put("A", null);
+ StaticBucketMap<K, V> map = new StaticBucketMap<K, V>(17);
+ map.put((K) "A", null);
assertEquals(true, map.containsValue(null));
// loop so we find a string that is in the same bucket as the null
for (int i = 'A'; i <= 'Z'; i++) {