[jboss-cvs] JBossAS SVN: r63474 - in projects/aop/trunk/aop/src: test/org/jboss/test/aop/beforeafterArgs and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jun 12 10:27:01 EDT 2007


Author: flavia.rainone at jboss.com
Date: 2007-06-12 10:27:00 -0400 (Tue, 12 Jun 2007)
New Revision: 63474

Modified:
   projects/aop/trunk/aop/src/resources/test/beforeafterArgs/jboss-aop.xml
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/JoinPointAspect.java
Log:
[JBAOP-373] Added some tests to assure that the user is not allowed to use info classes.

Modified: projects/aop/trunk/aop/src/resources/test/beforeafterArgs/jboss-aop.xml
===================================================================
--- projects/aop/trunk/aop/src/resources/test/beforeafterArgs/jboss-aop.xml	2007-06-12 13:55:28 UTC (rev 63473)
+++ projects/aop/trunk/aop/src/resources/test/beforeafterArgs/jboss-aop.xml	2007-06-12 14:27:00 UTC (rev 63474)
@@ -347,12 +347,14 @@
 	<bind pointcut="field(* org.jboss.test.aop.beforeafterArgs.JoinPointPOJO->number)">
 		<before name="before1" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
 		<after name="after1" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
+      <before name="before9" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
    </bind>
 
 	<bind pointcut="set(* org.jboss.test.aop.beforeafterArgs.JoinPointPOJO->text)">
 		<before name="before2" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
 		<after name="after2" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
       <finally name="finally1" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
+      <after name="after8" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
    </bind>
 
 	<bind pointcut="get(* org.jboss.test.aop.beforeafterArgs.JoinPointPOJO->text)">
@@ -363,6 +365,7 @@
 	<bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.JoinPointPOJO->method1(..))">
     	<before name="before3" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
 		<after name="after3" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
+      <finally name="finally9" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
    </bind>
 
 	<bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.JoinPointPOJO->method2(..))">
@@ -404,6 +407,8 @@
       <after name="after5" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
       <throwing name="throwing7" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
       <finally name="finally6" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
+      <throwing name="throwing9" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
+      <throwing name="throwing10" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
    </bind>
 
    <bind pointcut="call(* org.jboss.test.aop.beforeafterArgs.JoinPointPOJO->*Method(boolean)) AND withincode(org.jboss.test.aop.beforeafterArgs.JoinPointPOJO->new(..))">
@@ -411,6 +416,8 @@
       <after name="after6" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
       <throwing name="throwing8" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
       <finally name="finally3" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
+      <throwing name="throwing9" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
+      <throwing name="throwing10" aspect="org.jboss.test.aop.beforeafterArgs.JoinPointAspect"/>
    </bind>
    
    <bind pointcut="call(* org.jboss.test.aop.beforeafterArgs.JoinPointPOJO->*Method(boolean)) AND withincode(public void org.jboss.test.aop.beforeafterArgs.JoinPointPOJO->*(..))">

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/JoinPointAspect.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/JoinPointAspect.java	2007-06-12 13:55:28 UTC (rev 63473)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/JoinPointAspect.java	2007-06-12 14:27:00 UTC (rev 63474)
@@ -23,6 +23,11 @@
 
 import junit.framework.Assert;
 
+import org.jboss.aop.CallerConstructorInfo;
+import org.jboss.aop.CallerMethodInfo;
+import org.jboss.aop.FieldInfo;
+import org.jboss.aop.JoinPointInfo;
+import org.jboss.aop.MethodInfo;
 import org.jboss.aop.advice.annotation.JoinPoint;
 import org.jboss.aop.advice.annotation.Thrown;
 import org.jboss.aop.joinpoint.Construction;
@@ -111,6 +116,11 @@
       beforeJoinPoint = joinPoint;
    }
    
+   public void before9(@JoinPoint FieldInfo joinPoint)
+   {
+      Assert.fail("This advice should never be executed");
+   }
+   
    public void after1(@JoinPoint FieldAccess joinPoint)
    {
       afterAdvice = "after1";
@@ -151,6 +161,11 @@
       afterJoinPoint = joinPoint;
    }
    
+   public void after8(@JoinPoint JoinPointInfo joinPoint)
+   {
+      Assert.fail("This advice should never be executed");
+   }
+   
    public void throwing1(@Thrown Throwable throwable, @JoinPoint Object joinPoint)
    {
       throwingAdvice = "throwing1";
@@ -200,6 +215,16 @@
       throwingJoinPoint = joinPoint;
    }
 
+   public void throwing9(@JoinPoint CallerConstructorInfo joinPoint, @Thrown Throwable throwable)
+   {
+      Assert.fail("This advice should never be executed");
+   }
+   
+   public void throwing10(@JoinPoint CallerMethodInfo joinPoint, @Thrown Throwable throwable)
+   {
+      Assert.fail("This advice should never be executed");
+   }
+   
    public void finally1(@JoinPoint FieldAccess joinPoint)
    {
       finallyAdvice = "finally1";
@@ -245,4 +270,9 @@
       finallyAdvice = "finally8";
       finallyJoinPoint = joinPoint;
    }
+   
+   public void finally9(@JoinPoint MethodInfo joinPoint)
+   {
+      Assert.fail("This advice should never be executed");
+   }
 }
\ No newline at end of file




More information about the jboss-cvs-commits mailing list