[jboss-cvs] JBossAS SVN: r58862 - in projects/microcontainer/trunk/container/src: main/org/jboss/beans/info/plugins main/org/jboss/config/plugins main/org/jboss/reflect/plugins/introspection tests/org/jboss/test tests/org/jboss/test/beaninfo tests/org/jboss/test/beaninfo/support tests/org/jboss/test/beaninfo/test

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Dec 6 08:29:35 EST 2006


Author: adrian at jboss.org
Date: 2006-12-06 08:29:23 -0500 (Wed, 06 Dec 2006)
New Revision: 58862

Added:
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotatedGetterAndSetter.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotatedGetterAndSetterSimpleMerge.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotatedGetterOnly.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotatedSetterOnly.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotation1.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotation2.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoBooleanProperties.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoConstructors.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoEmpty.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericClass.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericGetterAndSetter.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericGetterOnly.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericInconsistentTypes.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericSetterOnly.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGetterAndSetter.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGetterOnly.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoInconsistentTypes.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoMethods.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoSetterOnly.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoUpperPropertyName.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/test/
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/test/AbstractBeanInfoTest.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/test/BeanInfoTestSuite.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/test/BeanInfoUnitTestCase.java
Modified:
   projects/microcontainer/trunk/container/src/main/org/jboss/beans/info/plugins/AbstractBeanInfoFactory.java
   projects/microcontainer/trunk/container/src/main/org/jboss/config/plugins/BasicConfiguration.java
   projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/introspection/ParameterizedClassInfo.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/ContainerAllTestSuite.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/ContainerTest.java
Log:
Tests for BeanInfo, includes:

1) Fix for only showing public constructors
2) Fix for only showing public non-static methods
3) Tests for annotation merging between getter and setter for a property

Modified: projects/microcontainer/trunk/container/src/main/org/jboss/beans/info/plugins/AbstractBeanInfoFactory.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/beans/info/plugins/AbstractBeanInfoFactory.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/beans/info/plugins/AbstractBeanInfoFactory.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -62,6 +62,9 @@
       TypeInfo[] parameters = minfo.getParameterTypes();
       if ((name.length() > 3 && name.startsWith("get")) || (name.length() > 2 && name.startsWith("is")))
       {
+         // isBoolean() is not a getter for java.lang.Boolean
+         if (name.startsWith("is") && returnType.equals(PrimitiveInfo.BOOLEAN) == false)
+            return false;
          if (parameters.length == 0 && PrimitiveInfo.VOID.equals(returnType) == false)
             return true;
       }
@@ -177,7 +180,10 @@
 
       HashSet<ConstructorInfo> result = new HashSet<ConstructorInfo>();
       for (int i = 0; i < cinfos.length; ++i)
-         result.add(cinfos[i]);
+      {
+         if (cinfos[i].isPublic() && cinfos[i].isStatic() == false)
+            result.add(cinfos[i]);
+      }
       return result;
    }
    
@@ -197,7 +203,7 @@
          {
             for (int i = 0; i < minfos.length; ++i)
             {
-               if (result.contains(minfos[i]) == false)
+               if (result.contains(minfos[i]) == false && minfos[i].isPublic() && minfos[i].isStatic() == false)
                   result.add(minfos[i]);
             }
          }
@@ -221,24 +227,21 @@
       {
          for (MethodInfo methodInfo : methods)
          {
-            if (methodInfo.isPublic() && methodInfo.isStatic() == false)
+            String name = methodInfo.getName();
+            String upperName = getUpperPropertyName(name);
+            if (isGetter(methodInfo))
             {
-               String name = methodInfo.getName();
-               String upperName = getUpperPropertyName(name);
-               if (isGetter(methodInfo))
+               getters.put(upperName, methodInfo);
+            }
+            else if (isSetter(methodInfo))
+            {
+               List<MethodInfo> list = setters.get(upperName);
+               if (list == null)
                {
-                  getters.put(upperName, methodInfo);
+                  list = new ArrayList<MethodInfo>();
+                  setters.put(upperName, list);
                }
-               else if (isSetter(methodInfo))
-               {
-                  List<MethodInfo> list = setters.get(upperName);
-                  if (list == null)
-                  {
-                     list = new ArrayList<MethodInfo>();
-                     setters.put(upperName, list);
-                  }
-                  list.add(methodInfo);
-               }
+               list.add(methodInfo);
             }
          }
       }
@@ -272,7 +275,7 @@
             AnnotationValue[] annotations = getter.getAnnotations();
             AnnotationValue[] setterAnnotations = null;
             if (setter != null)
