--- old/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/SubClassOfPatchedClass.java 2018-04-02 14:11:57.932702011 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/SubClassOfPatchedClass.java 2018-04-02 14:11:57.639674399 -0700 @@ -88,18 +88,20 @@ "--patch-module=java.naming=" + moduleJar, "-Xlog:class+load", "PatchMain", "javax.naming.Reference", "mypackage.MyReference"); - TestCommon.checkDump(output, "Loading classes to share"); + output.shouldHaveExitValue(1) + .shouldContain("Cannot use the following option when dumping the shared archive: --patch-module"); String classPath = appJar + File.pathSeparator + classDir; System.out.println("classPath: " + classPath); - TestCommon.run( + output = TestCommon.execCommon( "-XX:+UnlockDiagnosticVMOptions", "-cp", classPath, "--patch-module=java.naming=" + moduleJar, "-Xlog:class+load", - "PatchMain", "javax.naming.Reference", "mypackage.MyReference") - .assertNormalExit( - "I pass!", - "MyReference source: file:"); + "PatchMain", "javax.naming.Reference", "mypackage.MyReference"); + output.shouldHaveExitValue(0) + .shouldContain("CDS is disabled") + .shouldContain("MyReference source: file:") + .shouldContain("I pass!"); } }