aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs183
diff options
context:
space:
mode:
authorAndy Clement <aclement@gopivotal.com>2014-10-06 17:35:51 -0700
committerAndy Clement <aclement@gopivotal.com>2014-10-06 17:35:51 -0700
commitc8e951296c5f95e82d4c7c3f8eb9b0a647014e20 (patch)
tree2eaed5b80ad735e4c91e424098e35e221f4fea44 /tests/bugs183
parent102173fc11fc6648ed8f2283d3c5ad535e412c73 (diff)
downloadaspectj-c8e951296c5f95e82d4c7c3f8eb9b0a647014e20.tar.gz
aspectj-c8e951296c5f95e82d4c7c3f8eb9b0a647014e20.zip
Fix 436653: conditional aspect activation plus various polish
Modified test expectation system so it is possible to say the test cares about one particular message and the rest do not matter (prefix message string with '*') - crude but quick. Polished many places to exploit generics Upgraded all the tests to work on Java8 - some serious changes regarding ajdoc on Java8. Hopefully it has stayed backwards compatible with earlier JDK versions (e.g. if using AspectJ 1.8.3+ with a JDK less than 8) but no explicit testing done for this.
Diffstat (limited to 'tests/bugs183')
-rw-r--r--tests/bugs183/436653/A.java1
-rw-r--r--tests/bugs183/436653/AnnoX.java10
-rw-r--r--tests/bugs183/436653/B.java1
-rw-r--r--tests/bugs183/436653/Code.java3
-rw-r--r--tests/bugs183/436653/Runner.java11
-rw-r--r--tests/bugs183/436653/X.java6
-rw-r--r--tests/bugs183/436653/XA.java7
-rw-r--r--tests/bugs183/436653/XA2.java9
-rw-r--r--tests/bugs183/436653/XA3.java9
-rw-r--r--tests/bugs183/436653/XB.java6
-rw-r--r--tests/bugs183/436653/XCode.java7
-rw-r--r--tests/bugs183/436653/aop.xml7
-rw-r--r--tests/bugs183/436653/aop2.xml7
-rw-r--r--tests/bugs183/436653/bin/Code.classbin0 -> 699 bytes
14 files changed, 84 insertions, 0 deletions
diff --git a/tests/bugs183/436653/A.java b/tests/bugs183/436653/A.java
new file mode 100644
index 000000000..9f4b93d84
--- /dev/null
+++ b/tests/bugs183/436653/A.java
@@ -0,0 +1 @@
+public class A {}
diff --git a/tests/bugs183/436653/AnnoX.java b/tests/bugs183/436653/AnnoX.java
new file mode 100644
index 000000000..19c10457f
--- /dev/null
+++ b/tests/bugs183/436653/AnnoX.java
@@ -0,0 +1,10 @@
+import org.aspectj.lang.annotation.*;
+
+@RequiredTypes("A")
+@Aspect
+class X {
+ @Before("execution(* Code.*(..))")
+ public void m() {
+ System.out.println("x");
+ }
+}
diff --git a/tests/bugs183/436653/B.java b/tests/bugs183/436653/B.java
new file mode 100644
index 000000000..b90c4517f
--- /dev/null
+++ b/tests/bugs183/436653/B.java
@@ -0,0 +1 @@
+public class B {}
diff --git a/tests/bugs183/436653/Code.java b/tests/bugs183/436653/Code.java
new file mode 100644
index 000000000..866a01f1d
--- /dev/null
+++ b/tests/bugs183/436653/Code.java
@@ -0,0 +1,3 @@
+public class Code {
+ public void m() {}
+}
diff --git a/tests/bugs183/436653/Runner.java b/tests/bugs183/436653/Runner.java
new file mode 100644
index 000000000..7705eccd5
--- /dev/null
+++ b/tests/bugs183/436653/Runner.java
@@ -0,0 +1,11 @@
+public class Runner {
+ public static void main(String []argv) {
+ new Code().m();
+ }
+}
+
+class Code {
+ public void m() {
+ System.out.println("Code.m() running");
+ }
+}
diff --git a/tests/bugs183/436653/X.java b/tests/bugs183/436653/X.java
new file mode 100644
index 000000000..0f19a6190
--- /dev/null
+++ b/tests/bugs183/436653/X.java
@@ -0,0 +1,6 @@
+import org.aspectj.lang.annotation.*;
+
+@RequiredTypes("A")
+aspect X {
+ before(): execution(* Code.*(..)) {System.out.println("x");}
+}
diff --git a/tests/bugs183/436653/XA.java b/tests/bugs183/436653/XA.java
new file mode 100644
index 000000000..fc4029829
--- /dev/null
+++ b/tests/bugs183/436653/XA.java
@@ -0,0 +1,7 @@
+import org.aspectj.lang.annotation.*;
+
+aspect XA {
+ @SuppressAjWarnings("adviceDidNotMatch")
+ before(): execution(* A.*(..)) {}
+}
+
diff --git a/tests/bugs183/436653/XA2.java b/tests/bugs183/436653/XA2.java
new file mode 100644
index 000000000..94748bd28
--- /dev/null
+++ b/tests/bugs183/436653/XA2.java
@@ -0,0 +1,9 @@
+import org.aspectj.lang.annotation.*;
+
+// Aspect deactivated if A is missing
+@RequiredTypes("A")
+aspect XA2 {
+ @SuppressAjWarnings("adviceDidNotMatch")
+ before(): execution(* A.*(..)) {}
+}
+
diff --git a/tests/bugs183/436653/XA3.java b/tests/bugs183/436653/XA3.java
new file mode 100644
index 000000000..483d310ae
--- /dev/null
+++ b/tests/bugs183/436653/XA3.java
@@ -0,0 +1,9 @@
+import org.aspectj.lang.annotation.*;
+
+// Aspect deactivated if A or B is missing (although aspect only really needs A)
+@RequiredTypes({"A","B"})
+aspect XA2 {
+ @SuppressAjWarnings("adviceDidNotMatch")
+ before(): execution(* A.*(..)) {}
+}
+
diff --git a/tests/bugs183/436653/XB.java b/tests/bugs183/436653/XB.java
new file mode 100644
index 000000000..4bcf903ca
--- /dev/null
+++ b/tests/bugs183/436653/XB.java
@@ -0,0 +1,6 @@
+import org.aspectj.lang.annotation.*;
+
+aspect XB {
+ before(): execution(* B.*(..)) {}
+}
+
diff --git a/tests/bugs183/436653/XCode.java b/tests/bugs183/436653/XCode.java
new file mode 100644
index 000000000..d3985fc20
--- /dev/null
+++ b/tests/bugs183/436653/XCode.java
@@ -0,0 +1,7 @@
+import org.aspectj.lang.annotation.*;
+
+aspect XCode {
+ @SuppressAjWarnings("adviceDidNotMatch")
+ before(): execution(* Cod*.*(..)) {}
+}
+
diff --git a/tests/bugs183/436653/aop.xml b/tests/bugs183/436653/aop.xml
new file mode 100644
index 000000000..aa7d74b40
--- /dev/null
+++ b/tests/bugs183/436653/aop.xml
@@ -0,0 +1,7 @@
+<aspectj>
+<aspects>
+<aspect name="X"/>
+</aspects>
+<weaver options="-verbose"/>
+</aspectj>
+
diff --git a/tests/bugs183/436653/aop2.xml b/tests/bugs183/436653/aop2.xml
new file mode 100644
index 000000000..aa7d74b40
--- /dev/null
+++ b/tests/bugs183/436653/aop2.xml
@@ -0,0 +1,7 @@
+<aspectj>
+<aspects>
+<aspect name="X"/>
+</aspects>
+<weaver options="-verbose"/>
+</aspectj>
+
diff --git a/tests/bugs183/436653/bin/Code.class b/tests/bugs183/436653/bin/Code.class
new file mode 100644
index 000000000..3cb964043
--- /dev/null
+++ b/tests/bugs183/436653/bin/Code.class
Binary files differ