Installing Vaadin TestBench License
Installing License Key
Before running tests, you need to install a license key. You can purchase Vaadin TestBench or obtain a free trial key from the Vaadin TestBench download page in Vaadin Directory. You need to register in Vaadin Directory to obtain the key.
To install the license key on a development workstation, you can copy and paste it verbatim to a .vaadin.testbench.developer.license file in your home directory.
For example, in Linux and OS X:
$ echo "L1cen5e-c0de" > ~/.vaadin.testbench.developer.license
In Windows
$ echo L1cen5e-c0de > %HOMEPATH%\.vaadin.testbench.developer.license
If you are behind a proxy server, see Configuring License Check Through Proxy.
Using System Property
You can also pass the key as a system property to the Java application running the tests, usually with a -D option on the command-line:
$ java -Dvaadin.testbench.developer.license=L1cen5e-c0de …
How you actually pass the parameter to your test runner depends on the actual test execution environment. Below are listed a few typical environments:
- Apache Maven
-
If running tests with Apache Maven, you can pass the license key with a -D parameter to Maven:
$ mvn -Dvaadin.testbench.developer.license=L1cen5e-c0de verify
- Eclipse IDE
-
To install the license key for all projects, select Default VM arguments, give the -D expression as shown above.
and navigate to the section. Select the JRE version that you use for the application and click . In theFor a single project, create a new JUnit launch configuration in JUnit and click . If you have already ran JUnit in the project, the launch configuration already exists. Select JUnit 4 if not selected automatically. Go to Arguments tab and give the -D expression in the VM arguments field. Click to run the tests immediately or to just save the settings.
. Select - Apache Ant
-
If running tests with the <junit> task in Apache Ant, as described in "Running Tests with Ant", you can pass the key as follows:
<sysproperty key="vaadin.testbench.developer.license" value="L1cen5e-c0de"/>
However, you should never store license keys in a source repository, so if the Ant script is stored in a source repository, you should pass the license key to Ant as a property that you then use in the script for the value argument of the <sysproperty> as follows:
<sysproperty key="vaadin.testbench.developer.license" value="${vaadin.testbench.developer.license}"/>
When invoking Ant from the command-line, you can pass the property with a -D parameter to Ant.
- TeamCity
-
In TeamCity, you can pass the license key to build runners as a system property in the build configuration. However, this only passes it to a runner. As described above, Maven passes the parameter as is to JUnit, but Ant does not do so implicitly, so you need to forward it explicitly as described earlier.
See the CVAL license key installation instructions for more details.
Configuring License Check Through Proxy
TestBench requires a network access to the license server. If you are behind a proxy server, you have to configure Java Virtual Machine proxy settings with the following system properties:
-
https.proxyHost
-
https.proxyPort
-
http.nonProxyHosts
How the system properties are passed depends on the Java application you are using. Maven Failsafe and Surefire plugins require you to pass the parameters in plugin configuration for the forked VM.
<configuration>
<argLine>-Dhttps.proxyHost=proxy.example.com -Dhttps.proxyPort=443 -Dhttp.nonProxyHosts="localhost|host.example.com"</argLine>
</configuration>