--- a/test/hotspot/jtreg/runtime/appcds/BootClassPathMismatch.java Thu Nov 30 16:00:34 2017 -0500
+++ b/test/hotspot/jtreg/runtime/appcds/BootClassPathMismatch.java Thu Nov 30 14:25:33 2017 -0800
@@ -52,6 +52,7 @@
BootClassPathMismatch test = new BootClassPathMismatch();
test.testBootClassPathMismatch();
+ test.testBootClassPathMismatch2();
test.testBootClassPathMatch();
}
@@ -78,6 +79,26 @@
}
}
+ /* Error should be detected if:
+ * dump time: <no bootclasspath specified>
+ * run-time : -Xbootclasspath/a:${testdir}/hello.jar
+ */
+ public void testBootClassPathMismatch2() throws Exception {
+ String appJar = JarBuilder.getOrCreateHelloJar();
+ String appClasses[] = {"Hello"};
+ OutputAnalyzer dumpOutput = TestCommon.dump(appJar, appClasses);
+ OutputAnalyzer execOutput = TestCommon.exec(
+ appJar, "-verbose:class", "-Xbootclasspath/a:" + appJar, "Hello");
+ try {
+ TestCommon.checkExec(execOutput, mismatchMessage);
+ } catch (java.lang.RuntimeException re) {
+ String cause = re.getMessage();
+ if (!mismatchMessage.equals(cause)) {
+ throw re;
+ }
+ }
+ }
+
/* No error if:
* dump time: -Xbootclasspath/a:${testdir}/hello.jar
* run-time : -Xbootclasspath/a:${testdir}/hello.jar