[jboss-cvs] JBossAS SVN: r79187 - in projects/aop/trunk/aop: src/resources/test and 5 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Oct 7 04:47:27 EDT 2008


Author: kabir.khan at jboss.com
Date: 2008-10-07 04:47:27 -0400 (Tue, 07 Oct 2008)
New Revision: 79187

Added:
   projects/aop/trunk/aop/src/resources/test/inheritanceacrosspackages/
   projects/aop/trunk/aop/src/resources/test/inheritanceacrosspackages/jboss-aop.xml
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/InheritanceAcrossPackagesTestCase.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/TestInterceptor.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/base/
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/base/Base.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/child/
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/child/Child.java
Modified:
   projects/aop/trunk/aop/base-tests.xml
Log:
[JBAOP-660] Add test to try to reproduce problem in JIRA. It passes

Modified: projects/aop/trunk/aop/base-tests.xml
===================================================================
--- projects/aop/trunk/aop/base-tests.xml	2008-10-07 08:46:33 UTC (rev 79186)
+++ projects/aop/trunk/aop/base-tests.xml	2008-10-07 08:47:27 UTC (rev 79187)
@@ -2,6 +2,9 @@
 
    <target name="_base-tests">
       <antcall target="${test-target}" inheritRefs="true">
+         <param name="test" value="inheritanceacrosspackages"/>
+      </antcall>
+      <antcall target="${test-target}" inheritRefs="true">
          <param name="test" value="annotationoverride"/>
       </antcall>
       <antcall target="${test-target}" inheritRefs="true">

Added: projects/aop/trunk/aop/src/resources/test/inheritanceacrosspackages/jboss-aop.xml
===================================================================
--- projects/aop/trunk/aop/src/resources/test/inheritanceacrosspackages/jboss-aop.xml	                        (rev 0)
+++ projects/aop/trunk/aop/src/resources/test/inheritanceacrosspackages/jboss-aop.xml	2008-10-07 08:47:27 UTC (rev 79187)
@@ -0,0 +1,11 @@
+<aop>
+   <interceptor class="org.jboss.test.aop.inheritanceacrosspackages.TestInterceptor"/>
+   
+   <bind pointcut="execution(* org.jboss.test.aop.inheritanceacrosspackages.base.Base->*(..))">
+      <interceptor-ref name="org.jboss.test.aop.inheritanceacrosspackages.TestInterceptor"/>
+   </bind>
+   
+   <bind pointcut="execution(* org.jboss.test.aop.inheritanceacrosspackages.child.Child->*(..))">
+      <interceptor-ref name="org.jboss.test.aop.inheritanceacrosspackages.TestInterceptor"/>
+   </bind>
+</aop>
\ No newline at end of file

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/InheritanceAcrossPackagesTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/InheritanceAcrossPackagesTestCase.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/InheritanceAcrossPackagesTestCase.java	2008-10-07 08:47:27 UTC (rev 79187)
@@ -0,0 +1,59 @@
+/*
+* 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.aop.inheritanceacrosspackages;
+
+import org.jboss.test.aop.AOPTestWithSetup;
+import org.jboss.test.aop.inheritanceacrosspackages.base.Base;
+import org.jboss.test.aop.inheritanceacrosspackages.child.Child;
+
+/**
+ * To test JBAOP-660
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class InheritanceAcrossPackagesTestCase extends AOPTestWithSetup
+{
+   public InheritanceAcrossPackagesTestCase(String arg0)
+   {
+      super(arg0);
+   }
+
+   public void testBaseClass() throws Exception
+   {
+      Base base = new Base();
+      TestInterceptor.intercepted = false;
+      base.base();
+      assertTrue(TestInterceptor.intercepted);
+   }
+
+   public void testChildClass() throws Exception
+   {
+      Child child = new Child();
+      TestInterceptor.intercepted = false;
+      child.base();
+      assertTrue(TestInterceptor.intercepted);
+      TestInterceptor.intercepted = false;
+      child.child();
+      assertTrue(TestInterceptor.intercepted);
+   }
+}
\ No newline at end of file

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/TestInterceptor.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/TestInterceptor.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/TestInterceptor.java	2008-10-07 08:47:27 UTC (rev 79187)
@@ -0,0 +1,47 @@
+/*
+* 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.aop.inheritanceacrosspackages;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestInterceptor implements Interceptor
+{
+   public static boolean intercepted;
+   
+   public String getName()
+   {
+      return this.getClass().getName();
+   }
+
+   public Object invoke(Invocation invocation) throws Throwable
+   {
+      intercepted = true;
+      return invocation.invokeNext();
+   }
+
+}

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/base/Base.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/base/Base.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/base/Base.java	2008-10-07 08:47:27 UTC (rev 79187)
@@ -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.aop.inheritanceacrosspackages.base;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class Base
+{
+   public void base()
+   {
+      
+   }
+}

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/child/Child.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/child/Child.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/inheritanceacrosspackages/child/Child.java	2008-10-07 08:47:27 UTC (rev 79187)
@@ -0,0 +1,37 @@
+/*
+* 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.aop.inheritanceacrosspackages.child;
+
+import org.jboss.test.aop.inheritanceacrosspackages.base.Base;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class Child extends Base
+{
+   public void child()
+   {
+      
+   }
+}




More information about the jboss-cvs-commits mailing list