133 // --limit-modules jdk.dynalink,jdk.compiler 134 // It seems we can't exclude the java.base module. For this case, 135 // although the java.base module isn't in --limit-modules, the class 136 // in the java.base module (java.net.HttpCookie) can also be found. 137 // 138 // --limit-modules java.base,jdk.dynalink 139 // --limit-modules java.base,jdk.compiler 140 public void runTestLimitMods() throws Exception { 141 String limitMods = null; 142 for (int excludeModIdx = 0; excludeModIdx < 3; excludeModIdx++) { 143 for (int includeModIdx = 0; includeModIdx < 3; includeModIdx++) { 144 if (includeModIdx != excludeModIdx) { 145 if (limitMods != null) { 146 limitMods += ","; 147 limitMods += LIMIT_MODULES[includeModIdx]; 148 } else { 149 limitMods = LIMIT_MODULES[includeModIdx]; 150 } 151 } 152 } 153 output = TestCommon.exec( 154 appJar + File.pathSeparator + helperJar, 155 "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", bootClassPath, 156 "--limit-modules", limitMods, 157 "LimitModsHelper", 158 BOOT_ARCHIVE_CLASS, PLATFORM_ARCHIVE_CLASS, APP_ARCHIVE_CLASS, 159 Integer.toString(excludeModIdx)); // last 4 args passed to test 160 output.shouldHaveExitValue(0); 161 limitMods = null; 162 } 163 } 164 } | 133 // --limit-modules jdk.dynalink,jdk.compiler 134 // It seems we can't exclude the java.base module. For this case, 135 // although the java.base module isn't in --limit-modules, the class 136 // in the java.base module (java.net.HttpCookie) can also be found. 137 // 138 // --limit-modules java.base,jdk.dynalink 139 // --limit-modules java.base,jdk.compiler 140 public void runTestLimitMods() throws Exception { 141 String limitMods = null; 142 for (int excludeModIdx = 0; excludeModIdx < 3; excludeModIdx++) { 143 for (int includeModIdx = 0; includeModIdx < 3; includeModIdx++) { 144 if (includeModIdx != excludeModIdx) { 145 if (limitMods != null) { 146 limitMods += ","; 147 limitMods += LIMIT_MODULES[includeModIdx]; 148 } else { 149 limitMods = LIMIT_MODULES[includeModIdx]; 150 } 151 } 152 } 153 TestCommon.run( 154 "-cp", appJar + File.pathSeparator + helperJar, 155 "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", bootClassPath, 156 "--limit-modules", limitMods, 157 "LimitModsHelper", 158 BOOT_ARCHIVE_CLASS, PLATFORM_ARCHIVE_CLASS, APP_ARCHIVE_CLASS, 159 Integer.toString(excludeModIdx)) // last 4 args passed to test 160 .assertSilentlyDisabledCDS(out -> { 161 out.shouldHaveExitValue(0); 162 }); 163 limitMods = null; 164 } 165 } 166 } |