100 output = new OutputAnalyzer(pb.start()); |
100 output = new OutputAnalyzer(pb.start()); |
101 output.shouldContain("Hello World") |
101 output.shouldContain("Hello World") |
102 .shouldHaveExitValue(0); |
102 .shouldHaveExitValue(0); |
103 |
103 |
104 // relative path tests |
104 // relative path tests |
105 // We currently cannot handle relative path specified in the |
|
106 // -Xbootclasspath/a on windows. |
|
107 // |
105 // |
108 // relative path length within the file system limit |
106 // relative path length within the file system limit |
109 int fn_max_length = 255; |
107 int fn_max_length = 255; |
110 // In AUFS file system, the maximal file name length is 242 |
108 // In AUFS file system, the maximal file name length is 242 |
111 FileStore store = Files.getFileStore(new File(".").toPath()); |
109 FileStore store = Files.getFileStore(new File(".").toPath()); |
126 |
124 |
127 output = new OutputAnalyzer(pb.start()); |
125 output = new OutputAnalyzer(pb.start()); |
128 output.shouldContain("Hello World") |
126 output.shouldContain("Hello World") |
129 .shouldHaveExitValue(0); |
127 .shouldHaveExitValue(0); |
130 |
128 |
|
129 // Test a relative path for a jar file < MAX_PATH, but where the |
|
130 // absolute path is > MAX_PATH. |
|
131 Path jarDir = Paths.get("."); |
|
132 for (int i = 0; i < 21; ++i) { |
|
133 jarDir = jarDir.resolve("0123456789"); |
|
134 } |
|
135 Files.createDirectories(jarDir); |
|
136 Path jarPath = jarDir.resolve("hello.jar"); |
|
137 Files.copy(Paths.get(helloJar), jarPath); |
|
138 bootCP = "-Xbootclasspath/a:" + jarPath.toString(); |
|
139 pb = ProcessTools.createJavaProcessBuilder(bootCP, "Hello"); |
|
140 |
|
141 output = new OutputAnalyzer(pb.start()); |
|
142 output.shouldContain("Hello World") |
|
143 .shouldHaveExitValue(0); |
|
144 |
131 // total relative path length exceeds MAX_PATH |
145 // total relative path length exceeds MAX_PATH |
132 destDir = Paths.get(destDir.toString(), "yyyyyyyy"); |
146 destDir = Paths.get(destDir.toString(), "yyyyyyyy"); |
133 |
147 |
134 CompilerUtils.compile(sourceDir, destDir); |
148 CompilerUtils.compile(sourceDir, destDir); |
135 |
149 |