test/hotspot/jtreg/runtime/LoadClass/LongBCP.java
changeset 58878 452df727bebb
parent 58426 ed5e399d967d
--- a/test/hotspot/jtreg/runtime/LoadClass/LongBCP.java	Thu Oct 31 16:54:16 2019 -0700
+++ b/test/hotspot/jtreg/runtime/LoadClass/LongBCP.java	Tue Oct 15 17:08:09 2019 +0200
@@ -102,8 +102,6 @@
               .shouldHaveExitValue(0);
 
         // relative path tests
-        // We currently cannot handle relative path specified in the
-        // -Xbootclasspath/a on windows.
         //
         // relative path length within the file system limit
         int fn_max_length = 255;
@@ -128,6 +126,22 @@
         output.shouldContain("Hello World")
               .shouldHaveExitValue(0);
 
+        // Test a relative path for a jar file < MAX_PATH, but where the
+        // absolute path is > MAX_PATH.
+        Path jarDir = Paths.get(".");
+        for (int i = 0; i < 21; ++i) {
+            jarDir = jarDir.resolve("0123456789");
+        }
+        Files.createDirectories(jarDir);
+        Path jarPath = jarDir.resolve("hello.jar");
+        Files.copy(Paths.get(helloJar), jarPath);
+        bootCP = "-Xbootclasspath/a:" + jarPath.toString();
+        pb = ProcessTools.createJavaProcessBuilder(bootCP, "Hello");
+
+        output = new OutputAnalyzer(pb.start());
+        output.shouldContain("Hello World")
+              .shouldHaveExitValue(0);
+
         // total relative path length exceeds MAX_PATH
         destDir = Paths.get(destDir.toString(), "yyyyyyyy");