aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authormwebster <mwebster>2006-10-05 10:13:54 +0000
committermwebster <mwebster>2006-10-05 10:13:54 +0000
commitc315f9d9a754d01ea608d6d1ae020889d4018fc6 (patch)
treef64fe7729bbe5e5dc2f8bfd6ecfccecd10118a89 /tests
parent3ebee688f8dab9c114ca61b685b324c19640ae9b (diff)
downloadaspectj-c315f9d9a754d01ea608d6d1ae020889d4018fc6.tar.gz
aspectj-c315f9d9a754d01ea608d6d1ae020889d4018fc6.zip
Bug 158957 "NPE in LTW with RMI dynamic proxies w/ pointcut reuse" (restore catch(Throwable) in Aj.preProcess() and make adaptor disabled by default)
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs153/pr158957/HelloWorld.java11
-rw-r--r--tests/bugs153/pr158957/Missing.java3
-rw-r--r--tests/bugs153/pr158957/PointcutLibrary.aj9
-rw-r--r--tests/bugs153/pr158957/Tracing.aj6
-rw-r--r--tests/bugs153/pr158957/ant.xml27
-rw-r--r--tests/bugs153/pr158957/aop.xml9
-rw-r--r--tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java4
-rw-r--r--tests/src/org/aspectj/systemtest/ajc153/ajc153.xml41
8 files changed, 110 insertions, 0 deletions
diff --git a/tests/bugs153/pr158957/HelloWorld.java b/tests/bugs153/pr158957/HelloWorld.java
new file mode 100644
index 000000000..8f62298fa
--- /dev/null
+++ b/tests/bugs153/pr158957/HelloWorld.java
@@ -0,0 +1,11 @@
+public class HelloWorld {
+
+ public void println () {
+ System.out.println("Hello World!");
+ }
+
+ public static void main (String[] args) throws Exception {
+ new HelloWorld().println();
+ }
+
+} \ No newline at end of file
diff --git a/tests/bugs153/pr158957/Missing.java b/tests/bugs153/pr158957/Missing.java
new file mode 100644
index 000000000..a61ca7bfd
--- /dev/null
+++ b/tests/bugs153/pr158957/Missing.java
@@ -0,0 +1,3 @@
+public interface Missing {
+ public void doIt ();
+} \ No newline at end of file
diff --git a/tests/bugs153/pr158957/PointcutLibrary.aj b/tests/bugs153/pr158957/PointcutLibrary.aj
new file mode 100644
index 000000000..ffda35e80
--- /dev/null
+++ b/tests/bugs153/pr158957/PointcutLibrary.aj
@@ -0,0 +1,9 @@
+public aspect PointcutLibrary {
+
+ public static pointcut doIt () :
+ execution(public void doIt()) && this(Missing);
+
+ public static pointcut println () :
+ execution(public void println(..));
+
+} \ No newline at end of file
diff --git a/tests/bugs153/pr158957/Tracing.aj b/tests/bugs153/pr158957/Tracing.aj
new file mode 100644
index 000000000..5a974ad2e
--- /dev/null
+++ b/tests/bugs153/pr158957/Tracing.aj
@@ -0,0 +1,6 @@
+public aspect Tracing {
+
+ before () : PointcutLibrary.println() {
+ System.out.println("? " + thisJoinPointStaticPart.getSignature().getName());
+ }
+} \ No newline at end of file
diff --git a/tests/bugs153/pr158957/ant.xml b/tests/bugs153/pr158957/ant.xml
new file mode 100644
index 000000000..c2de686f1
--- /dev/null
+++ b/tests/bugs153/pr158957/ant.xml
@@ -0,0 +1,27 @@
+<!-- ajc-ant script, not to be used from Ant commant line - see AntSpec -->
+<project name="ltw">
+
+ <!-- using this we can debug the forked VM -->
+ <property
+ name="jdwp"
+ value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"/>
+ <property name="aj.bootpath" refid="aj.path"/>
+
+ <target name="NPE with LTW, pointcut library and missing aspect dependency">
+ <java fork="yes" classname="HelloWorld" failonerror="yes">
+ <classpath refid="aj.path"/>
+ <classpath>
+ <!--<pathelement path="${aj.sandbox}/hello.jar:${aj.sandbox}/tracing.jar:${aj.sandbox}/missing.jar"/>-->
+ <pathelement path="${aj.sandbox}/hello.jar:${aj.sandbox}/tracing.jar"/>
+ </classpath>
+ <jvmarg value="-Daj.weaving.verbose=true"/>
+ <jvmarg value="-Dorg.aspectj.weaver.showWeaveInfo=true"/>
+ <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
+ <jvmarg value="-Dorg.aspectj.tracing.enabled=true"/>
+ <jvmarg value="-Dorg.aspectj.tracing.factory=default"/>
+ <jvmarg value="-Dorg.aspectj.tracing.messages=true"/>
+<!-- <jvmarg line="${jdwp}"/>-->
+ </java>
+ </target>
+
+</project>
diff --git a/tests/bugs153/pr158957/aop.xml b/tests/bugs153/pr158957/aop.xml
new file mode 100644
index 000000000..fec692fda
--- /dev/null
+++ b/tests/bugs153/pr158957/aop.xml
@@ -0,0 +1,9 @@
+<aspectj>
+ <aspects>
+ <aspect name="PointcutLibrary"/>
+ <aspect name="Tracing"/>
+ </aspects>
+
+ <weaver options="-1.5"/>
+</aspectj>
+
diff --git a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
index caef4be71..3aa129227 100644
--- a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
@@ -150,6 +150,10 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testWeaveConcreteSubaspectWithCflow_pr132080() {
runTest("Weave concrete sub-aspect with cflow");
}
+
+ public void testNPEWithLTWPointcutLibraryAndMissingAspectDependency_pr158957 () {
+ runTest("NPE with LTW, pointcut library and missing aspect dependency");
+ }
public void testNoInvalidAbsoluteTypeNameWarning_pr156904_1() {runTest("ensure no invalidAbsoluteTypeName when do match - 1");}
public void testNoInvalidAbsoluteTypeNameWarning_pr156904_2() {runTest("ensure no invalidAbsoluteTypeName when do match - 2");}
diff --git a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
index 9b64b631f..7e3f4e888 100644
--- a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
+++ b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
@@ -544,6 +544,27 @@
</ant>
</ajc-test>
+ <ajc-test dir="bugs153/pr158957" title="NPE with LTW, pointcut library and missing aspect dependency" keywords="ltw">
+ <compile files="HelloWorld.java" options="-outjar hello.jar"/>
+ <compile files="Missing.java" options="-outjar missing.jar"/>
+ <compile files="Tracing.aj, PointcutLibrary.aj" options="-Xlint:ignore -1.5 -outxml -outjar tracing.jar" classpath="hello.jar,missing.jar"/>
+<!--
+ <run class="HelloWorld" ltw="aop.xml">
+ <stdout>
+ <line text="? main"/>
+ <line text="Hello World!"/>
+ </stdout>
+ </run>
+-->
+ <ant file="ant.xml" target="NPE with LTW, pointcut library and missing aspect dependency" verbose="true">
+ <stdout>
+ <line text="? main"/>
+ <line text="Hello World!"/>
+ </stdout>
+ </ant>
+
+ </ajc-test>
+
<ajc-test dir="bugs153/pr132080"
title="Weave concrete sub-aspect with advice"
keywords="aop.xml">
@@ -618,5 +639,25 @@
<run class="TestMain" ltw="aop-pr149096.xml"/>
</ajc-test>
+ <ajc-test dir="bugs153/pr158957" title="NPE with LTW, pointcut library and missing aspect dependency" keywords="ltw">
+ <compile files="HelloWorld.java" options="-outjar hello.jar"/>
+ <compile files="Missing.java" options="-outjar missing.jar"/>
+ <compile files="Tracing.aj, PointcutLibrary.aj" options="-Xlint:ignore -1.5 -outxml -outjar tracing.jar" classpath="hello.jar,missing.jar"/>
+<!--
+ <run class="HelloWorld" ltw="aop.xml">
+ <stdout>
+ <line text="? main"/>
+ <line text="Hello World!"/>
+ </stdout>
+ </run>
+-->
+ <ant file="ant.xml" target="NPE with LTW, pointcut library and missing aspect dependency" verbose="true">
+ <stdout>
+ <line text="? println"/>
+ <line text="Hello World!"/>
+ </stdout>
+ </ant>
+
+ </ajc-test>
</suite> \ No newline at end of file