< prev index next >

jdk/test/java/lang/reflect/Proxy/ProxyTest.java

Print this page




  44 public class ProxyTest {
  45 
  46     private static final String TEST_SRC = System.getProperty("test.src");
  47     private static final String TEST_CLASSES = System.getProperty("test.classes");
  48 
  49     private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
  50     private static final Path MODS_DIR = Paths.get("mods");
  51     private static final Path CPATH_DIR = Paths.get(TEST_CLASSES);
  52 
  53     // the names of the modules in this test
  54     private static List<String> modules = Arrays.asList("test", "m1", "m2", "m3");
  55 
  56 
  57     /**
  58      * Compiles all modules used by the test
  59      */
  60     @BeforeTest
  61     public void compileAll() throws Exception {
  62         for (String mn : modules) {
  63             Path msrc = SRC_DIR.resolve(mn);
  64             assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "-modulesourcepath", SRC_DIR.toString()));
  65         }
  66     }
  67 
  68     /**
  69      * Run the modular test
  70      */
  71     @Test
  72     public void runTest() throws Exception {
  73         int exitValue = executeTestJava("-cp", CPATH_DIR.toString(),
  74                                         "-mp", MODS_DIR.toString(),
  75                                         "-m", "test/jdk.test.Main")
  76                             .outputTo(System.out)
  77                             .errorTo(System.out)
  78                             .getExitValue();
  79 
  80         assertTrue(exitValue == 0);
  81     }
  82 }


  44 public class ProxyTest {
  45 
  46     private static final String TEST_SRC = System.getProperty("test.src");
  47     private static final String TEST_CLASSES = System.getProperty("test.classes");
  48 
  49     private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
  50     private static final Path MODS_DIR = Paths.get("mods");
  51     private static final Path CPATH_DIR = Paths.get(TEST_CLASSES);
  52 
  53     // the names of the modules in this test
  54     private static List<String> modules = Arrays.asList("test", "m1", "m2", "m3");
  55 
  56 
  57     /**
  58      * Compiles all modules used by the test
  59      */
  60     @BeforeTest
  61     public void compileAll() throws Exception {
  62         for (String mn : modules) {
  63             Path msrc = SRC_DIR.resolve(mn);
  64             assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "--module-source-path", SRC_DIR.toString()));
  65         }
  66     }
  67 
  68     /**
  69      * Run the modular test
  70      */
  71     @Test
  72     public void runTest() throws Exception {
  73         int exitValue = executeTestJava("-cp", CPATH_DIR.toString(),
  74                                         "--module-path", MODS_DIR.toString(),
  75                                         "-m", "test/jdk.test.Main")
  76                             .outputTo(System.out)
  77                             .errorTo(System.out)
  78                             .getExitValue();
  79 
  80         assertTrue(exitValue == 0);
  81     }
  82 }
< prev index next >