149 if (!hasMappingFailure) { 150 checker.check(output); 151 output.shouldNotHaveExitValue(0); 152 } 153 return this; 154 } 155 156 // When {--limit-modules, --patch-module, and/or --upgrade-module-path} 157 // are specified, CDS is silently disabled for both -Xshare:auto and -Xshare:on. 158 public Result assertSilentlyDisabledCDS(Checker checker) throws Exception { 159 if (hasMappingFailure) { 160 throw new RuntimeException("Unexpected mapping failure"); 161 } 162 // this comes from a JVM warning message. 163 output.shouldContain(CDS_DISABLED); 164 165 checker.check(output); 166 return this; 167 } 168 169 public Result ifNormalExit(Checker checker) throws Exception { 170 if (hasNormalExit) { 171 checker.check(output); 172 } 173 return this; 174 } 175 176 public Result ifAbnormalExit(Checker checker) throws Exception { 177 if (hasAbnormalExit) { 178 checker.check(output); 179 } 180 return this; 181 } 182 183 public Result ifNoMappingFailure(Checker checker) throws Exception { 184 if (!hasMappingFailure) { 185 checker.check(output); 186 } 187 return this; 188 } | 149 if (!hasMappingFailure) { 150 checker.check(output); 151 output.shouldNotHaveExitValue(0); 152 } 153 return this; 154 } 155 156 // When {--limit-modules, --patch-module, and/or --upgrade-module-path} 157 // are specified, CDS is silently disabled for both -Xshare:auto and -Xshare:on. 158 public Result assertSilentlyDisabledCDS(Checker checker) throws Exception { 159 if (hasMappingFailure) { 160 throw new RuntimeException("Unexpected mapping failure"); 161 } 162 // this comes from a JVM warning message. 163 output.shouldContain(CDS_DISABLED); 164 165 checker.check(output); 166 return this; 167 } 168 169 public Result assertSilentlyDisabledCDS(int exitCode, String... matches) throws Exception { 170 return assertSilentlyDisabledCDS((out) -> { 171 out.shouldHaveExitValue(exitCode); 172 checkMatches(out, matches); 173 }); 174 } 175 176 public Result ifNormalExit(Checker checker) throws Exception { 177 if (hasNormalExit) { 178 checker.check(output); 179 } 180 return this; 181 } 182 183 public Result ifAbnormalExit(Checker checker) throws Exception { 184 if (hasAbnormalExit) { 185 checker.check(output); 186 } 187 return this; 188 } 189 190 public Result ifNoMappingFailure(Checker checker) throws Exception { 191 if (!hasMappingFailure) { 192 checker.check(output); 193 } 194 return this; 195 } |