[Jboss-cvs] JBossAS SVN: r56854 - in trunk/testsuite/src: main/org/jboss/test/aop/scopedextender main/org/jboss/test/aop/test resources/aop/scopedextender/base/META-INF

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Sep 14 12:26:26 EDT 2006


Author: kabir.khan at jboss.com
Date: 2006-09-14 12:26:18 -0400 (Thu, 14 Sep 2006)
New Revision: 56854

Added:
   trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BasePerClassInterceptor.java
   trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BasePerClassJoinPointInterceptor.java
   trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BasePerInstanceInterceptor.java
   trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BasePerJoinPointInterceptor.java
Modified:
   trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BaseLoadedTester.java
   trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BaseNotLoadedTester.java
   trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/Base_Base.java
   trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/ScopedChildNoParentDelegationTester.java
   trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/ScopedChildParentDelegationTester.java
   trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/TestUtil.java
   trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/TesterMBean.java
   trunk/testsuite/src/main/org/jboss/test/aop/test/ScopedExtenderBaseTest.java
   trunk/testsuite/src/resources/aop/scopedextender/base/META-INF/jboss-aop.xml
Log:
[JBAOP-257] More tests for subclasses in a deployment using scoped classloaders extending classes deployed in the global classloading domain.

Make sure that when overriding aspect classes in the scoped child domain, that the correct aspect instance is used.


Modified: trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BaseLoadedTester.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BaseLoadedTester.java	2006-09-14 15:59:00 UTC (rev 56853)
+++ trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BaseLoadedTester.java	2006-09-14 16:26:18 UTC (rev 56854)
@@ -50,24 +50,24 @@
          System.out.println("=============== BaseLoadedTester - METHOD ================");
          Base_Base base = new Base_Base();
          
-         BaseAspect.invoked.clear();
+         clear();
          base.base();
          String m = "Base_Base.base";
          testUtil.compare(m, "BaseAspect", new String[]{"base"}, BaseAspect.invoked);
          
-         BaseAspect.invoked.clear();
+         clear();
          base.overridden();
          m = "Base_Base.overridden";
          testUtil.compare(m, "BaseAspect", new String[] {"overridden"}, BaseAspect.invoked);
          
          Base_A1 a1 = new Base_A1();
 
-         BaseAspect.invoked.clear();
+         clear();
          a1.a1();
          m = "Base_A1.a1";
          testUtil.compare(m, "BaseAspect", new String[]{"a1", "base"}, BaseAspect.invoked);
          
-         BaseAspect.invoked.clear();
+         clear();
          a1.overridden();
          m = "Base_A1.overridden";
          testUtil.compare(m, "BaseAspect", new String[] {"overridden"}, BaseAspect.invoked);
@@ -97,11 +97,11 @@
       {
          System.out.println("=============== BaseLoadedTester - CTOR ================");
          
-         BaseAspect.invoked.clear();
+         clear();
          Base_Base base = new Base_Base();
          testUtil.compare(base.getClass().getName(), "BaseAspect", new String[]{base.getClass().getName()}, BaseAspect.invoked);
          
-         BaseAspect.invoked.clear();
+         clear();
          Base_A1 a1 = new Base_A1();
          testUtil.compare(a1.getClass().getName(), "BaseAspect", new String[]{a1.getClass().getName()}, BaseAspect.invoked);
       }
@@ -128,24 +128,24 @@
          System.out.println("=============== BaseLoadedTester - FIELD ================");
          Base_Base base = new Base_Base();
          
-         BaseAspect.invoked.clear();
+         clear();
          base.base = 5;
          String m = "Base_Base.base";
          testUtil.compare(m, "BaseAspect", new String[]{"base"}, BaseAspect.invoked);
          
-         BaseAspect.invoked.clear();
+         clear();
          testUtil.compare(5, base.base);
          testUtil.compare(m, "BaseAspect", new String[]{"base"}, BaseAspect.invoked);
          
          
          Base_A1 a1 = new Base_A1();
 
