commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r907099 - /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java
Date Fri, 05 Feb 2010 21:22:29 GMT
Author: mbenson
Date: Fri Feb  5 21:22:29 2010
New Revision: 907099

URL: http://svn.apache.org/viewvc?rev=907099&view=rev
Log:
clean up toClass(Object[]) test

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

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java?rev=907099&r1=907098&r2=907099&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java Fri
Feb  5 21:22:29 2010
@@ -20,6 +20,7 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
@@ -899,21 +900,12 @@
     }
 
     public void testToClass_object() {
-        assertEquals(null, ClassUtils.toClass(null));
+        assertNull(ClassUtils.toClass(null));
 
-        assertSame(
-            ArrayUtils.EMPTY_CLASS_ARRAY,
-            ClassUtils.toClass(new Class[0]));
-
-        Object[] array = new Object[3];
-        array[0] = new String("Test");
-        array[1] = new Integer(1);
-        array[2] = new Double(99);
-
-        Class<?>[] results = ClassUtils.toClass(array);
-        assertEquals("String", ClassUtils.getShortClassName(results[0]));
-        assertEquals("Integer", ClassUtils.getShortClassName(results[1]));
-        assertEquals("Double", ClassUtils.getShortClassName(results[2]));
+        assertSame(ArrayUtils.EMPTY_CLASS_ARRAY, ClassUtils.toClass(ArrayUtils.EMPTY_OBJECT_ARRAY));
+
+        assertTrue(Arrays.equals(new Class[] { String.class, Integer.class, Double.class
},
+                ClassUtils.toClass(new Object[] { "Test", 1, 99d })));
     }
 
     public void test_getShortCanonicalName_Object() {



Mime
View raw message