]> source.dussan.org Git - aspectj.git/commitdiff
passing incremental tests from testing-drivers/testdata/harness/incremental
authorwisberg <wisberg>
Fri, 2 May 2003 19:09:11 +0000 (19:09 +0000)
committerwisberg <wisberg>
Fri, 2 May 2003 19:09:11 +0000 (19:09 +0000)
34 files changed:
tests/ajcTests.xml
tests/incremental/initialTests/TestNoTester.java [new file with mode: 0644]
tests/incremental/initialTests/classAdded/main/Main.20.java [new file with mode: 0644]
tests/incremental/initialTests/classAdded/main/Main.java [new file with mode: 0644]
tests/incremental/initialTests/classRemoved/main/Main.20.java [new file with mode: 0644]
tests/incremental/initialTests/classRemoved/main/Main.java [new file with mode: 0644]
tests/incremental/initialTests/classUnchanged/main/Main.20.java [new file with mode: 0644]
tests/incremental/initialTests/classUnchanged/main/Main.java [new file with mode: 0644]
tests/incremental/initialTests/classUpdated/main/Main.20.java [new file with mode: 0644]
tests/incremental/initialTests/classUpdated/main/Main.java [new file with mode: 0644]
tests/incremental/initialTests/defaultPackage-list/Main.30.java [new file with mode: 0644]
tests/incremental/initialTests/defaultPackage-list/Main.50.java [new file with mode: 0644]
tests/incremental/initialTests/defaultPackage-list/Main.java [new file with mode: 0644]
tests/incremental/initialTests/defaultPackage-list/Target.delete.40.java [new file with mode: 0644]
tests/incremental/initialTests/defaultPackage-list/Target.java [new file with mode: 0644]
tests/incremental/initialTests/defaultPackage/Main.30.java [new file with mode: 0644]
tests/incremental/initialTests/defaultPackage/Main.50.java [new file with mode: 0644]
tests/incremental/initialTests/defaultPackage/Main.java [new file with mode: 0644]
tests/incremental/initialTests/defaultPackage/Target.20.java [new file with mode: 0644]
tests/incremental/initialTests/defaultPackage/Target.delete.40.java [new file with mode: 0644]
tests/incremental/initialTests/expClasses/Main.java [new file with mode: 0644]
tests/incremental/initialTests/expClasses/expected/Main.class [new file with mode: 0644]
tests/incremental/initialTests/readme.txt [new file with mode: 0644]
tests/incremental/initialTests/selectionTest.xml [new file with mode: 0644]
tests/incremental/initialTests/sourceAdded/main/Main.30.java [new file with mode: 0644]
tests/incremental/initialTests/sourceAdded/main/Main.java [new file with mode: 0644]
tests/incremental/initialTests/sourceAdded/main/Target.20.java [new file with mode: 0644]
tests/incremental/initialTests/sourceDeleted/delete/DeleteMe.delete.20.java [new file with mode: 0644]
tests/incremental/initialTests/sourceDeleted/delete/DeleteMe.java [new file with mode: 0644]
tests/incremental/initialTests/sourceDeleted/delete/Main.java [new file with mode: 0644]
tests/incremental/initialTests/sourceDeleted/delete/Target.30.java [new file with mode: 0644]
tests/incremental/initialTests/sourceDeleted/delete/Target.java [new file with mode: 0644]
tests/incremental/initialTests/suite.xml [new file with mode: 0644]
tests/incremental/initialTests/suiteFails.xml [new file with mode: 0644]

index b7ad971d50268ac514aacb086afbd29c9d71e335..6a164462d379a3b8dbaf1956f9186adae2e76127 100644 (file)
@@ -13,6 +13,7 @@
                       so there may only be one copy marked "messages-vary" here.
   new-messages-vary   like messages-vary, except need to make ajcTest10 variant
 
+  incremental-test    incremental test.  All tests using inc-compile.
   fail-{...}          test fails in some configuration
   fail-unimplmented   eajc throwing "unimplemented" exception
   fail-commandLine    fails in ajc on command line (move to ajcTestsBroken.xml)
     </ajc-test>
 
     <ajc-test dir="incremental/stringliteral"   
-       keywords="knownLimitation"
+       keywords="knownLimitation,incremental-test"
        title="incrementally change string size and wire in injar classes">
         <compile staging="true" options="-incremental" 
                files="oneInjar.jar,twoInjar.jar"
         </compile>
     </ajc-test>
 
