test/hotspot/jtreg/runtime/LoadClass/LongBCP.java
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
open Cdiff test/hotspot/jtreg/runtime/LoadClass/LongBCP.java
test/hotspot/jtreg/runtime/LoadClass/LongBCP.java
Print this page
*** 27,36 ****
--- 27,37 ----
* class name) or directory path longer than MAX_PATH specified
* in -Xbootclasspath/a on windows.
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management
+ * jdk.jartool/sun.tools.jar
* @run main LongBCP
*/
import java.io.File;
import java.nio.file.Files;
*** 80,89 ****
--- 81,107 ----
pb = ProcessTools.createJavaProcessBuilder(
bootCP, "Hello");
output = new OutputAnalyzer(pb.start());
output.shouldContain("Hello World")
+ .shouldHaveExitValue(0);
+
+ // create a hello.jar
+ sun.tools.jar.Main jarTool = new sun.tools.jar.Main(System.out, System.err, "jar");
+ String helloJar = destDir.toString() + File.separator + "hello.jar";
+ if (!jarTool.run(new String[]
+ {"-cf", helloJar, "-C", destDir.toString(), "Hello.class"})) {
+ throw new RuntimeException("Could not write the Hello jar file");
+ }
+
+ // run with long bootclasspath to hello.jar
+ bootCP = "-Xbootclasspath/a:" + helloJar;
+ pb = ProcessTools.createJavaProcessBuilder(
+ bootCP, "Hello");
+
+ output = new OutputAnalyzer(pb.start());
+ output.shouldContain("Hello World")
.shouldHaveExitValue(0);
// relative path tests
// We currently cannot handle relative path specified in the
// -Xbootclasspath/a on windows.
test/hotspot/jtreg/runtime/LoadClass/LongBCP.java
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File