commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r892132 - /commons/proper/lang/trunk/src/test/org/apache/commons/lang3/ArrayUtilsRemoveTest.java
Date Fri, 18 Dec 2009 04:59:26 GMT
Author: sebb
Date: Fri Dec 18 04:59:25 2009
New Revision: 892132

URL: http://svn.apache.org/viewvc?rev=892132&view=rev
Log:
Check remove on non-Object array.

Modified:
    commons/proper/lang/trunk/src/test/org/apache/commons/lang3/ArrayUtilsRemoveTest.java

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang3/ArrayUtilsRemoveTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang3/ArrayUtilsRemoveTest.java?rev=892132&r1=892131&r2=892132&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang3/ArrayUtilsRemoveTest.java
(original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang3/ArrayUtilsRemoveTest.java
Fri Dec 18 04:59:25 2009
@@ -56,7 +56,22 @@
             fail("IndexOutOfBoundsException expected");
         } catch (IndexOutOfBoundsException e) {}
     }
-    
+
+    public void testRemoveNumberArray(){
+        Number[] inarray = {Integer.valueOf(1),Long.valueOf(2),Byte.valueOf((byte) 3)};
+        assertEquals(3, inarray.length);
+        Number[] outarray;
+        outarray = ArrayUtils.remove(inarray, 1);
+        assertEquals(2, outarray.length);
+        assertEquals(Number.class, outarray.getClass().getComponentType());
+        outarray = ArrayUtils.remove(outarray, 1);
+        assertEquals(1, outarray.length);
+        assertEquals(Number.class, outarray.getClass().getComponentType());
+        outarray = ArrayUtils.remove(outarray, 0);
+        assertEquals(0, outarray.length);
+        assertEquals(Number.class, outarray.getClass().getComponentType());
+    }
+
     public void testRemoveBooleanArray() {
         boolean[] array;
         array = ArrayUtils.remove(new boolean[] {true}, 0);



Mime
View raw message