author | prr |
Fri, 25 May 2018 12:12:24 -0700 | |
changeset 50347 | b2f046ae8eb6 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
1 |
/* |
45062 | 2 |
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
4 |
* |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
8 |
* |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
13 |
* accompanied this code). |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
14 |
* |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
18 |
* |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
21 |
* questions. |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
22 |
*/ |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
23 |
|
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
24 |
/** |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
25 |
* @test |
45062 | 26 |
* @bug 4894330 4810347 6277269 8029388 8169646 |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
27 |
* @compile -XDignore.symbol.file ChangeDataModel.java |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
28 |
* @run main ChangeDataModel |
45062 | 29 |
* @summary Verify -d32, -d64 and -J prefixed data-model options are rejected on all platforms |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
30 |
* @author Joseph D. Darcy, ksrini |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
31 |
*/ |
45062 | 32 |
|
33 |
import java.util.Arrays; |
|
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
34 |
|
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
35 |
public class ChangeDataModel extends TestHelper { |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
36 |
|
22066
f2133b498789
8029388: java.exe consumes argument intended for launched java class
ksrini
parents:
20201
diff
changeset
|
37 |
public static void main(String... args) throws Exception { |
45062 | 38 |
new ChangeDataModel().run(args); |
39 |
} |
|
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
40 |
|
45062 | 41 |
@Test |
42 |
public void check32bitRejection() throws Exception { |
|
43 |
checkRejection("-d32"); |
|
44 |
} |
|
45 |
||
46 |
@Test |
|
47 |
public void check64bitRejection() throws Exception { |
|
48 |
checkRejection("-d64"); |
|
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
49 |
} |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
50 |
|
45062 | 51 |
void checkRejection(String dmodel) throws Exception { |
52 |
String expect = "Unrecognized option: " + dmodel; |
|
53 |
String[] cmds1 = { |
|
54 |
javaCmd, |
|
55 |
dmodel, |
|
56 |
"-version" |
|
57 |
}; |
|
58 |
checkRejection(expect, cmds1); |
|
59 |
||
60 |
String[] cmds2 = { |
|
61 |
javacCmd, |
|
62 |
"-J" + dmodel, |
|
63 |
"-version" |
|
64 |
}; |
|
65 |
checkRejection(expect, cmds2); |
|
66 |
} |
|
67 |
||
68 |
||
69 |
void checkRejection(String expect, String... cmds) throws Exception { |
|
70 |
TestResult tr = doExec(cmds); |
|
71 |
tr.checkNegative(); |
|
72 |
if (!tr.contains(expect)) { |
|
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
73 |
System.out.println(tr); |
45062 | 74 |
String error = "did not get " + "\'" + expect + "\'" + |
75 |
"with options " + Arrays.asList(cmds); |
|
76 |
throw new Exception(error); |
|
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
77 |
} |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
78 |
} |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
diff
changeset
|
79 |
} |