[jboss-cvs] JBossAS SVN: r64758 - 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 Aug 21 20:24:46 EDT 2007
Author: flavia.rainone at jboss.com
Date: 2007-08-21 20:24:46 -0400 (Tue, 21 Aug 2007)
New Revision: 64758
Added:
projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/CallerInvalidTestCase.java
Modified:
projects/aop/trunk/aop/src/resources/test/beforeafterArgs/jboss-aop.xml
projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/CallerAspect.java
projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/TargetCallerInvalidPOJO.java
Log:
[JBAOP-387] Added tests for invalid advices with @Caller-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-21 22:56:27 UTC (rev 64757)
+++ projects/aop/trunk/aop/src/resources/test/beforeafterArgs/jboss-aop.xml 2007-08-22 00:24:46 UTC (rev 64758)
@@ -558,11 +558,23 @@
<finally name="finally4" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
</bind>
+ <bind pointcut="call(org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->new(short,..))">
+ <before name="before4" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
<bind pointcut="call(org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->new(int,..))">
- <before name="before4" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
<around name="around3" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="call(org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->new(long,..))">
<after name="after3" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="call(org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->new(float,..))">
<throwing name="throwing2" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="call(org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->new(double,..))">
<finally name="finally3" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
</bind>
@@ -595,11 +607,23 @@
<finally name="finally4" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
</bind>
- <bind pointcut="call(void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->method*_())">
+ <bind pointcut="call(void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->method*_Before4())">
<before name="before4" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="call(void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->method*_Around3())">
<around name="around3" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="call(void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->method*_After3())">
<after name="after3" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="call(void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->method*_Throwing2())">
<throwing name="throwing2" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="call(void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO2->method*_Finally3())">
<finally name="finally3" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
</bind>
@@ -607,19 +631,55 @@
<stack-ref name="CallerAdvices"/>
</bind>
- <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1())">
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1Before2())">
<before name="before2" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1Before3())">
<before name="before3" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1Before4())">
<before name="before4" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1Around2())">
<around name="around2" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1Around3())">
<around name="around3" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1Around4())">
<around name="around4" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1After2())">
<after name="after2" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1After3())">
<after name="after3" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1Throwing2())">
<throwing name="throwing2" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1Throwing3())">
<throwing name="throwing3" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1Finally1())">
<finally name="finally1" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1Finally3())">
<finally name="finally3" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method1Finally4())">
<finally name="finally4" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
</bind>
@@ -627,19 +687,55 @@
<stack-ref name="CallerAdvices"/>
</bind>
- <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3())">
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3Before2())">
<before name="before2" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3Before3())">
<before name="before3" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3Before4())">
<before name="before4" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3Around2())">
<around name="around2" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3Around3())">
<around name="around3" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3Around4())">
<around name="around4" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3After2())">
<after name="after2" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3After3())">
<after name="after3" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3Throwing2())">
<throwing name="throwing2" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3Throwing3())">
<throwing name="throwing3" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3Finally1())">
<finally name="finally1" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3Finally3())">
<finally name="finally3" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
+ </bind>
+
+ <bind pointcut="execution(public void org.jboss.test.aop.beforeafterArgs.TargetCallerInvalidPOJO->method3Finally4())">
<finally name="finally4" aspect="org.jboss.test.aop.beforeafterArgs.CallerAspect"/>
</bind>
Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/CallerAspect.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/CallerAspect.java 2007-08-21 22:56:27 UTC (rev 64757)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/CallerAspect.java 2007-08-22 00:24:46 UTC (rev 64758)
@@ -100,6 +100,12 @@
before3Caller = caller;
}
+ public void before3(@Caller TargetCallerInvalidPOJO caller)
+ {
+ before3 = true;
+ before3Caller = caller;
+ }
+
public void before4(@Caller ArgsPOJO caller)
{
Assert.fail("This advice should never be executed");
@@ -118,6 +124,13 @@
return CurrentInvocation.proceed();
}
+ public Object around2(@Caller TargetCallerInvalidPOJO caller) throws Throwable
+ {
+ around2 = true;
+ around2Caller = caller;
+ return CurrentInvocation.proceed();
+ }
+
public Object around3(@Caller String caller) throws Throwable
{
Assert.fail("This advice should never be executed");
@@ -142,7 +155,7 @@
after2Caller = caller;
}
- public void after3(@Caller TargetCallerPOJO2 caller)
+ public void after3(@Caller TargetCallerInvalidPOJO2 caller)
{
Assert.fail("This advice should never be executed");
}
@@ -169,6 +182,12 @@
finally1Caller = caller;
}
+ public void finally1(@Caller TargetCallerInvalidPOJO caller)
+ {
+ finally1 = true;
+ finally1Caller = caller;
+ }
+
public void finally2()
{
finally2 = true;
Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/CallerInvalidTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/CallerInvalidTestCase.java (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/CallerInvalidTestCase.java 2007-08-22 00:24:46 UTC (rev 64758)
@@ -0,0 +1,1061 @@
+/*
+ * 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 @Caller parameters with invalid advices.
+ *
+ * @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public class CallerInvalidTestCase extends AOPTestWithSetup
+{
+ private TargetCallerInvalidPOJO pojo;
+
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("CallerTestCase");
+ suite.addTestSuite(CallerInvalidTestCase.class);
+ return suite;
+ }
+
+ public CallerInvalidTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ CallerAspect.clear();
+ this.pojo = new TargetCallerInvalidPOJO();
+ }
+
+ public void test1()
+ {
+ boolean thrown = false;
+ try
+ {
+ pojo.method5Before4();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method5Around3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method5After3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method5Throwing2();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method5Finally3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test2() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ pojo.method6Before4();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method6Around3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method6After3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method6Throwing2();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method6Finally3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test3()
+ {
+ boolean thrown = false;
+ try
+ {
+ pojo.method7Before4();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method7Around3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method7After3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method7Throwing2();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method7Finally3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test4()
+ {
+ boolean thrown = false;
+ try
+ {
+ pojo.method8Before4();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method8Around3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method8After3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method8Throwing2();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method8Finally3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test5() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ pojo.method9Before4();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method9Around3();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method9After3();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method9Throwing2();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method9Finally3();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test6() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ pojo.method10Before4();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method10Around3();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method10After3();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method10Throwing2();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method10Finally3();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test7()
+ {
+ boolean thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method11Before4();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method11Around3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method11After3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method11Throwing2();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method11Finally3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test8()
+ {
+ boolean thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method12Before4();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method12Around3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method12After3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method12Throwing2();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method12Finally3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test9()
+ {
+ boolean thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method13Before4();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method13Around3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method13After3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method13Throwing2();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method13Finally3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test10() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method14Before4();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method14Around3();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method14After3();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method14Throwing2();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method14Finally3();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test11() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method15Before4();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method15Around3();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method15After3();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method15Throwing2();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ TargetCallerInvalidPOJO.method15Finally3();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test12() throws POJOException
+ {
+ testConstructorCaller(InvalidCallType.CONSTRUCTOR_BEFORE, false);
+ testConstructorCaller(InvalidCallType.CONSTRUCTOR_AROUND, false);
+ testConstructorCaller(InvalidCallType.CONSTRUCTOR_AFTER, false);
+ testConstructorCaller(InvalidCallType.CONSTRUCTOR_THROWING, false);
+ testConstructorCaller(InvalidCallType.CONSTRUCTOR_FINALLY, false);
+ }
+
+ public void test13() throws POJOException
+ {
+ testConstructorCaller(InvalidCallType.METHOD_BEFORE, false);
+ testConstructorCaller(InvalidCallType.METHOD_AROUND, false);
+ testConstructorCaller(InvalidCallType.METHOD_AFTER, false);
+ testConstructorCaller(InvalidCallType.METHOD_THROWING, false);
+ testConstructorCaller(InvalidCallType.METHOD_FINALLY, false);
+ }
+
+ public void test14() throws POJOException
+ {
+ testConstructorCaller(InvalidCallType.STATIC_METHOD_BEFORE, false);
+ testConstructorCaller(InvalidCallType.STATIC_METHOD_AROUND, false);
+ testConstructorCaller(InvalidCallType.STATIC_METHOD_AFTER, false);
+ testConstructorCaller(InvalidCallType.STATIC_METHOD_THROWING, false);
+ testConstructorCaller(InvalidCallType.STATIC_METHOD_FINALLY, false);
+ }
+
+ public void test15() throws POJOException
+ {
+ testConstructorCaller(InvalidCallType.CONSTRUCTOR_BEFORE, true);
+ testConstructorCaller(InvalidCallType.CONSTRUCTOR_AROUND, true);
+ testConstructorCaller(InvalidCallType.CONSTRUCTOR_AFTER, true);
+ testConstructorCaller(InvalidCallType.CONSTRUCTOR_THROWING, true);
+ testConstructorCaller(InvalidCallType.CONSTRUCTOR_FINALLY, true);
+ }
+
+ public void test16() throws POJOException
+ {
+ testConstructorCaller(InvalidCallType.METHOD_BEFORE, true);
+ testConstructorCaller(InvalidCallType.METHOD_AROUND, true);
+ testConstructorCaller(InvalidCallType.METHOD_AFTER, true);
+ testConstructorCaller(InvalidCallType.METHOD_THROWING, true);
+ testConstructorCaller(InvalidCallType.METHOD_FINALLY, true);
+ }
+
+ public void test17() throws POJOException
+ {
+ testConstructorCaller(InvalidCallType.STATIC_METHOD_BEFORE, true);
+ testConstructorCaller(InvalidCallType.STATIC_METHOD_AROUND, true);
+ testConstructorCaller(InvalidCallType.STATIC_METHOD_AFTER, true);
+ testConstructorCaller(InvalidCallType.STATIC_METHOD_THROWING, true);
+ testConstructorCaller(InvalidCallType.STATIC_METHOD_FINALLY, true);
+ }
+
+ public void test18()
+ {
+ boolean thrown = false;
+ try
+ {
+ pojo.method1Before2();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method1Before3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method1Before4();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method1Around2();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method1Around3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method1Around4();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method1After2();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method1After3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method1Throwing2();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method1Throwing3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method1Finally1();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method1Finally3();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method1Finally4();
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void test19() throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ pojo.method3Before2();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method3Before3();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method3Before4();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method3Around2();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method3Around3();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method3Around4();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method3After2();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method3After3();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method3Throwing2();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method3Throwing3();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method3Finally1();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method3Finally3();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+
+ thrown = false;
+ try
+ {
+ pojo.method3Finally4();
+ }
+ catch(NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+
+ public void testConstructorCaller(InvalidCallType callType, boolean throwException) throws POJOException
+ {
+ boolean thrown = false;
+ try
+ {
+ new TargetCallerInvalidPOJO(callType, throwException);
+ }
+ catch (NoMatchingAdviceException e)
+ {
+ thrown = true;
+ }
+ assertTrue(thrown);
+ }
+}
\ No newline at end of file
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-21 22:56:27 UTC (rev 64757)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/beforeafterArgs/TargetCallerInvalidPOJO.java 2007-08-22 00:24:46 UTC (rev 64758)
@@ -21,6 +21,12 @@
*/
package org.jboss.test.aop.beforeafterArgs;
+enum InvalidCallType {CONSTRUCTOR_BEFORE, CONSTRUCTOR_AROUND, CONSTRUCTOR_AFTER,
+ CONSTRUCTOR_THROWING, CONSTRUCTOR_FINALLY,
+ METHOD_BEFORE, METHOD_AROUND, METHOD_AFTER, METHOD_THROWING, METHOD_FINALLY,
+ STATIC_METHOD_BEFORE, STATIC_METHOD_AROUND, STATIC_METHOD_AFTER,
+ STATIC_METHOD_THROWING, STATIC_METHOD_FINALLY}
+
/**
* POJO whose joinpoint executions will throw a NoMatchingAdviceException, due to
* the fact that there is no advice that matches the joinpoint.
@@ -29,10 +35,535 @@
*/
public class TargetCallerInvalidPOJO
{
- public static void method15() throws POJOException
+ public TargetCallerInvalidPOJO(){}
+
+ // test constructor calls
+ public TargetCallerInvalidPOJO(InvalidCallType callType, boolean throwException) throws POJOException
{
- TargetCallerInvalidPOJO2.method4_();
+ switch(callType)
+ {
+ case CONSTRUCTOR_BEFORE:
+ if (throwException)
+ {
+ new TargetCallerInvalidPOJO2((short) 0, null);
+ }
+ new TargetCallerInvalidPOJO2((short) 5);
+ break;
+ case CONSTRUCTOR_AROUND:
+ if (throwException)
+ {
+ new TargetCallerInvalidPOJO2(0, null);
+ }
+ new TargetCallerInvalidPOJO2(5);
+ break;
+ case CONSTRUCTOR_AFTER:
+ if (throwException)
+ {
+ new TargetCallerInvalidPOJO2(0l, null);
+ }
+ new TargetCallerInvalidPOJO2(5l);
+ break;
+ case CONSTRUCTOR_THROWING:
+ if (throwException)
+ {
+ new TargetCallerInvalidPOJO2((float) 0.0, null);
+ }
+ new TargetCallerInvalidPOJO2((float) 5.0);
+ break;
+ case CONSTRUCTOR_FINALLY:
+ if (throwException)
+ {
+ new TargetCallerInvalidPOJO2((double) 0.0, null);
+ }
+ new TargetCallerInvalidPOJO2((double) 5);
+ 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;
+ }
}
+
+ /* method1() */
+
+ public void method1Before2(){}
+
+ public void method1Before3(){}
+
+ public void method1Before4(){}
+
+ public void method1Around2(){}
+
+ public void method1Around3(){}
+
+ public void method1Around4(){}
+
+ public void method1After2(){}
+
+ public void method1After3(){}
+
+ public void method1Throwing2(){}
+
+ public void method1Throwing3(){}
+
+ public void method1Finally1(){}
+
+ public void method1Finally3(){}
+
+ public void method1Finally4(){}
+
+ /* method3() */
+
+ public void method3Before2() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3Before3() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3Before4() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3Around2() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3Around3() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3Around4() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3After2() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3After3() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3Throwing2() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3Throwing3() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3Finally1() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3Finally3() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3Finally4() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ /* method5() */
+
+ public void method5Before4()
+ {
+ new TargetCallerInvalidPOJO2((short) 4);
+ }
+
+ public void method5Around3()
+ {
+ new TargetCallerInvalidPOJO2(3);
+ }
+
+ public void method5After3()
+ {
+ new TargetCallerInvalidPOJO2(3l);
+ }
+
+ public void method5Throwing2()
+ {
+ new TargetCallerInvalidPOJO2((float) 2.0);
+ }
+
+ public void method5Finally3()
+ {
+ new TargetCallerInvalidPOJO2((double) 3.0);
+ }
+
+ /* method6() */
+
+ public void method6Before4() throws POJOException
+ {
+ new TargetCallerInvalidPOJO2((short) 4, "method6");
+ }
+
+ public void method6Around3() throws POJOException
+ {
+ new TargetCallerInvalidPOJO2(3, "method6");
+ }
+
+ public void method6After3() throws POJOException
+ {
+ new TargetCallerInvalidPOJO2(3l, "method6");
+ }
+
+ public void method6Throwing2() throws POJOException
+ {
+ new TargetCallerInvalidPOJO2((float) 2.0, "method6");
+ }
+
+ public void method6Finally3() throws POJOException
+ {
+ new TargetCallerInvalidPOJO2((double) 3.0, "method6");
+ }
+
+ /* method7() */
+
+ public void method7Before4()
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method1_Before4();
+ }
+
+ public void method7Around3()
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method1_Around3();
+ }
+
+ public void method7After3()
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method1_After3();
+ }
+
+ public void method7Throwing2()
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method1_Throwing2();
+ }
+
+ public void method7Finally3()
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method1_Finally3();
+ }
+
+ /* method8() */
+
+ public void method8Before4()
+ {
+ TargetCallerInvalidPOJO2.method2_Before4();
+ }
+
+ public void method8Around3()
+ {
+ TargetCallerInvalidPOJO2.method2_Around3();
+ }
+
+ public void method8After3()
+ {
+ TargetCallerInvalidPOJO2.method2_After3();
+ }
+
+ public void method8Throwing2()
+ {
+ TargetCallerInvalidPOJO2.method2_Throwing2();
+ }
+
+ public void method8Finally3()
+ {
+ TargetCallerInvalidPOJO2.method2_Finally3();
+ }
+
+ /* method9() */
+
+ public void method9Before4() throws POJOException
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method3_Before4();
+ }
+
+ public void method9Around3() throws POJOException
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method3_Around3();
+ }
+
+ public void method9After3() throws POJOException
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method3_After3();
+ }
+
+ public void method9Throwing2() throws POJOException
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method3_Throwing2();
+ }
+
+ public void method9Finally3() throws POJOException
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method3_Finally3();
+ }
+
+ /* method10() */
+
+ public void method10Before4() throws POJOException
+ {
+ TargetCallerInvalidPOJO2.method4_Before4();
+ }
+
+ public void method10Around3() throws POJOException
+ {
+ TargetCallerInvalidPOJO2.method4_Around3();
+ }
+
+ public void method10After3() throws POJOException
+ {
+ TargetCallerInvalidPOJO2.method4_After3();
+ }
+
+ public void method10Throwing2() throws POJOException
+ {
+ TargetCallerInvalidPOJO2.method4_Throwing2();
+ }
+
+ public void method10Finally3() throws POJOException
+ {
+ TargetCallerInvalidPOJO2.method4_Finally3();
+ }
+
+ /* method11() */
+
+ public static void method11Before4(){
+ new TargetCallerInvalidPOJO2((short) 4);
+ }
+
+ public static void method11Around3(){
+ new TargetCallerInvalidPOJO2(3);
+ }
+
+ public static void method11After3(){
+ new TargetCallerInvalidPOJO2(3l);
+ }
+
+ public static void method11Throwing2(){
+ new TargetCallerInvalidPOJO2((float) 2.0);
+ }
+
+ public static void method11Finally3(){
+ new TargetCallerInvalidPOJO2((double) 3.0);
+ }
+
+ /* method12() */
+
+ public static void method12Before4()
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method1_Before4();
+ }
+
+ public static void method12Around3()
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method1_Around3();
+ }
+
+ public static void method12After3()
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method1_After3();
+ }
+
+ public static void method12Throwing2()
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method1_Throwing2();
+ }
+
+ public static void method12Finally3()
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method1_Finally3();
+ }
+
+ /* method13() */
+
+ public static void method13Before4()
+ {
+ TargetCallerInvalidPOJO2.method2_Before4();
+ }
+
+ public static void method13Around3()
+ {
+ TargetCallerInvalidPOJO2.method2_Around3();
+ }
+
+ public static void method13After3()
+ {
+ TargetCallerInvalidPOJO2.method2_After3();
+ }
+
+ public static void method13Throwing2()
+ {
+ TargetCallerInvalidPOJO2.method2_Throwing2();
+ }
+
+ public static void method13Finally3()
+ {
+ TargetCallerInvalidPOJO2.method2_Finally3();
+ }
+
+ /* method14() */
+
+ public static void method14Before4() throws POJOException
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method3_Before4();
+ }
+
+ public static void method14Around3() throws POJOException
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method3_Around3();
+ }
+
+ public static void method14After3() throws POJOException
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method3_After3();
+ }
+
+ public static void method14Throwing2() throws POJOException
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method3_Throwing2();
+ }
+
+ public static void method14Finally3() throws POJOException
+ {
+ TargetCallerInvalidPOJO2 pojo2 = new TargetCallerInvalidPOJO2();
+ pojo2.method3_Finally3();
+ }
+
+ /* method15() */
+
+ public static void method15Before4() throws POJOException
+ {
+ TargetCallerInvalidPOJO2.method4_Before4();
+ }
+
+ public static void method15Around3() throws POJOException
+ {
+ TargetCallerInvalidPOJO2.method4_Around3();
+ }
+
+ public static void method15After3() throws POJOException
+ {
+ TargetCallerInvalidPOJO2.method4_After3();
+ }
+
+ public static void method15Throwing2() throws POJOException
+ {
+ TargetCallerInvalidPOJO2.method4_Throwing2();
+ }
+
+ public static void method15Finally3() throws POJOException
+ {
+ TargetCallerInvalidPOJO2.method4_Finally3();
+ }
}
/**
@@ -43,6 +574,19 @@
*/
class TargetCallerInvalidPOJO2 extends TargetCallerInvalidPOJO
{
+ public TargetCallerInvalidPOJO2() {}
+
+ /* Constructors with invalid advices*/
+
+ // advice before4
+ public TargetCallerInvalidPOJO2(short x){}
+
+ public TargetCallerInvalidPOJO2(short x, String y) throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ // advice around3
public TargetCallerInvalidPOJO2(int x){}
public TargetCallerInvalidPOJO2(int x, String y) throws POJOException
@@ -50,8 +594,105 @@
throw new POJOException();
}
- public static void method4_() throws POJOException
+ // advice after3
+ public TargetCallerInvalidPOJO2(long x){}
+
+ public TargetCallerInvalidPOJO2(long x, String y) throws POJOException
{
throw new POJOException();
}
+
+ // advice throwing2
+ public TargetCallerInvalidPOJO2(float x){}
+
+ public TargetCallerInvalidPOJO2(float x, String y) throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ // advice finally3
+ public TargetCallerInvalidPOJO2(double x){}
+
+ public TargetCallerInvalidPOJO2(double x, String y) throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ /* method1_() */
+
+ public void method1_Before4(){}
+
+ public void method1_Around3(){}
+
+ public void method1_After3(){}
+
+ public void method1_Throwing2(){}
+
+ public void method1_Finally3(){}
+
+ /* method2_() */
+
+ 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_() */
+
+ public void method3_Before4() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3_Around3() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3_After3() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3_Throwing2() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public void method3_Finally3() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ /* method4_() */
+
+ public static void method4_Before4() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public static void method4_Around3() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public static void method4_After3() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public static void method4_Throwing2() throws POJOException
+ {
+ throw new POJOException();
+ }
+
+ public static void method4_Finally3() throws POJOException
+ {
+ throw new POJOException();
+ }
}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list