Check remove on non-Object array.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@892132 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2009-12-18 04:59:25 +00:00
parent a7bbdfb54b
commit fd7450f301
1 changed files with 16 additions and 1 deletions

View File

@ -57,6 +57,21 @@ public class ArrayUtilsRemoveTest extends TestCase {
} 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);