You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2014/02/28 23:23:47 UTC

svn commit: r1573099 - /sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java

Author: desruisseaux
Date: Fri Feb 28 22:23:47 2014
New Revision: 1573099

URL: http://svn.apache.org/r1573099
Log:
Added a test case.

Modified:
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java?rev=1573099&r1=1573098&r2=1573099&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java [UTF-8] Fri Feb 28 22:23:47 2014
@@ -21,9 +21,13 @@ import java.util.Arrays;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
+import java.util.Set;
+import java.util.EnumSet;
+import java.util.HashSet;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Locale;
+import org.apache.sis.util.collection.CodeListSet;
 import org.apache.sis.util.ObjectConverters;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
@@ -75,6 +79,24 @@ public final strictfp class CollectionsE
     }
 
     /**
+     * Tests {@link CollectionsExt#createSetForType(Class, int)}.
+     */
+    @Test
+    public void testCreateSetForType() {
+        Set<?> set = CollectionsExt.createSetForType(java.lang.annotation.ElementType.class, 0);
+        assertTrue("isEmpty", set.isEmpty());
+        assertInstanceOf("Set<ElementType>", EnumSet.class, set);
+
+        set = CollectionsExt.createSetForType(org.opengis.referencing.cs.AxisDirection.class, 0);
+        assertTrue("isEmpty", set.isEmpty());
+        assertInstanceOf("Set<AxisDirection>", CodeListSet.class, set);
+
+        set = CollectionsExt.createSetForType(String.class, 0);
+        assertTrue("isEmpty", set.isEmpty());
+        assertInstanceOf("Set<String>", HashSet.class, set);
+    }
+
+    /**
      * Tests {@link CollectionsExt#addToMultiValuesMap(Map, Object, Object)}.
      */
     @Test