Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Jubula » Object Mappping not working for JavaFX AUT using javax.swing
Object Mappping not working for JavaFX AUT using javax.swing [message #1829541] Mon, 06 July 2020 15:59 Go to next message
Bruce Schurmann is currently offline Bruce SchurmannFriend
Messages: 7
Registered: July 2020
Junior Member
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 15:09 Go to previous messageGo to next message
Bruce Schurmann is currently offline Bruce SchurmannFriend
Messages: 7
Registered: July 2020
Junior Member
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 #1829853 is a reply to message #1829608] Mon, 13 July 2020 06:45 Go to previous messageGo to next message
Marvin Mueller is currently offline Marvin MuellerFriend
Messages: 255
Registered: March 2012
Senior Member
We do not support swing elements within Javafx. The Toolkits are splitted and are not all available only the one setup. But if the App uses only swing elements, try to start it as swing Application. This might work

best regards
Marvin Mueller
Re: Object Mappping not working for JavaFX AUT using javax.swing [message #1829887 is a reply to message #1829853] Mon, 13 July 2020 12:44 Go to previous messageGo to next message
Bruce Schurmann is currently offline Bruce SchurmannFriend
Messages: 7
Registered: July 2020
Junior Member
Thanks for the reply.
If I switch the AUT Toolkit to 'swing' then when I try to start the AUT I get this:
2020-07-13 07:38:27.593 [Connection.ReaderThread:Socket[addr=/127.0.0.1,port=63709,localport=60001]] ERROR o.e.j.autagent.OsgiAUTStartHelper - No bundle found for ID 'com.thoughtworks.xstream'.
2020-07-13 07:38:27.593 [Connection.ReaderThread:Socket[addr=/127.0.0.1,port=63709,localport=60001]] ERROR o.e.j.autagent.OsgiAUTStartHelper - No bundle found for ID 'org.xmlpull'.
2020-07-13 07:38:29.738 [Connection.ReaderThread:Socket[addr=localhost/127.0.0.1,port=60001,localport=63709]] ERROR o.e.j.c.i.c.StartAUTServerStateCommand - AUTServer could not start: Invalid arguments.;
 Picked up _JAVA_OPTIONS: "-javaagent:C:\utils\jubula_8.7.1.046\ite\plugins\org.eclipse.jubula.rc.common.agent_7.0.2.201902270829.jar"
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/C:/Users/gng/AppData/Local/Temp/com.thoughtworks.xstream-1.3.1.v2011112409242167391810650255551.jar) to field java.util.Properties.defaults
WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Error: Could not find or load main class C:\utils\jubula_8.7.1.046\ite
Caused by: java.lang.ClassNotFoundException: C:\utils\jubula_8.7.1.046\ite
Re: Object Mappping not working for JavaFX AUT using javax.swing [message #1829895 is a reply to message #1829887] Mon, 13 July 2020 13:46 Go to previous message
Bruce Schurmann is currently offline Bruce SchurmannFriend
Messages: 7
Registered: July 2020
Junior Member
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.
Previous Topic:Abstract Test Cases
Next Topic:Establishing Connection to AUT failed
Goto Forum:
  


Current Time: Thu Apr 25 05:00:25 GMT 2024

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

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

Back to the top