[jboss-cvs] JBossAS SVN: r64487 - projects/microcontainer/trunk/container/src/tests/org/jboss/test/classinfo/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 7 15:53:29 EDT 2007


Author: scott.stark at jboss.org
Date: 2007-08-07 15:53:29 -0400 (Tue, 07 Aug 2007)
New Revision: 64487

Modified:
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/classinfo/test/ClassInfoArrayTest.java
Log:
Add a primative char[] test and test for TypeInfo.getArrayType(int)

Modified: projects/microcontainer/trunk/container/src/tests/org/jboss/test/classinfo/test/ClassInfoArrayTest.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/classinfo/test/ClassInfoArrayTest.java	2007-08-07 19:12:33 UTC (rev 64486)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/classinfo/test/ClassInfoArrayTest.java	2007-08-07 19:53:29 UTC (rev 64487)
@@ -45,7 +45,33 @@
       String[] array = new String[0];
       testArray(array);
    }
-   
+   public void testCharArray()
+      throws Throwable
+   {
+      char[] array = {'h', 'e', 'l', 'l', 'o'};
+      testArray(array);
+   }
+   public void testArrayType()
+   {
+      String[] array = {"hello", "world"};
+      TypeInfoFactory factory = getTypeInfoFactory();
+      TypeInfo info = factory.getTypeInfo(array.getClass());
+
+      TypeInfo info0 = info.getArrayType(0);
+      assertEquals(info0.getName(), "[java.lang.String;", info0.getName());
+   }
+   public void test2DArrayType()
+   {
+      String[][] array = {{"hello"}, {"world"}};
+      TypeInfoFactory factory = getTypeInfoFactory();
+      TypeInfo info = factory.getTypeInfo(array.getClass());
+      
+      TypeInfo info0 = info.getArrayType(0);
+      assertEquals(info0.getName(), "[[java.lang.String;", info0.getName());
+      TypeInfo info1 = info.getArrayType(1);
+      assertEquals(info1.getName(), "[java.lang.String;", info1.getName());
+   }
+
    public void testDeepArray() throws Throwable
    {
       String[][][][][] array = new String[1][2][3][4][0];




More information about the jboss-cvs-commits mailing list