<dependency>
<groupId>org.jboss.arquillian.junit5</groupId>
<artifactId>arquillian-junit5-container</artifactId>
<version>1.7.0.Alpha10</version>
</dependency>
Setup and Configuration |
Previous | Next | Contents |
Note
|
The Jakarta EE Specification process provides for any number of compatible implementations. As additional implementations become available, refer to project or product documentation from those vendors for specific TCK setup and operational guidance. |
This chapter describes how to set up the Jakarta REST TCK. Before proceeding with the instructions in this chapter, be sure to install all required software, as described in Chapter 3, "Installation."
After completing the instructions in this chapter, proceed to Chapter 5, "Executing Tests," for instructions on running the Jakarta REST TCK.
Note
|
The Jakarta REST TCK is not depended on any particular build tool to run the tests. It will be convenient and advisable to create a Apache Maven project to setup and run the TCK. This chapter will henceforth use instructions and steps to provide setup with Apache Maven as a build tool. |
After configuring your environment as described in this section, continue with the instructions in Chapter 5, "Executing Tests."
Note
|
In these instructions, variables in angle brackets need to be expanded
for each platform. For example, On Windows, you must escape any backslashes with an extra backslash in path separators used in any of the following properties, or use forward slashes as a path separator instead. |
Set the following environment variables in your shell environment:
JAVA_HOME
to the directory in which Java SE 17 is installed
M2_HOME
to the directory in which the Apache Maven build tool is installed.
JAXRS_HOME
to the directory in which the Jakarta REST
4.0 CI has been installed
PATH
to include the following directories: JAVA_HOME/bin
,
and M2_HOME/bin
Set the following System properties:
Set the webServerHost
property to the name of the host on which
Jakarta EE 11 CI is running.
The default setting is localhost
.
Set the webServerPort
property to the port number of the host on
which Jakarta EE 11 CI is running.
The default setting is 8080
.
Set the web.home
property to the installation directory of Jakarta EE
11 CI.
Set the servlet_adaptor
property to point to the Servlet adaptor
class for the Jakarta REST implementation.
The default setting for this property, if you are using the Eclipse Jersey 4.0 CI is
org/glassfish/jersey/servlet/ServletContainer.class
.
Set the porting.ts.url.class.1
property to your porting
implementation class that is used for obtaining URLs.
The default setting for this property is
com.sun.ts.lib.implementation.sun.common.SunRIURL
.
Set the below jars to the classpath
JAR file for the Jakarta REST 4.0 API.
eg. ${web.home}/modules/jakarta.ws.rs-api.jar
.
Arquillian JAR arquillian-junit5-container Maven cordinates :
<dependency>
<groupId>org.jboss.arquillian.junit5</groupId>
<artifactId>arquillian-junit5-container</artifactId>
<version>1.7.0.Alpha10</version>
</dependency>
JUnit 5 jars (5.7.2+) Maven cordinates :
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.7.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
sigtest-maven-plugin (1.4) to run the signature tests. Maven cordinates :
<dependency>
<groupId>org.netbeans.tools</groupId>
<artifactId>sigtest-maven-plugin</artifactId>
<version>1.4</version>
</dependency>
Eclipse Jersey 4.0 CI jars
For eg, if you are using the Eclipse Jersey 4.0 CI below jars need to be added to Classpath
${web.home}/modules/jersey-client.jar:
${web.home}/modules/jersey-common.jar:
${web.home}/modules/jersey-server.jar:
${web.home}/modules/jersey-container-servlet.jar:
${web.home}/modules/jersey-container-servlet-core.jar:
${web.home}/modules/jersey-media-jaxb.jar:
${web.home}/modules/jersey-media-sse.jar:
${web.home}/modules/jersey-hk2.jar:
${web.home}/modules/osgi-resource-locator.jar:
${web.home}/modules/jakarta.inject-api.jar:
${web.home}/modules/guava.jar:
${web.home}/modules/hk2-api.jar:
${web.home}/modules/hk2-locator.jar:
${web.home}/modules/hk2-utils.jar:
${web.home}/modules/cglib.jar:
${web.home}/modules/asm-all-repackaged.jar:
${web.home}/modules/bean-validator.jar:
${web.home}/modules/jakarta.annotation-api.jar:
${web.home}/modules/jakarta.xml.bind-api.jar:
${web.home}/modules/jaxb-osgi.jar:
${web.home}/modules/jakarta.activation.jar:
${web.home}/modules/javassist.jar
Provide compatible implementation of the porting package interface
provided with the Jakarta REST TCK.
The porting package interface, TSURLInterface.java
, obtains URL
strings for web resources in an implementation-specific manner. API
documentation for the TSURLInterface.java
porting package interface is
available in the Jakarta REST TCK documentation bundle.
If the Jakarta REST TCK test applications are published on
a Servlet 5.0-compliant Web container to run the CI, the servlet_adaptor
property needs to be set as System property, and CI-specific WAR files
containing the Servlet information need to be created for publishing.
The CI-specific WAR files should never override any existing files that
come with the TCK. Refer to Appendix B,
"Packaging the Test Applications in Servlet-Compliant WAR
Files With VI-Specific Information," for more information.
After configuring your environment as described in this section, continue with the instructions in Chapter 5, "Executing Tests."
Note
|
In these instructions, variables in angle brackets need to be expanded
for each platform. For example, On Windows, you must escape any backslashes with an extra backslash in path separators used in any of the following properties, or use forward slashes as a path separator instead. |
Before You Begin
Decide against which Jakarta REST implementation the tests will be run and determine to which Servlet–compliant Web server the Jakarta REST TCK applications will be published.
Package the Jakarta REST test applications for that Jakarta REST implementation and Servlet–compliant Web server.
See Appendix B, "Packaging the Test Applications in Servlet-Compliant WAR Files With VI-Specific Information," for information about repackaging the Jakarta REST test application.
Set the following environment variables in your shell environment:
JAVA_HOME
to the directory in which Java SE 17 is installed
M2_HOME
to the directory in which the Apache Maven build tool is installed.
JAXRS_HOME
to the directory in which the Jakarta REST
4.0 CI has been installed
PATH
to include the following directories: JAVA_HOME/bin
,
and M2_HOME/bin
Set the following System properties:
Set the webServerHost
property to the name of the host on which
Jakarta EE 11 CI is running.
The default setting is localhost
.
Set the webServerPort
property to the port number of the host on
which Jakarta EE 11 CI is running.
The default setting is 8080
.
Set the web.home
property to the installation directory of Jakarta EE
11 CI.
Set the servlet_adaptor
property to point to the Servlet adaptor
class for the Jakarta REST implementation.
The default setting for this property, if you are using the Eclipse Jersey 4.0 CI is
org/glassfish/jersey/servlet/ServletContainer.class
.
Set the porting.ts.url.class.1
property to your porting
implementation class that is used for obtaining URLs.
The default setting for this property is
com.sun.ts.lib.implementation.sun.common.SunRIURL
.
Set the below jars to the classpath
JAR file for the Jakarta REST 4.0 API.
eg. ${web.home}/modules/jakarta.ws.rs-api.jar
.
Arquillian JAR arquillian-junit5-container Maven cordinates :
<dependency>
<groupId>org.jboss.arquillian.junit5</groupId>
<artifactId>arquillian-junit5-container</artifactId>
<version>1.7.0.Alpha10</version>
</dependency>
JUnit 5 jars (5.7.2+) Maven cordinates :
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.7.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Eclipse Jersey 4.0 CI jars
For eg, if you are using the Eclipse Jersey 4.0 CI below jars need to be added to Classpath
${web.home}/modules/jersey-client.jar:
${web.home}/modules/jersey-common.jar:
${web.home}/modules/jersey-server.jar:
${web.home}/modules/jersey-container-servlet.jar:
${web.home}/modules/jersey-container-servlet-core.jar:
${web.home}/modules/jersey-media-jaxb.jar:
${web.home}/modules/jersey-media-sse.jar:
${web.home}/modules/jersey-hk2.jar:
${web.home}/modules/osgi-resource-locator.jar:
${web.home}/modules/jakarta.inject-api.jar:
${web.home}/modules/guava.jar:
${web.home}/modules/hk2-api.jar:
${web.home}/modules/hk2-locator.jar:
${web.home}/modules/hk2-utils.jar:
${web.home}/modules/cglib.jar:
${web.home}/modules/asm-all-repackaged.jar:
${web.home}/modules/bean-validator.jar:
${web.home}/modules/jakarta.annotation-api.jar:
${web.home}/modules/jakarta.xml.bind-api.jar:
${web.home}/modules/jaxb-osgi.jar:
${web.home}/modules/jakarta.activation.jar:
${web.home}/modules/javassist.jar
Provide compatible implementation of the porting package interface
provided with the Jakarta REST TCK.
The porting package interface, TSURLInterface.java
, obtains URL
strings for web resources in an implementation-specific manner. API
documentation for the TSURLInterface.java
porting package interface is
available in the Jakarta REST TCK documentation bundle.
If the Jakarta REST TCK test applications are published on
a Servlet 5.0-compliant Web container to run the CI, the servlet_adaptor
property needs to be set as System property, and CI-specific WAR files
containing the Servlet information need to be created for publishing.
The CI-specific WAR files should never override any existing files that
come with the TCK. Refer to Appendix B,
"Packaging the Test Applications in Servlet-Compliant WAR
Files With VI-Specific Information," for more information.
Configure the Compatible Implementation by performing the following tasks:
Creates users and the appropriate roles
Enables HTTP trace requests
Sets up users and passwords for your Jakarta REST server as follows:
User | Password | Groups |
---|---|---|
|
|
|
|
|
|
Also make sure the principal to role-mappings that are specified in the runtime XML files are properly mapped in your environment. These mappings may vary for each application.
The Jakarta REST TCK provides an automatic way of deploying both archives to the configured web container or containers by using arquillian Shrinkwrap API before the tests are run
Previous | Next | Contents |