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 }
|
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(0);
161 limitMods = null;
162 }
163 }
164 }
|