From 68b58062583a7bace4b4ed7f76dee6cb48ac4ad8 Mon Sep 17 00:00:00 2001 From: Henri Yandell Date: Tue, 15 Sep 2009 05:57:37 +0000 Subject: [PATCH] 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 ------------------------------------------------------------------------ git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@815132 13f79535-47bb-0310-9956-ffa450edef68 --- .../collections/map/TestStaticBucketMap.java | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/test/org/apache/commons/collections/map/TestStaticBucketMap.java b/src/test/org/apache/commons/collections/map/TestStaticBucketMap.java index 62f201fbf..31014a021 100644 --- a/src/test/org/apache/commons/collections/map/TestStaticBucketMap.java +++ b/src/test/org/apache/commons/collections/map/TestStaticBucketMap.java @@ -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 @@ import org.apache.commons.collections.BulkTest; * * @author Michael A. Smith */ -public class TestStaticBucketMap extends AbstractTestMap { +public class TestStaticBucketMap extends AbstractTestIterableMap { public TestStaticBucketMap(String name) { super(name); @@ -45,8 +43,16 @@ public class TestStaticBucketMap extends AbstractTestMap { junit.textui.TestRunner.main(testCaseName); } - public Map makeEmptyMap() { - return new StaticBucketMap(30); + public StaticBucketMap makeObject() { + return new StaticBucketMap(30); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isFailFastExpected() { + return false; } public String[] ignoredTests() { @@ -60,9 +66,10 @@ public class TestStaticBucketMap extends AbstractTestMap { } // Bugzilla 37567 + @SuppressWarnings("unchecked") public void test_get_nullMatchesIncorrectly() { - StaticBucketMap map = new StaticBucketMap(17); - map.put(null, "A"); + StaticBucketMap map = new StaticBucketMap(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 @@ public class TestStaticBucketMap extends AbstractTestMap { } } + @SuppressWarnings("unchecked") public void test_containsKey_nullMatchesIncorrectly() { - StaticBucketMap map = new StaticBucketMap(17); - map.put(null, "A"); + StaticBucketMap map = new StaticBucketMap(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 @@ public class TestStaticBucketMap extends AbstractTestMap { } } + @SuppressWarnings("unchecked") public void test_containsValue_nullMatchesIncorrectly() { - StaticBucketMap map = new StaticBucketMap(17); - map.put("A", null); + StaticBucketMap map = new StaticBucketMap(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++) {