Skip to content
Juho Saarinen edited this page Jan 1, 2020 · 5 revisions

New Features

  • Supports kwargs and named arguments
  • Injects defined default values with correct types to method call (no need to RobotOverload or putting those to array or list)
  • Varargs can be any type, as long as given data is correct type and all varargs have same type. (Issue)

Technical changes

  • Needs Java 8+
  • Remote library 3.0 is not working with this javalib-core because of type change of returned keyword names. Issue at here. Fix is to copy array instead of casting. Fix/PR to that coming.

Changes needed in libraries using Javalib-core

Classpathlibrary users

  • Library needs to be compiled with -parameters option. E.g. with Maven with parameters-option.

Annotationlibrary users

  • Default values are handled now inside javalib-core, so those should be defined with correct types to keyword (not wrap those inside array). E.g.
@ArgumentNames({ "url", "browserName=firefox", "alias=None", "remoteUrl=None", "desiredCapabilities=None",
            "browserOptions=None", "isWebDriverManager=false" })
    public String openBrowser(String url, String... args) {
...

->

@ArgumentNames({ "url", "browserName=firefox", "alias=None", "remoteUrl=None", "desiredCapabilities=None",
            "browserOptions=None", "isWebDriverManager=false" })
    public String openBrowser(String url, String browserName, String alias, String  remoteUrl, String desiredCapabilities, String browserOptions, boolean isWebDriverManager) {
...
  • Varargs needs to be marked with prefix * to allow javalib-core to construct arguments correctly for reflection call. Because there can be only 1 vararg parameter, default values has to be changed to actual arguments as shown in previous example.
Clone this wiki locally