test/jdk/tools/jmod/hashes/HashesTest.java
changeset 52111 367b2cd49ec5
parent 48841 0937e5f799df
equal deleted inserted replaced
52110:65efb9c57fef 52111:367b2cd49ec5
   235         Stream.concat(jars.stream(), jmods.stream())
   235         Stream.concat(jars.stream(), jmods.stream())
   236               .filter(mn -> !mn.equals("j1") && !mn.equals("j2"))
   236               .filter(mn -> !mn.equals("j1") && !mn.equals("j2"))
   237               .forEach(mn -> assertTrue(ht.hashes(mn) == null));
   237               .forEach(mn -> assertTrue(ht.hashes(mn) == null));
   238     }
   238     }
   239 
   239 
       
   240     @Test
       
   241     public static void upgradeableModule() throws IOException {
       
   242         Path mpath = Paths.get(System.getProperty("java.home"), "jmods");
       
   243         if (!Files.exists(mpath)) {
       
   244             return;
       
   245         }
       
   246 
       
   247         Path dest = Paths.get("test4");
       
   248         HashesTest ht = new HashesTest(dest);
       
   249         ht.makeModule("m1");
       
   250         ht.makeModule("java.compiler", "m1");
       
   251         ht.makeModule("m2", "java.compiler");
       
   252 
       
   253         ht.makeJmod("m1");
       
   254         ht.makeJmod("m2");
       
   255         ht.makeJmod("java.compiler",
       
   256                     "--module-path",
       
   257                     ht.lib.toString() + File.pathSeparator + mpath,
       
   258                     "--hash-modules", "java\\.(?!se)|^m.*");
       
   259 
       
   260         ht.checkHashes("java.compiler",  "m2");
       
   261     }
   240 
   262 
   241     @Test
   263     @Test
   242     public static void testImageJmods() throws IOException {
   264     public static void testImageJmods() throws IOException {
   243         Path mpath = Paths.get(System.getProperty("java.home"), "jmods");
   265         Path mpath = Paths.get(System.getProperty("java.home"), "jmods");
   244         if (!Files.exists(mpath)) {
   266         if (!Files.exists(mpath)) {