diff --git a/AUTHORS.txt b/AUTHORS.txt
index 9a5e4bc..4a3b89d 100644
--- a/AUTHORS.txt
+++ b/AUTHORS.txt
@@ -9,3 +9,4 @@ Sakari Hoisko Dockerized linux env with X
Juho Lehtonen Optimized docker environment.
Juho Saarinen Package improvements, initial monocle support, screenshot bug fix
Turo Soisenniemi Initial java agent support
+Jari Parviainen Latest changes to Java 8 and 11 versions
\ No newline at end of file
diff --git a/README.md b/README.md
index 6d74771..6a073cc 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
JavaFXLibrary works with both Jython (local and remote use) and Python (remote only) versions of Robot Framework. This means JavaFXLibrary can be used with Jython incompatible test libraries too by importing it as a remote library.
-JavaFXLibrary is tested to work with Java 8 and Robot Framework 3.2.1 or later.
+JavaFXLibrary is tested to work with Java (8 and 11) and Robot Framework 3.2.1 or later.
## Keyword documentation
See keyword [documentation](https://repo1.maven.org/maven2/org/robotframework/javafxlibrary/0.7.1/javafxlibrary-0.7.1.html).
diff --git a/pom.xml b/pom.xml
index ec9144e..27196af 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,10 +21,13 @@
org.robotframework
javafxlibrary
jar
- 0.7.1
+ 0.7.1-SNAPSHOT
UTF-8
- 1.44
+ 1.49
+ 11
+ 11
+ 11
${project.groupId}:${project.artifactId}
@@ -59,6 +62,12 @@
Eficode
http://www.eficode.com
+
+ Jari Parviainen
+ jari.parviainen@eficode.com
+ Eficode
+ http://www.eficode.com
+
@@ -80,7 +89,7 @@
org.apache.maven.plugins
maven-source-plugin
- 3.2.1
+ 3.3.0
attach-sources
@@ -93,7 +102,7 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 3.2.0
+ 3.6.0
attach-javadocs
@@ -107,7 +116,7 @@
org.codehaus.mojo
build-helper-maven-plugin
- 3.2.0
+ 3.4.0
attach-artifacts
@@ -133,7 +142,7 @@
org.apache.maven.plugins
maven-gpg-plugin
- 1.6
+ 3.1.0
sign-artifacts
@@ -185,7 +194,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 2.22.2
+ 3.1.2
-javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar
@@ -195,7 +204,7 @@
org.sonatype.plugins
nexus-staging-maven-plugin
- 1.6.8
+ 1.6.13
true
ossrh
@@ -204,17 +213,36 @@
+ org.apache.maven.plugins
maven-compiler-plugin
- 3.8.1
-
- 1.8
- 1.8
-
+ 3.11.0
+
+
+ compile-java-8
+
+ compile
+
+
+ 8
+
+
+
+ compile-java-11
+ compile
+
+ compile
+
+
+ 11
+ true
+
+
+
org.apache.maven.plugins
maven-jar-plugin
- 3.2.0
+ 3.3.0
@@ -223,8 +251,10 @@
JavaFXLibrary
+ true
+ ${project.artifactId}-${project.version}
@@ -237,7 +267,7 @@
org.apache.maven.plugins
maven-assembly-plugin
- 3.3.0
+ 3.6.0
package
@@ -260,7 +290,26 @@
org.robotframework
robotframework-maven-plugin
- 1.7.1
+ 2.1.0
+
+
+ smoke
+
+
+
+ not-ready
+
+
+ monocle-issue
+
+ TRACE:INFO
+ false
+
+ appJar:${project.build.directory}/${project.artifactId}*tests.jar
+
+
acceptance tests
@@ -268,22 +317,6 @@
run
-
-
- smoke
-
-
- not-ready
-
-
- monocle-issue
-
- TRACE:INFO
- false
-
- appJar:${project.build.directory}/${project.artifactId}*tests.jar
-
-
documentation
@@ -320,7 +353,7 @@
org.apache.maven.plugins
maven-shade-plugin
- 3.2.4
+ 3.5.1
package
@@ -367,10 +400,43 @@
+
+ org.openjfx
+ javafx-graphics
+ 11
+ win
+
+
+ org.openjfx
+ javafx-graphics
+ 11
+ linux
+
+
+ org.openjfx
+ javafx-graphics
+ 11
+ mac
+
+
+ org.openjfx
+ javafx-controls
+ 11
+
+
+ org.openjfx
+ javafx-swing
+ 11
+
+
+ org.openjfx
+ javafx-fxml
+ 11
+
org.apache.maven
maven-model
- 3.6.3
+ 3.9.4
org.jmockit
@@ -381,17 +447,22 @@
junit
junit
- 4.13.1
+ 4.13.2
org.testfx
testfx-core
- 4.0.16-alpha
+ 4.0.17
+
+
+ org.testfx
+ testfx-junit
+ 4.0.17
org.testfx
openjfx-monocle
- 8u76-b04
+ jdk-12.0.1+2
org.robotframework
@@ -401,7 +472,7 @@
org.robotframework
robotframework
- 3.2.1
+ 4.1.2
org.hamcrest
@@ -416,12 +487,12 @@
org.apache.commons
commons-lang3
- 3.11
+ 3.13.0
commons-io
commons-io
- 2.7
+ 2.14.0
diff --git a/src/main/java/JavaFXLibrary.java b/src/main/java/JavaFXLibrary.java
index 2b54eb9..0d105c9 100644
--- a/src/main/java/JavaFXLibrary.java
+++ b/src/main/java/JavaFXLibrary.java
@@ -128,6 +128,8 @@ public JavaFXLibrary(boolean headless) {
if (headless) {
System.setProperty("testfx.robot", "glass");
System.setProperty("testfx.headless", "true");
+ System.setProperty("glass.platform", "Monocle");
+ System.setProperty("monocle.platform", "Headless");
System.setProperty("prism.order", "sw");
System.setProperty("prism.text", "t2k");
TestFxAdapter.isHeadless = true;
@@ -150,13 +152,14 @@ public static String loadRobotLibraryVersion() {
@Autowired
protected RunOnFailure runOnFailure;
+ @SuppressWarnings("unchecked")
@Override
public Object runKeyword(String keywordName, List args, Map kwargs) {
if (kwargs == null) {
- kwargs = new HashMap();
+ kwargs = new HashMap<>();
}
- List finalArgs;
- Map finalKwargs;
+ List> finalArgs;
+ Map,?> finalKwargs;
// JavalibCore changes arguments of Call Method keywords to Strings after this check, so they need to handle their own objectMapping
if (!(keywordName.equals("callObjectMethod") || keywordName.equals("callObjectMethodInFxApplicationThread"))) {
diff --git a/src/main/java/JavaFXLibraryRemoteServer.java b/src/main/java/JavaFXLibraryRemoteServer.java
index cab0435..c9d9fb2 100644
--- a/src/main/java/JavaFXLibraryRemoteServer.java
+++ b/src/main/java/JavaFXLibraryRemoteServer.java
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.config.Configurator;
@@ -36,6 +35,5 @@ public static void configureLogging() {
LogFactory.releaseAll();
LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log",
"org.apache.commons.logging.impl.Log4JLogger");
- Log log = LogFactory.getLog(RemoteServer.class);
}
}
\ No newline at end of file
diff --git a/src/main/java/javafxlibrary/keywords/AdditionalKeywords/ApplicationLauncher.java b/src/main/java/javafxlibrary/keywords/AdditionalKeywords/ApplicationLauncher.java
index 57cc01f..74da686 100644
--- a/src/main/java/javafxlibrary/keywords/AdditionalKeywords/ApplicationLauncher.java
+++ b/src/main/java/javafxlibrary/keywords/AdditionalKeywords/ApplicationLauncher.java
@@ -28,7 +28,6 @@
import org.robotframework.javalib.annotation.RobotKeywords;
import java.io.File;
-import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.FileSystems;
@@ -72,7 +71,7 @@ public void launchJavafxApplication(String appName, String... appArgs) {
@ArgumentNames({"appName", "*args"})
public void launchSwingApplication(String appName, String... appArgs) {
RobotLog.info("Starting application:" + appName);
- Class mainClass = getMainClass(appName);
+ Class> mainClass = getMainClass(appName);
Application app = createWrapperApplication(mainClass, appArgs);
createNewSession(app);
waitForEventsInFxApplicationThread(getLibraryKeywordTimeout());
@@ -92,14 +91,14 @@ public void launchSwingApplication(String appName, String... appArgs) {
@ArgumentNames({"appName", "*args"})
public void launchSwingApplicationInSeparateThread(String appName, String... appArgs) {
RobotLog.info("Starting application:" + appName);
- Class c = getMainClass(appName);
+ Class> c = getMainClass(appName);
Application app = createThreadedWrapperApplication(c, appArgs);
createNewSession(app);
waitForEventsInFxApplicationThread(getLibraryKeywordTimeout());
RobotLog.info("Application: " + appName + " started.");
}
- private Class getMainClass(String appName) {
+ private Class> getMainClass(String appName) {
try {
if (appName.endsWith(".jar")) {
return getMainClassFromJarFile(appName);
@@ -112,14 +111,14 @@ private Class getMainClass(String appName) {
}
private void addPathToClassPath(String path) {
- URLClassLoader classLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
RobotLog.info("Setting following path to classpath: " + path);
try {
- Method method = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
- method.setAccessible(true);
- method.invoke(classLoader, (new File(path)).toURI().toURL());
+ URL[] urls = new URL[]{new File(path).toURI().toURL()};
+ URLClassLoader classLoader = new URLClassLoader(urls, ClassLoader.getSystemClassLoader());
+
+ classLoader.close();
} catch (Exception e) {
throw new JavaFXLibraryFatalException("Problem setting the classpath: " + path, e);
@@ -176,11 +175,11 @@ public void setToClasspath(String path, boolean failIfNotFound) {
@RobotKeyword("Logs current classpath content")
public void logApplicationClasspath() {
try {
- ClassLoader cl = ClassLoader.getSystemClassLoader();
- URL[] urls = ((URLClassLoader) cl).getURLs();
RobotLog.info("Printing out classpaths: \n");
- for (URL url : urls) {
- RobotLog.info(url.getFile());
+
+ String classpathStr = System.getProperty("java.class.path");
+ for (String classpathItem : classpathStr.split(System.getProperty("path.separator"))) {
+ RobotLog.info(classpathItem);
}
} catch (Exception e) {
throw new JavaFXLibraryNonFatalException("Unable to log application classpaths", e);
@@ -216,7 +215,7 @@ public String getSystemProperty(String name) {
public void logSystemProperties() {
try {
Properties p = System.getProperties();
- Enumeration keys = p.keys();
+ Enumeration> keys = p.keys();
while (keys.hasMoreElements()) {
String key = (String) keys.nextElement();
String value = (String) p.get(key);
diff --git a/src/main/java/javafxlibrary/keywords/AdditionalKeywords/ConvenienceKeywords.java b/src/main/java/javafxlibrary/keywords/AdditionalKeywords/ConvenienceKeywords.java
index 531cc7d..c3b34b2 100644
--- a/src/main/java/javafxlibrary/keywords/AdditionalKeywords/ConvenienceKeywords.java
+++ b/src/main/java/javafxlibrary/keywords/AdditionalKeywords/ConvenienceKeywords.java
@@ -17,8 +17,8 @@
package javafxlibrary.keywords.AdditionalKeywords;
-import com.sun.javafx.scene.control.skin.TableViewSkin;
-import com.sun.javafx.scene.control.skin.VirtualFlow;
+import javafx.scene.control.skin.TableViewSkin;
+import javafx.scene.control.skin.VirtualFlow;
import javafx.collections.ObservableList;
import javafx.css.PseudoClass;
import javafx.geometry.BoundingBox;
@@ -113,7 +113,7 @@ public void callObjectMethodInFxApplicationThread(Object object, String method,
public String[] listNodeMethods(Node node) {
try {
RobotLog.info("Listing all available methods for node: \"" + node + "\"");
- Class nodeClass = node.getClass();
+ Class> nodeClass = node.getClass();
ArrayList list = new ArrayList<>();
System.out.println("*INFO*");
while (nodeClass != null) {
@@ -137,7 +137,7 @@ private String getMethodDescription(Method m) {
StringBuilder entry = new StringBuilder(m.getReturnType().getName() + " ");
entry.append(m.getName());
entry.append("(");
- Class[] args = m.getParameterTypes();
+ Class>[] args = m.getParameterTypes();
for (int i = 0; i < args.length; i++) {
entry.append(args[i].getName());
if (i != args.length - 1)
@@ -279,7 +279,7 @@ public String getNodeText(Object locator) {
@RobotKeyword("Returns image name and path of the node. \n\n"
+ "``locator`` is either a _query_ or _Object_ for a node whose getHeight method will be called, see "
+ "`3. Locating JavaFX Nodes`. \n\n"
- + "Returns full image path by subsequently calling impl_getUrl -method. \n\n"
+ + "Returns full image path by subsequently calling getUrl -method. \n\n"
+ "Note, impl_getUrl -method is deprecated! Support for this method will be removed from Java in the future.")
@ArgumentNames({"node"})
public String getNodeImageUrl(Object locator) {
@@ -294,8 +294,7 @@ public String getNodeImageUrl(Object locator) {
try {
Object result = m.invoke(node, (Object) null);
Image image = (Image) result;
- RobotLog.trace("Calling deprecated method impl_getUrl() for image: \"" + image + "\"");
- return image.impl_getUrl();
+ return image.getUrl();
} catch (Exception e) {
throw new JavaFXLibraryNonFatalException("Problem calling method: .getImage(): " + e.getMessage(), e);
}
@@ -409,9 +408,10 @@ public Object getTableCellValue(Object locator, int row, int column) {
checkObjectArgumentNotNull(locator);
try {
RobotLog.info("Getting table \"" + locator + "\" cell value from row \"" + row + "\" and column \"" + column + "\".");
- TableView table = (TableView) objectToNode(locator);
+ TableView> table = (TableView>) objectToNode(locator);
Object item = table.getItems().get(row);
- TableColumn col = (TableColumn) table.getColumns().get(column);
+ TableColumn col = (TableColumn, ?>) table.getColumns().get(column);
+ @SuppressWarnings("unchecked")
Object value = col.getCellObservableValue(item).getValue();
return mapObject(value);
} catch (ClassCastException cce) {
@@ -433,7 +433,7 @@ public Object getTableCell(Object locator, int row, int column) {
checkObjectArgumentNotNull(locator);
try {
RobotLog.info("Getting table \"" + locator + "\" cell from row \"" + row + "\" and column \"" + column + "\".");
- TableView table = (TableView) objectToNode(locator);
+ TableView> table = (TableView>) objectToNode(locator);
return mapObject(getTableRowCell(table, row, column));
} catch (ClassCastException cce) {
throw new JavaFXLibraryNonFatalException("Unable to handle argument as TableView!");
@@ -444,15 +444,16 @@ public Object getTableCell(Object locator, int row, int column) {
+ "``locator`` is either a _query_ or _Object:Node_ for identifying the TableView element, see "
+ "`3. Locating JavaFX Nodes`. \n\n"
+ "``column`` Integer value for the column")
+ @SuppressWarnings("unchecked")
@ArgumentNames({"table", "column"})
public List