Author: ggregory Date: Tue Aug 16 14:11:31 2011 New Revision: 1158284 URL: http://svn.apache.org/viewvc?rev=1158284&view=rev Log: Port to JUnit 4.
Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsRemoveTest.java Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsRemoveTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsRemoveTest.java?rev=1158284&r1=1158283&r2=1158284&view=diff ============================================================================== --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsRemoveTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsRemoveTest.java Tue Aug 16 14:11:31 2011 @@ -17,17 +17,23 @@ package org.apache.commons.lang3; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import java.util.Arrays; -import junit.framework.TestCase; +import org.junit.Test; /** * Tests ArrayUtils remove and removeElement methods. * * @version $Id$ */ -public class ArrayUtilsRemoveTest extends TestCase { +public class ArrayUtilsRemoveTest { + @Test public void testRemoveObjectArray() { Object[] array; array = ArrayUtils.remove(new Object[] {"a"}, 0); @@ -56,6 +62,7 @@ public class ArrayUtilsRemoveTest extend } catch (IndexOutOfBoundsException e) {} } + @Test public void testRemoveNumberArray(){ Number[] inarray = {Integer.valueOf(1),Long.valueOf(2),Byte.valueOf((byte) 3)}; assertEquals(3, inarray.length); @@ -71,6 +78,7 @@ public class ArrayUtilsRemoveTest extend assertEquals(Number.class, outarray.getClass().getComponentType()); } + @Test public void testRemoveBooleanArray() { boolean[] array; array = ArrayUtils.remove(new boolean[] {true}, 0); @@ -99,6 +107,7 @@ public class ArrayUtilsRemoveTest extend } catch (IndexOutOfBoundsException e) {} } + @Test public void testRemoveByteArray() { byte[] array; array = ArrayUtils.remove(new byte[] {1}, 0); @@ -127,6 +136,7 @@ public class ArrayUtilsRemoveTest extend } catch (IndexOutOfBoundsException e) {} } + @Test public void testRemoveCharArray() { char[] array; array = ArrayUtils.remove(new char[] {'a'}, 0); @@ -155,6 +165,7 @@ public class ArrayUtilsRemoveTest extend } catch (IndexOutOfBoundsException e) {} } + @Test public void testRemoveDoubleArray() { double[] array; array = ArrayUtils.remove(new double[] {1}, 0); @@ -183,6 +194,7 @@ public class ArrayUtilsRemoveTest extend } catch (IndexOutOfBoundsException e) {} } + @Test public void testRemoveFloatArray() { float[] array; array = ArrayUtils.remove(new float[] {1}, 0); @@ -211,6 +223,7 @@ public class ArrayUtilsRemoveTest extend } catch (IndexOutOfBoundsException e) {} } + @Test public void testRemoveIntArray() { int[] array; array = ArrayUtils.remove(new int[] {1}, 0); @@ -239,6 +252,7 @@ public class ArrayUtilsRemoveTest extend } catch (IndexOutOfBoundsException e) {} } + @Test public void testRemoveLongArray() { long[] array; array = ArrayUtils.remove(new long[] {1}, 0); @@ -267,6 +281,7 @@ public class ArrayUtilsRemoveTest extend } catch (IndexOutOfBoundsException e) {} } + @Test public void testRemoveShortArray() { short[] array; array = ArrayUtils.remove(new short[] {1}, 0); @@ -295,6 +310,7 @@ public class ArrayUtilsRemoveTest extend } catch (IndexOutOfBoundsException e) {} } + @Test public void testRemoveElementObjectArray() { Object[] array; array = ArrayUtils.removeElement((Object[]) null, "a"); @@ -313,6 +329,7 @@ public class ArrayUtilsRemoveTest extend assertEquals(Object.class, array.getClass().getComponentType()); } + @Test public void testRemoveElementBooleanArray() { boolean[] array; array = ArrayUtils.removeElement((boolean[]) null, true); @@ -331,6 +348,7 @@ public class ArrayUtilsRemoveTest extend assertEquals(Boolean.TYPE, array.getClass().getComponentType()); } + @Test public void testRemoveElementByteArray() { byte[] array; array = ArrayUtils.removeElement((byte[]) null, (byte) 1); @@ -349,6 +367,7 @@ public class ArrayUtilsRemoveTest extend assertEquals(Byte.TYPE, array.getClass().getComponentType()); } + @Test public void testRemoveElementCharArray() { char[] array; array = ArrayUtils.removeElement((char[]) null, 'a'); @@ -367,6 +386,7 @@ public class ArrayUtilsRemoveTest extend assertEquals(Character.TYPE, array.getClass().getComponentType()); } + @Test @SuppressWarnings("cast") public void testRemoveElementDoubleArray() { double[] array; @@ -386,6 +406,7 @@ public class ArrayUtilsRemoveTest extend assertEquals(Double.TYPE, array.getClass().getComponentType()); } + @Test @SuppressWarnings("cast") public void testRemoveElementFloatArray() { float[] array; @@ -405,6 +426,7 @@ public class ArrayUtilsRemoveTest extend assertEquals(Float.TYPE, array.getClass().getComponentType()); } + @Test public void testRemoveElementIntArray() { int[] array; array = ArrayUtils.removeElement((int[]) null, 1); @@ -423,6 +445,7 @@ public class ArrayUtilsRemoveTest extend assertEquals(Integer.TYPE, array.getClass().getComponentType()); } + @Test @SuppressWarnings("cast") public void testRemoveElementLongArray() { long[] array; @@ -442,6 +465,7 @@ public class ArrayUtilsRemoveTest extend assertEquals(Long.TYPE, array.getClass().getComponentType()); } + @Test public void testRemoveElementShortArray() { short[] array; array = ArrayUtils.removeElement((short[]) null, (short) 1);