< prev index next >

test/jdk/tools/jlink/plugins/SystemModuleDescriptors/SystemModulesTest.java

Print this page
rev 59105 : imported patch corelibs


  62 
  63     @Test
  64     public void testSystemModules() {
  65         Path jimage = Paths.get(System.getProperty("java.home"), "lib", "modules");
  66         if (Files.notExists(jimage))
  67             return;
  68 
  69         ModuleFinder.ofSystem().findAll().stream()
  70                     .forEach(this::checkAttributes);
  71     }
  72 
  73     // JMOD files are created with OS name and arch matching the bundle name
  74     private boolean checkOSName(String name) {
  75         if (OS_NAME.startsWith("Windows")) {
  76             return name.equals("windows");
  77         }
  78 
  79         switch (OS_NAME) {
  80             case "Linux":
  81                 return name.equals("linux");
  82             case "SunOS":
  83                 return name.equals("solaris");
  84             case "Mac OS X":
  85                 return name.equals("macos");
  86             default:
  87                 // skip validation on unknown platform
  88                 System.out.println("Skip checking OS name in ModuleTarget: " + name);
  89                 return true;
  90         }
  91     }
  92 
  93     private boolean checkOSArch(String name) {
  94         if (name.equals(OS_ARCH))
  95             return true;
  96 
  97         switch (OS_ARCH) {
  98             case "i386":
  99             case "x86":
 100                 return name.equals("x86");
 101             case "amd64":
 102             case "x86_64":
 103                 return name.equals("amd64");




  62 
  63     @Test
  64     public void testSystemModules() {
  65         Path jimage = Paths.get(System.getProperty("java.home"), "lib", "modules");
  66         if (Files.notExists(jimage))
  67             return;
  68 
  69         ModuleFinder.ofSystem().findAll().stream()
  70                     .forEach(this::checkAttributes);
  71     }
  72 
  73     // JMOD files are created with OS name and arch matching the bundle name
  74     private boolean checkOSName(String name) {
  75         if (OS_NAME.startsWith("Windows")) {
  76             return name.equals("windows");
  77         }
  78 
  79         switch (OS_NAME) {
  80             case "Linux":
  81                 return name.equals("linux");


  82             case "Mac OS X":
  83                 return name.equals("macos");
  84             default:
  85                 // skip validation on unknown platform
  86                 System.out.println("Skip checking OS name in ModuleTarget: " + name);
  87                 return true;
  88         }
  89     }
  90 
  91     private boolean checkOSArch(String name) {
  92         if (name.equals(OS_ARCH))
  93             return true;
  94 
  95         switch (OS_ARCH) {
  96             case "i386":
  97             case "x86":
  98                 return name.equals("x86");
  99             case "amd64":
 100             case "x86_64":
 101                 return name.equals("amd64");


< prev index next >