diff options
-rw-r--r-- | tests/ajcHarnessTests.xml | 99 | ||||
-rw-r--r-- | tests/harness/DirChangesTest.java | 16 | ||||
-rw-r--r-- | tests/harness/dirchanges-inc/src/Changed.20.java | 11 | ||||
-rw-r--r-- | tests/harness/dirchanges-inc/src/Changed.java | 12 | ||||
-rw-r--r-- | tests/harness/dirchanges-inc/src/Removed.delete.20.java | 7 | ||||
-rw-r--r-- | tests/harness/dirchanges-inc/src/Removed.java | 7 | ||||
-rw-r--r-- | tests/harness/dirchanges-inc/src/Unchanged.java | 6 |
7 files changed, 158 insertions, 0 deletions
diff --git a/tests/ajcHarnessTests.xml b/tests/ajcHarnessTests.xml index f90eaabdc..304552eff 100644 --- a/tests/ajcHarnessTests.xml +++ b/tests/ajcHarnessTests.xml @@ -341,6 +341,105 @@ </compile> </ajc-test> + <ajc-test dir="harness" + title="pass dir-changes: nested and static class"> + <compile files="DirChangesTest.java"> + <dir-changes added="DirChangesTest,DirChangesTest$Inner,DirChangesTest$Nested"/> + </compile> + </ajc-test> + + <ajc-test dir="harness" + keywords="expect-fail" + title="fail dir-changes: at end, expected file not added .. $Missing.."> + <compile files="DirChangesTest.java"> + <dir-changes added="DirChangesTest$Missing"/> + </compile> + </ajc-test> + + <ajc-test dir="harness/dirchanges-inc" + title="pass dir-changes incremental"> + <compile + options="-incremental" + staging="true" + sourceroots="src"> + <dir-changes added="Unchanged,Changed"/> + </compile> + <run class="Changed" options="first"/> + <inc-compile tag="20"> + <dir-changes removed="Removed" updated="Changed"/> + </inc-compile> + <run class="Changed" options="second"/> + </ajc-test> + + <ajc-test dir="harness/dirchanges-inc" + keywords="expect-fail" + title="fail dir-changes incremental: at start, did not expect added file to exist: {added==}Changed.class"> + <compile + options="-incremental" + staging="true" + sourceroots="src"/> + <inc-compile tag="20"> + <dir-changes added="Changed"/> + </inc-compile> + </ajc-test> + + <ajc-test dir="harness/dirchanges-inc" + keywords="expect-fail" + title="fail dir-changes incremental: at start, expected removed file to exist: {removed==}Missing.class"> + <compile + options="-incremental" + staging="true" + sourceroots="src"> + <dir-changes removed="Missing"/> + </compile> + </ajc-test> + + <ajc-test dir="harness/dirchanges-inc" + keywords="expect-fail" + title="fail dir-changes incremental: at start, expected updated file to exist: {updated==}Missing.class"> + <compile + options="-incremental" + staging="true" + sourceroots="src"> + <dir-changes updated="Missing"/> + </compile> + </ajc-test> + + <ajc-test dir="harness/dirchanges-inc" + keywords="expect-fail" + title="fail dir-changes incremental: at end, expected added file to exist: {added==}Missing.class"> + <compile + options="-incremental" + staging="true" + sourceroots="src"> + <dir-changes added="Missing"/> + </compile> + </ajc-test> + + <ajc-test dir="harness/dirchanges-inc" + keywords="expect-fail" + title="fail dir-changes incremental: at end, did not expect removed file to exist: {removed==}Changed.class"> + <compile + options="-incremental" + staging="true" + sourceroots="src"/> + <inc-compile tag="20"> + <dir-changes removed="Changed"/> + </inc-compile> + </ajc-test> + + <ajc-test dir="harness/dirchanges-inc" + keywords="expect-fail" + title="fail dir-changes incremental: at end, expected updated file to exist: {updated==}Removed.class"> + <compile + options="-incremental" + staging="true" + sourceroots="src"/> + <inc-compile tag="20"> + <dir-changes updated="Removed"/> + </inc-compile> + </ajc-test> + </suite> diff --git a/tests/harness/DirChangesTest.java b/tests/harness/DirChangesTest.java new file mode 100644 index 000000000..a305cd220 --- /dev/null +++ b/tests/harness/DirChangesTest.java @@ -0,0 +1,16 @@ +import org.aspectj.testing.Tester; + +public class DirChangesTest { + public static void main (String[] args) { + Tester.check(true, "ok"); + } + static class Nested { + static int meaningOfLife = 42; + } + class Inner { + int meaningOfLife = 42; + } + +} + + diff --git a/tests/harness/dirchanges-inc/src/Changed.20.java b/tests/harness/dirchanges-inc/src/Changed.20.java new file mode 100644 index 000000000..6d4871531 --- /dev/null +++ b/tests/harness/dirchanges-inc/src/Changed.20.java @@ -0,0 +1,11 @@ + + +public class Changed { + public static void main(String[] args) { + Unchanged.main(args); + String sargs = java.util.Arrays.asList(args).toString(); + if (!"[second]".equals(sargs)) { + throw new Error("expected args [second] but got " + sargs); + } + } +}
\ No newline at end of file diff --git a/tests/harness/dirchanges-inc/src/Changed.java b/tests/harness/dirchanges-inc/src/Changed.java new file mode 100644 index 000000000..7c6484ec8 --- /dev/null +++ b/tests/harness/dirchanges-inc/src/Changed.java @@ -0,0 +1,12 @@ + +import org.aspectj.testing.Tester; + +public class Changed { + public static void main(String[] args) { + Unchanged.main(args); + String sargs = java.util.Arrays.asList(args).toString(); + if (!"[first]".equals(sargs)) { + throw new Error("expected args [first] but got " + sargs); + } + } +}
\ No newline at end of file diff --git a/tests/harness/dirchanges-inc/src/Removed.delete.20.java b/tests/harness/dirchanges-inc/src/Removed.delete.20.java new file mode 100644 index 000000000..0b430c163 --- /dev/null +++ b/tests/harness/dirchanges-inc/src/Removed.delete.20.java @@ -0,0 +1,7 @@ + + +public class Removed { + public static void main(String[] args) { + Changed.main(args); + } +}
\ No newline at end of file diff --git a/tests/harness/dirchanges-inc/src/Removed.java b/tests/harness/dirchanges-inc/src/Removed.java new file mode 100644 index 000000000..0b430c163 --- /dev/null +++ b/tests/harness/dirchanges-inc/src/Removed.java @@ -0,0 +1,7 @@ + + +public class Removed { + public static void main(String[] args) { + Changed.main(args); + } +}
\ No newline at end of file diff --git a/tests/harness/dirchanges-inc/src/Unchanged.java b/tests/harness/dirchanges-inc/src/Unchanged.java new file mode 100644 index 000000000..807c14bf7 --- /dev/null +++ b/tests/harness/dirchanges-inc/src/Unchanged.java @@ -0,0 +1,6 @@ + + +public class Unchanged { + public static void main(String[] args) { + } +}
\ No newline at end of file |