[jboss-cvs] JBossAS SVN: r102953 - in projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode: test and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Mar 25 07:11:35 EDT 2010


Author: kabir.khan at jboss.com
Date: 2010-03-25 07:11:34 -0400 (Thu, 25 Mar 2010)
New Revision: 102953

Added:
   projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/support/BoxedInterface.java
   projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/support/PrimitiveInterface.java
   projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/AbstractJavassistMethodFactoryTest.java
   projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/JavassistMemberFactoryBoxedInterfaceUnitTestCase.java
   projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/JavassistMemberFactoryPrimitiveInterfaceUnitTestCase.java
Modified:
   projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/support/PublicBoxedBean.java
   projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/support/PublicPrimitiveBean.java
   projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/AbstractJavassistMethodAndFieldFactoryTest.java
   projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/JavassistMemberFactoryTestSuite.java
Log:
[JBREFLECT-6] Add tests to test invocation via an interface (i.e. invokeinterface rather than invokevirtual)

Added: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/support/BoxedInterface.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/support/BoxedInterface.java	                        (rev 0)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/support/BoxedInterface.java	2010-03-25 11:11:34 UTC (rev 102953)
@@ -0,0 +1,53 @@
+/*
+* 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.plugins.javassist.bytecode.support;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public interface BoxedInterface
+{
+   void noReturnNoParams();
+   
+   String bigMethod(String s, Boolean booleanField, Byte byteField, Character charField);
+
+   Object objectMethod(Object object);
+
+   Boolean booleanMethod(Boolean param);
+
+   Byte byteMethod(Byte param);
+
+   Character charMethod(Character param);
+
+   Double doubleMethod(Double param);
+
+   Float floatMethod(Float param);
+
+   Integer intMethod(Integer param);
+
+   Long longMethod(Long param);
+
+   Short shortMethod(Short param);
+
+}
\ No newline at end of file

Added: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/support/PrimitiveInterface.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/support/PrimitiveInterface.java	                        (rev 0)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/support/PrimitiveInterface.java	2010-03-25 11:11:34 UTC (rev 102953)
@@ -0,0 +1,53 @@
+/*
+* 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.plugins.javassist.bytecode.support;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public interface PrimitiveInterface
+{
+   void noReturnNoParams();
+   
+   String bigMethod(String s, boolean booleanField, byte byteField, char charField);
+
+   Object objectMethod(Object object);
+
+   boolean booleanMethod(boolean param);
+
+   byte byteMethod(byte param);
+
+   char charMethod(char param);
+
+   double doubleMethod(double param);
+
+   float floatMethod(float param);
+
+   int intMethod(int param);
+
+   long longMethod(long param);
+
+   short shortMethod(short param);
+
+}
\ No newline at end of file

Modified: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/support/PublicBoxedBean.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/support/PublicBoxedBean.java	2010-03-25 10:47:37 UTC (rev 102952)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/support/PublicBoxedBean.java	2010-03-25 11:11:34 UTC (rev 102953)
@@ -26,7 +26,7 @@
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
  * @version $Revision: 1.1 $
  */