-               setter.getAnnotations();
+               setterAnnotations = setter.getAnnotations();
             if (annotations == null || annotations.length == 0)
                annotations = setterAnnotations;
             else if (setterAnnotations != null && setterAnnotations.length > 0)

Modified: projects/microcontainer/trunk/container/src/main/org/jboss/config/plugins/BasicConfiguration.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/config/plugins/BasicConfiguration.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/config/plugins/BasicConfiguration.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -56,7 +56,9 @@
 
    protected ClassAdapterFactory createDefaultClassAdapterFactory() throws Throwable
    {
-      return new BasicClassAdapterFactory();
+      BasicClassAdapterFactory result = new BasicClassAdapterFactory();
+      result.setConfiguration(this);
+      return result;
    }
 
    protected TypeInfoFactory createDefaultTypeInfoFactory() throws Throwable

Modified: projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/introspection/ParameterizedClassInfo.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/introspection/ParameterizedClassInfo.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/introspection/ParameterizedClassInfo.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -233,10 +233,28 @@
          return false;
       
       ClassInfo other = (ClassInfo) obj;
+      ClassInfo otherDelegate = other;
       if (other instanceof ParameterizedClassInfo)
-         other = ((ParameterizedClassInfo) other).delegate;
+         otherDelegate = ((ParameterizedClassInfo) other).delegate;
       
-      return delegate.equals(other);
+      if (delegate.equals(otherDelegate) == false)
+         return false;
+      
+      // We are equal to the raw type (seems hacky?)
+      if (other instanceof ParameterizedClassInfo == false)
+         return true;
+      
+      TypeInfo[] typeArguments = getActualTypeArguments();
+      TypeInfo[] otherTypeArguments = other.getActualTypeArguments();
+      if (typeArguments.length != otherTypeArguments.length)
+         return false;
+      
+      for (int i = 0; i < typeArguments.length; ++i)
+      {
+         if (typeArguments[i].equals(otherTypeArguments[i]) == false)
+            return false;
+      }
+      return true;
    }
 
    public void toShortString(JBossStringBuilder buffer)

Modified: projects/microcontainer/trunk/container/src/tests/org/jboss/test/ContainerAllTestSuite.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/ContainerAllTestSuite.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/ContainerAllTestSuite.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -25,6 +25,7 @@
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
 
+import org.jboss.test.beaninfo.test.BeanInfoTestSuite;
 import org.jboss.test.classinfo.test.ClassInfoTestSuite;
 import org.jboss.test.joinpoint.test.JoinpointTestSuite;
 import org.jboss.test.metadata.MetaDataAllTestSuite;
@@ -49,6 +50,7 @@
 
       suite.addTest(ClassInfoTestSuite.suite());
       suite.addTest(JoinpointTestSuite.suite());
+      suite.addTest(BeanInfoTestSuite.suite());
       suite.addTest(MetaDataAllTestSuite.suite());
       suite.addTest(VFSAllTestSuite.suite());
       

Modified: projects/microcontainer/trunk/container/src/tests/org/jboss/test/ContainerTest.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/ContainerTest.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/ContainerTest.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -23,6 +23,8 @@
 
 import java.util.Arrays;
 
