< prev index next >

test/tools/jdeps/jdkinternals/RemovedJDKInternals.java

Print this page
rev 3947 : imported patch xmodule-to-patch-module


  46 
  47 public class RemovedJDKInternals {
  48     private static final String TEST_SRC = System.getProperty("test.src");
  49 
  50     private static final Path CLASSES_DIR = Paths.get("classes");
  51     private static final Path PATCHES_DIR = Paths.get("patches");
  52 
  53     private static final String JDK_UNSUPPORTED = "jdk.unsupported";
  54     /**
  55      * Compiles classes used by the test
  56      */
  57     @BeforeTest
  58     public void compileAll() throws Exception {
  59         CompilerUtils.cleanDir(PATCHES_DIR);
  60         CompilerUtils.cleanDir(CLASSES_DIR);
  61 
  62         // compile sun.misc types
  63         Path sunMiscSrc = Paths.get(TEST_SRC, "patches", JDK_UNSUPPORTED);
  64         Path patchDir = PATCHES_DIR.resolve(JDK_UNSUPPORTED);
  65         assertTrue(CompilerUtils.compile(sunMiscSrc, patchDir,
  66                                          "-Xmodule:" + JDK_UNSUPPORTED));
  67 
  68         // compile com.sun.image.codec.jpeg types
  69         Path codecSrc = Paths.get(TEST_SRC, "patches", "java.desktop");
  70         Path codecDest = PATCHES_DIR;
  71         assertTrue(CompilerUtils.compile(codecSrc, codecDest));
  72 
  73         // patch jdk.unsupported and set -cp to codec types
  74         assertTrue(CompilerUtils.compile(Paths.get(TEST_SRC, "src", "p"),
  75                                          CLASSES_DIR,
  76                                          "--patch-module", "jdk.unsupported=" + patchDir,
  77                                          "-cp", codecDest.toString()));
  78     }
  79 
  80     @DataProvider(name = "deps")
  81     public Object[][] deps() {
  82         return new Object[][] {
  83             { "classes", new ModuleMetaData("classes", false)
  84                 .reference("p.Main", "java.lang.Class", "java.base")
  85                 .reference("p.Main", "java.lang.Object", "java.base")
  86                 .reference("p.Main", "java.util.Iterator", "java.base")




  46 
  47 public class RemovedJDKInternals {
  48     private static final String TEST_SRC = System.getProperty("test.src");
  49 
  50     private static final Path CLASSES_DIR = Paths.get("classes");
  51     private static final Path PATCHES_DIR = Paths.get("patches");
  52 
  53     private static final String JDK_UNSUPPORTED = "jdk.unsupported";
  54     /**
  55      * Compiles classes used by the test
  56      */
  57     @BeforeTest
  58     public void compileAll() throws Exception {
  59         CompilerUtils.cleanDir(PATCHES_DIR);
  60         CompilerUtils.cleanDir(CLASSES_DIR);
  61 
  62         // compile sun.misc types
  63         Path sunMiscSrc = Paths.get(TEST_SRC, "patches", JDK_UNSUPPORTED);
  64         Path patchDir = PATCHES_DIR.resolve(JDK_UNSUPPORTED);
  65         assertTrue(CompilerUtils.compile(sunMiscSrc, patchDir,
  66                                          "--patch-module", JDK_UNSUPPORTED + "=" + sunMiscSrc.toString()));
  67 
  68         // compile com.sun.image.codec.jpeg types
  69         Path codecSrc = Paths.get(TEST_SRC, "patches", "java.desktop");
  70         Path codecDest = PATCHES_DIR;
  71         assertTrue(CompilerUtils.compile(codecSrc, codecDest));
  72 
  73         // patch jdk.unsupported and set -cp to codec types
  74         assertTrue(CompilerUtils.compile(Paths.get(TEST_SRC, "src", "p"),
  75                                          CLASSES_DIR,
  76                                          "--patch-module", "jdk.unsupported=" + patchDir,
  77                                          "-cp", codecDest.toString()));
  78     }
  79 
  80     @DataProvider(name = "deps")
  81     public Object[][] deps() {
  82         return new Object[][] {
  83             { "classes", new ModuleMetaData("classes", false)
  84                 .reference("p.Main", "java.lang.Class", "java.base")
  85                 .reference("p.Main", "java.lang.Object", "java.base")
  86                 .reference("p.Main", "java.util.Iterator", "java.base")


< prev index next >