1 /*
2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
65 public TestData(String appName, String pldrName, int exitCode) {
66 this(appName, pldrName, false, exitCode);
67 }
68
69 public TestData(String appName, boolean headless, int exitCode) {
70 this(appName, null, headless, exitCode);
71 }
72
73 public TestData(String appName, String pldrName, boolean headless, int exitCode) {
74 this.appName = pkgName + "." + appName;
75 this.pldrName = pldrName == null ? null : pkgName + "." + pldrName;
76 this.headless = headless;
77 this.exitCode = exitCode;
78 }
79 }
80
81 private static final TestData[] testData = {
82 new TestData("TestApp"),
83 new TestData("TestAppNoMain"),
84 new TestData("TestNotApplication"),
85 new TestData("TestAppThreadCheck", ERROR_NONE),
86 new TestData("TestAppNoMainThreadCheck", ERROR_NONE),
87 new TestData("TestNotApplicationThreadCheck", ERROR_NONE),
88 new TestData("TestAppThreadCheck", "TestPreloader", ERROR_NONE),
89 new TestData("TestAppNoMainThreadCheck", "TestPreloader", ERROR_NONE),
90 new TestData("TestAppCCL", ERROR_NONE),
91 new TestData("TestAppCCL1", ERROR_NONE),
92 new TestData("TestAppCCL2", ERROR_NONE),
93 new TestData("TestAppNoMainCCL", ERROR_NONE),
94 new TestData("TestAppNoMainCCL2", ERROR_NONE),
95 new TestData("TestAppNoMainCCL3", ERROR_NONE),
96 new TestData("TestNotApplicationCCL", ERROR_NONE),
97 new TestData("TestHeadlessApp", true, ERROR_NONE),
98 };
99
100 @Parameters
101 public static Collection getParams() {
102 if (params == null) {
103 params = new ArrayList();
104 for (TestData data : testData) {
207 + ": preloader class initialization called on wrong thread");
208 case ERROR_PRELOADER_CONSTRUCTOR_WRONG_THREAD:
209 throw new AssertionFailedError(testAppName
210 + ": preloader constructor called on wrong thread");
211 case ERROR_PRELOADER_INIT_WRONG_THREAD:
212 throw new AssertionFailedError(testAppName
213 + ": preloader init called on wrong thread");
214 case ERROR_PRELOADER_START_WRONG_THREAD:
215 throw new AssertionFailedError(testAppName
216 + ": preloader start called on wrong thread");
217 case ERROR_PRELOADER_STOP_WRONG_THREAD:
218 throw new AssertionFailedError(testAppName
219 + ": preloader stop called on wrong thread");
220
221 case ERROR_CONSTRUCTOR_WRONG_CCL:
222 throw new AssertionFailedError(testAppName
223 + ": constructor has wrong CCL");
224 case ERROR_START_WRONG_CCL:
225 throw new AssertionFailedError(testAppName
226 + ": start has wrong CCL");
227
228 case ERROR_UNEXPECTED_EXCEPTION:
229 throw new AssertionFailedError(testAppName
230 + ": unexpected exception");
231 case ERROR_LAUNCH_SUCCEEDED:
232 throw new AssertionFailedError(testAppName
233 + ": Application.launch unexpectedly succeeded");
234
235 default:
236 throw new AssertionFailedError(testAppName
237 + ": Unexpected error exit: " + retVal);
238 }
239 }
240
241 }
|
1 /*
2 * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
65 public TestData(String appName, String pldrName, int exitCode) {
66 this(appName, pldrName, false, exitCode);
67 }
68
69 public TestData(String appName, boolean headless, int exitCode) {
70 this(appName, null, headless, exitCode);
71 }
72
73 public TestData(String appName, String pldrName, boolean headless, int exitCode) {
74 this.appName = pkgName + "." + appName;
75 this.pldrName = pldrName == null ? null : pkgName + "." + pldrName;
76 this.headless = headless;
77 this.exitCode = exitCode;
78 }
79 }
80
81 private static final TestData[] testData = {
82 new TestData("TestApp"),
83 new TestData("TestAppNoMain"),
84 new TestData("TestNotApplication"),
85 new TestData("TestStartupApp1", ERROR_NONE),
86 new TestData("TestStartupApp2", ERROR_NONE),
87 new TestData("TestStartupAppNoMain", ERROR_NONE),
88 new TestData("TestStartupJFXPanel", ERROR_NONE),
89 new TestData("TestStartupNotApplication", ERROR_NONE),
90 new TestData("TestAppThreadCheck", ERROR_NONE),
91 new TestData("TestAppNoMainThreadCheck", ERROR_NONE),
92 new TestData("TestNotApplicationThreadCheck", ERROR_NONE),
93 new TestData("TestAppThreadCheck", "TestPreloader", ERROR_NONE),
94 new TestData("TestAppNoMainThreadCheck", "TestPreloader", ERROR_NONE),
95 new TestData("TestAppCCL", ERROR_NONE),
96 new TestData("TestAppCCL1", ERROR_NONE),
97 new TestData("TestAppCCL2", ERROR_NONE),
98 new TestData("TestAppNoMainCCL", ERROR_NONE),
99 new TestData("TestAppNoMainCCL2", ERROR_NONE),
100 new TestData("TestAppNoMainCCL3", ERROR_NONE),
101 new TestData("TestNotApplicationCCL", ERROR_NONE),
102 new TestData("TestHeadlessApp", true, ERROR_NONE),
103 };
104
105 @Parameters
106 public static Collection getParams() {
107 if (params == null) {
108 params = new ArrayList();
109 for (TestData data : testData) {
212 + ": preloader class initialization called on wrong thread");
213 case ERROR_PRELOADER_CONSTRUCTOR_WRONG_THREAD:
214 throw new AssertionFailedError(testAppName
215 + ": preloader constructor called on wrong thread");
216 case ERROR_PRELOADER_INIT_WRONG_THREAD:
217 throw new AssertionFailedError(testAppName
218 + ": preloader init called on wrong thread");
219 case ERROR_PRELOADER_START_WRONG_THREAD:
220 throw new AssertionFailedError(testAppName
221 + ": preloader start called on wrong thread");
222 case ERROR_PRELOADER_STOP_WRONG_THREAD:
223 throw new AssertionFailedError(testAppName
224 + ": preloader stop called on wrong thread");
225
226 case ERROR_CONSTRUCTOR_WRONG_CCL:
227 throw new AssertionFailedError(testAppName
228 + ": constructor has wrong CCL");
229 case ERROR_START_WRONG_CCL:
230 throw new AssertionFailedError(testAppName
231 + ": start has wrong CCL");
232 case ERROR_LAUNCH_SUCCEEDED:
233 throw new AssertionFailedError(testAppName
234 + ": Application.launch unexpectedly succeeded");
235 case ERROR_STARTUP_SUCCEEDED:
236 throw new AssertionFailedError(testAppName
237 + ": Plataform.startup unexpectedly succeeded");
238 case ERROR_STARTUP_FAILED:
239 throw new AssertionFailedError(testAppName
240 + ": Plataform.startup failed");
241
242 case ERROR_ASSERTION_FAILURE:
243 throw new AssertionFailedError(testAppName
244 + ": Assertion failure in test application");
245
246 case ERROR_UNEXPECTED_EXCEPTION:
247 throw new AssertionFailedError(testAppName
248 + ": unexpected exception");
249
250 default:
251 throw new AssertionFailedError(testAppName
252 + ": Unexpected error exit: " + retVal);
253 }
254 }
255
256 }
|