[jboss-cvs] JBossAS SVN: r66505 - in projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo: test and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Oct 26 13:43:06 EDT 2007


Author: alex.loubyansky at jboss.com
Date: 2007-10-26 13:43:06 -0400 (Fri, 26 Oct 2007)
New Revision: 66505

Added:
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericInterface.java
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericInterfaceImpl.java
Modified:
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/test/BeanInfoUnitTestCase.java
Log:
test reflecting property type in the impl class rather than the interface

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericInterface.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericInterface.java	                        (rev 0)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericInterface.java	2007-10-26 17:43:06 UTC (rev 66505)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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;
+
+
+/**
+ * A BeanInfoGenericInterface.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public interface BeanInfoGenericInterface<T extends Object>
+{
+   T getProperty();
+   void setProperty(T value);
+}

Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericInterfaceImpl.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericInterfaceImpl.java	                        (rev 0)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/support/BeanInfoGenericInterfaceImpl.java	2007-10-26 17:43:06 UTC (rev 66505)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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;
+
+
+/**
+ * A BeanInfoGenericInterfaceImpl.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanInfoGenericInterfaceImpl implements BeanInfoGenericInterface<String>
+{
+   public String getProperty()
+   {
+      return null;
+   }
+
+   public void setProperty(String value)
+   {
+   }
+}

Modified: 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	2007-10-26 15:48:31 UTC (rev 66504)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/beaninfo/test/BeanInfoUnitTestCase.java	2007-10-26 17:43:06 UTC (rev 66505)
@@ -41,6 +41,7 @@
 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.BeanInfoGenericInterfaceImpl;
 import org.jboss.test.beaninfo.support.BeanInfoGenericSetterOnly;
 import org.jboss.test.beaninfo.support.BeanInfoGetterAndSetter;
 import org.jboss.test.beaninfo.support.BeanInfoGetterOnly;
@@ -230,6 +231,15 @@
       assertTrue(invoked == bean.notInvoked);
    }
    
+   public void testGenericInterfaceImpl() throws Throwable
+   {
+      BeanInfo beanInfo = getBeanInfo(BeanInfoGenericInterfaceImpl.class);
+      assertNotNull(beanInfo);
+      PropertyInfo property = beanInfo.getProperty("property");
+      assertNotNull(property);
+      assertEquals("java.lang.String", property.getType().getName());
+   }
+   
    protected void testBean(Class clazz, String[] beanNames) throws Throwable
    {
       BeanInfo beanInfo = getBeanInfo(clazz);




More information about the jboss-cvs-commits mailing list