-         BaseAspect.invoked.clear();
+         clear();
          a1.a1 = 10;
          m = "Base_A1.a1";
          testUtil.compare(m, "BaseAspect", new String[]{"a1"}, BaseAspect.invoked);
 
-         BaseAspect.invoked.clear();
+         clear();
          testUtil.compare(10, a1.a1);
          testUtil.compare(m, "BaseAspect", new String[]{"a1"}, BaseAspect.invoked);
       }
@@ -164,11 +164,43 @@
       {
          throw new RuntimeException("BaseNotBaseWoven should not be woven");
       }
-}
+   }
 
+
+   public void testOverriddenInterceptors() throws Exception
+   {
+      //Not really a test per se, the real test is in the ScopedChildNoParentDelegationTester, when deployed along with this base loaded sar
+      System.out.println("=============== BaseLoadedTester - TEST OVERRIDDEN INTERCEPTORS ================");
+      TestUtil testUtil = new TestUtil();
+      
+      Base_Base base = new Base_Base();
+      
+      clear();
+      base.differentScopes();
+      String m = "differentScopes";
+      testUtil.compare(m, "BaseAspect", new String[]{"differentScopes"}, BaseAspect.invoked);
+      testUtil.invoked(BasePerClassInterceptor.class);
+      testUtil.invoked(BasePerInstanceInterceptor.class);
+      testUtil.invoked(BasePerJoinPointInterceptor.class);
+      testUtil.invoked(BasePerClassJoinPointInterceptor.class);
+      
+      if (testUtil.getErrors() != null)
+      {
+         throw new RuntimeException(testUtil.getErrors());
+      }
+   }
+
    public String readName()
    {
       return "BaseLoadedTester";
    }
 
+   private void clear()
+   {
+      BaseAspect.invoked.clear();
+      BasePerClassInterceptor.invoked = false;
+      BasePerInstanceInterceptor.invoked = false;
+      BasePerJoinPointInterceptor.invoked = false;
+      BasePerClassJoinPointInterceptor.invoked = false;
+   }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BaseNotLoadedTester.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BaseNotLoadedTester.java	2006-09-14 15:59:00 UTC (rev 56853)
+++ trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BaseNotLoadedTester.java	2006-09-14 16:26:18 UTC (rev 56854)
@@ -76,5 +76,10 @@
    {
       return "BaseNotLoadedTester";
    }
+
+   public void testOverriddenInterceptors() throws Exception
+   {
+      System.out.println("=============== BaseNotLoadedTester - TEST OVERRIDDEN INTERCEPTORS ================");
+   }
    
 }

