langtools/test/tools/sjavac/CompileWithOverrideSources.java
changeset 31115 8d8e98052d5d
parent 30730 d3ce7619db2c
child 32337 c9d3ab9f601c
--- a/langtools/test/tools/sjavac/CompileWithOverrideSources.java	Tue Jun 09 11:52:13 2015 +0200
+++ b/langtools/test/tools/sjavac/CompileWithOverrideSources.java	Tue Jun 09 15:57:45 2015 +0200
@@ -50,33 +50,43 @@
     // Compile gensrc and gensrc2. However do not compile broken beta.B in gensrc,
     // only compile ok beta.B in gensrc2
     void test() throws Exception {
-        Files.createDirectory(BIN);
+        clean(TEST_ROOT);
+        Files.createDirectories(BIN);
         clean(GENSRC, GENSRC2, GENSRC3, BIN);
 
         Map<String,Long> previous_bin_state = collectState(BIN);
         ToolBox tb = new ToolBox();
         tb.writeFile(GENSRC.resolve("alfa/omega/A.java"),
-                 "package alfa.omega; import beta.B; import gamma.C; public class A { B b; C c; }");
+                     "package alfa.omega; import beta.B; import gamma.C; public class A { B b; C c; }");
         tb.writeFile(GENSRC.resolve("beta/B.java"),
-                 "package beta; public class B { broken");
+                     "package beta; public class B { broken");
         tb.writeFile(GENSRC.resolve("gamma/C.java"),
-                 "package gamma; public class C { }");
+                     "package gamma; public class C { }");
 
         tb.writeFile(GENSRC2.resolve("beta/B.java"),
-                 "package beta; public class B { }");
+                     "package beta; public class B { }");
 
-        compile("-x", "beta", "gensrc", "gensrc2", "-d", "bin", "-h", "headers", "-j", "1",
+        compile("-x", "beta",
+                GENSRC.toString(),
+                GENSRC2.toString(),
+                "-d", BIN.toString(),
+                "-h", HEADERS.toString(),
+                "-j", "1",
                 SERVER_ARG);
         Map<String,Long> new_bin_state = collectState(BIN);
         verifyThatFilesHaveBeenAdded(previous_bin_state, new_bin_state,
-                                     "bin/alfa/omega/A.class",
-                                     "bin/beta/B.class",
-                                     "bin/gamma/C.class",
-                                     "bin/javac_state");
+                                     BIN + "/alfa/omega/A.class",
+                                     BIN + "/beta/B.class",
+                                     BIN + "/gamma/C.class",
+                                     BIN + "/javac_state");
 
         System.out.println("----- Compile with exluded beta went well!");
         clean(BIN);
-        compileExpectFailure("gensrc", "gensrc2", "-d", "bin", "-h", "headers", "-j", "1",
+        compileExpectFailure(GENSRC.toString(),
+                             GENSRC2.toString(),
+                             "-d", BIN.toString(),
+                             "-h", HEADERS.toString(),
+                             "-j", "1",
                              SERVER_ARG);
 
         System.out.println("----- Compile without exluded beta failed, as expected! Good!");