27
28 import java.io.File;
29 import java.util.ArrayList;
30 import junit.framework.AssertionFailedError;
31 import org.junit.Test;
32
33 import static org.junit.Assert.*;
34 import static test.launchertest.Constants.*;
35
36 /**
37 * Unit test for launching modular FX applications
38 */
39 public class ModuleLauncherTest {
40
41 private static final String modulePath2 = System.getProperty("launchertest.testapp2.module.path");
42 private static final String modulePath3 = System.getProperty("launchertest.testapp3.module.path");
43 private static final String modulePath4 = System.getProperty("launchertest.testapp4.module.path");
44 private static final String modulePath5 = System.getProperty("launchertest.testapp5.module.path");
45 private static final String modulePath6 = System.getProperty("launchertest.testapp6.module.path");
46 private static final String modulePathScript1 = System.getProperty("launchertest.testscriptapp1.module.path");
47
48 private static final String moduleName = "mymod";
49
50 private final int testExitCode = ERROR_NONE;
51
52 private void doTestLaunchModule(String appModulePath, String testAppName) throws Exception {
53 final String javafxModulePath = System.getProperty("worker.module.path");
54 String modulePath;
55 if (javafxModulePath != null) {
56 modulePath = javafxModulePath + File.pathSeparator + appModulePath;
57 } else {
58 modulePath = appModulePath;
59 }
60 assertNotNull(testAppName);
61 System.err.println("The following Unknown module WARNING messages are expected:");
62 String mpArg = "--module-path=" + modulePath;
63 String moduleAppName = "--module=" + moduleName + "/" + testAppName;
64 final ArrayList<String> cmd =
65 test.util.Util.createApplicationLaunchCommand(
66 moduleAppName,
264 @Test (timeout = 15000)
265 public void testModuleFXMLQualExported() throws Exception {
266 doTestLaunchModule(modulePath6, "myapp6.AppFXMLQualExported");
267 }
268
269 @Test (timeout = 15000)
270 public void testModuleFXMLOpened() throws Exception {
271 doTestLaunchModule(modulePath6, "myapp6.AppFXMLOpened");
272 }
273
274 @Test (timeout = 15000)
275 public void testModuleFXMLQualOpened() throws Exception {
276 doTestLaunchModule(modulePath6, "myapp6.AppFXMLQualOpened");
277 }
278
279 @Test (timeout = 15000)
280 public void testFXMLScriptDeployment() throws Exception {
281 doTestLaunchModule(modulePathScript1, "myapp1.FXMLScriptDeployment");
282 }
283
284 }
|
27
28 import java.io.File;
29 import java.util.ArrayList;
30 import junit.framework.AssertionFailedError;
31 import org.junit.Test;
32
33 import static org.junit.Assert.*;
34 import static test.launchertest.Constants.*;
35
36 /**
37 * Unit test for launching modular FX applications
38 */
39 public class ModuleLauncherTest {
40
41 private static final String modulePath2 = System.getProperty("launchertest.testapp2.module.path");
42 private static final String modulePath3 = System.getProperty("launchertest.testapp3.module.path");
43 private static final String modulePath4 = System.getProperty("launchertest.testapp4.module.path");
44 private static final String modulePath5 = System.getProperty("launchertest.testapp5.module.path");
45 private static final String modulePath6 = System.getProperty("launchertest.testapp6.module.path");
46 private static final String modulePathScript1 = System.getProperty("launchertest.testscriptapp1.module.path");
47 private static final String modulePathScript2 = System.getProperty("launchertest.testscriptapp2.module.path");
48
49 private static final String moduleName = "mymod";
50
51 private final int testExitCode = ERROR_NONE;
52
53 private void doTestLaunchModule(String appModulePath, String testAppName) throws Exception {
54 final String javafxModulePath = System.getProperty("worker.module.path");
55 String modulePath;
56 if (javafxModulePath != null) {
57 modulePath = javafxModulePath + File.pathSeparator + appModulePath;
58 } else {
59 modulePath = appModulePath;
60 }
61 assertNotNull(testAppName);
62 System.err.println("The following Unknown module WARNING messages are expected:");
63 String mpArg = "--module-path=" + modulePath;
64 String moduleAppName = "--module=" + moduleName + "/" + testAppName;
65 final ArrayList<String> cmd =
66 test.util.Util.createApplicationLaunchCommand(
67 moduleAppName,
265 @Test (timeout = 15000)
266 public void testModuleFXMLQualExported() throws Exception {
267 doTestLaunchModule(modulePath6, "myapp6.AppFXMLQualExported");
268 }
269
270 @Test (timeout = 15000)
271 public void testModuleFXMLOpened() throws Exception {
272 doTestLaunchModule(modulePath6, "myapp6.AppFXMLOpened");
273 }
274
275 @Test (timeout = 15000)
276 public void testModuleFXMLQualOpened() throws Exception {
277 doTestLaunchModule(modulePath6, "myapp6.AppFXMLQualOpened");
278 }
279
280 @Test (timeout = 15000)
281 public void testFXMLScriptDeployment() throws Exception {
282 doTestLaunchModule(modulePathScript1, "myapp1.FXMLScriptDeployment");
283 }
284
285 @Test (timeout = 15000)
286 public void testFXMLScriptDeployment2Compile_On() throws Exception {
287 doTestLaunchModule(modulePathScript2, "myapp2.FXMLScriptDeployment2Compile_On");
288 }
289
290 @Test (timeout = 15000)
291 public void testFXMLScriptDeployment2Compile_Off() throws Exception {
292 doTestLaunchModule(modulePathScript2, "myapp2.FXMLScriptDeployment2Compile_Off");
293 }
294
295 @Test (timeout = 15000)
296 public void testFXMLScriptDeployment2Compile_On_Off() throws Exception {
297 doTestLaunchModule(modulePathScript2, "myapp2.FXMLScriptDeployment2Compile_On_Off");
298 }
299
300 @Test (timeout = 15000)
301 public void testFXMLScriptDeployment2Compile_Off_On() throws Exception {
302 doTestLaunchModule(modulePathScript2, "myapp2.FXMLScriptDeployment2Compile_Off_On");
303 }
304 @Test (timeout = 15000)
305 public void testFXMLScriptDeployment2Compile_Fail_Compilation() throws Exception {
306 doTestLaunchModule(modulePathScript2, "myapp2.FXMLScriptDeployment2Compile_Fail_Compilation");
307 }
308 }
309
310
|