aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2005-12-21 17:21:57 +0000
committeraclement <aclement>2005-12-21 17:21:57 +0000
commita778ac41009cdc13412ca79cf7a1649ccec93571 (patch)
treedf3293faab1ba7f8ba55d6225a080bb732dd84b7 /tests
parent6f74831e80244cce6b78dc86e7100d0944ae2496 (diff)
downloadaspectj-a778ac41009cdc13412ca79cf7a1649ccec93571.tar.gz
aspectj-a778ac41009cdc13412ca79cf7a1649ccec93571.zip
proper fix for 121385.
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs150/pr121385/A.java16
-rw-r--r--tests/bugs150/pr121385/ConcreteWorld.aj5
-rw-r--r--tests/bugs150/pr121385/Hello.java16
-rw-r--r--tests/bugs150/pr121385/World.aj24
-rw-r--r--tests/bugs150/pr121385/WorldAt.java10
-rw-r--r--tests/bugs150/pr121385/ant.xml43
-rw-r--r--tests/bugs150/pr121385/aop.xml19
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java7
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml24
9 files changed, 163 insertions, 1 deletions
diff --git a/tests/bugs150/pr121385/A.java b/tests/bugs150/pr121385/A.java
new file mode 100644
index 000000000..fd94e0a30
--- /dev/null
+++ b/tests/bugs150/pr121385/A.java
@@ -0,0 +1,16 @@
+import org.aspectj.lang.annotation.*;
+
+ abstract aspect X {
+ void around(): execution(* foo(..)) {}
+}
+
+
+@Aspect class B extends X { }
+
+public class A {
+ public void foo() { }
+
+public static void main(String []argv) {
+ new A().foo();
+}
+}
diff --git a/tests/bugs150/pr121385/ConcreteWorld.aj b/tests/bugs150/pr121385/ConcreteWorld.aj
new file mode 100644
index 000000000..cb1716509
--- /dev/null
+++ b/tests/bugs150/pr121385/ConcreteWorld.aj
@@ -0,0 +1,5 @@
+public aspect ConcreteWorld extends World {
+ pointcut greeting() :
+ execution(* Hello.sayWorld(..))
+ || execution(* Hello.sayHello(..));
+}
diff --git a/tests/bugs150/pr121385/Hello.java b/tests/bugs150/pr121385/Hello.java
new file mode 100644
index 000000000..833ee1d3e
--- /dev/null
+++ b/tests/bugs150/pr121385/Hello.java
@@ -0,0 +1,16 @@
+public class Hello {
+
+ public static void main(String[] args) {
+ sayHello();
+ }
+
+ public static void sayHello() {
+ System.out.println("Hello");
+ sayWorld();
+ }
+
+ public static int sayWorld() {
+ System.out.println("World");
+ return 0;
+ }
+}
diff --git a/tests/bugs150/pr121385/World.aj b/tests/bugs150/pr121385/World.aj
new file mode 100644
index 000000000..ac3fd5cc6
--- /dev/null
+++ b/tests/bugs150/pr121385/World.aj
@@ -0,0 +1,24 @@
+import org.aspectj.lang.Signature;
+import org.aspectj.lang.JoinPoint;
+public abstract aspect World {
+ //private Object result;
+ pointcut greeting() : execution(* Hello.sayWorld(..));
+
+ Object around(): greeting() {
+ System.out.println("around start!");
+ Object result = proceed();
+ System.out.println("around end!");
+ return result;
+ }
+
+// before() : greeting() {
+// Signature signature = thisJoinPoint.getSignature();
+// System.out.println("before " + signature.getName());
+// }
+
+// after() returning () : greeting() {
+// Signature signature = thisJoinPoint.getSignature();
+// System.out.println("after " + signature.getName());
+// }
+
+}
diff --git a/tests/bugs150/pr121385/WorldAt.java b/tests/bugs150/pr121385/WorldAt.java
new file mode 100644
index 000000000..1d142de59
--- /dev/null
+++ b/tests/bugs150/pr121385/WorldAt.java
@@ -0,0 +1,10 @@
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+
+@Aspect
+public abstract class WorldAt {
+
+ @Pointcut("execution(* Hello.sayWorld(..))")
+ void greeting() {}
+
+}
diff --git a/tests/bugs150/pr121385/ant.xml b/tests/bugs150/pr121385/ant.xml
new file mode 100644
index 000000000..994778ceb
--- /dev/null
+++ b/tests/bugs150/pr121385/ant.xml
@@ -0,0 +1,43 @@
+<!-- ajc-ant script, not to be used from Ant commant line - see AntSpec -->
+<project name="pr120473">
+
+ <!-- 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"/>
+
+ <target name="compile:javac">
+ <!-- compile only javac compilable stuff, exclude the one that needs other dependencies -->
+ <javac destdir="${aj.sandbox}" classpathref="aj.path"
+ srcdir="${basedir}"
+ includes="ataspectj/*"
+ excludes="ataspectj/UnweavableTest.java"
+ debug="true">
+ </javac>
+ </target>
+
+ <target name="ltw">
+ <java fork="yes" classname="ataspectj.AllLTWTests" failonerror="yes">
+ <classpath refid="aj.path"/>
+ <!-- use META-INF/aop.xml style -->
+ <classpath path="ataspectj/pathentry"/>
+ <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
+<!-- <jvmarg line="${jdwp}"/>-->
+ </java>
+ </target>
+
+ <target name="ConcreteAsepectTest">
+ <copy file="aop.xml" todir="${aj.sandbox}/META-INF">
+ </copy>
+ <java fork="yes" classname="Hello" failonerror="yes">
+ <classpath refid="aj.path"/>
+ <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
+<!--
+ <jvmarg value="-Daj5.def=aop.xml"/>
+ <jvmarg value="-Daj.weaving.verbose=true"/>
+-->
+<!-- <jvmarg line="${jdwp}"/> -->
+ </java>
+ </target>
+
+</project>
diff --git a/tests/bugs150/pr121385/aop.xml b/tests/bugs150/pr121385/aop.xml
new file mode 100644
index 000000000..b5e25899e
--- /dev/null
+++ b/tests/bugs150/pr121385/aop.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<aspectj>
+ <aspects>
+ <concrete-aspect name="World1" extends="World">
+ <pointcut name="greeting" expression="execution(* Hello.sayWorld(..)) || execution(* Hello.sayHello(..))"/>
+ </concrete-aspect>
+ </aspects>
+<!--
+ <aspects>
+ <aspect name="World"/>
+ <aspect name="ConcreteWorld"/>
+ </aspects>
+-->
+
+ <weaver options="-Xreweavable -verbose -XlazyTjp -showWeaveInfo">
+ <include within="Hello"/>
+ </weaver>
+</aspectj>
+
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index effaf6eeb..87a4eea60 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -41,7 +41,7 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
protected File getSpecFile() {
return new File("../tests/src/org/aspectj/systemtest/ajc150/ajc150.xml");
}
-
+ public void testMixingCodeStyles_pr121385() { runTest("mixing aspect styles");}
public void testTypeVars_pr121575() { runTest("different numbers of type vars");}
public void testTypeVars_pr121575_2() { runTest("different numbers of type vars - 2");}
public void testTypeVars_pr121575_3() { runTest("different numbers of type vars - 3");}
@@ -869,6 +869,11 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
runTest("abstract perthis in @AspectJ");
}
+ public void testNPEInBcelAdviceWithConcreteAspect_pr121385() {
+ runTest("override protected pointcut in aop.xml concrete aspect");
+ }
+
+
// helper methods.....
public SyntheticRepository createRepos(File cpentry) {
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index 34e9cb069..6a343d5f1 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -11,6 +11,12 @@
<compile files="pr121575.aj" options="-1.5"/>
<run class="pr121575"/>
</ajc-test>
+
+
+ <ajc-test dir="bugs150/pr121385" title="mixing aspect styles">
+ <compile files="A.java" options="-1.5"/>
+ <run class="A"/>
+ </ajc-test>
<ajc-test dir="java5/generics/tvars" title="different numbers of type vars - 2">
<compile files="Case1.aj" options="-1.5 -showWeaveInfo">
@@ -6207,5 +6213,23 @@
</stdout>
</run>
</ajc-test>
+
+ <ajc-test dir="bugs150/pr121385" title="override protected pointcut in aop.xml concrete aspect">
+ <compile files="Hello.java"/>
+ <compile files="World.aj, ConcreteWorld.aj"/>
+ <run class="Hello" ltw="aop.xml">
+ <stdout>
+ <line text="around start!"/>
+ <line text="Hello"/>
+ <line text="around start!"/>
+ <line text="World"/>
+ <line text="around end!"/>
+ <line text="around end!"/>
+ </stdout>
+ </run>
+<!--
+ <ant file="ant.xml" target="ConcreteAsepectTest" verbose="true"/>
+-->
+ </ajc-test>
</suite> \ No newline at end of file