+import junit.framework.AssertionFailedError;
+
 /**
  * A ContainerTest.
  * 
@@ -52,8 +54,29 @@
       if (array != null)
          assertEquals(Arrays.asList(array).toString(), 0, array.length);
    }
-   
+
    /**
+    * Assert two arrays are equal
+    *
+    * TODO fix the abstract test case
+    * @param expected the expected array
+    * @param actual the actual array
+    */
+   protected void assertEquals(Object[] expected, Object[] actual)
+   {
+      if (Arrays.equals(expected, actual) == false)
+      {
+         String expectedString = null;
+         if (expected != null)
+            expectedString = Arrays.asList(expected).toString();
+         String actualString = null;
+         if (actual != null)
+            actualString = Arrays.asList(actual).toString();
+         throw new AssertionFailedError("expected: " + expectedString + " actual: " + actualString);
+      }
+   }
+
+   /**
     * Default setup with security manager enabled
     * 
     * @param clazz the class

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotatedGetterAndSetter.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotatedGetterAndSetter.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotatedGetterAndSetter.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+/**
+ * BeanInfoGetterAndSetter.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanInfoAnnotatedGetterAndSetter
+{
+   @BeanInfoAnnotation1
+   public int getSomething()
+   {
+      return 0;
+   }
+
+   @BeanInfoAnnotation1
+   public void setSomething(int x)
+   {
+   }
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotatedGetterAndSetterSimpleMerge.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotatedGetterAndSetterSimpleMerge.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotatedGetterAndSetterSimpleMerge.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+/**
+ * BeanInfoGetterAndSetter.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanInfoAnnotatedGetterAndSetterSimpleMerge
+{
+   @BeanInfoAnnotation1
+   public int getSomething()
+   {
+      return 0;
+   }
+
+   @BeanInfoAnnotation2
+   public void setSomething(int x)
+   {
+   }
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotatedGetterOnly.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotatedGetterOnly.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotatedGetterOnly.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+/**
+ * BeanInfoGetterOnly.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanInfoAnnotatedGetterOnly
+{
+   @BeanInfoAnnotation1
+   public int getSomething()
+   {
+      return 0;
+   }
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotatedSetterOnly.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotatedSetterOnly.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotatedSetterOnly.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+/**
+ * BeanInfoSetterOnly.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanInfoAnnotatedSetterOnly
+{
+   @BeanInfoAnnotation1
+   public void setSomething(BeanInfoGenericClass<String> x)
+   {
+   }
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotation1.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotation1.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotation1.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * BeanInfoAnnotation1.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface BeanInfoAnnotation1
+{
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotation2.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotation2.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoAnnotation2.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * BeanInfoAnnotation1.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface BeanInfoAnnotation2
+{
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoBooleanProperties.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoBooleanProperties.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoBooleanProperties.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,54 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+/**
+ * BeanInfoBooleanProperties
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanInfoBooleanProperties
+{
+   public boolean isSomething()
+   {
+      return true;
+   }
+
+   public void setSomething(boolean x)
+   {
+   }
+
+   public Boolean getSomethingElse()
+   {
+      return true;
+   }
+
+   public void setSomethingElse(Boolean x)
+   {
+   }
+
+   public Boolean isNotGetter()
+   {
+      return true;
+   }
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoConstructors.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoConstructors.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoConstructors.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+/**
+ * BeanInfoConstructors.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanInfoConstructors
+{
+   private BeanInfoConstructors() {}
+   BeanInfoConstructors(int p1) {}
+   protected BeanInfoConstructors(int p1, String p2) {}
+   public BeanInfoConstructors(long p1, String p2) throws IllegalArgumentException, IllegalStateException { }
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoEmpty.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoEmpty.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoEmpty.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+/**
+ * BeanInfoEmpty.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanInfoEmpty
+{
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericClass.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericClass.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericClass.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+/**
+ * BeanInfoGenericClass.
+ *
+ * @param <T> the generic type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanInfoGenericClass<T>
+{
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericGetterAndSetter.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericGetterAndSetter.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericGetterAndSetter.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+/**
+ * BeanInfoGetterAndSetter.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanInfoGenericGetterAndSetter
+{
+   public BeanInfoGenericClass<String> getSomething()
+   {
+      return null;
+   }
+
+   public void setSomething(BeanInfoGenericClass<String> x)
+   {
+   }
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericGetterOnly.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericGetterOnly.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericGetterOnly.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+/**
+ * BeanInfoGetterOnly.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanInfoGenericGetterOnly
+{
+   public BeanInfoGenericClass<String> getSomething()
+   {
+      return null;
+   }
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericInconsistentTypes.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericInconsistentTypes.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericInconsistentTypes.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+/**
+ * BeanInfoGenericInconsistentTypes.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanInfoGenericInconsistentTypes
+{
+   public BeanInfoGenericClass<String> getSomething()
+   {
+      return null;
+   }
+
+   public void setSomething(BeanInfoGenericClass<Integer> x)
+   {
+   }
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericSetterOnly.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericSetterOnly.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericSetterOnly.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+/**
+ * BeanInfoSetterOnly.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanInfoGenericSetterOnly
+{
+   public void setSomething(BeanInfoGenericClass<String> x)
+   {
+   }
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGetterAndSetter.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGetterAndSetter.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGetterAndSetter.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+/**
+ * BeanInfoGetterAndSetter.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanInfoGetterAndSetter
+{
+   public int getSomething()
+   {
+      return 0;
+   }
+
+   public void setSomething(int x)
+   {
+   }
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGetterOnly.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGetterOnly.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGetterOnly.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+/**
+ * BeanInfoGetterOnly.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanInfoGetterOnly
+{
+   public int getSomething()
+   {
+      return 0;
+   }
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoInconsistentTypes.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoInconsistentTypes.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoInconsistentTypes.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,34 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+public class BeanInfoInconsistentTypes
+{
+   public String getSomething()
+   {
+      return null;
+   }
+
+   public void setSomething(long x)
+   {
+   }
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoMethods.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoMethods.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoMethods.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,60 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+/**
+ * BeanInfoMethodsClass
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanInfoMethods
+{
+   private void voidMethodVoidPrivate() {}
+   private long longMethodVoidPrivate() { return 0; }
+   private void voidMethodintPrivate(int p1) {}
+   private long longMethodintPrivate(int p1) { return 0; }
+   private void voidMethodintStringPrivate(int p1, String p2) {}
+   private long longMethodintStringPrivate(int p1, String p2) { return 0; }
+   private long longMethodintStringThrowsPrivate(int p1, String p2) throws IllegalArgumentException, IllegalStateException { return 0; }
+   void voidMethodVoidPackage() { voidMethodVoidPrivate(); }
+   long longMethodVoidPackage() { return longMethodVoidPrivate(); }
+   void voidMethodintPackage(int p1) { voidMethodintPrivate(p1); }
+   long longMethodintPackage(int p1) { return longMethodintPrivate(p1); }
+   void voidMethodintStringPackage(int p1, String p2) { voidMethodintStringPrivate(p1, p2); }
+   long longMethodintStringPackage(int p1, String p2) { return longMethodintStringPrivate(p1, p2); }
+   long longMethodintStringThrowsPackage(int p1, String p2) throws IllegalArgumentException, IllegalStateException { return longMethodintStringThrowsPrivate(p1, p2); }
+   protected void voidMethodVoidProtected() {}
+   protected long longMethodVoidProtected() { return 0; }
+   protected void voidMethodintProtected(int p1) {}
+   protected long longMethodintProtected(int p1) { return 0; }
+   protected void voidMethodintStringProtected(int p1, String p2) {}
+   protected long longMethodintStringProtected(int p1, String p2) { return 0; }
+   protected long longMethodintStringThrowsProtected(int p1, String p2) throws IllegalArgumentException, IllegalStateException { return 0; }
+   public void voidMethodVoidPublic() {}
+   public long longMethodVoidPublic() { return 0; }
+   public void voidMethodintPublic(int p1) {}
+   public long longMethodintPublic(int p1) { return 0; }
+   public void voidMethodintStringPublic(int p1, String p2) {}
+   public long longMethodintStringPublic(int p1, String p2) { return 0; }
+   public long longMethodintStringThrowsPublic(int p1, String p2) throws IllegalArgumentException, IllegalStateException { return 0; }
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoSetterOnly.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoSetterOnly.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoSetterOnly.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+/**
+ * BeanInfoSetterOnly.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanInfoSetterOnly
+{
+   public void setSomething(int x)
+   {
+   }
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoUpperPropertyName.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoUpperPropertyName.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoUpperPropertyName.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.support;
+
+/**
+ * BeanInfoUpperPropertyName.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanInfoUpperPropertyName
+{
+   public Object getMBean()
+   {
+      return null;
+   }
+
+   public void setMBean(Object x)
+   {
+   }
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/test/AbstractBeanInfoTest.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/test/AbstractBeanInfoTest.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/test/AbstractBeanInfoTest.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,361 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.test;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.beans.info.plugins.AbstractPropertyInfo;
+import org.jboss.beans.info.spi.BeanInfo;
+import org.jboss.beans.info.spi.PropertyInfo;
+import org.jboss.config.plugins.BasicConfiguration;
+import org.jboss.config.spi.Configuration;
+import org.jboss.reflect.plugins.ConstructorInfoImpl;
+import org.jboss.reflect.plugins.MethodInfoImpl;
+import org.jboss.reflect.spi.AnnotationValue;
+import org.jboss.reflect.spi.ClassInfo;
+import org.jboss.reflect.spi.ConstructorInfo;
+import org.jboss.reflect.spi.MethodInfo;
+import org.jboss.reflect.spi.PrimitiveInfo;
+import org.jboss.reflect.spi.TypeInfo;
+import org.jboss.reflect.spi.TypeInfoFactory;
+import org.jboss.test.classinfo.test.AbstractClassInfoTest;
+
+/**
+ * AbstractBeanInfoTest.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractBeanInfoTest extends AbstractClassInfoTest
+{
+   private Configuration configuration = new BasicConfiguration();
+   
+   public AbstractBeanInfoTest(String name)
+   {
+      super(name);
+   }
+   
+   protected void assertBeanInfo(BeanInfo beanInfo, Class<?> clazz) throws Throwable
+   {
+      assertEquals(clazz.getName(), beanInfo.getName());
+      ClassInfo classInfo = beanInfo.getClassInfo();
+      assertClassInfo(classInfo, clazz);
+      assertBeanConstructors(beanInfo, clazz);
+      assertBeanMethods(beanInfo, clazz);
+      assertBeanProperties(beanInfo, clazz);
+   }
+   
+   protected void assertBeanConstructors(BeanInfo beanInfo, Class clazz)
+   {
+      ClassInfo classInfo = beanInfo.getClassInfo();
+      
+      TypeInfoFactory factory = getTypeInfoFactory();
+      Set<ConstructorInfo> expected = new HashSet<ConstructorInfo>();
+      for (Constructor constructor : clazz.getConstructors())
+      {
+         Class[] paramClasses = constructor.getParameterTypes();
+         TypeInfo[] paramTypes = new TypeInfo[paramClasses.length];
+         AnnotationValue[][] paramAnnotations = new AnnotationValue[paramClasses.length][0];
+         int i = 0;
+         for (Class c : paramClasses)
+            paramTypes[i++] = factory.getTypeInfo(c);
+         ConstructorInfo c = new ConstructorInfoImpl(null, paramTypes, paramAnnotations, null, constructor.getModifiers(), classInfo);
+         expected.add(c);
+      }
+      
+      Set<ConstructorInfo> actual = beanInfo.getConstructors();
+      if (expected.isEmpty())
+      {
+         assertEmpty(actual);
+         return;
+      }
+      assertNotNull(actual);
+      assertEquals(expected.size(), actual.size());
+      getLog().debug(clazz + " expected constructors=" + expected + " actual=" + actual);
+      assertEquals(expected, actual);
+   }
+   
+   protected void assertBeanMethods(BeanInfo beanInfo, Class<?> clazz) throws Throwable
+   {
+      TypeInfoFactory factory = getTypeInfoFactory();
+      Set<MethodInfo> expected = new HashSet<MethodInfo>();
+      for (Method method : clazz.getMethods())
+      {
+         TypeInfo returnType = factory.getTypeInfo(method.getReturnType());
+         Class[] paramClasses = method.getParameterTypes();
+         TypeInfo[] paramTypes = new TypeInfo[paramClasses.length];
+         AnnotationValue[][] paramAnnotations = new AnnotationValue[paramClasses.length][0];
+         int i = 0;
+         for (Class c : paramClasses)
+            paramTypes[i++] = factory.getTypeInfo(c);
+         ClassInfo classInfo = (ClassInfo) factory.getTypeInfo(method.getDeclaringClass());
+         MethodInfo m = new MethodInfoImpl(null, method.getName(), returnType, paramTypes, paramAnnotations, null, method.getModifiers(), classInfo);
+         expected.add(m);
+      }
+      
+      Set<MethodInfo> actual = beanInfo.getMethods();
+      if (expected.isEmpty())
+      {
+         assertEmpty(actual);
+         return;
+      }
+      getLog().debug(clazz + " expected methods=" + expected + " actual=" + actual);
+      assertEquals(expected, actual);
+   }
+   
+   protected void assertBeanProperties(BeanInfo beanInfo, Class<?> clazz) throws Throwable
+   {
+      Set<PropertyInfo> expected = getExpectedProperties(clazz);
+      
+      Set<PropertyInfo> actual = beanInfo.getProperties();
+      if (expected.isEmpty())
+      {
+         assertEmpty(actual);
+         return;
+      }
+      getLog().debug(clazz + " expected properties=" + expected + " actual=" + actual);
+      assertEquals(expected, actual);
+      
+      HashMap<String, PropertyInfo> actualProps = new HashMap<String, PropertyInfo>();
+      for (PropertyInfo prop : actual)
+         actualProps.put(prop.getName(), prop);
+      
+      for (PropertyInfo propExpected : expected)
+      {
+         PropertyInfo propActual = actualProps.get(propExpected.getName());
+         AnnotationValue[] annotationsExpected = propExpected.getAnnotations();
+         AnnotationValue[] annotationsActual = propActual.getAnnotations();
+         Set<AnnotationValue> expectedSet = new HashSet<AnnotationValue>();
+         if (annotationsExpected != null)
+         {
+            for (AnnotationValue a : annotationsExpected)
+               expectedSet.add(a);
+         }
+         Set<AnnotationValue> actualSet = new HashSet<AnnotationValue>();
+         if (annotationsActual != null)
+         {
+            for (AnnotationValue a : annotationsActual)
+               actualSet.add(a);
+         }
+         getLog().debug("Checking annotations for " + propExpected.getName() + " expected: " + expectedSet + " actual=" + actualSet);
+         assertEquals(expectedSet, actualSet);
+      }
+   }
+
+   protected Set<PropertyInfo> getExpectedProperties(Class clazz)
+   {
+      TypeInfoFactory factory = getTypeInfoFactory();
+      Method[] methods = clazz.getMethods();
+      HashMap<String, Method> getters = new HashMap<String, Method>();
+      HashMap<String, List<Method>> setters = new HashMap<String, List<Method>>();
+      if (methods.length > 0)
+      {
+         for (Method method : methods)
+         {
+            String name = method.getName();
+            String upperName = getUpperPropertyName(name);
+            if (isGetter(method))
+               getters.put(upperName, method);
+            else if (isSetter(method))
+            {
+               List<Method> list = setters.get(upperName);
+               if (list == null)
+               {
+                  list = new ArrayList<Method>();
+                  setters.put(upperName, list);
+               }
+               list.add(method);
+            }
+         }
+      }
+
+      HashSet<PropertyInfo> properties = new HashSet<PropertyInfo>();
+      if (getters.isEmpty() == false)
+      {
+         for (Iterator<Map.Entry<String, Method>> i = getters.entrySet().iterator(); i.hasNext();)
+         {
+            Map.Entry<String, Method> entry = i.next();
+            String name = entry.getKey();
+            Method getter = entry.getValue();
+            Method setter = null;
+            List<Method> setterList = setters.remove(name);
+            if (setterList != null && setterList.size() != 0)
+            {
+               for (int j = 0; j < setterList.size(); ++j)
+               {
+                  Method thisSetter = setterList.get(j);
+                  Type pinfo = thisSetter.getGenericParameterTypes()[0];
+                  if (getter.getGenericReturnType().equals(pinfo) == true)
+                  {
+                     setter = thisSetter;
+                     break;
+                  }
+               }
+            }
+            String lowerName = getLowerPropertyName(name);
+            
+            // Merge the annotations between the getters and setters
+            Set<AnnotationValue> getterAnnotations = getExpectedAnnotations(getter.getAnnotations());
+            Set<AnnotationValue> setterAnnotations = null;
+            if (setter != null)
+               setterAnnotations = getExpectedAnnotations(setter.getAnnotations());
+            AnnotationValue[] annotations = getterAnnotations.toArray(new AnnotationValue[getterAnnotations.size()]);
+            if (annotations == null || annotations.length == 0)
+            {
+               if (setterAnnotations != null)
+                  annotations = setterAnnotations.toArray(new AnnotationValue[setterAnnotations.size()]);
+            }
+            else if (setterAnnotations != null && setterAnnotations.size() > 0)
+            {
+               HashSet<AnnotationValue> merged = new HashSet<AnnotationValue>();
+               merged.addAll(getterAnnotations);
+               merged.addAll(setterAnnotations);
+               annotations = merged.toArray(new AnnotationValue[merged.size()]);
+            }
+            
+            TypeInfo type = factory.getTypeInfo(getter.getGenericReturnType());
+            ClassInfo declaringType = (ClassInfo) factory.getTypeInfo(getter.getDeclaringClass());
+            MethodInfo getterInfo = new MethodInfoImpl(null, getter.getName(), type, new TypeInfo[0], null, null, getter.getModifiers(), declaringType);
+            MethodInfo setterInfo = null;
+            if (setter != null)
+            {
+               declaringType = (ClassInfo) factory.getTypeInfo(setter.getDeclaringClass());
+               AnnotationValue[][] paramAnnotations = new AnnotationValue[1][];
+               setterAnnotations = getExpectedAnnotations(setter.getParameterAnnotations()[0]); 
+               paramAnnotations[0] = setterAnnotations.toArray(new AnnotationValue[setterAnnotations.size()]);
+               setterInfo = new MethodInfoImpl(null, setter.getName(), PrimitiveInfo.VOID, new TypeInfo[] { type }, paramAnnotations, null, setter.getModifiers(), declaringType);
+            }
+            properties.add(new AbstractPropertyInfo(lowerName, name, type, getterInfo, setterInfo, annotations));
+         }
+      }
+      if (setters.isEmpty() == false)
+      {
+         for (Iterator<Map.Entry<String, List<Method>>> i = setters.entrySet().iterator(); i.hasNext();)
+         {
+            Map.Entry<String, List<Method>> entry = i.next();
+            String name = entry.getKey();
+            List<Method> setterList = entry.getValue();
+            // Review: Maybe should just create duplicate propertyInfo and let the configurator guess?
+            if (setterList.size() == 1)
+            {
+               Method setter = setterList.get(0);
+               Type pinfo = setter.getGenericParameterTypes()[0];
+               TypeInfo type = factory.getTypeInfo(pinfo);
+               String lowerName = getLowerPropertyName(name);
+               Set<AnnotationValue> setterAnnotations = getExpectedAnnotations(setter.getAnnotations()); 
+               AnnotationValue[] annotations = setterAnnotations.toArray(new AnnotationValue[setterAnnotations.size()]);
+               ClassInfo declaringType = (ClassInfo) factory.getTypeInfo(setter.getDeclaringClass());
+               AnnotationValue[][] paramAnnotations = new AnnotationValue[1][];
+               setterAnnotations = getExpectedAnnotations(setter.getParameterAnnotations()[0]); 
+               paramAnnotations[0] = setterAnnotations.toArray(new AnnotationValue[setterAnnotations.size()]);
+               MethodInfo setterInfo = new MethodInfoImpl(null, setter.getName(), PrimitiveInfo.VOID, new TypeInfo[] { type }, paramAnnotations, null, setter.getModifiers(), declaringType);
+               properties.add(new AbstractPropertyInfo(lowerName, name, type, null, setterInfo, annotations));
+            }
+         }
+      }
+      return properties;
+   }
+   
+   protected static String getUpperPropertyName(String name)
+   {
+      int start = 3;
+      if (name.startsWith("is"))
+         start = 2;
+      
+      return name.substring(start);
+   }
+   
+   protected static String getLowerPropertyName(String name)
+   {
+      // If the second character is upper case then we don't make
+      // the first character lower case
+      if (name.length() > 1)
+      {
+         if (Character.isUpperCase(name.charAt(1)))
+            return name;
+      }
+
+      StringBuilder buffer = new StringBuilder(name.length());
+      buffer.append(Character.toLowerCase(name.charAt(0)));
+      if (name.length() > 1)
+         buffer.append(name.substring(1));
+      return buffer.toString();
+   }
+   
+   protected static boolean isGetter(Method method)
+   {
+      String name = method.getName();
+      Class returnType = method.getReturnType();
+      Class[] parameters = method.getParameterTypes();
+      if ((name.length() > 3 && name.startsWith("get")) || (name.length() > 2 && name.startsWith("is")))
+      {
+         // isBoolean() is not a getter for java.lang.Boolean
+         if (name.startsWith("is") && returnType.equals(Boolean.TYPE) == false)
+            return false;
+         if (parameters.length == 0 && Void.TYPE.equals(returnType) == false)
+            return true;
+      }
+      return false;
+   }
+   
+   protected static boolean isSetter(Method method)
+   {
+      String name = method.getName();
+      Class returnType = method.getReturnType();
+      Class[] parameters = method.getParameterTypes();
+      if ((name.length() > 3 && name.startsWith("set")))
+      {
+         if (parameters.length == 1 && Void.TYPE.equals(returnType))
+            return true;
+      }
+      return false;
+   }
+
+   protected TypeInfoFactory getTypeInfoFactory()
+   {
+      return configuration.getTypeInfoFactory();
+   }
+   
+   protected BeanInfo getBeanInfo(Class clazz) throws Throwable
+   {
+      return configuration.getBeanInfo(clazz);
+   }
+   
+   protected Configuration getConfiguration()
+   {
+      return configuration;
+   }
+   
+   protected void configureLogging()
+   {
+      enableTrace("org.jboss.beans");
+   }
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/test/BeanInfoTestSuite.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/test/BeanInfoTestSuite.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/test/BeanInfoTestSuite.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * BeanInfo Test Suite.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 58838 $
+ */
+public class BeanInfoTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("BeanInfo Tests");
+
+      suite.addTest(BeanInfoUnitTestCase.suite());
+      
+      return suite;
+   }
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/test/BeanInfoUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/test/BeanInfoUnitTestCase.java	2006-12-06 11:38:46 UTC (rev 58861)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/test/BeanInfoUnitTestCase.java	2006-12-06 13:29:23 UTC (rev 58862)
@@ -0,0 +1,168 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.beaninfo.test;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import junit.framework.Test;
+
+import org.jboss.beans.info.spi.BeanInfo;
+import org.jboss.beans.info.spi.PropertyInfo;
+import org.jboss.test.beaninfo.support.BeanInfoAnnotatedGetterAndSetter;
+import org.jboss.test.beaninfo.support.BeanInfoAnnotatedGetterAndSetterSimpleMerge;
+import org.jboss.test.beaninfo.support.BeanInfoAnnotatedGetterOnly;
+import org.jboss.test.beaninfo.support.BeanInfoAnnotatedSetterOnly;
+import org.jboss.test.beaninfo.support.BeanInfoBooleanProperties;
+import org.jboss.test.beaninfo.support.BeanInfoConstructors;
+import org.jboss.test.beaninfo.support.BeanInfoEmpty;
+import org.jboss.test.beaninfo.support.BeanInfoGenericGetterAndSetter;
+import org.jboss.test.beaninfo.support.BeanInfoGenericGetterOnly;
+import org.jboss.test.beaninfo.support.BeanInfoGenericInconsistentTypes;
+import org.jboss.test.beaninfo.support.BeanInfoGenericSetterOnly;
+import org.jboss.test.beaninfo.support.BeanInfoGetterAndSetter;
+import org.jboss.test.beaninfo.support.BeanInfoGetterOnly;
+import org.jboss.test.beaninfo.support.BeanInfoInconsistentTypes;
+import org.jboss.test.beaninfo.support.BeanInfoSetterOnly;
+import org.jboss.test.beaninfo.support.BeanInfoUpperPropertyName;
+
+/**
+ * BeanInfo Test Case.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 45663 $
+ */
+public class BeanInfoUnitTestCase extends AbstractBeanInfoTest
+{
+   public static Test suite()
+   {
+      return suite(BeanInfoUnitTestCase.class);
+   }
+   
+   public BeanInfoUnitTestCase(String name)
+   {
+      super(name);
+   }
+   
+   public void testEmptyBean() throws Throwable
+   {
+      testBean(BeanInfoEmpty.class, null);
+   }
+   
+   public void testBeanConstructors() throws Throwable
+   {
+      testBean(BeanInfoConstructors.class, null);
+   }
+   
+   public void testBeanMethods() throws Throwable
+   {
+      testBean(BeanInfoConstructors.class, null);
+   }
+   
+   public void testBeanGetterOnly() throws Throwable
+   {
+      testBean(BeanInfoGetterOnly.class, new String[] { "something" });
+   }
+   
+   public void testBeanSetterOnly() throws Throwable
+   {
+      testBean(BeanInfoSetterOnly.class, new String[] { "something" });
+   }
+   
+   public void testBeanGetterAndSetter() throws Throwable
+   {
+      testBean(BeanInfoGetterAndSetter.class, new String[] { "something" });
+   }
+   
+   public void testBeanBooleanProperties() throws Throwable
+   {
+      testBean(BeanInfoBooleanProperties.class, new String[] { "something", "somethingElse" });
+   }
+   
+   public void testBeanUpperPropertyName() throws Throwable
+   {
+      testBean(BeanInfoUpperPropertyName.class, new String[] { "MBean" });
+   }
+   
+   public void testBeanInconsistentTypes() throws Throwable
+   {
+      testBean(BeanInfoInconsistentTypes.class, new String[] { "something" });
+   }
+   
+   public void testBeanGenericGetterOnly() throws Throwable
+   {
+      testBean(BeanInfoGenericGetterOnly.class, new String[] { "something" });
+   }
+   
+   public void testBeanGenericSetterOnly() throws Throwable
+   {
+      testBean(BeanInfoGenericSetterOnly.class, new String[] { "something" });
+   }
+   
+   public void testBeanGenericGetterAndSetter() throws Throwable
+   {
+      testBean(BeanInfoGenericGetterAndSetter.class, new String[] { "something" });
+   }
+   
+   public void testBeanGenericInconsistentTypes() throws Throwable
+   {
+      testBean(BeanInfoGenericInconsistentTypes.class, new String[] { "something" });
+   }
+   
+   public void testBeanAnnotatedGetterOnly() throws Throwable
+   {
+      testBean(BeanInfoAnnotatedGetterOnly.class, new String[] { "something" });
+   }
+   
+   public void testBeanAnnotatedSetterOnly() throws Throwable
+   {
+      testBean(BeanInfoAnnotatedSetterOnly.class, new String[] { "something" });
+   }
+   
+   public void testBeanAnnotatedGetterAndSetter() throws Throwable
+   {
+      testBean(BeanInfoAnnotatedGetterAndSetter.class, new String[] { "something" });
+   }
+   
+   public void testBeanAnnotatedGetterAndSetterSimpleMerge() throws Throwable
+   {
+      testBean(BeanInfoAnnotatedGetterAndSetterSimpleMerge.class, new String[] { "something" });
+   }
+
+   protected void testBean(Class clazz, String[] beanNames) throws Throwable
+   {
+      BeanInfo beanInfo = getBeanInfo(clazz);
+      assertBeanInfo(beanInfo, clazz);
+      if (beanNames != null)
+      {
+         Set<PropertyInfo> properties = beanInfo.getProperties();
+         Set<String> props = new HashSet<String>();
+         for (PropertyInfo p : properties)
+            props.add(p.getName());
+         Set<String> expected = new HashSet<String>();
+         for (String beanName : beanNames)
+            expected.add(beanName);
+         expected.add("class");
+         assertEquals(expected, props);
+      }
+   }
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list