Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Java 11 + Tycho-Surefire + bundled OpenJFX11
Java 11 + Tycho-Surefire + bundled OpenJFX11 [message #1828277] Fri, 05 June 2020 13:16 Go to next message
Shawn Kleese is currently offline Shawn KleeseFriend
Messages: 1
Registered: June 2020
Junior Member
Hello everybody,

i'm struggeling really hard with the migration of our project from Java 8 to Java 11.

One of the biggest Issues are the UI tests with Tycho-Surefire. I've thinked that the frameworkExtension "org.eclipse.fx.osgi" registers the JavaFx Bundles/Modules and everything is fine - but its changes nothing...

<frameworkExtension>
<groupId>org.eclipse.fx</groupId>
 <artifactId>org.eclipse.fx.osgi</artifactId>
<version>3.7</version>
</frameworkExtension>


I have added the rebundled JavaFX11 Bundles from Bestsolution to my target: downloads.efxclipse.bestsolution.at/p2-repos/openjfx-11/repository/

The only way i've found that this works is when i use "--module-path [path to javafx-sdk-11.0.2]" and alot of "--add-modules ... --add-exports ... --add-opens"-Parameters. Second is not the Problem but i don't want to have everywhere(devlopers and Jenkins,etc.) a javafx-SDK installed at the same path. This seems to be the wrong way for me...

Here is my POM for example:
<properties>
		<test.cmdline.base>-Dorg.osgi.framework.bundle.parent=ext -Dosgi.framework.extensions=org.eclipse.fx.osgi -Dfile.encoding=UTF-8 -Dprism.order=d3d</test.cmdline.base>
		
		<test.cmdline.jigsaw.modulepath>--module-path "C:\Program Files\Java\javafx-sdk-11.0.2\lib" </test.cmdline.jigsaw.modulepath>
		<test.cmdline.jigsaw.modules>--add-modules javafx.base,javafx.controls,javafx.graphics,javafx.fxml,javafx.web</test.cmdline.jigsaw.modules>
		<test.cmdline.jigsaw.exports>--add-exports javafx.base/com.sun.javafx.beans=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.css=ALL-UNNAMED --add-exports=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED --add-exports=javafx.graphics/com.sun.glass.ui=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.scene.traversal=ALL-UNNAMED --add-opens=javafx.graphics/com.sun.javafx.text=ALL-UNNAMED</test.cmdline.jigsaw.exports>
		<test.cmdline.jigsaw.opens>--add-opens=javafx.graphics/javafx.scene=ALL-UNNAMED --add-opens=javafx.graphics/javafx.application=ALL-UNNAMED --add-opens=javafx.graphics/javafx.scene.text=ALL-UNNAMED</test.cmdline.jigsaw.opens>

		<test.cmdline.arguments>${test.cmdline.base} ${test.cmdline.jigsaw.modulepath} ${test.cmdline.jigsaw.modules} ${test.cmdline.jigsaw.exports} ${test.cmdline.jigsaw.opens}</test.cmdline.arguments>
	
		<test.app.argline>-nosplash -consoleLog -console</test.app.argline>
	       <tycho.version>1.7.0</tycho.version>
	</properties>

	<modules>
		<module>de.cooltests.module.A</module>
		<module>de.cooltests.module.C</module>
		<module>de.cooltests.module.C</module>
	</modules>

	<build>
		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-surefire-plugin</artifactId>
				<version>${tycho.version}</version>
				<configuration>
				 	<argLine>${test.cmdline.arguments}</argLine> <!-- maybe neded for monocle:   - - add-exports=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED  - - illegal-access=permit - - add-modules javafx.fxml,javafx.graphics - - add-exports=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED  - -add-modules javafx.graphics - -add-reads javafx.graphics=ALL-UNNAMED      -Dtestfx.robot=glass -Dglass.platform=Monocle -Dmonocle.platform=Headless -Dprism.order=sw     - -    add-exports javafx.graphics/com.sun.javafx.application=ALL-UNNAMED-->
				 	<!-- sooo many params  -Djava.awt.headless=true -Dtestfx.headless=true -Dtestfx.robot=glass -Dmonocle.platform=Headless -Dprism.order=d3d -Dprism.text=t2k -Dprism.verbose=true -Dtestfx.setup.timeout=2500 -   -   add-opens de.truncated.framework.shared/de.truncated.framework.shared.resources=ALL-UNNAMED -->
					<appArgLine>${test.app.argline}</appArgLine>
					<forkCount>0</forkCount>
					<useUIHarness>false</useUIHarness>
	                  <frameworkExtensions>
						 <frameworkExtension>
							<groupId>org.eclipse.fx</groupId>
						    <artifactId>org.eclipse.fx.osgi</artifactId>
						    <version>3.7</version>
						 </frameworkExtension>
					 </frameworkExtensions>
				</configuration>
			</plugin>
		
			<plugin>
			   <groupId>org.eclipse.tycho</groupId>
			   <artifactId>target-platform-configuration</artifactId>
			   <version>${tycho.version}</version>
			   <configuration>
<target>
						<artifact>
							<groupId>de.cooltests</groupId>
							<artifactId>de.cooltests.target</artifactId>
							<version>${project.version}</version>
						</artifact>
					</target>
environments>
						<environment>
							<os>win32</os>
							<ws>win32</ws>
							<arch>x86_64</arch>
						</environment>
					</environments>
			      <dependency-resolution>
			         <extraRequirements>
			          <requirement>
			               <type>p2-installable-unit</type>
			               <id>openjfx.base</id>
			               <versionRange>0.0.0</versionRange>
			            </requirement>
			            <requirement>
			               <type>p2-installable-unit</type>
			               <id>openjfx.controls</id>
			               <versionRange>0.0.0</versionRange>
			            </requirement>
			            <requirement>
			               <type>p2-installable-unit</type>
			               <id>openjfx.fxml</id>
			               <versionRange>0.0.0</versionRange>
			            </requirement>
			            <requirement>
			               <type>p2-installable-unit</type>
			               <id>openjfx.graphics.win32_64</id>
			               <versionRange>0.0.0</versionRange>
			            </requirement>
			            <requirement>
			               <type>p2-installable-unit</type>
			               <id>openjfx.media.win32_64</id>
			               <versionRange>0.0.0</versionRange>
			            </requirement>
			            <requirement>
			               <type>p2-installable-unit</type>
			               <id>org.controlsfx</id>
			               <versionRange>0.0.0</versionRange>
			            </requirement>
			             <!--<requirement>
			               <type>p2-installable-unit</type>
			               <id>org.testfx.openjfx-monocle</id>
			               <versionRange>0.0.0</versionRange>
			            </requirement> -->
			         </extraRequirements>
			      </dependency-resolution>
			   </configuration>
			</plugin>
			
		</plugins>
	</build>




I hope this is totally wrong and somebody have a small hint for me to point the right way. (and a easy solution :-))


