Object Mappping not working for JavaFX AUT using javax.swing [message #1829541] |
Mon, 06 July 2020 11:59  |
Eclipse User |
|
|
|
Object Mappping not working for JavaFX AUT using javax.swing
Using Jubula 8.7.1.046
Two test cases:
GOOD
Simple app built with OpenJDK 11.0.7 and OpenJFX 11.0.2.
The app uses javafx.scene.control elements.
This does launch and Object Mapping works. All is good.
BAD
Simple app built with OpenJDK 11.0.7 and OpenJFX 11.0.2.
The app exclusively uses javax.swing elements.
This does launch but Object Mapping does not work. The elements do not get the green highlight when I hover over them.
I tested with and without these args:
--add-opens javafx.controls/javafx.scene.control.skin=ALL-UNNAMED --illegal-access=permit
The problem is that the app I need to test is the latter. I do not see anything unusual in the logs.
Any thoughts?
|
|
|
Re: Object Mappping not working for JavaFX AUT using javax.swing [message #1829608 is a reply to message #1829541] |
Tue, 07 July 2020 11:09   |
Eclipse User |
|
|
|
If it helps this is the sample code of the AUT that does not work, i.e. it launches but Object Mapping does not work. I can also post the Maven pom if someone want to give it a try.
package org.gng.semiqe;
import javafx.application.Application;
import javafx.embed.swing.SwingNode;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
import javafx.geometry.Pos;
public class HelloFXSW extends Application {
@Override
public void start (Stage stage) {
final SwingNode swingNode1 = new SwingNode();
final SwingNode swingNode2 = new SwingNode();
createSwingContent(swingNode1,swingNode2);
StackPane pane = new StackPane();
StackPane.setAlignment(swingNode1, Pos.TOP_CENTER);
pane.getChildren().addAll(swingNode1,swingNode2);
stage.setTitle("Swing in JavaFX");
stage.setScene(new Scene(pane, 640, 480));
stage.show();
}
private void createSwingContent(final SwingNode swingNode1,final SwingNode swingNode2) {
SwingUtilities.invokeLater(() -> {
String javaVersion = System.getProperty("java.version");
String javafxVersion = System.getProperty("javafx.version");
JLabel lbl = new JLabel("Hello, JavaFX " + javafxVersion + ", running on Java " + javaVersion + ".");
swingNode1.setContent(lbl);
swingNode2.setContent(new JButton("Click me!"));
});
}
}
|
|
|
|
|
Re: Object Mappping not working for JavaFX AUT using javax.swing [message #1829895 is a reply to message #1829887] |
Mon, 13 July 2020 09:46  |
Eclipse User |
|
|
|
Should have mentioned that this is the AUT settings in Jubula:
AUT Executable:
C:\utils\jdk-11.0.7\bin\javaw.exe
AUT Arguments:
--module-path c:\utils\javafx-sdk-11.0.2\lib --add-modules=javafx.controls,javafx.swing --add-opens javafx.swing/javafx.embed.swing=ALL-UNNAMED --add-opens javafx.controls/javafx.scene.control.skin=ALL-UNNAMED --illegal-access=permit -jar C:\projects\DStestSwing2\target\hellofxsw-1.0-SNAPSHOT.jar
If I remove the 'javafx' bits from the arguments the AUT will not start - it needs those. Also the AUT needs OpenJDK11.
|
|
|
Powered by
FUDForum. Page generated in 0.04732 seconds