< prev index next >

langtools/test/tools/sjavac/OverlappingSrcDst.java

Print this page




  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 /*
  27  * @test
  28  * @summary Make sure sjavac doesn't allow overlapping source and destination
  29  *          directories.
  30  * @bug 8061320
  31  * @library /tools/lib
  32  * @modules jdk.compiler/com.sun.tools.javac.api
  33  *          jdk.compiler/com.sun.tools.javac.main
  34  *          jdk.compiler/com.sun.tools.sjavac
  35  *          jdk.jdeps/com.sun.tools.javap
  36  * @build Wrapper toolbox.ToolBox
  37  * @run main Wrapper OverlappingSrcDst
  38  */
  39 
  40 import java.io.File;
  41 import java.nio.file.Paths;
  42 


  43 public class OverlappingSrcDst extends SJavacTester {
  44     public static void main(String... args) {
  45         new OverlappingSrcDst().run();
  46     }
  47 
  48     public void run() {
  49         String abs = ToolBox.currDir.toAbsolutePath().toString();
  50 
  51         // Relative vs relative
  52         test("dir", "dir", false);
  53         test("dir", "dir/dst", false);
  54         test("dir/src", "dir", false);
  55         test("src", "dst", true);
  56 
  57         // Absolute vs absolute
  58         test(abs + "/dir", abs + "/dir", false);
  59         test(abs + "/dir", abs + "/dir/dst", false);
  60         test(abs + "/dir/src", abs + "/dir", false);
  61         test(abs + "/src", abs + "/dst", true);
  62 




  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 /*
  27  * @test
  28  * @summary Make sure sjavac doesn't allow overlapping source and destination
  29  *          directories.
  30  * @bug 8061320
  31  * @library /tools/lib
  32  * @modules jdk.compiler/com.sun.tools.javac.api
  33  *          jdk.compiler/com.sun.tools.javac.main
  34  *          jdk.compiler/com.sun.tools.sjavac

  35  * @build Wrapper toolbox.ToolBox
  36  * @run main Wrapper OverlappingSrcDst
  37  */
  38 
  39 import java.io.File;
  40 import java.nio.file.Paths;
  41 
  42 import toolbox.ToolBox;
  43 
  44 public class OverlappingSrcDst extends SJavacTester {
  45     public static void main(String... args) {
  46         new OverlappingSrcDst().run();
  47     }
  48 
  49     public void run() {
  50         String abs = ToolBox.currDir.toAbsolutePath().toString();
  51 
  52         // Relative vs relative
  53         test("dir", "dir", false);
  54         test("dir", "dir/dst", false);
  55         test("dir/src", "dir", false);
  56         test("src", "dst", true);
  57 
  58         // Absolute vs absolute
  59         test(abs + "/dir", abs + "/dir", false);
  60         test(abs + "/dir", abs + "/dir/dst", false);
  61         test(abs + "/dir/src", abs + "/dir", false);
  62         test(abs + "/src", abs + "/dst", true);
  63 


< prev index next >