6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 /*
26 * @test
27 * @summary Use special characters in the name of the cache file specified by -XX:AOTCacheOutput
28 * Make sure these characters are passed to the child JVM process that assembles the cache.
29 * @requires vm.cds.supports.aot.class.linking
30 * @comment work around JDK-8345635
31 * @requires !vm.jvmci.enabled
32 * @library /test/lib
33 * @build SpecialCacheNames
34 * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar app.jar MyTestApp
35 * @run driver SpecialCacheNames AOT --one-step-training
36 */
37
38 import java.io.File;
39 import jdk.test.lib.cds.CDSAppTester;
40 import jdk.test.lib.helpers.ClassFileInstaller;
41 import jdk.test.lib.Platform;
42 import jdk.test.lib.process.OutputAnalyzer;
43
44 public class SpecialCacheNames {
45 static final String appJar = ClassFileInstaller.getJarPath("app.jar");
46 static final String mainClass = "MyTestApp";
47
48 public static void main(String[] args) throws Exception {
49 test("with spaces", args);
50 test("single'quote", args);
51 if (!Platform.isWindows()) {
52 // This seems to be a limitation of ProcessBuilder on Windows that has problem passing
53 // double quote or unicode characters to a child process. As a result, we can't
54 // even pass these parameters to the training run JVM.
55 test("double\"quote", args);
56 test("unicode\u202fspace", args); // Narrow No-Break Space
57 test("unicode\u6587", args); // CJK unifed ideographs "wen" = "script"
|
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 /*
26 * @test id=aot
27 * @summary Use special characters in the name of the cache file specified by -XX:AOTCacheOutput.
28 * Make sure these characters are passed to the child JVM process that assembles the cache.
29 * @requires vm.cds.supports.aot.class.linking
30 * @comment work around JDK-8345635
31 * @requires !vm.jvmci.enabled
32 * @library /test/lib
33 * @build SpecialCacheNames
34 * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar app.jar MyTestApp
35 * @run driver SpecialCacheNames AOT --one-step-training
36 */
37
38 /*
39 * @test id=leyden
40 * @summary Use special characters in the name of the cache file specified by -XX:CacheDataStore.
41 * Make sure these characters are passed to the child JVM process that assembles the cache.
42 * @requires vm.cds.supports.aot.class.linking
43 * @comment work around JDK-8345635
44 * @requires !vm.jvmci.enabled
45 * @library /test/lib
46 * @build SpecialCacheNames
47 * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar app.jar MyTestApp
48 * @run driver SpecialCacheNames LEYDEN
49 */
50
51 import java.io.File;
52 import jdk.test.lib.cds.CDSAppTester;
53 import jdk.test.lib.helpers.ClassFileInstaller;
54 import jdk.test.lib.Platform;
55 import jdk.test.lib.process.OutputAnalyzer;
56
57 public class SpecialCacheNames {
58 static final String appJar = ClassFileInstaller.getJarPath("app.jar");
59 static final String mainClass = "MyTestApp";
60
61 public static void main(String[] args) throws Exception {
62 test("with spaces", args);
63 test("single'quote", args);
64 if (!Platform.isWindows()) {
65 // This seems to be a limitation of ProcessBuilder on Windows that has problem passing
66 // double quote or unicode characters to a child process. As a result, we can't
67 // even pass these parameters to the training run JVM.
68 test("double\"quote", args);
69 test("unicode\u202fspace", args); // Narrow No-Break Space
70 test("unicode\u6587", args); // CJK unifed ideographs "wen" = "script"
|