+    <ajc-test dir="incremental/initialTests/classAdded" 
+       title="expect class added in initial incremental tests" 
+       keywords="incremental-test" >
+        <compile staging="true" 
+               options="-incremental"
+               sourceroots="."/>
+        <run class="main.Main"/>
+        <inc-compile tag="20" >
+            <dir-changes added="main.Target"/>
+        </inc-compile>
+        <run class="main.Main"  skipTester="true"/>
+    </ajc-test>
+
+    <ajc-test dir="incremental/initialTests/classRemoved" 
+       title="expect class removed in initial incremental tests" 
+       keywords="incremental-test" >
+        <compile staging="true" 
+               options="-incremental" 
+               sourceroots="."/>
+        <run class="main.Main"/>
+        <inc-compile tag="20">
+            <dir-changes removed="main.Target"/>
+        </inc-compile>
+        <run class="main.Main"/>
+    </ajc-test>
+
+    <ajc-test dir="incremental/initialTests/classUpdated" 
+       title="expect class updated in initial incremental tests" 
+       keywords="incremental-test" >
+        <compile staging="true" 
+               options="-incremental"
+               sourceroots="."/>
+        <run class="main.Main"/>
+        <inc-compile tag="20">
+            <dir-changes updated="main.Main"/>
+        </inc-compile>
+        <run class="main.Main"/>
+    </ajc-test>
+
+     <ajc-test dir="incremental/initialTests/sourceAdded" 
+       title="add file with class"
+       comment="only expecting pickup if sourceroots"    
+       keywords="incremental-test" >
+        <compile staging="true" 
+               options="-incremental"
+               sourceroots="."/>
+        <run class="main.Main"/>
+        <inc-compile tag="20">
+            <dir-changes added="main.Target"/>
+        </inc-compile>
+        <inc-compile tag="30">
+            <dir-changes updated="main.Main"/>
+        </inc-compile>
+        <run class="main.Main"/>
+    </ajc-test>
+
+    <ajc-test dir="incremental/initialTests/sourceDeleted" 
+        title="delete source file before incremental compile"
+        comment="build config should permit file deletions for incremental (sourceroots)"
+        keywords="incremental-test" >
+        <compile staging="true" 
+               options="-incremental"
+               sourceroots="."/>
+        <run class="delete.Main"/>
+        <inc-compile tag="20">
+            <dir-changes removed="delete.DeleteMe"/>
+               <message kind="error" line="6" file="delete/Target.java"/>
+        </inc-compile>
+        <inc-compile tag="30"/> 
+        <run class="delete.Main"/>
+    </ajc-test>
+
+    <ajc-test dir="incremental/initialTests/expClasses" 
+       title="expected class tree" >
+        <compile files="Main.java">
+            <dir-changes expDir="expected"/>
+        </compile>
+        <run class="Main"/>
+    </ajc-test>
+    
+    <ajc-test dir="incremental/initialTests/defaultPackage" 
+       title="do everything in default package (sourceroots)" 
+       keywords="incremental-test" >
+        <compile staging="true" 
+               options="-incremental"
+               sourceroots="."/>
+        <run class="Main"/>
+        <inc-compile tag="20">
+            <dir-changes added="Target"/>
+        </inc-compile>
+        <run class="Target" skipTester="true"/>
+        <inc-compile tag="30">
+            <dir-changes updated="Main"/>
+        </inc-compile>
+        <run class="Main" skipTester="true"/>
+        <inc-compile tag="40"> 
+                       <message kind="error" line="6" file="Main.java"/>
+        </inc-compile>
+        <inc-compile tag="50"/>
+        <run class="Main"/>
+    </ajc-test>
+
 </suite>
