[jboss-cvs] JBossAS SVN: r57725 - projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 19 06:19:42 EDT 2006


Author: stalep
Date: 2006-10-19 06:19:38 -0400 (Thu, 19 Oct 2006)
New Revision: 57725

Added:
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/SubPOJO.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/SubPOJOJDK14.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/SuperPOJO.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/SuperPOJOJDK14.java
Modified:
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/MethodOverrideTestCase.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/POJO.java
Log:
[JBAOP-255]
Added a few more tests to make sure that changes wont create
other bugs.

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/MethodOverrideTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/MethodOverrideTestCase.java	2006-10-19 04:56:39 UTC (rev 57724)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/MethodOverrideTestCase.java	2006-10-19 10:19:38 UTC (rev 57725)
@@ -73,5 +73,40 @@
       }
      
    }
+   
+   public void testGenericMethod()
+   {
+      try {
+         SuperPOJO superPojo = (SuperPOJO) ClassProxyFactory.newInstance(SubPOJO.class);
+//         java.util.AbstractList aList = new java.util.ArrayList();
+//         superPojo.foo(aList);
+//         SubPOJO subPojo = (SubPOJO) ClassProxyFactory.newInstance(SubPOJO.class);
+//         java.util.ArrayList aList = new java.util.ArrayList();
+//         subPojo.foo(aList);
+         assertTrue("ClassProxy failed to instrument generic class", true);
+      }
+      catch(Exception e)
+      {
+         System.out.println("ERROR: "+e.getMessage());
+         e.printStackTrace();
+         assertTrue("ClassProxy failed to instrument generic class", false);
+         
+      }
+   }
+   
+   public void testMethodOverride14()
+   {
+      try {
+         ClassProxyFactory.newInstance(SubPOJOJDK14.class);
+         assertTrue("ClassProxy failed to instrument jdk14 class", true);
+         }
+         catch(Exception e)
+         {
+            System.out.println("ERROR: "+e.getMessage());
+            e.printStackTrace();
+            assertTrue("ClassProxy failed to instrument jdk14 class", false);
+            
+         }
+   }
 
 }
\ No newline at end of file

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/POJO.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/POJO.java	2006-10-19 04:56:39 UTC (rev 57724)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/POJO.java	2006-10-19 10:19:38 UTC (rev 57725)
@@ -29,6 +29,8 @@
 public class POJO implements POJI
 {
    private String foo;
+   
+   public POJO() { }
 
    public POJO(String f)
    {

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/SubPOJO.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/SubPOJO.java	2006-10-19 04:56:39 UTC (rev 57724)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/SubPOJO.java	2006-10-19 10:19:38 UTC (rev 57725)
@@ -0,0 +1,43 @@
+/*
+  * 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.aop.methodoverride;
+
+/**
+ *
+ * @author <a href="mailto:stalep at conduct.no">Stale W. Pedersen</a>
+ * @version $Revision
+ */
+public class SubPOJO extends SuperPOJO<java.util.ArrayList>
+{
+   private java.util.ArrayList bar;
+   
+   public void setFoo(java.util.ArrayList a)
+   {
+      bar = a;
+   }
+   
+   public java.util.ArrayList getFoo()
+   {
+      return bar;
+   }
+
+}

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/SubPOJOJDK14.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/SubPOJOJDK14.java	2006-10-19 04:56:39 UTC (rev 57724)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/SubPOJOJDK14.java	2006-10-19 10:19:38 UTC (rev 57725)
@@ -0,0 +1,44 @@
+/*
+  * 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.aop.methodoverride;
+
+/**
+ *
+ * @author <a href="mailto:stalep at conduct.no">Stale W. Pedersen</a>
+ * @version $Revision
+ */
+public class SubPOJOJDK14 extends SuperPOJOJDK14
+{
+
+   private String bar;
+   
+   public void setFoo(String s)
+   {
+      bar = s;
+   }
+   
+   public String getFoo()
+   {
+      return bar;
+   }
+
+}

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/SuperPOJO.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/SuperPOJO.java	2006-10-19 04:56:39 UTC (rev 57724)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/SuperPOJO.java	2006-10-19 10:19:38 UTC (rev 57725)
@@ -0,0 +1,22 @@
+package org.jboss.test.aop.methodoverride;
+
+/**
+ *
+ * @author <a href="mailto:stalep at conduct.no">Stale W. Pedersen</a>
+ * @version $Revision
+ */
+public class SuperPOJO<T extends java.util.AbstractList>
+{
+   private T fooObject;
+   
+   public void setFoo(T arg)
+   {
+      fooObject = arg;
+   }
+   
+   public T getFoo()
+   {
+      return fooObject;
+   }
+
+}

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/SuperPOJOJDK14.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/SuperPOJOJDK14.java	2006-10-19 04:56:39 UTC (rev 57724)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/methodoverride/SuperPOJOJDK14.java	2006-10-19 10:19:38 UTC (rev 57725)
@@ -0,0 +1,42 @@
+/*
+  * 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.aop.methodoverride;
+
+/**
+ *
+ * @author <a href="mailto:stalep at conduct.no">Stale W. Pedersen</a>
+ * @version $Revision
+ */
+public class SuperPOJOJDK14
+{
+   private Object foo;
+   
+   public void setFoo(Object arg)
+   {
+      foo = arg;
+   }
+   
+   public Object getFoo()
+   {
+      return foo;
+   }
+}




More information about the jboss-cvs-commits mailing list