# HG changeset patch # User Jaroslav Tulach # Date 1443769034 -7200 # Node ID a0f79e32d5269a5a69be572215096f8e01151f18 # Parent c7f11fbd54758ed19f19f14baa2195b18641bc5a Ability to run the JavaFX presenter in headless mode is useful for testing diff -r c7f11fbd5475 -r a0f79e32d526 boot-fx/src/main/java/net/java/html/boot/fx/FXBrowsers.java --- a/boot-fx/src/main/java/net/java/html/boot/fx/FXBrowsers.java Mon Sep 21 21:19:13 2015 +0200 +++ b/boot-fx/src/main/java/net/java/html/boot/fx/FXBrowsers.java Fri Oct 02 08:57:14 2015 +0200 @@ -62,8 +62,13 @@ * application and based on other events in the application * {@link #runInBrowser(javafx.scene.web.WebView, java.lang.Runnable) re-execute code} * inside of such {@link WebView}s. + *

* In case such detailed control is not necessary, - * consider using {@link BrowserBuilder}. + * consider using {@link BrowserBuilder}. Btw. when using the {@link BrowserBuilder} + * one can execute presenter in headless mode. Just specify: + * {@link System}.{@link System#setProperty(java.lang.String, java.lang.String) setProperty}("fxpresenter.headless", "true"); + * + * * * @author Jaroslav Tulach * @since 0.6 diff -r c7f11fbd5475 -r a0f79e32d526 boot-fx/src/main/java/org/netbeans/html/boot/fx/FXBrwsr.java --- a/boot-fx/src/main/java/org/netbeans/html/boot/fx/FXBrwsr.java Mon Sep 21 21:19:13 2015 +0200 +++ b/boot-fx/src/main/java/org/netbeans/html/boot/fx/FXBrwsr.java Fri Oct 02 08:57:14 2015 +0200 @@ -159,6 +159,9 @@ if (arr[4] != null) { scene.getWindow().setOnCloseRequest((EventHandler) arr[4]); } + if (Boolean.getBoolean("fxpresenter.headless")) { + return; + } primaryStage.show(); } diff -r c7f11fbd5475 -r a0f79e32d526 boot-fx/src/main/resources/org/netbeans/html/boot/fx/Bundle.properties --- a/boot-fx/src/main/resources/org/netbeans/html/boot/fx/Bundle.properties Mon Sep 21 21:19:13 2015 +0200 +++ b/boot-fx/src/main/resources/org/netbeans/html/boot/fx/Bundle.properties Fri Oct 02 08:57:14 2015 +0200 @@ -51,3 +51,4 @@ PromptTitle=Question PromptOKButton=OK PromptCancelButton=Cancel + diff -r c7f11fbd5475 -r a0f79e32d526 boot-fx/src/test/java/net/java/html/boot/fx/FXBrowsersOnResourceTest.java --- a/boot-fx/src/test/java/net/java/html/boot/fx/FXBrowsersOnResourceTest.java Mon Sep 21 21:19:13 2015 +0200 +++ b/boot-fx/src/test/java/net/java/html/boot/fx/FXBrowsersOnResourceTest.java Fri Oct 02 08:57:14 2015 +0200 @@ -193,7 +193,6 @@ pane.setCenter(getV1()); pane.setBottom(getV2()); - stage.show(); CDL.countDown(); } diff -r c7f11fbd5475 -r a0f79e32d526 boot-fx/src/test/java/net/java/html/boot/fx/FXBrowsersTest.java --- a/boot-fx/src/test/java/net/java/html/boot/fx/FXBrowsersTest.java Mon Sep 21 21:19:13 2015 +0200 +++ b/boot-fx/src/test/java/net/java/html/boot/fx/FXBrowsersTest.java Fri Oct 02 08:57:14 2015 +0200 @@ -209,7 +209,6 @@ pane.setCenter(getV1()); pane.setBottom(getV2()); - stage.show(); CDL.countDown(); } diff -r c7f11fbd5475 -r a0f79e32d526 ko-felix-test/pom.xml --- a/ko-felix-test/pom.xml Mon Sep 21 21:19:13 2015 +0200 +++ b/ko-felix-test/pom.xml Fri Oct 02 08:57:14 2015 +0200 @@ -32,7 +32,6 @@ maven-failsafe-plugin - 2.16 ${project.build.directory}/${project.build.finalName}.jar diff -r c7f11fbd5475 -r a0f79e32d526 ko-osgi-test/pom.xml --- a/ko-osgi-test/pom.xml Mon Sep 21 21:19:13 2015 +0200 +++ b/ko-osgi-test/pom.xml Fri Oct 02 08:57:14 2015 +0200 @@ -32,7 +32,6 @@ maven-failsafe-plugin - 2.16 ${project.build.directory}/${project.build.finalName}.jar diff -r c7f11fbd5475 -r a0f79e32d526 pom.xml --- a/pom.xml Mon Sep 21 21:19:13 2015 +0200 +++ b/pom.xml Fri Oct 02 08:57:14 2015 +0200 @@ -164,6 +164,21 @@ org.apache.maven.plugins maven-surefire-plugin 2.13 + + + true + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.18.1 + + + true + + org.apache.maven.plugins diff -r c7f11fbd5475 -r a0f79e32d526 src/main/javadoc/overview.html --- a/src/main/javadoc/overview.html Mon Sep 21 21:19:13 2015 +0200 +++ b/src/main/javadoc/overview.html Fri Oct 02 08:57:14 2015 +0200 @@ -94,6 +94,25 @@ yet the application code can be written in Java.

+

Improvements in version 1.3

+ + The JavaFX presenter can be executed in headless mode - + just specify -Dfxpresenter.headless=true when launching + its virtual machine and no window will be shown. This is particularly + useful for testing. Configure your surefire or failsafe + plugins like:
+<plugin>
+  <groupId>org.apache.maven.plugins</groupId>
+  <artifactId>maven-surefire-plugin</artifactId>
+  <version>2.13</version>
+  <configuration>
+      <systemPropertyVariables>
+          <fxpresenter.headless>true</fxpresenter.headless>
+      </systemPropertyVariables>
+  </configuration>
+</plugin>
+
+

What's Been Improved in Version 1.2.3?

One can control {@link net.java.html.json.OnReceive#headers() HTTP request headers}