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:
parent
a7bbdfb54b
commit
fd7450f301
|
@ -56,7 +56,22 @@ public class ArrayUtilsRemoveTest extends TestCase {
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue