[jboss-cvs] JBossAS SVN: r63227 - 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
Mon May 28 14:59:21 EDT 2007
Author: flavia.rainone at jboss.com
Date: 2007-05-28 14:59:21 -0400 (Mon, 28 May 2007)
New Revision: 63227
Modified:
projects/aop/trunk/aop/src/resources/test/beforeafterArgs/jboss-aop.xml
projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/CallerTestCase.java
Log:
Added tests for @Call on joinpoints that don't have a caller available (joinpoints that are not of the type call)
Modified: projects/aop/trunk/aop/src/resources/test/beforeafterArgs/jboss-aop.xml
===================================================================
--- projects/aop/trunk/aop/src/resources/test/beforeafterArgs/jboss-aop.xml 2007-05-28 17:17:24 UTC (rev 63226)
+++ projects/aop/trunk/aop/src/resources/test/beforeafterArgs/jboss-aop.xml 2007-05-28 18:59:21 UTC (rev 63227)
@@ -284,6 +284,14 @@
<bind pointcut="call(void org.jboss.test.aop.beforeafterArgs.TargetCallerPOJO2->*())">
<stack-ref name="CallerAdvices"/>
</bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerPOJO->method1())">
+ <stack-ref name="CallerAdvices"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerPOJO->method3())">
+ <stack-ref name="CallerAdvices"/>
+ </bind>
<!-- @JoinPoint test -->
<aspect class="org.jboss.test.aop.beforeafterArgs.JoinPointAspect" scope="PER_VM"/>
Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/CallerTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/CallerTestCase.java 2007-05-28 17:17:24 UTC (rev 63226)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/CallerTestCase.java 2007-05-28 18:59:21 UTC (rev 63227)
@@ -171,6 +171,55 @@
assertAllAdvices(null, thrown);
}
+ public void test12()
+ {
+ // no call pointcut
+ pojo.method1();
+
+ assertTrue(CallerAspect.before1);
+ assertFalse(CallerAspect.before2);
+ assertFalse(CallerAspect.before3);
+ assertTrue(CallerAspect.around1);
+ assertFalse(CallerAspect.around2);
+ assertFalse(CallerAspect.around4);
+ assertTrue(CallerAspect.after1);
+ assertFalse(CallerAspect.after2);
+ assertFalse(CallerAspect.throwing1);
+ assertFalse(CallerAspect.throwing3);
+ assertFalse(CallerAspect.finally1);
+ assertTrue(CallerAspect.finally2);
+ assertFalse(CallerAspect.finally4);
+ }
+
+ public void test13()
+ {
+ // no call pointcut
+ boolean thrown = false;
+ try
+ {
+ pojo.method3();
+ }
+ catch(POJOException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ assertTrue(CallerAspect.before1);
+ assertFalse(CallerAspect.before2);
+ assertFalse(CallerAspect.before3);
+ assertTrue(CallerAspect.around1);
+ assertFalse(CallerAspect.around2);
+ assertFalse(CallerAspect.around4);
+ assertFalse(CallerAspect.after1);
+ assertFalse(CallerAspect.after2);
+ assertTrue(CallerAspect.throwing1);
+ assertFalse(CallerAspect.throwing3);
+ assertFalse(CallerAspect.finally1);
+ assertTrue(CallerAspect.finally2);
+ assertFalse(CallerAspect.finally4);
+ }
+
public void assertAllAdvices(Object caller, boolean error)
{
assertTrue(CallerAspect.before1);
More information about the jboss-cvs-commits
mailing list