1 /* |
1 /* |
2 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
26 * @bug 8035063 8054465 |
26 * @bug 8035063 8054465 |
27 * @summary Tests decoding of String[] into Options. |
27 * @summary Tests decoding of String[] into Options. |
28 * |
28 * |
29 * @modules jdk.compiler/com.sun.tools.sjavac |
29 * @modules jdk.compiler/com.sun.tools.sjavac |
30 * jdk.compiler/com.sun.tools.sjavac.client |
30 * jdk.compiler/com.sun.tools.sjavac.client |
|
31 * jdk.compiler/com.sun.tools.sjavac.comp |
31 * jdk.compiler/com.sun.tools.sjavac.options |
32 * jdk.compiler/com.sun.tools.sjavac.options |
32 * @build Wrapper |
33 * @build Wrapper |
33 * @run main Wrapper OptionDecoding |
34 * @run main Wrapper OptionDecoding |
34 */ |
35 */ |
35 |
36 |
145 |
146 |
146 SourceLocation dir1 = new SourceLocation(Paths.get("dir1"), i, x); |
147 SourceLocation dir1 = new SourceLocation(Paths.get("dir1"), i, x); |
147 SourceLocation dir2 = new SourceLocation(Paths.get("dir2"), i, x); |
148 SourceLocation dir2 = new SourceLocation(Paths.get("dir2"), i, x); |
148 String dir1_PS_dir2 = "dir1" + File.pathSeparator + "dir2"; |
149 String dir1_PS_dir2 = "dir1" + File.pathSeparator + "dir2"; |
149 |
150 |
150 Options options = Options.parseArgs("-sourcepath", dir1_PS_dir2); |
151 Options options = Options.parseArgs("--source-path", dir1_PS_dir2); |
151 assertEquals(options.getSourceSearchPaths(), Arrays.asList(dir1, dir2)); |
152 assertEquals(options.getSourceSearchPaths(), Arrays.asList(dir1, dir2)); |
152 |
153 |
153 options = Options.parseArgs("-modulepath", dir1_PS_dir2); |
154 options = Options.parseArgs("--module-path", dir1_PS_dir2); |
154 assertEquals(options.getModuleSearchPaths(), Arrays.asList(dir1, dir2)); |
155 assertEquals(options.getModuleSearchPaths(), Arrays.asList(dir1, dir2)); |
155 |
156 |
156 options = Options.parseArgs("-classpath", dir1_PS_dir2); |
157 options = Options.parseArgs("--class-path", dir1_PS_dir2); |
157 assertEquals(options.getClassSearchPath(), Arrays.asList(dir1, dir2)); |
158 assertEquals(options.getClassSearchPath(), Arrays.asList(dir1, dir2)); |
158 } |
159 } |
159 |
160 |
160 // Test -tr option |
161 // Test -tr option |
161 static void testTranslationRules() { |
162 static void testTranslationRules() { |