Added: trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BasePerClassInterceptor.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BasePerClassInterceptor.java	2006-09-14 15:59:00 UTC (rev 56853)
+++ trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BasePerClassInterceptor.java	2006-09-14 16:26:18 UTC (rev 56854)
@@ -0,0 +1,46 @@
+/*
+* 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.scopedextender;
+
+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 BasePerClassInterceptor implements Interceptor
+{
+   public static boolean invoked;
+   public String getName()
+   {
+      return this.getClass().getName();
+   }
+
+   public Object invoke(Invocation invocation) throws Throwable
+   {
+      invoked = true;
+      return invocation.invokeNext();
+   }
+
+}

Added: trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BasePerClassJoinPointInterceptor.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BasePerClassJoinPointInterceptor.java	2006-09-14 15:59:00 UTC (rev 56853)
+++ trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BasePerClassJoinPointInterceptor.java	2006-09-14 16:26:18 UTC (rev 56854)
@@ -0,0 +1,45 @@
+/*
+* 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.scopedextender;
+
+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 BasePerClassJoinPointInterceptor implements Interceptor
+{
+   public static boolean invoked;
+   public String getName()
+   {
+      return this.getClass().getName();
+   }
+
+   public Object invoke(Invocation invocation) throws Throwable
+   {
+      invoked = true;
+      return invocation.invokeNext();
+   }
+}

Added: trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BasePerInstanceInterceptor.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BasePerInstanceInterceptor.java	2006-09-14 15:59:00 UTC (rev 56853)
+++ trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BasePerInstanceInterceptor.java	2006-09-14 16:26:18 UTC (rev 56854)
@@ -0,0 +1,45 @@
+/*
+* 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.scopedextender;
+
+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 BasePerInstanceInterceptor implements Interceptor
+{
+   public static boolean invoked;
+   public String getName()
+   {
+      return this.getClass().getName();
+   }
+
+   public Object invoke(Invocation invocation) throws Throwable
+   {
+      invoked = true;
+      return invocation.invokeNext();
+   }
+}

Added: trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BasePerJoinPointInterceptor.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BasePerJoinPointInterceptor.java	2006-09-14 15:59:00 UTC (rev 56853)
+++ trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/BasePerJoinPointInterceptor.java	2006-09-14 16:26:18 UTC (rev 56854)
@@ -0,0 +1,45 @@
+/*
+* 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.scopedextender;
+
+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 BasePerJoinPointInterceptor implements Interceptor
+{
+   public static boolean invoked;
+   public String getName()
+   {
+      return this.getClass().getName();
+   }
+
+   public Object invoke(Invocation invocation) throws Throwable
+   {
+      invoked = true;
+      return invocation.invokeNext();
+   }
+}

Modified: trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/Base_Base.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/Base_Base.java	2006-09-14 15:59:00 UTC (rev 56853)
+++ trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/Base_Base.java	2006-09-14 16:26:18 UTC (rev 56854)
@@ -38,4 +38,9 @@
    {
       
    }
+   
+   public void differentScopes()
+   {
+      
+   }
  }
\ No newline at end of file

Modified: trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/ScopedChildNoParentDelegationTester.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/ScopedChildNoParentDelegationTester.java	2006-09-14 15:59:00 UTC (rev 56853)
+++ trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/ScopedChildNoParentDelegationTester.java	2006-09-14 16:26:18 UTC (rev 56854)
@@ -422,6 +422,29 @@
       }
    }
 
+   public void testOverriddenInterceptors() throws Exception
+   {
+      //This makes sure that we get the correct overridden aspect instances loaded
+      System.out.println("=============== ScopedChildNoParentDelegationTester - TEST OVERRIDDEN INTERCEPTORS ================");
+      TestUtil testUtil = new TestUtil();
+      
+      Base_Base base = new Base_Base();
+      
+      clear();
+      base.differentScopes();
+      String m = "differentScopes";
+      testUtil.compare(m, "BaseAspect", new String[]{"differentScopes"}, BaseAspect.invoked);
+      testUtil.invoked(BasePerClassInterceptor.class);
+      testUtil.invoked(BasePerInstanceInterceptor.class);
+      testUtil.invoked(BasePerJoinPointInterceptor.class);
+      testUtil.invoked(BasePerClassJoinPointInterceptor.class);
+      
+      if (testUtil.getErrors() != null)
+      {
+         throw new RuntimeException(testUtil.getErrors());
+      }
+   }
+
    public String readName()
    {
       return "ScopedChildNoParentDelegationTester";
@@ -432,6 +455,10 @@
       BaseAspect.invoked.clear();
       ChildAspect.invoked.clear();
       BaseParentAspect.invoked.clear();
+      BasePerClassInterceptor.invoked = false;
+      BasePerInstanceInterceptor.invoked = false;
+      BasePerJoinPointInterceptor.invoked = false;
+      BasePerClassJoinPointInterceptor.invoked = false;
    }
 
 }

Modified: trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/ScopedChildParentDelegationTester.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/ScopedChildParentDelegationTester.java	2006-09-14 15:59:00 UTC (rev 56853)
+++ trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/ScopedChildParentDelegationTester.java	2006-09-14 16:26:18 UTC (rev 56854)
@@ -235,7 +235,7 @@
    public void testField() throws Exception
    {
       TestUtil testUtil = new TestUtil();
-      System.out.println("=============== ScopedChildNoParentDelegationTester - FIELD ================");
+      System.out.println("=============== ScopedChildParentDelegationTester - FIELD ================");
       Child_A3 a3 = new Child_A3();
       
       clear();
@@ -398,6 +398,29 @@
       }   
    }
 
+   public void testOverriddenInterceptors() throws Exception
+   {
+      //Not really a test per se, the real test is in the ScopedChildNoParentDelegationTester, when deployed along with the base loaded sar
+      System.out.println("=============== ScopedChildParentDelegationTester - TEST OVERRIDDEN INTERCEPTORS ================");
+      TestUtil testUtil = new TestUtil();
+      
+      Base_Base base = new Base_Base();
+      
+      clear();
+      base.differentScopes();
+      String m = "differentScopes";
+      testUtil.compare(m, "BaseAspect", new String[]{"differentScopes"}, BaseAspect.invoked);
+      testUtil.invoked(BasePerClassInterceptor.class);
+      testUtil.invoked(BasePerInstanceInterceptor.class);
+      testUtil.invoked(BasePerJoinPointInterceptor.class);
+      testUtil.invoked(BasePerClassJoinPointInterceptor.class);
+      
+      if (testUtil.getErrors() != null)
+      {
+         throw new RuntimeException(testUtil.getErrors());
+      }
+   }
+
    public String readName()
    {
       return "ScopedChildParentDelegationTester";
@@ -408,5 +431,10 @@
       BaseAspect.invoked.clear();
       ChildAspect.invoked.clear();
       BaseParentAspect.invoked.clear();
+      BasePerClassInterceptor.invoked = false;
+      BasePerInstanceInterceptor.invoked = false;
+      BasePerJoinPointInterceptor.invoked = false;
+      BasePerClassJoinPointInterceptor.invoked = false;
+
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/TestUtil.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/TestUtil.java	2006-09-14 15:59:00 UTC (rev 56853)
+++ trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/TestUtil.java	2006-09-14 16:26:18 UTC (rev 56854)
@@ -25,6 +25,8 @@
 import java.util.Arrays;
 import java.util.List;
 
+import org.jboss.aop.advice.Interceptor;
+
 /**
  * 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
@@ -34,6 +36,31 @@
 {
    StringBuffer errors;
    
+   public void invoked(Class interceptor)
+   {
+      boolean intercepted = false;
+      if (interceptor == BasePerClassInterceptor.class)
+      {
+         intercepted = BasePerClassInterceptor.invoked;
+      }
+      else if (interceptor == BasePerInstanceInterceptor.class)
+      {
+         intercepted = BasePerInstanceInterceptor.invoked;
+      }
+      else if (interceptor == BasePerJoinPointInterceptor.class)
+      {
+         intercepted = BasePerJoinPointInterceptor.invoked;
+      }
+      else if (interceptor == BasePerClassJoinPointInterceptor.class)
+      {
+         intercepted = BasePerClassJoinPointInterceptor.invoked;         
+      }
+      
+      if (!intercepted)
+      {
+         throw new RuntimeException(interceptor.getClass().getName() + " did not intercept");
+      }
+   }
    public void compare(int expected, int actual)
    {
       if (expected != actual) throw new RuntimeException("Expected " + expected + " but was " + actual);

Modified: trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/TesterMBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/TesterMBean.java	2006-09-14 15:59:00 UTC (rev 56853)
+++ trunk/testsuite/src/main/org/jboss/test/aop/scopedextender/TesterMBean.java	2006-09-14 16:26:18 UTC (rev 56854)
@@ -37,4 +37,6 @@
    void testField() throws Exception;
    
    void testConstructor() throws Exception;
+   
+   void testOverriddenInterceptors() throws Exception;
 }

Modified: trunk/testsuite/src/main/org/jboss/test/aop/test/ScopedExtenderBaseTest.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/test/ScopedExtenderBaseTest.java	2006-09-14 15:59:00 UTC (rev 56853)
+++ trunk/testsuite/src/main/org/jboss/test/aop/test/ScopedExtenderBaseTest.java	2006-09-14 16:26:18 UTC (rev 56854)
@@ -54,44 +54,34 @@
       assertEquals(getExpectedChildName(), name);
    }
    
-   public void testBaseLoaders() throws Exception
+   public void testLoaders() throws Exception
    {
       invokeTestClassLoaders(BASE_NAME);
-   }
-   
-   public void testChildLoaders() throws Exception
-   {
       invokeTestClassLoaders(CHILD_NAME);
    }
    
-   public void testBaseMethod() throws Exception
+   public void testMethod() throws Exception
    {
       invokeMethodTest(BASE_NAME);
-   }
-   
-   public void testChildMethod() throws Exception
-   {
       invokeMethodTest(CHILD_NAME);
    }
    
-   public void testBaseField() throws Exception
+   public void testField() throws Exception
    {
       invokeFieldTest(BASE_NAME);
-   }
-   
-   public void testChildField() throws Exception
-   {
       invokeFieldTest(CHILD_NAME);
    }
    
-   public void testBaseConstructor() throws Exception
+   public void testConstructor() throws Exception
    {
       invokeConstructorTest(BASE_NAME);
+      invokeConstructorTest(CHILD_NAME);
    }
    
-   public void testChildConstructor() throws Exception
+   public void testDifferentScopes() throws Exception
    {
-      invokeConstructorTest(CHILD_NAME);
+      invokeOverriddenInterceptorsTest(BASE_NAME);
+      invokeOverriddenInterceptorsTest(CHILD_NAME);
    }
    
    private void invokeMethodTest(String objName) throws Exception
@@ -119,6 +109,11 @@
       invoke(objName, "testLoaders");
    }
    
+   private void invokeOverriddenInterceptorsTest(String objName) throws Exception
+   {
+      invoke(objName, "testOverriddenInterceptors");
+   }
+   
    private Object invoke(String objName, String method) throws Exception
    {
       ObjectName testerName = new ObjectName(objName);

Modified: trunk/testsuite/src/resources/aop/scopedextender/base/META-INF/jboss-aop.xml
===================================================================
--- trunk/testsuite/src/resources/aop/scopedextender/base/META-INF/jboss-aop.xml	2006-09-14 15:59:00 UTC (rev 56853)
+++ trunk/testsuite/src/resources/aop/scopedextender/base/META-INF/jboss-aop.xml	2006-09-14 16:26:18 UTC (rev 56854)
@@ -6,6 +6,10 @@
 
 <aop>
    <aspect class="org.jboss.test.aop.scopedextender.BaseAspect"/>
+   <interceptor name="class" class="org.jboss.test.aop.scopedextender.BasePerClassInterceptor" scope="PER_CLASS"/>
+   <interceptor name="instance" class="org.jboss.test.aop.scopedextender.BasePerInstanceInterceptor" scope="PER_INSTANCE"/>
+   <interceptor name="joinpoint" class="org.jboss.test.aop.scopedextender.BasePerJoinPointInterceptor" scope="PER_JOINPOINT"/>
+   <interceptor name="classjoinpoint" class="org.jboss.test.aop.scopedextender.BasePerClassJoinPointInterceptor" scope="PER_CLASS_JOINPOINT"/>
    
    <bind pointcut="execution(* $instanceof{org.jboss.test.aop.scopedextender.Base_Base}->*(..))">
       <advice aspect="org.jboss.test.aop.scopedextender.BaseAspect" name="invoke"/>
@@ -16,5 +20,11 @@
    <bind pointcut="execution($instanceof{org.jboss.test.aop.scopedextender.Base_Base}->new(..))">
       <advice aspect="org.jboss.test.aop.scopedextender.BaseAspect" name="invoke"/>
    </bind>
+   <bind pointcut="execution(* org.jboss.test.aop.scopedextender.Base_Base->differentScopes())">
+   	<interceptor-ref name="class"/>
+   	<interceptor-ref name="instance"/>
+   	<interceptor-ref name="joinpoint"/>
+   	<interceptor-ref name="classjoinpoint"/>
+   </bind>
    
 </aop>




More information about the jboss-cvs-commits mailing list