-public class PublicBoxedBean implements BeanInterface
+public class PublicBoxedBean implements BeanInterface, BoxedInterface
 {
    public Object object;
    

Modified: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/support/PublicPrimitiveBean.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/support/PublicPrimitiveBean.java	2010-03-25 10:47:37 UTC (rev 102952)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/support/PublicPrimitiveBean.java	2010-03-25 11:11:34 UTC (rev 102953)
@@ -26,7 +26,7 @@
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
  * @version $Revision: 1.1 $
  */
-public class PublicPrimitiveBean implements BeanInterface
+public class PublicPrimitiveBean implements BeanInterface, PrimitiveInterface
 {
    public Object object;
    

Modified: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/AbstractJavassistMethodAndFieldFactoryTest.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/AbstractJavassistMethodAndFieldFactoryTest.java	2010-03-25 10:47:37 UTC (rev 102952)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/AbstractJavassistMethodAndFieldFactoryTest.java	2010-03-25 11:11:34 UTC (rev 102953)
@@ -30,127 +30,13 @@
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
  * @version $Revision: 1.1 $
  */
-public abstract class AbstractJavassistMethodAndFieldFactoryTest extends AbstractJavassistMemberFactoryTest
+public abstract class AbstractJavassistMethodAndFieldFactoryTest extends AbstractJavassistMethodFactoryTest
 {
    public AbstractJavassistMethodAndFieldFactoryTest(String name, boolean isPrimitive)
    {
       super(name, isPrimitive);
    }
 
-   //Test methods
-   
-   public void testNoParamsNoReturnMethod() throws Throwable
-   {
-      JavassistMethod m = createMethod(getClazz(), "noReturnNoParams");
-      m.invoke(createInstance(), null);  
-   }
-
-   public void testNoParamsNoReturnMethodEmptyParameters() throws Throwable
-   {
-      JavassistMethod m = createMethod(getClazz(), "noReturnNoParams");
-      m.invoke(createInstance(), new Object[0]);  
-   }
-   
-   public void testNoParamsNoReturnMethodWithTooManyParametersError() throws Throwable
-   {
-      JavassistMethod m = createMethod(getClazz(), "noReturnNoParams");
-      checkWrongParameters(m, createInstance(), new Object[] {new Object()});
-   }
-   
-   public void testObjectMethod() throws Throwable
-   {
-      JavassistMethod m = createMethod(getClazz(), "objectMethod", Object.class);
-      Object p1 = new Object();
-      Object ret = m.invoke(createInstance(), new Object[] {p1});
-      assertSame(ret, p1);
-   }
-
-   public void testObjectMethodWithNullParameters() throws Throwable
-   {
-      JavassistMethod m = createMethod(getClazz(), "noReturnNoParams");
-      checkWrongParameters(m, createInstance(), null);
-   }
-
-   public void testObjectMethodWithEmptyParameters() throws Throwable
-   {
-      JavassistMethod m = createMethod(getClazz(), "noReturnNoParams");
-      checkWrongParameters(m, createInstance(), new Object[0]);
-   }
-
-   public void testObjectMethodWithTooManyParameters() throws Throwable
-   {
-      JavassistMethod m = createMethod(getClazz(), "noReturnNoParams");
-      checkWrongParameters(m, createInstance(), new Object[] {new Object(), new Object()});
-   }
-
-   public void testSimpleBooleanMethod() throws Throwable
-   {
-      testSimplePrimitiveMethod(createMethod(getClazz(), "booleanMethod", Boolean.class), Boolean.TRUE);
-   }
-   
-   public void testSimpleByteMethod() throws Throwable
-   {
-      testSimplePrimitiveMethod(createMethod(getClazz(), "byteMethod", Byte.class), Byte.valueOf((byte)1));
-   }
-   
-   public void testSimpleCharMethod() throws Throwable
-   {
-      testSimplePrimitiveMethod(createMethod(getClazz(), "charMethod", Character.class), Character.valueOf('a'));
-   }
-   
-   public void testSimpleDoubleMethod() throws Throwable
-   {
-      testSimplePrimitiveMethod(createMethod(getClazz(), "doubleMethod", Double.class), Double.valueOf(2));
-   }
-   
-   public void testSimpleFloatMethod() throws Throwable
-   {
-      testSimplePrimitiveMethod(createMethod(getClazz(), "floatMethod", Float.class), Float.valueOf(3));
-   }
-   
-   public void testSimpleIntMethod() throws Throwable
-   {
-      testSimplePrimitiveMethod(createMethod(getClazz(), "intMethod", Integer.class), Integer.valueOf(4));
-   }
-   
-   public void testSimpleLongMethod() throws Throwable
-   {
-      testSimplePrimitiveMethod(createMethod(getClazz(), "longMethod", Long.class), Long.valueOf(4));
-   }
-   
-   public void testSimpleShortMethod() throws Throwable
-   {
-      testSimplePrimitiveMethod(createMethod(getClazz(), "shortMethod", Short.class), Short.valueOf((short)4));
-   }
-   
-   protected void testSimplePrimitiveMethod(JavassistMethod method, Object goodParam) throws Throwable
-   {
-      Object target = createInstance();
-      checkWrongParameters(method, target, new Object[] {"Not a primitive"});
-      checkWrongParameters(method, target, new Object[] {null});
-      checkWrongParameters(method, target, new Object[0]);
-      checkWrongParameters(method, target, new Object[] {goodParam, goodParam});
-      if (isPrimitive)
-         checkWrongParameters(method, target, new Object[] {null});
-      else
-         assertNull(method.invoke(target, new Object[] {null}));
-
-      assertEquals(goodParam, method.invoke(target, new Object[] {goodParam}));
-   }
-
-   public void testBigMethod() throws Throwable
-   {
-      Object target = createInstance();
-      JavassistMethod method = createMethod(getClazz(), "bigMethod", new Class[] {String.class, Boolean.class, Byte.class, Character.class});
-      checkWrongParameters(method, target, new Object[] {Integer.valueOf(1)});
-      checkWrongParameters(method, target, new Object[] {"Test"});
-      checkWrongParameters(method, target, new Object[] {"Test", Boolean.TRUE});
-      checkWrongParameters(method, target, new Object[] {"Test", Boolean.TRUE, Byte.valueOf((byte)1)});
-      checkWrongParameters(method, target, new Object[] {"Test", Boolean.TRUE, Byte.valueOf((byte)1), Integer.valueOf(5)});
-      assertEquals("Test", method.invoke(target, new Object[] {"Test", Boolean.TRUE, Byte.valueOf((byte)1), Character.valueOf('a')}));
-      checkWrongParameters(method, target, new Object[] {"Test", Boolean.TRUE, Byte.valueOf((byte)1), Character.valueOf('a'), null});
-   }
-   
    //Test fields
    
    public void testObjectField() throws Throwable
@@ -225,18 +111,6 @@
          assertSame(goodParam, field.get(target));
    }
    
-   public void checkWrongParameters(JavassistMethod m, Object bean, Object[] params) throws Throwable
-   {
-      try
-      {
-         m.invoke(bean, new Object[] {new Object()});
-         fail("Should have picked up too many parameters");
-      }
-      catch (Exception expected)
-      {
-      }  
-   }
-
    public void checkWrongParameter(JavassistField f, Object bean, Object param) throws Throwable
    {
       try
@@ -249,8 +123,5 @@
       }  
    }
    
-   protected abstract Class<?> getClazz();
-   
-   protected abstract Object createInstance();
 
 }