Thx 4 Help!




Re: Java 11 + Tycho-Surefire + bundled OpenJFX11 [message #1829351 is a reply to message #1828277] Wed, 01 July 2020 19:02 Go to previous message
Quang Tran is currently offline Quang TranFriend
Messages: 1
Registered: July 2020
Junior Member
I have the same problem. It's working in the IDE but not in the tycho build.
I run the tests with:
-Defxclipse.osgi.hook.debug=true -Dosgi.framework.extensions=org.eclipse.fx.osgi -Defxclipse.java-modules.dir=${javafx.home}\lib

but I always get the error
!ENTRY org.eclipse.osgi 4 0 2020-07-01 20:50:35.045
!MESSAGE Bundle org.eclipse.fx.osgi not found.
even though it is there.
My pom.xml
<plugin>
	<groupId>org.eclipse.tycho</groupId>
	<artifactId>target-platform-configuration</artifactId>
	<version>${tycho-version}</version>
	<configuration>
	<resolver>p2</resolver>
	<pomDependencies>consider</pomDependencies>
	<dependency-resolution>
		<extraRequirements>
			<requirement>
				<type>eclipse-plugin</type>
				<id>org.eclipse.fx.osgi</id>
				<versionRange>0.0.0</versionRange>
			</requirement>
		</extraRequirements>
	</dependency-resolution>
	<environments>
		<environment>
			<os>win32</os>
			<ws>win32</ws>
			<arch>x86_64</arch>
		</environment>
	</environments>
	</configuration>
</plugin>

<plugin>
	<groupId>org.eclipse.tycho</groupId>
	<artifactId>tycho-surefire-plugin</artifactId>
	<version>${tycho-version}</version>
	<configuration>
	<frameworkExtension>
		<frameworkExtension>
			<groupId>org.eclipse.fx.runtime</groupId>
			<artifactId>org.eclipse.fx.osgi</artifactId>
			<version>3.7.0</version>
		</frameworkExtension>
	</frameworkExtension>
	<argLine>${additionalTestArgLine} -Defxclipse.osgi.hook.debug=true -Dosgi.framework.extensions=org.eclipse.fx.osgi -Defxclipse.java-modules.dir=${javafx.home}\lib</argLine>
	</configuration>
</plugin>
Previous Topic:FullScreen Stage mode
Goto Forum:
  


Current Time: Thu Jul 02 19:09:58 GMT 2020

Powered by FUDForum. Page generated in 0.01452 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top