[jboss-cvs] JBossAS SVN: r73239 - in projects/aop/trunk/aop/src: test/org/jboss/test/aop/beforeafterthrowingscoped and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri May 9 17:02:18 EDT 2008
Author: flavia.rainone at jboss.com
Date: 2008-05-09 17:02:18 -0400 (Fri, 09 May 2008)
New Revision: 73239
Modified:
projects/aop/trunk/aop/src/resources/test/beforeafterthrowingscoped/jboss-aop.xml
projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterthrowingscoped/BeforeAfterThrowingScopedTestCase.java
projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterthrowingscoped/POJOWithNullAspect.java
Log:
[JBAOP-560] Tests for call joinpoints have been added to BeforeAfterThrowingScopedTestCase.testNullAspectFactory().
Modified: projects/aop/trunk/aop/src/resources/test/beforeafterthrowingscoped/jboss-aop.xml
===================================================================
--- projects/aop/trunk/aop/src/resources/test/beforeafterthrowingscoped/jboss-aop.xml 2008-05-09 20:54:37 UTC (rev 73238)
+++ projects/aop/trunk/aop/src/resources/test/beforeafterthrowingscoped/jboss-aop.xml 2008-05-09 21:02:18 UTC (rev 73239)
@@ -108,18 +108,30 @@
<stack-ref name="nullFactoryStack"/>
</bind>
- <bind pointcut="construction(org.jboss.test.aop.beforeafterthrowingscoped.POJOWithNullAspect->new(..))">
+ <bind pointcut="construction(org.jboss.test.aop.beforeafterthrowingscoped.POJOWithNullAspect->new())">
<stack-ref name="nullFactoryStack"/>
</bind>
- <bind pointcut="execution(org.jboss.test.aop.beforeafterthrowingscoped.POJOWithNullAspect->new(..))">
+ <bind pointcut="execution(org.jboss.test.aop.beforeafterthrowingscoped.POJOWithNullAspect->new())">
<stack-ref name="nullFactoryStack"/>
</bind>
- <bind pointcut="execution(* org.jboss.test.aop.beforeafterthrowingscoped.POJOWithNullAspect->*(..))">
+ <bind pointcut="execution(* org.jboss.test.aop.beforeafterthrowingscoped.POJOWithNullAspect->method(..))">
<stack-ref name="nullFactoryStack"/>
</bind>
+ <bind pointcut="execution(* org.jboss.test.aop.beforeafterthrowingscoped.POJOWithNullAspect->staticMethod(..))">
+ <stack-ref name="nullFactoryStack"/>
+ </bind>
+
+ <bind pointcut="call(* org.jboss.test.aop.beforeafterthrowingscoped.POJOWithNullAspect->calledMethod*(..))">
+ <stack-ref name="nullFactoryStack"/>
+ </bind>
+
+ <bind pointcut="call(org.jboss.test.aop.beforeafterthrowingscoped.POJOWithNullAspect->new(int))">
+ <stack-ref name="nullFactoryStack"/>
+ </bind>
+
<bind pointcut="execution(* org.jboss.test.aop.beforeafterthrowingscoped.POJOWithNullAspect->mixedMethod(..))">
<stack-ref name="nullFactoryStack"/>
<stack-ref name="PER_INSTANCE"/>
Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterthrowingscoped/BeforeAfterThrowingScopedTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterthrowingscoped/BeforeAfterThrowingScopedTestCase.java 2008-05-09 20:54:37 UTC (rev 73238)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterthrowingscoped/BeforeAfterThrowingScopedTestCase.java 2008-05-09 21:02:18 UTC (rev 73239)
@@ -955,10 +955,13 @@
int value = POJOWithNullAspect.staticField;
POJOWithNullAspect.staticField = value + 1;
POJOWithNullAspect.staticMethod();
+ POJOWithNullAspect.callerMethod2();
POJOWithNullAspect pojo = new POJOWithNullAspect();
value += pojo.field;
pojo.field = value - 10;
pojo.method();
+ pojo.callerMethod1();
+ new POJOWithNullAspect(5, 6);
// check that mixed method does get correctly intercepted without errors
PerInstanceAspect.reset();
Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterthrowingscoped/POJOWithNullAspect.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterthrowingscoped/POJOWithNullAspect.java 2008-05-09 20:54:37 UTC (rev 73238)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterthrowingscoped/POJOWithNullAspect.java 2008-05-09 21:02:18 UTC (rev 73239)
@@ -28,11 +28,42 @@
*/
public class POJOWithNullAspect
{
+ // for get and set joinpoints
public int field;
public static int staticField;
+
+ // for execution and construction joinpoints
public POJOWithNullAspect() {}
+
+ // for execution joinpoints
public void method() {}
public static void staticMethod() {}
+
+ // for call joinpoints
+ // callers:
+ public POJOWithNullAspect(int value1, int value2)
+ {
+ POJOWithNullAspect pojo = new POJOWithNullAspect(1);
+ pojo.calledMethod1();
+ calledMethod2();
+ }
+ public void callerMethod1()
+ {
+ POJOWithNullAspect pojo = new POJOWithNullAspect(1);
+ pojo.calledMethod1();
+ calledMethod2();
+ }
+ public static void callerMethod2()
+ {
+ POJOWithNullAspect pojo = new POJOWithNullAspect(2);
+ pojo.calledMethod1();
+ calledMethod2();
+ }
+ // called:
+ public POJOWithNullAspect(int value) {}
+ public void calledMethod1() {}
+ public static void calledMethod2() {}
+
// method that will be intercepted by both normal aspects and
// NullAspectFactories
public void mixedMethod(boolean throwException) throws Exception
More information about the jboss-cvs-commits
mailing list