[jboss-cvs] JBossAS SVN: r64833 - 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
Thu Aug 23 20:53:10 EDT 2007
Author: flavia.rainone at jboss.com
Date: 2007-08-23 20:53:10 -0400 (Thu, 23 Aug 2007)
New Revision: 64833
Added:
projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/TargetInvalidTestCase.java
Modified:
projects/aop/trunk/aop/src/resources/test/beforeafterArgs/jboss-aop.xml
projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/TargetCallerInvalidPOJO.java
Log:
[JBAOP-387] Added tests for invalid advices with @Target-annotated parameters.
Modified: projects/aop/trunk/aop/src/resources/test/beforeafterArgs/jboss-aop.xml
===================================================================
--- projects/aop/trunk/aop/src/resources/test/beforeafterArgs/jboss-aop.xml 2007-08-24 00:39:11 UTC (rev 64832)
+++ projects/aop/trunk/aop/src/resources/test/beforeafterArgs/jboss-aop.xml 2007-08-24 00:53:10 UTC (rev 64833)
@@ -1005,10 +1005,19 @@
<stack-ref name="TargetAdvices"/>
</bind>
+ <bind pointcut="execution(org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->new(short,..))">
+ <before name="before3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
<bind pointcut="execution(org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->new(int,..))">
- <before name="before3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
<around name="around3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="execution(org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->new(long,..))">
<throwing name="throwing3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="execution(org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->new(double,..))">
<finally name="finally3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
</bind>
@@ -1016,10 +1025,19 @@
<stack-ref name="TargetAdvices"/>
</bind>
- <bind pointcut="field(int org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->*)">
+ <bind pointcut="field(int org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->*Before)">
<before name="before3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="field(int org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->*Around)">
<around name="around3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="field(int org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->*Throwing)">
<throwing name="throwing3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="field(int org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->*Finally)">
<finally name="finally3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
</bind>
@@ -1027,10 +1045,19 @@
<stack-ref name="TargetAdvices"/>
</bind>
- <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1(..))">
+ <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1Before(..))">
<before name="before3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1Around(..))">
<around name="around3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1Throwing(..))">
<throwing name="throwing3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1Finally(..))">
<finally name="finally3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
</bind>
@@ -1038,10 +1065,19 @@
<stack-ref name="TargetAdvices"/>
</bind>
- <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method2(..))">
+ <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method2Before(..))">
<before name="before3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method2Around(..))">
<around name="around3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method2Throwing(..))">
<throwing name="throwing3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method2Finally(..))">
<finally name="finally3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
</bind>
@@ -1049,10 +1085,19 @@
<stack-ref name="TargetAdvices"/>
</bind>
- <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3(..))">
+ <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3Before(..))">
<before name="before3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3Around(..))">
<around name="around3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3Throwing(..))">
<throwing name="throwing3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3Finally(..))">
<finally name="finally3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
</bind>
@@ -1060,10 +1105,19 @@
<stack-ref name="TargetAdvices"/>
</bind>
- <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method4(..))">
+ <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method4Before(..))">
<before name="before3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method4Around(..))">
<around name="around3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method4Throwing(..))">
<throwing name="throwing3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="execution(* org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method4Finally(..))">
<finally name="finally3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
</bind>
@@ -1071,26 +1125,39 @@
<stack-ref name="TargetAdvices"/>
</bind>
- <bind pointcut="call(org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->new(int,..))">
- <stack-ref name="TargetAdvices"/>
+ <bind pointcut="call(org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->new(.., short))">
+ <before name="before3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
</bind>
- <bind pointcut="call(void org.jboss.test.aop.beforeafterArgs.TargetCallerPOJO2->*()) AND !call(* *->method*_())">
- <stack-ref name="TargetAdvices"/>
- <before name="before3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ <bind pointcut="call(org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->new(.., int))">
<around name="around3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="call(org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->new(.., long))">
<throwing name="throwing3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="call(org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->new(.., double))">
<finally name="finally3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
</bind>
-
+
<bind pointcut="call(void org.jboss.test.aop.beforeafterArgs.TargetCallerPOJO2->method*_())">
<stack-ref name="TargetAdvices"/>
</bind>
- <bind pointcut="call(void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->method*_())">
+ <bind pointcut="call(void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->method*_Before())">
<before name="before3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="call(void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->method*_Around())">
<around name="around3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="call(void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->method*_Throwing())">
<throwing name="throwing3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
+ </bind>
+
+ <bind pointcut="call(void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->method*_Finally())">
<finally name="finally3" aspect="org.jboss.test.aop.beforeafterArgs.TargetAspect"/>
</bind>
Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/TargetCallerInvalidPOJO.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/TargetCallerInvalidPOJO.java 2007-08-24 00:39:11 UTC (rev 64832)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/TargetCallerInvalidPOJO.java 2007-08-24 00:53:10 UTC (rev 64833)
@@ -36,8 +36,44 @@
public class TargetCallerInvalidPOJO
{
public TargetCallerInvalidPOJO(){}
+
+ /* intercepted by advice before3 for @Target */
- // test constructor calls
+ public TargetCallerInvalidPOJO(short x){}
+
+ public TargetCallerInvalidPOJO(short x, String y) throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ /* intercepted by advice around3 for @Target */
+
+ public TargetCallerInvalidPOJO(int x){}
+
+ public TargetCallerInvalidPOJO(int x, String y) throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ /* intercepted by advice throwing3 for @Target */
+
+ public TargetCallerInvalidPOJO(long x){}
+
+ public TargetCallerInvalidPOJO(long x, String y) throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ /* intercepted by advice finally3 for @Target */
+
+ public TargetCallerInvalidPOJO(double x){}
+
+ public TargetCallerInvalidPOJO(double x, String y) throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ // test constructor calls for @Caller
public TargetCallerInvalidPOJO(InvalidCallType callType, boolean throwException) throws POJOException
{
switch(callType)
@@ -158,8 +194,140 @@
}
}
- /* method1() */
+ // test constructor calls for @Target
+ public TargetCallerInvalidPOJO(boolean throwException, InvalidCallType callType) throws POJOException
+ {
+ switch(callType)
+ {
+ case CONSTRUCTOR_BEFORE:
+ if (throwException)
+ {
+ new TargetCallerInvalidPOJO2(null, null, (short) 3);
+ }
+ new TargetCallerInvalidPOJO2(null, (short) 3);
+ break;
+ case CONSTRUCTOR_AROUND:
+ if (throwException)
+ {
+ new TargetCallerInvalidPOJO2(null, null, 3);
+ }
+ new TargetCallerInvalidPOJO2(null, 3);
+ break;
+ case CONSTRUCTOR_THROWING:
+ if (throwException)
+ {
+ new TargetCallerInvalidPOJO2(null, null, 3l);
+ }
+ new TargetCallerInvalidPOJO2(null, 3l);
+ break;
+ case CONSTRUCTOR_FINALLY:
+ if (throwException)
+ {
+ new TargetCallerInvalidPOJO2(null, null, (double) 3.0);
+ }
+ new TargetCallerInvalidPOJO2(null, (double) 3.0);
+ break;
+
+ case METHOD_BEFORE:
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ if (throwException)
+ {
+ pojo2.method3_Before4();
+ }
+ pojo2.method1_Before4();
+ break;
+ case METHOD_AROUND:
+ pojo2 = new TargetCallerInvalidPOJO2();
+ if (throwException)
+ {
+ pojo2.method3_Around3();
+ }
+ pojo2.method1_Around3();
+ break;
+ case METHOD_AFTER:
+ pojo2 = new TargetCallerInvalidPOJO2();
+ if (throwException)
+ {
+ pojo2.method3_After3();
+ }
+ pojo2.method1_After3();
+ break;
+
+ case METHOD_THROWING:
+ pojo2 = new TargetCallerInvalidPOJO2();
+ if (throwException)
+ {
+ pojo2.method3_Throwing2();
+ }
+ pojo2.method1_Throwing2();
+ break;
+ case METHOD_FINALLY:
+ pojo2 = new TargetCallerInvalidPOJO2();
+ if (throwException)
+ {
+ pojo2.method3_Finally3();
+ }
+ pojo2.method1_Finally3();
+ break;
+
+ case STATIC_METHOD_BEFORE:
+ if (throwException)
+ {
+ TargetCallerInvalidPOJO2.method4_Before4();
+ }
+ TargetCallerInvalidPOJO2.method2_Before4();
+ break;
+ case STATIC_METHOD_AROUND:
+ if (throwException)
+ {
+ TargetCallerInvalidPOJO2.method4_Around3();
+ }
+ TargetCallerInvalidPOJO2.method2_Around3();
+ break;
+ case STATIC_METHOD_AFTER:
+ if (throwException)
+ {
+ TargetCallerInvalidPOJO2.method4_After3();
+ }
+ TargetCallerInvalidPOJO2.method2_After3();
+ break;
+ case STATIC_METHOD_THROWING:
+ if (throwException)
+ {
+ TargetCallerInvalidPOJO2.method4_Throwing2();
+ }
+ TargetCallerInvalidPOJO2.method2_Throwing2();
+ break;
+ case STATIC_METHOD_FINALLY:
+ if (throwException)
+ {
+ TargetCallerInvalidPOJO2.method4_Finally3();
+ }
+ TargetCallerInvalidPOJO2.method2_Finally3();
+ break;
+ }
+ }
+ /* int field1 for @Target */
+ public int field1Before;
+ public int field1Around;
+ public int field1Throwing;
+ public int field1Finally;
+
+ /* int field2 for @Target */
+ public static int field2Before;
+ public static int field2Around;
+ public static int field2Throwing;
+ public static int field2Finally;
+
+ /* method1() for @Target*/
+ public void method1Before() {}
+ public void method1Around() {}
+ public void method1Throwing() {}
+ public void method1Finally() {}
+
+ /* method1() for @Caller*/
+
public void method1Before2(){}
public void method1Before3(){}
@@ -186,8 +354,36 @@
public void method1Finally4(){}
- /* method3() */
+ /* method2() for @Target */
+ public static void method2Before(){}
+ public static void method2Around(){}
+ public static void method2Throwing(){}
+ public static void method2Finally(){}
+ /* method3() for @Target */
+
+ public void method3Before() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3Around() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3Throwing() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3Finally() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ /* method3() for @Caller */
+
public void method3Before2() throws POJOException
{
throw new POJOException();
@@ -253,8 +449,52 @@
throw new POJOException();
}
- /* method5() */
+ /* method4() for @Target */
+ public static void method4Before() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public static void method4Around() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public static void method4Throwing() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public static void method4Finally() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ /* method5() for @Target */
+
+ public void method5Before()
+ {
+ new TargetCallerInvalidPOJO2(null, (short) 3);
+ }
+
+ public void method5Around()
+ {
+ new TargetCallerInvalidPOJO2(null, 3);
+ }
+
+ public void method5Throwing()
+ {
+ new TargetCallerInvalidPOJO2(null, 3l);
+ }
+
+ public void method5Finally()
+ {
+ new TargetCallerInvalidPOJO2(null, (double) 3.0);
+ }
+
+ /* method5() for @Caller */
+
public void method5Before4()
{
new TargetCallerInvalidPOJO2((short) 4);
@@ -280,8 +520,30 @@
new TargetCallerInvalidPOJO2((double) 3.0);
}
- /* method6() */
+ /* method6() for @Target */
+ public void method6Before() throws POJOException
+ {
+ new TargetCallerInvalidPOJO2("method6", "method6", (short) 3);
+ }
+
+ public void method6Around() throws POJOException
+ {
+ new TargetCallerInvalidPOJO2("method6", "method6", 3);
+ }
+
+ public void method6Throwing() throws POJOException
+ {
+ new TargetCallerInvalidPOJO2("method6", "method6", 3l);
+ }
+
+ public void method6Finally() throws POJOException
+ {
+ new TargetCallerInvalidPOJO2("method6", "method6", (double) 3.0);
+ }
+
+ /* method6() for @Caller */
+
public void method6Before4() throws POJOException
{
new TargetCallerInvalidPOJO2((short) 4, "method6");
@@ -307,8 +569,34 @@
new TargetCallerInvalidPOJO2((double) 3.0, "method6");
}
- /* method7() */
+ /* method7() for @Target */
+ public void method7Before()
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method1_Before();
+ }
+
+ public void method7Around()
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method1_Around();
+ }
+
+ public void method7Throwing()
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method1_Throwing();
+ }
+
+ public void method7Finally()
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method1_Finally();
+ }
+
+ /* method7() for @Caller */
+
public void method7Before4()
{
TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
@@ -339,8 +627,30 @@
pojo2.method1_Finally3();
}
- /* method8() */
+ /* method8() for @Target */
+ public void method8Before()
+ {
+ TargetCallerInvalidPOJO2.method2_Before();
+ }
+
+ public void method8Around()
+ {
+ TargetCallerInvalidPOJO2.method2_Around();
+ }
+
+ public void method8Throwing()
+ {
+ TargetCallerInvalidPOJO2.method2_Throwing();
+ }
+
+ public void method8Finally()
+ {
+ TargetCallerInvalidPOJO2.method2_Finally();
+ }
+
+ /* method8() for @Caller */
+
public void method8Before4()
{
TargetCallerInvalidPOJO2.method2_Before4();
@@ -366,8 +676,34 @@
TargetCallerInvalidPOJO2.method2_Finally3();
}
- /* method9() */
+ /* method9() for @Target */
+ public void method9Before() throws POJOException
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method3_Before();
+ }
+
+ public void method9Around() throws POJOException
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method3_Around();
+ }
+
+ public void method9Throwing() throws POJOException
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method3_Throwing();
+ }
+
+ public void method9Finally() throws POJOException
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method3_Finally();
+ }
+
+ /* method9() for @Caller */
+
public void method9Before4() throws POJOException
{
TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
@@ -398,8 +734,30 @@
pojo2.method3_Finally3();
}
- /* method10() */
+ /* method10() for @Target */
+ public void method10Before() throws POJOException
+ {
+ TargetCallerInvalidPOJO2.method4_Before();
+ }
+
+ public void method10Around() throws POJOException
+ {
+ TargetCallerInvalidPOJO2.method4_Around();
+ }
+
+ public void method10Throwing() throws POJOException
+ {
+ TargetCallerInvalidPOJO2.method4_Throwing();
+ }
+
+ public void method10Finally() throws POJOException
+ {
+ TargetCallerInvalidPOJO2.method4_Finally();
+ }
+
+ /* method10() for @Caller */
+
public void method10Before4() throws POJOException
{
TargetCallerInvalidPOJO2.method4_Before4();
@@ -425,8 +783,26 @@
TargetCallerInvalidPOJO2.method4_Finally3();
}
- /* method11() */
+ /* method11() for @Target */
+ public static void method11Before(){
+ new TargetCallerInvalidPOJO2(null, (short) 3);
+ }
+
+ public static void method11Around(){
+ new TargetCallerInvalidPOJO2(null, 3);
+ }
+
+ public static void method11Throwing(){
+ new TargetCallerInvalidPOJO2(null, 3l);
+ }
+
+ public static void method11Finally(){
+ new TargetCallerInvalidPOJO2(null, (double) 3.0);
+ }
+
+ /* method11() for @Caller */
+
public static void method11Before4(){
new TargetCallerInvalidPOJO2((short) 4);
}
@@ -447,8 +823,34 @@
new TargetCallerInvalidPOJO2((double) 3.0);
}
- /* method12() */
+ /* method12() for @Target */
+ public static void method12Before()
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method1_Before();
+ }
+
+ public static void method12Around()
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method1_Around();
+ }
+
+ public static void method12Throwing()
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method1_Throwing();
+ }
+
+ public static void method12Finally()
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method1_Finally();
+ }
+
+ /* method12() for @Caller */
+
public static void method12Before4()
{
TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
@@ -479,8 +881,30 @@
pojo2.method1_Finally3();
}
- /* method13() */
+ /* method13() for @Target */
+ public static void method13Before()
+ {
+ TargetCallerInvalidPOJO2.method2_Before();
+ }
+
+ public static void method13Around()
+ {
+ TargetCallerInvalidPOJO2.method2_Around();
+ }
+
+ public static void method13Throwing()
+ {
+ TargetCallerInvalidPOJO2.method2_Throwing();
+ }
+
+ public static void method13Finally()
+ {
+ TargetCallerInvalidPOJO2.method2_Finally();
+ }
+
+ /* method13() for @Caller */
+
public static void method13Before4()
{
TargetCallerInvalidPOJO2.method2_Before4();
@@ -506,8 +930,34 @@
TargetCallerInvalidPOJO2.method2_Finally3();
}
- /* method14() */
+ /* method14() for @Target */
+ public static void method14Before() throws POJOException
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method3_Before();
+ }
+
+ public static void method14Around() throws POJOException
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method3_Around();
+ }
+
+ public static void method14Throwing() throws POJOException
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method3_Throwing();
+ }
+
+ public static void method14Finally() throws POJOException
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method3_Finally();
+ }
+
+ /* method14() for @Caller */
+
public static void method14Before4() throws POJOException
{
TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
@@ -538,8 +988,30 @@
pojo2.method3_Finally3();
}
- /* method15() */
+ /* method15() for @Target */
+ public static void method15Before() throws POJOException
+ {
+ TargetCallerInvalidPOJO2.method4_Before();
+ }
+
+ public static void method15Around() throws POJOException
+ {
+ TargetCallerInvalidPOJO2.method4_Around();
+ }
+
+ public static void method15Throwing() throws POJOException
+ {
+ TargetCallerInvalidPOJO2.method4_Throwing();
+ }
+
+ public static void method15Finally() throws POJOException
+ {
+ TargetCallerInvalidPOJO2.method4_Finally();
+ }
+
+ /* method15() for @Caller */
+
public static void method15Before4() throws POJOException
{
TargetCallerInvalidPOJO2.method4_Before4();
@@ -576,7 +1048,7 @@
{
public TargetCallerInvalidPOJO2() {}
- /* Constructors with invalid advices*/
+ /* Constructors with invalid @Caller advices*/
// advice before4
public TargetCallerInvalidPOJO2(short x){}
@@ -618,32 +1090,90 @@
throw new POJOException();
}
- /* method1_() */
+ /* Constructors with invalid @Target advices*/
+ // advice before3
+ public TargetCallerInvalidPOJO2(String y, short x){}
+
+ public TargetCallerInvalidPOJO2(String y, String z, short x) throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ // advice around3
+ public TargetCallerInvalidPOJO2(String y, int x){}
+
+ public TargetCallerInvalidPOJO2(String y, String z, int x) throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ // advice throwing3
+ public TargetCallerInvalidPOJO2(String y, long x){}
+
+ public TargetCallerInvalidPOJO2(String y, String z, long x) throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ // advice finally3
+ public TargetCallerInvalidPOJO2(String y, double x){}
+
+ public TargetCallerInvalidPOJO2(String y, String z, double x) throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ /* method1_() for @Target */
+ public void method1_Before() {}
+ public void method1_Around() {}
+ public void method1_Throwing() {}
+ public void method1_Finally() {}
+
+ /* method1_() for @Caller */
public void method1_Before4(){}
-
public void method1_Around3(){}
-
public void method1_After3(){}
-
public void method1_Throwing2(){}
-
public void method1_Finally3(){}
- /* method2_() */
+ /* method2_() for @Target */
+ public static void method2_Before() {}
+ public static void method2_Around() {}
+ public static void method2_Throwing() {}
+ public static void method2_Finally() {}
+ /* method2_() for @Caller */
public static void method2_Before4(){}
-
public static void method2_Around3(){}
-
public static void method2_After3(){}
-
public static void method2_Throwing2(){}
-
public static void method2_Finally3(){}
- /* method3_() */
+ /* method3_() for @Target */
+ public void method3_Before() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3_Around() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3_Throwing() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3_Finally() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ /* method3_() for @Caller */
+
public void method3_Before4() throws POJOException
{
throw new POJOException();
@@ -669,8 +1199,30 @@
throw new POJOException();
}
- /* method4_() */
+ /* method4_() for @Target */
+ public static void method4_Before() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public static void method4_Around() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public static void method4_Throwing() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public static void method4_Finally() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ /* method4_() for @Caller */
+
public static void method4_Before4() throws POJOException
{
throw new POJOException();
Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/TargetInvalidTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/TargetInvalidTestCase.java (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/TargetInvalidTestCase.java 2007-08-24 00:53:10 UTC (rev 64833)
@@ -0,0 +1,1332 @@
+/*
+ * 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.beforeafterArgs;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.aop.advice.NoMatchingAdviceException;
+import org.jboss.test.aop.AOPTestWithSetup;
+
+/**
+ * Tests the use of @Target parameters with invalid advices.
+ *
+ * @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public class TargetInvalidTestCase extends AOPTestWithSetup
+{
+ private TargetCallerInvalidPOJO pojo;
+
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("TargetTestCase");
+ suite.addTestSuite(TargetInvalidTestCase.class);
+ return suite;
+ }
+
+ public TargetInvalidTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ TargetAspect.clear();
+ this.pojo = new TargetCallerInvalidPOJO();
+ }
+
+ public void test1()
+ {
+ boolean thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO((short) 1);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(1);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(1l);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(1.1);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test2() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO((short) 2, "test2");
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(2, "test2");
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(2l, "test2");
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(2.2, "test2");
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test3()
+ {
+ boolean thrown = false;
+ try
+ {
+ pojo.field1Before = 0;
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.field1Around = 0;
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.field1Throwing = 0;
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.field1Finally = 0;
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test4()
+ {
+ boolean thrown = false;
+ try
+ {
+ int test = pojo.field1Before;
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ int test = pojo.field1Around;
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ int test = pojo.field1Throwing;
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ int test = pojo.field1Finally;
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test5()
+ {
+ boolean thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.field2Before = 5;
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.field2Around = 5;
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.field2Throwing = 5;
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.field2Finally = 5;
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test6()
+ {
+ boolean thrown = false;
+ try
+ {
+ int test = TargetCallerInvalidPOJO.field2Before;
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ int test = TargetCallerInvalidPOJO.field2Around;
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ int test = TargetCallerInvalidPOJO.field2Throwing;
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ int test = TargetCallerInvalidPOJO.field2Finally;
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test7()
+ {
+ boolean thrown = false;
+ try
+ {
+ pojo.method1Before();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method1Around();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method1Throwing();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method1Finally();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test8()
+ {
+ boolean thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method2Before();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method2Around();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method2Throwing();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method2Finally();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test9() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ pojo.method3Before();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method3Around();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method3Throwing();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method3Finally();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test10() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method4Before();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method4Around();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method4Throwing();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method4Finally();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test11()
+ {
+ boolean thrown = false;
+ try
+ {
+ pojo.method5Before();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method5Around();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method5Throwing();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method5Finally();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test12() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ pojo.method6Before();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method6Around();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method6Throwing();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method6Finally();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test13()
+ {
+ boolean thrown = false;
+ try
+ {
+ pojo.method7Before();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method7Around();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method7Throwing();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method7Finally();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test14()
+ {
+ boolean thrown = false;
+ try
+ {
+ pojo.method8Before();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method8Around();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method8Throwing();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method8Finally();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test15() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ pojo.method9Before();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method9Around();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method9Throwing();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method9Finally();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test16() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ pojo.method10Before();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method10Around();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method10Throwing();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method10Finally();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test17()
+ {
+ boolean thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method11Before();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method11Around();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method11Throwing();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method11Finally();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test18()
+ {
+ boolean thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method12Before();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method12Around();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method12Throwing();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method12Finally();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test19()
+ {
+ boolean thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method13Before();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method13Around();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method13Throwing();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method13Finally();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test20() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method14Before();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method14Around();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method14Throwing();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method14Finally();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test21() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method15Before();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method15Around();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method15Throwing();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method15Finally();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test22() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(false, InvalidCallType.CONSTRUCTOR_BEFORE);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(false, InvalidCallType.CONSTRUCTOR_AROUND);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(false, InvalidCallType.CONSTRUCTOR_THROWING);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(false, InvalidCallType.CONSTRUCTOR_FINALLY);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test23() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(true, InvalidCallType.CONSTRUCTOR_BEFORE);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(true, InvalidCallType.CONSTRUCTOR_AROUND);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(true, InvalidCallType.CONSTRUCTOR_THROWING);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(true, InvalidCallType.CONSTRUCTOR_FINALLY);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test24() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(false, InvalidCallType.METHOD_BEFORE);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(false, InvalidCallType.METHOD_AROUND);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(false, InvalidCallType.METHOD_THROWING);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(false, InvalidCallType.METHOD_FINALLY);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test25() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(true, InvalidCallType.METHOD_BEFORE);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(true, InvalidCallType.METHOD_AROUND);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(true, InvalidCallType.METHOD_THROWING);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(true, InvalidCallType.METHOD_FINALLY);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test26() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(false, InvalidCallType.STATIC_METHOD_BEFORE);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(false, InvalidCallType.STATIC_METHOD_AROUND);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(false, InvalidCallType.STATIC_METHOD_THROWING);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(false, InvalidCallType.STATIC_METHOD_FINALLY);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test27() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(true, InvalidCallType.STATIC_METHOD_BEFORE);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(true, InvalidCallType.STATIC_METHOD_AROUND);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(true, InvalidCallType.STATIC_METHOD_THROWING);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(true, InvalidCallType.STATIC_METHOD_FINALLY);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list