Payara Micro Managed Arquillian Container Adapter
When using this adapter, the Payara Micro container lifecycle is managed by Arquillian by starting a separate JVM process to launch and stop a Payara Micro instance locally.
Usage
The Payara Micro Managed Arquillian container adapter can be found on Maven Central, and can be included in your project using the following Maven GAV coordinates:
<dependency>
<groupId>fish.payara.arquillian</groupId>
<artifactId>arquillian-payara-micro-managed</artifactId>
<version>${version}</version>
</dependency>
Container Configuration
The Payara Micro container can be configured via the arquillian.xml
file using the standard Arquillian Container Configuration mechanism.
The following configuration options are available:
Container Option | Description | System Property | Environment Variable | Default |
---|---|---|---|---|
|
Provides the location of the Payara Micro Jar. |
|
|
|
|
Specifies the amount of time in seconds that the container will wait for Payara Micro to start. |
|
|
|
|
Randomises the initial HTTP port of Payara Micro. This saves time by avoiding collisions with the default port. |
|
|
|
|
Enables the |
|
|
|
|
Enables clustering on the Micro instance. |
|
|
|
|
Enables/disables console output on the Micro instance. |
|
|
|
|
Enables debugging on the Payara Micro instance. By default, Payara Micro will wait for the debugger on port Disables the startup timeout. To change this, provide java debug options to |
|
|
|
|
Provides JVM options to the Java process running the Micro instance. |
|
|
|
|
Provides standard Payara Micro arguments for the server instance to launch with |
|
|
Examples
To configure the options using Arquillian container properties, you need to use an arquillian.xml
file placed on the test classpath.
Here’s an example arquillian.xml
file. It configures randomHttpPort
and autoBindHttp
options.
arquillian.xml
file<?xml version="1.0"?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://jboss.org/schema/arquillian"
xsi:schemaLocation="http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<container qualifier="payara-micro-managed" default="true">
<configuration>
<property name="randomHttpPort">false</property>
<property name="autoBindHttp">false</property>
</configuration>
</container>
</arquillian>
You can configure the options also using system properties. Here’s an example configuration if you run your tests using the maven surefire
plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<arquillian.launch>payara-micro-managed</arquillian.launch>
<payara.randomHttpPort>false</payara.randomHttpPort>
<payara.autoBindHttp>false</payara.autoBindHttp>
</systemPropertyVariables>
</configuration>
</plugin>
You can also configure the options using environment variables, for example when running the maven mvn test
command:
export MICRO_RANDOM_HTTP_PORT=false
export MICRO_AUTOBIND_HTTP=false
mvn test