test/runtime/modules/ModuleStress/ExportModuleStressTest.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File bug_8136930.hs3 Sdiff test/runtime/modules/ModuleStress

test/runtime/modules/ModuleStress/ExportModuleStressTest.java

Print this page




  46 
  47     /**
  48      * Compiles all module definitions used by the test
  49      */
  50     public static void main(String[] args) throws Exception {
  51 
  52         boolean compiled;
  53         // Compile module jdk.test declaration
  54         compiled = CompilerUtils.compile(
  55             SRC_DIR.resolve("jdk.test"),
  56             MODS_DIR.resolve("jdk.test"));
  57         if (!compiled) {
  58             throw new RuntimeException("Test failed to compile module jdk.test");
  59         }
  60 
  61         // Compile module jdk.translet declaration
  62         compiled = CompilerUtils.compile(
  63             SRC_DIR.resolve("jdk.translet"),
  64             MODS_DIR.resolve("jdk.translet"),
  65             "-XaddExports:jdk.test/test=jdk.translet",
  66             "-mp", MODS_DIR.toString());
  67         if (!compiled) {
  68             throw new RuntimeException("Test failed to compile module jdk.translet");
  69         }
  70 
  71         // Sanity check that the test, jdk.test/test/Main.java
  72         // runs without error.
  73         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  74             "-mp", MODS_DIR.toString(),
  75             "-m", "jdk.test/test.Main");
  76         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  77         output.shouldContain("failed: 0")
  78               .shouldHaveExitValue(0);
  79     }
  80 }


  46 
  47     /**
  48      * Compiles all module definitions used by the test
  49      */
  50     public static void main(String[] args) throws Exception {
  51 
  52         boolean compiled;
  53         // Compile module jdk.test declaration
  54         compiled = CompilerUtils.compile(
  55             SRC_DIR.resolve("jdk.test"),
  56             MODS_DIR.resolve("jdk.test"));
  57         if (!compiled) {
  58             throw new RuntimeException("Test failed to compile module jdk.test");
  59         }
  60 
  61         // Compile module jdk.translet declaration
  62         compiled = CompilerUtils.compile(
  63             SRC_DIR.resolve("jdk.translet"),
  64             MODS_DIR.resolve("jdk.translet"),
  65             "-XaddExports:jdk.test/test=jdk.translet",
  66             "-p", MODS_DIR.toString());
  67         if (!compiled) {
  68             throw new RuntimeException("Test failed to compile module jdk.translet");
  69         }
  70 
  71         // Sanity check that the test, jdk.test/test/Main.java
  72         // runs without error.
  73         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  74             "-p", MODS_DIR.toString(),
  75             "-m", "jdk.test/test.Main");
  76         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  77         output.shouldContain("failed: 0")
  78               .shouldHaveExitValue(0);
  79     }
  80 }
test/runtime/modules/ModuleStress/ExportModuleStressTest.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File