summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/ajcHarnessTests.xml22
-rw-r--r--tests/harness/aspectpath/A.java6
-rw-r--r--tests/harness/aspectpath/Main.java8
3 files changed, 36 insertions, 0 deletions
diff --git a/tests/ajcHarnessTests.xml b/tests/ajcHarnessTests.xml
index 56c098a38..76cef4c50 100644
--- a/tests/ajcHarnessTests.xml
+++ b/tests/ajcHarnessTests.xml
@@ -461,6 +461,28 @@
fork="true"
vmargs="-DPASS=true,-Dname=value"/>
</ajc-test>
+ <ajc-test dir="harness/aspectpath"
+ title="pass aspectpath LTW aspect works in one compile">
+ <compile files="A.java,Main.java"/>
+ <run class="Main"/>
+ </ajc-test>
+
+ <ajc-test dir="harness/aspectpath"
+ keywords="expect-fail"
+ title="fail aspectpath LTW failure case">
+ <compile files="Main.java"/>
+ <run class="Main"/>
+ </ajc-test>
+
+ <!-- uncomment after weaveinfo messages
+ (which cause false negatives) are suppressed
+ <ajc-test dir="harness/aspectpath"
+ title="pass aspectpath LTW">
+ <compile files="A.java" outjar="out.jar"/>
+ <compile files="Main.java"/>
+ <run class="Main" aspectpath="out.jar"/>
+ </ajc-test>
+ -->
</suite>
diff --git a/tests/harness/aspectpath/A.java b/tests/harness/aspectpath/A.java
new file mode 100644
index 000000000..267b2679f
--- /dev/null
+++ b/tests/harness/aspectpath/A.java
@@ -0,0 +1,6 @@
+
+aspect A {
+ before() : execution(void main(String[])) {
+ System.setProperty("A.before", "true");
+ }
+} \ No newline at end of file
diff --git a/tests/harness/aspectpath/Main.java b/tests/harness/aspectpath/Main.java
new file mode 100644
index 000000000..15b5d742e
--- /dev/null
+++ b/tests/harness/aspectpath/Main.java
@@ -0,0 +1,8 @@
+
+public class Main {
+ public static void main(String[] args) {
+ if (!Boolean.getBoolean("A.before")) {
+ throw new Error("property A.before not set by aspect A.java");
+ }
+ }
+} \ No newline at end of file