Added: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/AbstractJavassistMethodFactoryTest.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/AbstractJavassistMethodFactoryTest.java	                        (rev 0)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/AbstractJavassistMethodFactoryTest.java	2010-03-25 11:11:34 UTC (rev 102953)
@@ -0,0 +1,166 @@
+/*
+* 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.plugins.javassist.bytecode.test;
+
+import org.jboss.reflect.plugins.javassist.JavassistMethod;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractJavassistMethodFactoryTest extends AbstractJavassistMemberFactoryTest
+{
+
+   public AbstractJavassistMethodFactoryTest(String name, boolean isPrimitive)
+   {
+      super(name, isPrimitive);
+   }
+
+   public void testNoParamsNoReturnMethod() throws Throwable
+   {
+      JavassistMethod m = createMethod(getClazz(), "noReturnNoParams");
+      m.invoke(createInstance(), null);  
+   }
+
+   public void testNoParamsNoReturnMethodEmptyParameters() throws Throwable
+   {
+      JavassistMethod m = createMethod(getClazz(), "noReturnNoParams");
+      m.invoke(createInstance(), new Object[0]);  
+   }
+   
+   public void testNoParamsNoReturnMethodWithTooManyParametersError() throws Throwable
+   {
+      JavassistMethod m = createMethod(getClazz(), "noReturnNoParams");
+      checkWrongParameters(m, createInstance(), new Object[] {new Object()});
+   }
+   
+   public void testObjectMethod() throws Throwable
+   {
+      JavassistMethod m = createMethod(getClazz(), "objectMethod", Object.class);
+      Object p1 = new Object();
+      Object ret = m.invoke(createInstance(), new Object[] {p1});
+      assertSame(ret, p1);
+   }
+
+   public void testObjectMethodWithNullParameters() throws Throwable
+   {
+      JavassistMethod m = createMethod(getClazz(), "noReturnNoParams");
+      checkWrongParameters(m, createInstance(), null);
+   }
+
+   public void testObjectMethodWithEmptyParameters() throws Throwable
+   {
+      JavassistMethod m = createMethod(getClazz(), "noReturnNoParams");
+      checkWrongParameters(m, createInstance(), new Object[0]);
+   }
+
+   public void testObjectMethodWithTooManyParameters() throws Throwable
+   {
+      JavassistMethod m = createMethod(getClazz(), "noReturnNoParams");
+      checkWrongParameters(m, createInstance(), new Object[] {new Object(), new Object()});
+   }
+
+   public void testSimpleBooleanMethod() throws Throwable
+   {
+      testSimplePrimitiveMethod(createMethod(getClazz(), "booleanMethod", Boolean.class), Boolean.TRUE);
+   }
+   
+   public void testSimpleByteMethod() throws Throwable
+   {
+      testSimplePrimitiveMethod(createMethod(getClazz(), "byteMethod", Byte.class), Byte.valueOf((byte)1));
+   }
+   
+   public void testSimpleCharMethod() throws Throwable
+   {
+      testSimplePrimitiveMethod(createMethod(getClazz(), "charMethod", Character.class), Character.valueOf('a'));
+   }
+   
+   public void testSimpleDoubleMethod() throws Throwable
+   {
+      testSimplePrimitiveMethod(createMethod(getClazz(), "doubleMethod", Double.class), Double.valueOf(2));
+   }
+   
+   public void testSimpleFloatMethod() throws Throwable
+   {
+      testSimplePrimitiveMethod(createMethod(getClazz(), "floatMethod", Float.class), Float.valueOf(3));
+   }
+   
+   public void testSimpleIntMethod() throws Throwable
+   {
+      testSimplePrimitiveMethod(createMethod(getClazz(), "intMethod", Integer.class), Integer.valueOf(4));
+   }
+   
+   public void testSimpleLongMethod() throws Throwable
+   {
+      testSimplePrimitiveMethod(createMethod(getClazz(), "longMethod", Long.class), Long.valueOf(4));
+   }
+   
+   public void testSimpleShortMethod() throws Throwable
+   {
+      testSimplePrimitiveMethod(createMethod(getClazz(), "shortMethod", Short.class), Short.valueOf((short)4));
+   }
+   
+   protected void testSimplePrimitiveMethod(JavassistMethod method, Object goodParam) throws Throwable
+   {
+      Object target = createInstance();
+      checkWrongParameters(method, target, new Object[] {"Not a primitive"});
+      checkWrongParameters(method, target, new Object[] {null});
+      checkWrongParameters(method, target, new Object[0]);
+      checkWrongParameters(method, target, new Object[] {goodParam, goodParam});
+      if (isPrimitive)
+         checkWrongParameters(method, target, new Object[] {null});
+      else
+         assertNull(method.invoke(target, new Object[] {null}));
+
+      assertEquals(goodParam, method.invoke(target, new Object[] {goodParam}));
+   }
+
+   public void testBigMethod() throws Throwable
+   {
+      Object target = createInstance();
+      JavassistMethod method = createMethod(getClazz(), "bigMethod", new Class[] {String.class, Boolean.class, Byte.class, Character.class});
+      checkWrongParameters(method, target, new Object[] {Integer.valueOf(1)});
+      checkWrongParameters(method, target, new Object[] {"Test"});
+      checkWrongParameters(method, target, new Object[] {"Test", Boolean.TRUE});
+      checkWrongParameters(method, target, new Object[] {"Test", Boolean.TRUE, Byte.valueOf((byte)1)});
+      checkWrongParameters(method, target, new Object[] {"Test", Boolean.TRUE, Byte.valueOf((byte)1), Integer.valueOf(5)});
+      assertEquals("Test", method.invoke(target, new Object[] {"Test", Boolean.TRUE, Byte.valueOf((byte)1), Character.valueOf('a')}));
+      checkWrongParameters(method, target, new Object[] {"Test", Boolean.TRUE, Byte.valueOf((byte)1), Character.valueOf('a'), null});
+   }
+   
+   protected void checkWrongParameters(JavassistMethod m, Object bean, Object[] params) throws Throwable
+   {
+      try
+      {
+         m.invoke(bean, new Object[] {new Object()});
+         fail("Should have picked up too many parameters");
+      }
+      catch (Exception expected)
+      {
+      }  
+   }
+
+   protected abstract Class<?> getClazz();
+   
+   protected abstract Object createInstance();
+}

Added: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/JavassistMemberFactoryBoxedInterfaceUnitTestCase.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/JavassistMemberFactoryBoxedInterfaceUnitTestCase.java	                        (rev 0)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/JavassistMemberFactoryBoxedInterfaceUnitTestCase.java	2010-03-25 11:11:34 UTC (rev 102953)
@@ -0,0 +1,57 @@
+/*
+* 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.plugins.javassist.bytecode.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.plugins.javassist.bytecode.support.BoxedInterface;
+import org.jboss.test.plugins.javassist.bytecode.support.PublicBoxedBean;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class JavassistMemberFactoryBoxedInterfaceUnitTestCase extends AbstractJavassistMethodFactoryTest
+{
+   public static Test suite()
+   {
+      return suite(JavassistMemberFactoryBoxedInterfaceUnitTestCase.class);
+   }
+
+   public JavassistMemberFactoryBoxedInterfaceUnitTestCase(String name)
+   {
+      super(name, false);
+   }
+
+   @Override
+   protected Object createInstance()
+   {
+      return new PublicBoxedBean();
+   }
+
+   @Override
+   protected Class<?> getClazz()
+   {
+      return BoxedInterface.class;
+   }
+}

Added: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/JavassistMemberFactoryPrimitiveInterfaceUnitTestCase.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/JavassistMemberFactoryPrimitiveInterfaceUnitTestCase.java	                        (rev 0)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/JavassistMemberFactoryPrimitiveInterfaceUnitTestCase.java	2010-03-25 11:11:34 UTC (rev 102953)
@@ -0,0 +1,57 @@
+/*
+* 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.plugins.javassist.bytecode.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.plugins.javassist.bytecode.support.PrimitiveInterface;
+import org.jboss.test.plugins.javassist.bytecode.support.PublicPrimitiveBean;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class JavassistMemberFactoryPrimitiveInterfaceUnitTestCase extends AbstractJavassistMethodFactoryTest
+{
+   public static Test suite()
+   {
+      return suite(JavassistMemberFactoryPrimitiveInterfaceUnitTestCase.class);
+   }
+
+   public JavassistMemberFactoryPrimitiveInterfaceUnitTestCase(String name)
+   {
+      super(name, true);
+   }
+
+   @Override
+   protected Object createInstance()
+   {
+      return new PublicPrimitiveBean();
+   }
+
+   @Override
+   protected Class<?> getClazz()
+   {
+      return PrimitiveInterface.class;
+   }
+}

Modified: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/JavassistMemberFactoryTestSuite.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/JavassistMemberFactoryTestSuite.java	2010-03-25 10:47:37 UTC (rev 102952)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/plugins/javassist/bytecode/test/JavassistMemberFactoryTestSuite.java	2010-03-25 11:11:34 UTC (rev 102953)
@@ -61,6 +61,9 @@
       suite.addTest(JavassistMemberFactoryPrivateStaticBoxedUnitTestCase.suite());
       suite.addTest(JavassistMemberFactoryPrivateStaticPrimitiveUnitTestCase.suite());
       
+      suite.addTest(JavassistMemberFactoryPrimitiveInterfaceUnitTestCase.suite());
+      suite.addTest(JavassistMemberFactoryBoxedInterfaceUnitTestCase.suite());
+      
       suite.addTest(JavassistMemberFactoryArrayUnitTestCase.suite());
       
       return suite;




More information about the jboss-cvs-commits mailing list