langtools/test/tools/javac/modules/EdgeCases.java
changeset 43272 421ae1e38d2d
parent 43271 ce89609dde7c
child 43369 aafd33c96bac
equal deleted inserted replaced
43271:ce89609dde7c 43272:421ae1e38d2d
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 8154283 8167320 8171098 8172809
    26  * @bug 8154283 8167320 8171098 8172809 8173117
    27  * @summary tests for multi-module mode compilation
    27  * @summary tests for multi-module mode compilation
    28  * @library /tools/lib
    28  * @library /tools/lib
    29  * @modules
    29  * @modules
    30  *      jdk.compiler/com.sun.tools.javac.api
    30  *      jdk.compiler/com.sun.tools.javac.api
    31  *      jdk.compiler/com.sun.tools.javac.code
    31  *      jdk.compiler/com.sun.tools.javac.code
   491                 "1 error");
   491                 "1 error");
   492 
   492 
   493         if (!expected.equals(log)) {
   493         if (!expected.equals(log)) {
   494             throw new AssertionError("Unexpected output: " + log);
   494             throw new AssertionError("Unexpected output: " + log);
   495         }
   495         }
       
   496     }
       
   497 
       
   498     @Test
       
   499     public void testInvisibleClassVisiblePackageClash(Path base) throws Exception {
       
   500         Path src = base.resolve("src");
       
   501         Path src_m1 = src.resolve("m1x");
       
   502         tb.writeJavaFiles(src_m1,
       
   503                           "module m1x { }",
       
   504                           "package m1x;\n" +
       
   505                           "import m1x.a.*; public class Test { A a; }\n",
       
   506                           "package m1x.a;\n" +
       
   507                           "public class A { }\n");
       
   508         Path src_m2 = src.resolve("m2x");
       
   509         tb.writeJavaFiles(src_m2,
       
   510                           "module m2x { }",
       
   511                           "package m1x;\n" +
       
   512                           "public class a { public static class A { } }\n");
       
   513         Path classes = base.resolve("classes");
       
   514         tb.createDirectories(classes);
       
   515 
       
   516         new JavacTask(tb)
       
   517             .options("--module-source-path", src.toString(),
       
   518                      "-XDrawDiagnostics")
       
   519             .outdir(classes)
       
   520             .files(findJavaFiles(src))
       
   521             .run()
       
   522             .writeAll();
   496     }
   523     }
   497 
   524 
   498     @Test
   525     @Test
   499     public void testStripUnknownRequired(Path base) throws Exception {
   526     public void testStripUnknownRequired(Path base) throws Exception {
   500         Path src = base.resolve("src");
   527         Path src = base.resolve("src");