< prev index next >

jdk/test/java/lang/reflect/Module/access/AccessTest.java

Print this page




  55     private static List<String> modules = Arrays.asList("test", "target");
  56 
  57 
  58     /**
  59      * Compiles all modules used by the test
  60      */
  61     @BeforeTest
  62     public void compileAll() throws Exception {
  63         for (String mn : modules) {
  64             Path src = SRC_DIR.resolve(mn);
  65             Path mods = MODS_DIR.resolve(mn);
  66             assertTrue(CompilerUtils.compile(src, mods));
  67         }
  68     }
  69 
  70     /**
  71      * Run the test
  72      */
  73     public void runTest() throws Exception {
  74         int exitValue
  75             = executeTestJava("-mp", MODS_DIR.toString(),
  76                               "-addmods", "target",
  77                               "-m", "test/test.Main")
  78                 .outputTo(System.out)
  79                 .errorTo(System.out)
  80                 .getExitValue();
  81 
  82         assertTrue(exitValue == 0);
  83     }
  84 
  85 }


  55     private static List<String> modules = Arrays.asList("test", "target");
  56 
  57 
  58     /**
  59      * Compiles all modules used by the test
  60      */
  61     @BeforeTest
  62     public void compileAll() throws Exception {
  63         for (String mn : modules) {
  64             Path src = SRC_DIR.resolve(mn);
  65             Path mods = MODS_DIR.resolve(mn);
  66             assertTrue(CompilerUtils.compile(src, mods));
  67         }
  68     }
  69 
  70     /**
  71      * Run the test
  72      */
  73     public void runTest() throws Exception {
  74         int exitValue
  75             = executeTestJava("--module-path", MODS_DIR.toString(),
  76                               "--add-modules", "target",
  77                               "-m", "test/test.Main")
  78                 .outputTo(System.out)
  79                 .errorTo(System.out)
  80                 .getExitValue();
  81 
  82         assertTrue(exitValue == 0);
  83     }
  84 
  85 }
< prev index next >