diff options
Diffstat (limited to 'harmony-tests/src/test/java')
-rw-r--r-- | harmony-tests/src/test/java/org/apache/harmony/tests/java/util/EnumMapTest.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/EnumMapTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/EnumMapTest.java index 2a37a18..676e373 100644 --- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/EnumMapTest.java +++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/EnumMapTest.java @@ -233,6 +233,17 @@ public class EnumMapTest extends TestCase { } } + @SuppressWarnings("unchecked") + public void testConstructor_badMapArg() { + HashMap badMap = new HashMap(); + badMap.put("NotAnEnum", "Value"); + try { + new EnumMap<Color, String>(badMap); + fail(); + } catch (ClassCastException expected) { + } + } + /** * java.util.EnumMap#clear() */ |