]> source.dussan.org Git - aspectj.git/commitdiff
dir-changes tests
authorwisberg <wisberg>
Wed, 31 Mar 2004 00:38:51 +0000 (00:38 +0000)
committerwisberg <wisberg>
Wed, 31 Mar 2004 00:38:51 +0000 (00:38 +0000)
tests/ajcHarnessTests.xml
tests/harness/DirChangesTest.java [new file with mode: 0644]
tests/harness/dirchanges-inc/src/Changed.20.java [new file with mode: 0644]
tests/harness/dirchanges-inc/src/Changed.java [new file with mode: 0644]
tests/harness/dirchanges-inc/src/Removed.delete.20.java [new file with mode: 0644]
tests/harness/dirchanges-inc/src/Removed.java [new file with mode: 0644]
tests/harness/dirchanges-inc/src/Unchanged.java [new file with mode: 0644]

index f90eaabdcf939671ac55c2581982e8e8b3b34551..304552eff5cf7c6751f193d4ff9b5a44c0fc9616 100644 (file)
         </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 (file)
index 0000000..a305cd2
--- /dev/null
@@ -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 (file)
index 0000000..6d48715
--- /dev/null
@@ -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 (file)
index 0000000..7c6484e
--- /dev/null
@@ -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 (file)
index 0000000..0b430c1
--- /dev/null
@@ -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 (file)
index 0000000..0b430c1
--- /dev/null
@@ -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 (file)
index 0000000..807c14b
--- /dev/null
@@ -0,0 +1,6 @@
+
+
+public class Unchanged {
+    public static void main(String[] args) {
+       }
+}
\ No newline at end of file