diff --git a/tests/incremental/initialTests/TestNoTester.java b/tests/incremental/initialTests/TestNoTester.java
new file mode 100644 (file)
index 0000000..c411c15
--- /dev/null
@@ -0,0 +1,5 @@
+
+public class TestNoTester {
+    public static void main (String[] args) {
+    } 
+}
diff --git a/tests/incremental/initialTests/classAdded/main/Main.20.java b/tests/incremental/initialTests/classAdded/main/Main.20.java
new file mode 100644 (file)
index 0000000..aae295f
--- /dev/null
@@ -0,0 +1,11 @@
+package main;
+
+public class Main {
+    public static void main (String[] args) {
+        new Target().run();
+    }
+}
+
+class Target {
+    void run() {}
+}
diff --git a/tests/incremental/initialTests/classAdded/main/Main.java b/tests/incremental/initialTests/classAdded/main/Main.java
new file mode 100644 (file)
index 0000000..185ed42
--- /dev/null
@@ -0,0 +1,7 @@
+
+package main;
+
+public class Main {
+    public static void main (String[] args) {
+    }
+}
diff --git a/tests/incremental/initialTests/classRemoved/main/Main.20.java b/tests/incremental/initialTests/classRemoved/main/Main.20.java
new file mode 100644 (file)
index 0000000..dbe5d38
--- /dev/null
@@ -0,0 +1,8 @@
+
+package main;
+
+public class Main {
+    public static void main (String[] args) {
+    }
+}
+
diff --git a/tests/incremental/initialTests/classRemoved/main/Main.java b/tests/incremental/initialTests/classRemoved/main/Main.java
new file mode 100644 (file)
index 0000000..aae295f
--- /dev/null
@@ -0,0 +1,11 @@
+package main;
+
+public class Main {
+    public static void main (String[] args) {
+        new Target().run();
+    }
+}
+
+class Target {
+    void run() {}
+}
diff --git a/tests/incremental/initialTests/classUnchanged/main/Main.20.java b/tests/incremental/initialTests/classUnchanged/main/Main.20.java
new file mode 100644 (file)
index 0000000..fba791e
--- /dev/null
@@ -0,0 +1,12 @@
+
+package main;
+
+public class Main {
+    public static void main (String[] args) {
+        String s = "" + new Target();
+    }
+}
+
+class Target {
+    void run() {}
+}
diff --git a/tests/incremental/initialTests/classUnchanged/main/Main.java b/tests/incremental/initialTests/classUnchanged/main/Main.java
new file mode 100644 (file)
index 0000000..aae295f
--- /dev/null
@@ -0,0 +1,11 @@
+package main;
+
+public class Main {
+    public static void main (String[] args) {
+        new Target().run();
+    }
+}
+
+class Target {
+    void run() {}
+}
diff --git a/tests/incremental/initialTests/classUpdated/main/Main.20.java b/tests/incremental/initialTests/classUpdated/main/Main.20.java
new file mode 100644 (file)
index 0000000..d0b9d37
--- /dev/null
@@ -0,0 +1,8 @@
+package main;
+
+public class Main {
+    public static void main (String[] args) {
+        new Main().run();
+    }
+    void run() {}
+}
diff --git a/tests/incremental/initialTests/classUpdated/main/Main.java b/tests/incremental/initialTests/classUpdated/main/Main.java
new file mode 100644 (file)
index 0000000..185ed42
--- /dev/null
@@ -0,0 +1,7 @@
+
+package main;
+
+public class Main {
+    public static void main (String[] args) {
+    }
+}
diff --git a/tests/incremental/initialTests/defaultPackage-list/Main.30.java b/tests/incremental/initialTests/defaultPackage-list/Main.30.java
new file mode 100644 (file)
index 0000000..a46687d
--- /dev/null
@@ -0,0 +1,8 @@
+
+// default package 
+
+public class Main {
+    public static void main (String[] args) {
+        new Target().run();
+    }
+}
diff --git a/tests/incremental/initialTests/defaultPackage-list/Main.50.java b/tests/incremental/initialTests/defaultPackage-list/Main.50.java
new file mode 100644 (file)
index 0000000..7616df9
--- /dev/null
@@ -0,0 +1,7 @@
+
+// default package 
+
+public class Main {
+    public static void main (String[] args) {
+    }
+}
diff --git a/tests/incremental/initialTests/defaultPackage-list/Main.java b/tests/incremental/initialTests/defaultPackage-list/Main.java
new file mode 100644 (file)
index 0000000..66b7433
--- /dev/null
@@ -0,0 +1,7 @@
+
+// default package
+
+public class Main {
+    public static void main (String[] args) {
+    }
+}
diff --git a/tests/incremental/initialTests/defaultPackage-list/Target.delete.40.java b/tests/incremental/initialTests/defaultPackage-list/Target.delete.40.java
new file mode 100644 (file)
index 0000000..187c8a8
--- /dev/null
@@ -0,0 +1,2 @@
+
+// delete this file
\ No newline at end of file
diff --git a/tests/incremental/initialTests/defaultPackage-list/Target.java b/tests/incremental/initialTests/defaultPackage-list/Target.java
new file mode 100644 (file)
index 0000000..d67b065
--- /dev/null
@@ -0,0 +1,9 @@
+
+// default package
+
+public class Target {
+    public static void main(String[] args) {
+        new Target().run();
+    }
+    void run() {}
+}
diff --git a/tests/incremental/initialTests/defaultPackage/Main.30.java b/tests/incremental/initialTests/defaultPackage/Main.30.java
new file mode 100644 (file)
index 0000000..a46687d
--- /dev/null
@@ -0,0 +1,8 @@
+
+// default package 
+
+public class Main {
+    public static void main (String[] args) {
+        new Target().run();
+    }
+}
diff --git a/tests/incremental/initialTests/defaultPackage/Main.50.java b/tests/incremental/initialTests/defaultPackage/Main.50.java
new file mode 100644 (file)
index 0000000..7616df9
--- /dev/null
@@ -0,0 +1,7 @@
+
+// default package 
+
+public class Main {
+    public static void main (String[] args) {
+    }
+}
diff --git a/tests/incremental/initialTests/defaultPackage/Main.java b/tests/incremental/initialTests/defaultPackage/Main.java
new file mode 100644 (file)
index 0000000..66b7433
--- /dev/null
@@ -0,0 +1,7 @@
+
+// default package
+
+public class Main {
+    public static void main (String[] args) {
+    }
+}
diff --git a/tests/incremental/initialTests/defaultPackage/Target.20.java b/tests/incremental/initialTests/defaultPackage/Target.20.java
new file mode 100644 (file)
index 0000000..d67b065
--- /dev/null
@@ -0,0 +1,9 @@
+
+// default package
+
+public class Target {
+    public static void main(String[] args) {
+        new Target().run();
+    }
+    void run() {}
+}
diff --git a/tests/incremental/initialTests/defaultPackage/Target.delete.40.java b/tests/incremental/initialTests/defaultPackage/Target.delete.40.java
new file mode 100644 (file)
index 0000000..187c8a8
--- /dev/null
@@ -0,0 +1,2 @@
+
+// delete this file
\ No newline at end of file
diff --git a/tests/incremental/initialTests/expClasses/Main.java b/tests/incremental/initialTests/expClasses/Main.java
new file mode 100644 (file)
index 0000000..66b7433
--- /dev/null
@@ -0,0 +1,7 @@
+
+// default package
+
+public class Main {
+    public static void main (String[] args) {
+    }
+}
diff --git a/tests/incremental/initialTests/expClasses/expected/Main.class b/tests/incremental/initialTests/expClasses/expected/Main.class
new file mode 100644 (file)
index 0000000..fba840b
Binary files /dev/null and b/tests/incremental/initialTests/expClasses/expected/Main.class differ
diff --git a/tests/incremental/initialTests/readme.txt b/tests/incremental/initialTests/readme.txt
new file mode 100644 (file)
index 0000000..c4ef5e1
--- /dev/null
@@ -0,0 +1,15 @@
+
+These tests were brought over from testing-drivers.
+
+The test specifications are in ajcTests{Failing}.xml.
+
+Some files are old and unused in this directory:
+
+- The files suite.xml, suiteFails.xml, and selectionTest.xml
+  show the old test specifications.  
+  - Note that you can run "incremental" tests without the
+    -incremental option, and it will work even when listing
+    files (rather than using sourceroots), except that 
+    deleting listed files causes an error.
+
+- It's possible not all sources are used.
diff --git a/tests/incremental/initialTests/selectionTest.xml b/tests/incremental/initialTests/selectionTest.xml
new file mode 100644 (file)
index 0000000..1657317
--- /dev/null
@@ -0,0 +1,145 @@
+
+<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd">
+
+<suite >
+
+    <!-- .............................................................................
+         Should get 1 tests run and passed when running with global options:
+           -ajctestRequireKeywords=requireKeyword
+           -ajctestSkipKeywords=skipKeyword
+           !verbose
+           -eclipse
+         
+         This is used by a JUnit test HarnessSelectionTest.      
+         Do not change the outcome without changing that test.
+    -->
+    
+    <ajc-test dir="." title="run and pass" 
+        keywords="requireKeyword" >
+        <compile files="TestNoTester.java"/>
+        <run class="TestNoTester"/>
+    </ajc-test>
+
+    <!-- .............................................................................
+         AjcTest should skip or select based on (arbitrary) keywords
+    -->
+
+    <ajc-test dir="." pr="100" title="omit if skipKeyword" keywords="requireKeyword,skipKeyword" >
+        <compile staging="false" files="TestNoTester.java"/>
+        <run class="TestNoTester"/>
+    </ajc-test>
+    
+    <!-- .............................................................................
+         CompilerRun should resolve soft conflicts in favor of globals. XXX
+    -->
+
+    <!-- .............................................................................
+         CompilerRun should skip hard conflicts (both local and global use force). XXX
+    -->
+    <ajc-test dir="." pr="101" title="skip - conflict of local ^verbose and global !verbose XXX failing - runs" 
+        keywords="requireKeyword" >
+        <compile files="TestNoTester.java" options="^verbose"/>
+        <run class="TestNoTester"/>
+    </ajc-test>
+
+    
+    <!-- .............................................................................
+         CompilerRun should skip semantic conflicts - see CompilerRun.Spec.setupArgs(..).
+    -->
+
+    <ajc-test dir="." title="skip - local conflict between -lenient, -strict" 
+        keywords="requireKeyword" >
+        <compile files="TestNoTester.java" options="-lenient,-strict"/>
+        <run class="TestNoTester"/>
+    </ajc-test>
+
+    <ajc-test dir="." title="skip - local conflict between forced lenient, forced strict" 
+        keywords="requireKeyword" >
+        <compile files="TestNoTester.java" options="!lenient,!strict"/>
+        <run class="TestNoTester"/>
+    </ajc-test>
+
+    <!-- ................... ajc limitations -->
+    <ajc-test dir="." title="skip - forced ajc with incremental tests" 
+        keywords="requireKeyword" >
+        <compile staging="true" files="TestNoTester.java" options="!ajc"/>
+        <run class="TestNoTester"/>
+    </ajc-test>
+
+    <!-- ................... eajc limitations -->
+    <ajc-test dir="." title="skip - forced eclipse with -strict" 
+        keywords="requireKeyword,ajcEclipseForceConflict,eclipseOptionSkip" >
+        <compile staging="true" files="TestNoTester.java" options="-strict,!eclipse"/>
+        <run class="TestNoTester"/>
+    </ajc-test>
+
+    <ajc-test dir="." title="skip - forced eclipse with -lenient" 
+        keywords="requireKeyword,ajcEclipseForceConflict,eclipseOptionSkip" >
+        <compile staging="true" files="TestNoTester.java" options="-lenient,!eclipse"/>
+        <run class="TestNoTester"/>
+    </ajc-test>
+
+    <ajc-test dir="." title="skip - forced eclipse with forced strict" 
+        keywords="requireKeyword,ajcEclipseForceConflict,eclipseOptionSkip" >
+        <compile staging="true" files="TestNoTester.java" options="!strict,!eclipse"/>
+        <run class="TestNoTester"/>
+    </ajc-test>
+
+    <ajc-test dir="." title="skip - forced eclipse with forced lenient" 
+        keywords="requireKeyword,ajcEclipseForceConflict,eclipseOptionSkip" >
+        <compile staging="true" files="TestNoTester.java" options="!lenient,!eclipse"/>
+        <run class="TestNoTester"/>
+    </ajc-test>
+
+    <ajc-test dir="." title="skip - forced eclipse with -preprocess" 
+        keywords="requireKeyword,ajcEclipseForceConflict,eclipseOptionSkip" >
+        <compile staging="true" files="TestNoTester.java" options="-preprocess,!eclipse"/>
+        <run class="TestNoTester"/>
+    </ajc-test>
+
+    <ajc-test dir="." title="skip - forced eclipse with -usejavac" 
+        keywords="requireKeyword,ajcEclipseForceConflict,eclipseOptionSkip" >
+        <compile staging="true" files="TestNoTester.java" options="-usejavac,!eclipse"/>
+        <run class="TestNoTester"/>
+    </ajc-test>
+
+    <!-- .............................................................................
+         CompilerRun should skip invalid options CompilerRun.Spec.INVALID_OPTIONS:
+      { "-workingdir", "-argfile", "-sourceroot", "-outjar", "-source" }
+    -->
+
+    <ajc-test dir="." title="skip - local invalid option -workingdir" 
+        keywords="requireKeyword,localInvalidOption" >
+        <compile files="TestNoTester.java" options="-workingdir,."/>
+        <run class="TestNoTester"/>
+    </ajc-test>
+
+    <ajc-test dir="." title="skip - local invalid option -argfile" 
+        keywords="requireKeyword,localInvalidOption" >
+        <compile files="TestNoTester.java" options="-argfile,f"/>
+        <run class="TestNoTester"/>
+    </ajc-test>
+
+    <ajc-test dir="." title="skip - local invalid option -sourceroot" 
+        keywords="requireKeyword,localInvalidOption" >
+        <compile files="TestNoTester.java" options="-sourceroot,."/>
+        <run class="TestNoTester"/>
+    </ajc-test>
+
+    <ajc-test dir="." title="skip - local invalid option -outjar"
+        keywords="requireKeyword,localInvalidOption" >
+        <compile files="TestNoTester.java" options="-outjar,foo.jar"/>
+        <run class="TestNoTester"/>
+    </ajc-test>
+
+    <ajc-test dir="." title="skip - local invalid option -source 1.4" 
+        keywords="requireKeyword,localInvalidOption" >
+        <compile files="TestNoTester.java" options="-source,1.4"/>
+        <run class="TestNoTester"/>
+    </ajc-test>
+    
+    <!-- .............................................................................
+         CompilerRun should skip invalid options specified as globals XXX
+    -->
+
+</suite>
diff --git a/tests/incremental/initialTests/sourceAdded/main/Main.30.java b/tests/incremental/initialTests/sourceAdded/main/Main.30.java
new file mode 100644 (file)
index 0000000..59564d3
--- /dev/null
@@ -0,0 +1,12 @@
+
+package main;
+
+import org.aspectj.testing.Tester;
+
+public class Main {
+    public static void main (String[] args) {
+        new Target().run();
+        Tester.expectEvent("Target.run()");
+        Tester.checkAllEvents();
+    }
+}
diff --git a/tests/incremental/initialTests/sourceAdded/main/Main.java b/tests/incremental/initialTests/sourceAdded/main/Main.java
new file mode 100644 (file)
index 0000000..185ed42
--- /dev/null
@@ -0,0 +1,7 @@
+
+package main;
+
+public class Main {
+    public static void main (String[] args) {
+    }
+}
diff --git a/tests/incremental/initialTests/sourceAdded/main/Target.20.java b/tests/incremental/initialTests/sourceAdded/main/Target.20.java
new file mode 100644 (file)
index 0000000..985587e
--- /dev/null
@@ -0,0 +1,9 @@
+package main;
+
+import org.aspectj.testing.Tester;
+
+public class Target {
+    void run() { 
+        Tester.event("Target.run()");
+    }
+}
diff --git a/tests/incremental/initialTests/sourceDeleted/delete/DeleteMe.delete.20.java b/tests/incremental/initialTests/sourceDeleted/delete/DeleteMe.delete.20.java
new file mode 100644 (file)
index 0000000..345047b
--- /dev/null
@@ -0,0 +1,2 @@
+
+// delete file DeleteMe.java
\ No newline at end of file
diff --git a/tests/incremental/initialTests/sourceDeleted/delete/DeleteMe.java b/tests/incremental/initialTests/sourceDeleted/delete/DeleteMe.java
new file mode 100644 (file)
index 0000000..9057235
--- /dev/null
@@ -0,0 +1,7 @@
+
+package delete;
+
+public class DeleteMe {
+    static void run() {
+    }
+}
diff --git a/tests/incremental/initialTests/sourceDeleted/delete/Main.java b/tests/incremental/initialTests/sourceDeleted/delete/Main.java
new file mode 100644 (file)
index 0000000..e180e46
--- /dev/null
@@ -0,0 +1,8 @@
+
+package delete;
+
+public class Main {
+       public static void main(String[] args) {
+        Target.run();
+       }
+}
diff --git a/tests/incremental/initialTests/sourceDeleted/delete/Target.30.java b/tests/incremental/initialTests/sourceDeleted/delete/Target.30.java
new file mode 100644 (file)
index 0000000..1678b70
--- /dev/null
@@ -0,0 +1,7 @@
+
+package delete;
+
+public class Target {
+    static void run() {
+    }
+}
diff --git a/tests/incremental/initialTests/sourceDeleted/delete/Target.java b/tests/incremental/initialTests/sourceDeleted/delete/Target.java
new file mode 100644 (file)
index 0000000..a194019
--- /dev/null
@@ -0,0 +1,8 @@
+
+package delete;
+
+public class Target {
+    static void run() {
+        DeleteMe.run(); // CE 6 after DeleteMe deleted
+    }
+}
diff --git a/tests/incremental/initialTests/suite.xml b/tests/incremental/initialTests/suite.xml
new file mode 100644 (file)
index 0000000..b6b5683
--- /dev/null
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd">
+
+<suite>    
+
+    <!-- driven from JUnit by HarnessSelectionTest.testIncrementalSuite() -->
+       <!-- 
+             Using OldAjc (no inc-compile), get two errors (updated file not found (b/c cleared?), 
+             deleted file not found.
+        -->
+
+    <!-- 
+         test harness ability to update and delete source files to prep for a compile
+     -->
+    <ajc-test dir="sourceDeleted" title="  file" keywords="incremental" >
+        <compile staging="true" files="delete/Main.java,delete/Target.java,delete/DeleteMe.java"/>
+        <run class="delete.Main"/>
+        <inc-compile tag="20">
+            <dir-changes removed="delete.DeleteMe"/>
+               <message kind="error" line="6" file="delete/Target.java"/>
+        </inc-compile>
+        <inc-compile tag="30"/> 
+        <run class="delete.Main"/>
+    </ajc-test>
+    
+    <ajc-test dir="sourceAdded" title="add file with class" keywords="incremental" >
+        <compile staging="true" files="main/Main.java"/>
+        <run class="main.Main"/>
+        <inc-compile tag="20">
+            <dir-changes added="main.Target"/>
+        </inc-compile>
+        <inc-compile tag="30">
+            <dir-changes updated="main.Main"/>
+        </inc-compile>
+        <run class="main.Main"/>
+    </ajc-test>
+
+    <ajc-test dir="defaultPackage" title="do everything in default package" keywords="incremental" >
+        <compile staging="true" files="Main.java"/>
+        <run class="Main"/>
+        <inc-compile tag="20">
+            <dir-changes added="Target"/>
+        </inc-compile>
+        <run class="Target" skipTester="true"/>
+        <inc-compile tag="30">
+            <dir-changes updated="Main"/>
+        </inc-compile>
+        <run class="Main" skipTester="true"/>
+        <inc-compile tag="40">
+            <dir-changes updated="Main" removed="Target"/>
+                       <message kind="error" line="1"/>
+        </inc-compile>
+        <run class="Main"/>
+    </ajc-test>
+
+    <!-- 
+         test harness detection of .class file added, removed, or changed 
+         as a result of the compile process. 
+         XXX test dir-changes for JavaRun, CompilerRun
+         XXX document special handling of dir-changes paths as FQN for .class suffix
+         XXX need negative tests, fails reported
+     -->
+    <ajc-test dir="classAdded" title="expect class added" keywords="incremental" >
+        <compile staging="true" files="main/Main.java"/>
+        <run class="main.Main"/>
+        <inc-compile tag="20" >
+            <dir-changes added="main.Target"/>
+        </inc-compile>
+        <run class="main.Main"  skipTester="true"/>
+    </ajc-test>
+
+    <ajc-test dir="classRemoved" title="expect class removed" keywords="incremental" >
+        <compile staging="true" files="main/Main.java"/>
+        <run class="main.Main"/>
+        <inc-compile tag="20">
+            <dir-changes removed="main.Target"/>
+        </inc-compile>
+        <run class="main.Main"/>
+    </ajc-test>
+
+    <ajc-test dir="classUnchanged" title="expect class unchanged" keywords="incremental" >
+        <compile staging="true" files="main/Main.java"/>
+        <run class="main.Main"/>
+        <inc-compile tag="20">
+            <dir-changes updated="main.Main" unchanged="main.Target"/>
+        </inc-compile>
+        <run class="main.Main"/>
+    </ajc-test>
+
+    <ajc-test dir="classUpdated" title="expect class updated" keywords="incremental" >
+        <compile staging="true" files="main/Main.java"/>
+        <run class="main.Main"/>
+        <inc-compile tag="20">
+            <dir-changes updated="main.Main"/>
+        </inc-compile>
+        <run class="main.Main"/>
+    </ajc-test>
+
+    <ajc-test dir="expClasses" title="expected class tree" keywords="incremental"
+      comment="XXX need to install Main.class compiled with harness" >
+        <compile files="Main.java">
+            <dir-changes expDir="expClasses"/>
+        </compile>
+        <run class="Main"/>
+    </ajc-test>
+
+
+</suite>
diff --git a/tests/incremental/initialTests/suiteFails.xml b/tests/incremental/initialTests/suiteFails.xml
new file mode 100644 (file)
index 0000000..8bf7f74
--- /dev/null
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!DOCTYPE suite [
+   <!ELEMENT suite (ajc-test+)>
+   <!ATTLIST suite suiteDir CDATA #IMPLIED >
+   <!ATTLIST suite verbose CDATA #IMPLIED >
+
+   <!ELEMENT ajc-test (compile, (compile | inc-compile | run )*)>
+   <!ATTLIST ajc-test title CDATA #REQUIRED >
+   <!ATTLIST ajc-test dir CDATA #REQUIRED >
+   <!ATTLIST ajc-test pr CDATA #IMPLIED >
+   <!ATTLIST ajc-test keywords CDATA #IMPLIED >
+
+   <!ELEMENT compile (dir-changes*,file*,message*)>
+   <!ATTLIST compile files CDATA #IMPLIED >
+   <!ATTLIST compile options CDATA #IMPLIED >
+   <!ATTLIST compile staging (true | false) #IMPLIED >
+
+   <!ELEMENT inc-compile (dir-changes*,message*)> <!-- 0-1? -->
+   <!ATTLIST inc-compile tag CDATA #REQUIRED >
+   <!ATTLIST inc-compile changedFiles CDATA #IMPLIED >
+   <!ATTLIST inc-compile classesAdded CDATA #IMPLIED >
+   <!ATTLIST inc-compile classesRemoved CDATA #IMPLIED >
+   <!ATTLIST inc-compile classesUpdated CDATA #IMPLIED >
+
+   <!ELEMENT run (dir-changes*,message*)>
+   <!ATTLIST run class CDATA #REQUIRED >
+   <!ATTLIST run skipTester CDATA #IMPLIED >
+   <!ATTLIST run options CDATA #IMPLIED >
+
+   <!ELEMENT file (#PCDATA)>
+   <!ATTLIST file path CDATA #IMPLIED >
+
+   <!ELEMENT dir-changes (#PCDATA)>
+   <!ATTLIST dir-changes dirToken (classes | run) #IMPLIED >
+   <!ATTLIST dir-changes defaultSuffix CDATA #IMPLIED >
+   <!ATTLIST dir-changes added CDATA #IMPLIED >
+   <!ATTLIST dir-changes removed CDATA #IMPLIED >
+   <!ATTLIST dir-changes updated CDATA #IMPLIED >
+   <!ATTLIST dir-changes unchanged CDATA #IMPLIED >
+
+   <!ELEMENT message (#PCDATA)>
+   <!ATTLIST message kind (error | warning | info | Xlint) #REQUIRED >
+   <!ATTLIST message line CDATA #REQUIRED >
+   <!ATTLIST message text CDATA #IMPLIED >
+   <!ATTLIST message file CDATA #IMPLIED >
+   ]>
+
+<suite suiteDir="."  verbose="true">    
+       <!-- 
+             Using OldAjc (no inc-compile), get two errors (updated file not found (b/c cleared?), 
+             deleted file not found.
+        -->
+
+    <!-- 
+         test harness ability to update and delete source files to prep for a compile
+     -->
+    <!-- 
+         test harness ability to detect directory changes
+     -->
+    <ajc-test title="report dir-changes fail when expected added class not added"
+       dir="classAdded" keywords="incremental" >
+        <compile staging="true" files="main/Main.java"/>
+        <run class="main.Main"/>
+        <inc-compile tag="20" >
+            <dir-changes added="main.ExpectNotAdded"/>
+        </inc-compile>
+    </ajc-test>
+
+    <ajc-test title="report dir-changes fail when expected added class exists at start"
+       dir="classAdded" keywords="incremental" >
+        <compile staging="true" files="main/Main.java"/>
+        <run class="main.Main"/>
+        <inc-compile tag="20" >
+            <dir-changes added="main.Main"/>
+        </inc-compile>
+    </ajc-test>
+
+    <ajc-test title="report dir-changes fail when expected unchanged class changed"
+       dir="classAdded" keywords="incremental" >
+        <compile staging="true" files="main/Main.java"/>
+        <run class="main.Main"/>
+        <inc-compile tag="20" >
+            <dir-changes unchanged="main.Main"/>
+        </inc-compile>
+    </ajc-test>
+
+    <ajc-test title="report dir-changes fail when expected unchanged class does not exist at start"
+       dir="classAdded" keywords="incremental" >
+        <compile staging="true" files="main/Main.java"/>
+        <run class="main.Main"/>
+        <inc-compile tag="20" >
+            <dir-changes unchanged="main.DoesNotExistAtStart"/>
+        </inc-compile>
+    </ajc-test>
+
+    <ajc-test title="report dir-changes fail when expected updated class is not updated"
+       dir="classUnchanged" keywords="incremental" >
+        <compile staging="true" files="main/Main.java"/>
+        <run class="main.Main"/>
+        <inc-compile tag="20" >
+            <dir-changes updated="main.Target"/>
+        </inc-compile>
+    </ajc-test>
+
+    <ajc-test title="report dir-changes fail when expected updated class does not exist at start"
+       dir="classAdded" keywords="incremental" >
+        <compile staging="true" files="main/Main.java"/>
+        <run class="main.Main"/>
+        <inc-compile tag="20" >
+            <dir-changes updated="main.DoesNotExistAtStart"/>
+        </inc-compile>
+    </ajc-test>
+
+
+    <ajc-test title="report dir-changes fail when expected deleted class not deleted"
+       dir="classAdded" keywords="incremental" >
+        <compile staging="true" files="main/Main.java"/>
+        <run class="main.Main"/>
+        <inc-compile tag="20" >
+            <dir-changes removed="main.Main"/>
+        </inc-compile>
+    </ajc-test>
+
+    <ajc-test title="report dir-changes fail when expected deleted class does not exist at start"
+       dir="classAdded" keywords="incremental" >
+        <compile staging="true" files="main/Main.java"/>
+        <run class="main.Main"/>
+        <inc-compile tag="20" >
+            <dir-changes removed="main.DoesNotExistAtStart"/>
+        </inc-compile>
+    </ajc-test>
+
+</suite>