aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndy Clement <aclement@gopivotal.com>2014-03-18 22:21:20 -0700
committerAndy Clement <aclement@gopivotal.com>2014-03-18 22:21:20 -0700
commitc1c4a4d41f3173bb72040d91d42d07662ab703bd (patch)
treeee5f5bb17e86908b93504db85d2886e0375a94c5 /tests
parentbedb85ee870c2c0dad34d68662c83ff7033dd746 (diff)
downloadaspectj-c1c4a4d41f3173bb72040d91d42d07662ab703bd.tar.gz
aspectj-c1c4a4d41f3173bb72040d91d42d07662ab703bd.zip
merging 1.7.4 fixes into 1.8.0
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs174/ajdt_markers/Code.java20
-rw-r--r--tests/bugs174/extra_inserts/Code.java18
-rw-r--r--tests/bugs174/pr419279/Code.java10
-rw-r--r--tests/src/org/aspectj/systemtest/ajc174/Ajc174Tests.java14
-rw-r--r--tests/src/org/aspectj/systemtest/ajc174/ajc174.xml41
5 files changed, 103 insertions, 0 deletions
diff --git a/tests/bugs174/ajdt_markers/Code.java b/tests/bugs174/ajdt_markers/Code.java
new file mode 100644
index 000000000..b5b52c1e9
--- /dev/null
+++ b/tests/bugs174/ajdt_markers/Code.java
@@ -0,0 +1,20 @@
+public class Code extends A implements I {
+
+ public static void main(String[] argv) {
+ Code code = new Code();
+ code.am();
+ code.im();
+ }
+}
+
+class A {
+ public void am() {}
+}
+
+interface I {
+}
+
+aspect X {
+ public void I.im() {}
+ before(): call(* A+.*m(..)) {}
+}
diff --git a/tests/bugs174/extra_inserts/Code.java b/tests/bugs174/extra_inserts/Code.java
new file mode 100644
index 000000000..fa4d85990
--- /dev/null
+++ b/tests/bugs174/extra_inserts/Code.java
@@ -0,0 +1,18 @@
+public aspect Code {
+ declare warning: call(* foo(..)): "Call to foo made inside class {joinpoint.enclosingclass}";
+ declare warning: call(* foo(..)): "Call to foo made inside member {joinpoint.enclosingmember.name}";
+ declare warning: call(* foo(..)): "Call to foo made inside member {joinpoint.enclosingmember}";
+}
+class Bar {
+ public void booble() {
+ foo();
+ }
+ public void foo() {}
+}
+
+class Boo {
+ public void m() {
+ foo();
+ }
+ public void foo() {}
+}
diff --git a/tests/bugs174/pr419279/Code.java b/tests/bugs174/pr419279/Code.java
new file mode 100644
index 000000000..672d720ef
--- /dev/null
+++ b/tests/bugs174/pr419279/Code.java
@@ -0,0 +1,10 @@
+public aspect Code {
+ before(): execution(* *(String)) { }
+ before(): call(* someMethod(..)) {
+ System.out.println(thisJoinPoint);
+ }
+ public void foo() {
+ someMethod();
+ }
+ public void someMethod(){}
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc174/Ajc174Tests.java b/tests/src/org/aspectj/systemtest/ajc174/Ajc174Tests.java
index 1e300dd0a..e647532fd 100644
--- a/tests/src/org/aspectj/systemtest/ajc174/Ajc174Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc174/Ajc174Tests.java
@@ -21,6 +21,20 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
*/
public class Ajc174Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+/* wip
+ public void testAjdtMarkers() throws Exception {
+ runTest("ajdt markers");
+ }
+*/
+
+ public void testExtraInserts() throws Exception {
+ runTest("extra inserts");
+ }
+
+ public void testMoreConfigurableLint_419279() throws Exception {
+ runTest("more configurable lint");
+ }
+
public void testAnnotatedItd_418129() throws Exception {
runTest("annotated itd");
}
diff --git a/tests/src/org/aspectj/systemtest/ajc174/ajc174.xml b/tests/src/org/aspectj/systemtest/ajc174/ajc174.xml
index 5b47cf4d3..2ee09c456 100644
--- a/tests/src/org/aspectj/systemtest/ajc174/ajc174.xml
+++ b/tests/src/org/aspectj/systemtest/ajc174/ajc174.xml
@@ -2,6 +2,47 @@
<suite>
+ <ajc-test dir="bugs174/ajdt_markers" title="ajdt markers">
+ <compile files="Code.java" options="-1.5 -showWeaveInfo">
+ </compile>
+ </ajc-test>
+
+
+ <ajc-test dir="bugs174/extra_inserts" title="extra inserts">
+ <compile files="Code.java" options="-1.5">
+ <message kind="warning" line="8" text="Call to foo made inside class Bar"/>
+ <message kind="warning" line="15" text="Call to foo made inside class Boo"/>
+ <message kind="warning" line="8" text="Call to foo made inside member booble"/>
+ <message kind="warning" line="15" text="Call to foo made inside member m"/>
+ <message kind="warning" line="8" text="Call to foo made inside member void Bar.booble()"/>
+ <message kind="warning" line="15" text="Call to foo made inside member void Boo.m()"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs174/pr419279" title="more configurable lint">
+ <compile files="Code.java" options="-1.5">
+ <message kind="warning" text="advice defined in Code has not been applied [Xlint:adviceDidNotMatch]"/>
+ </compile>
+ <compile files="Code.java" options="-1.5 -Xlint:adviceDidNotMatch=ignore">
+ </compile>
+ <compile files="Code.java" options="-1.5 -Xlint:adviceDidNotMatch=error">
+ <message kind="error" text="advice defined in Code has not been applied [Xlint:adviceDidNotMatch]"/>
+ </compile>
+ <compile files="Code.java" options="-1.5 -Xlint:foo=bar">
+ <message kind="error" text="invalid Xlint key: foo"/>
+ </compile>
+ <compile files="Code.java" options="-1.5 -Xlint:adviceDidNotMatch=wibble">
+ <message kind="error" text="invalid Xlint message kind (must be one of ignore, warning, error): wibble"/>
+ </compile>
+ <compile files="Code.java" options="-1.5 -Xlint:adviceDidNotMatch=ignore{adviceDidNotMatch=error">
+ <message kind="error" text="advice defined in Code has not been applied [Xlint:adviceDidNotMatch]"/>
+ </compile>
+ <compile files="Code.java" options="-1.5 -Xlint:adviceDidNotMatch=error{noGuardForLazyTjp=error">
+ <message kind="error" text="advice defined in Code has not been applied [Xlint:adviceDidNotMatch]"/>
+ <message kind="error" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]"/>
+ </compile>
+ </ajc-test>
+
<ajc-test dir="bugs174/pr418129" title="annotated itd">
<compile files="Target.java" options="-1.5 -showWeaveInfo">
<message kind="weave" text="Type 'Behavior' (Target.java) has intertyped method from 'Trait' (Target.java:'java.lang.String Behavior.hello()')"/>