Setup and Configuration

## 4 Setup and Configuration

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 XML Web Services TCK and JavaTest harness software. 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 XML Web Services TCK.

### 4.1 Configuring Your Environment to Run the TCK Against the Compatible Implementation

After configuring your environment as described in this section, continue with the instructions in Section 4.6, "Using the JavaTest Harness Software."

Note | In these instructions, variables in angle brackets need to be expanded for each platform. For example, `<TS_HOME>` becomes `$TS_HOME` on Solaris/Linux and `%TS_HOME%` on Windows. In addition, the forward slashes (`/`) used in all of the examples need to be replaced with backslashes (`\`) for Windows. Finally, be sure to use the appropriate separator for your operating system when specifying multiple path entries (`;` on Windows, `:` on UNIX/Linux). 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.

1. Set the following environment variables in your shell environment:

   1. `JAVA_HOME` to the directory in which Java SE 8 is installed

   2. `TS_HOME` to the directory in which the XML Web Services TCK 3.0 software is installed

   3. `PATH` to include the following directories: `JAVA_HOME/bin`, `JAXWS_HOME/bin`, and `ANT_HOME/bin`

2. If you use Jakarta EE 9 Compatible Platform, edit your `<TS_HOME>/bin/ts.jte` file and set the following environment variables:

   1. Set the `webServerHost` property to the hostname where the web server is running that is configured with the XML Web Services Compatible Implementation.
      The default setting is `localhost`.

   2. Set the `webServerPort` property to the port number where the web server is running that is configured with the XML Web Services Compatible Implementation.
      The default setting is `8000`.

   3. Set the `jaxws.home` property to the location where the XML Web Services Compatible Implementation is installed.
      The default setting is `${webcontainer.home}`. The value of this property must match the value of the `webcontainer.home` property that is set in step g.

   4. Set the `jaxws.classes` property to point to the XML Web Services Compatible Implementation classes/jars.
      Note that this property is already set and should not require any changes.

   5. Set the `impl.vi, impl.vi.deploy.dir, impl.vi.host, and impl.vi.port` properties to the supported web container, deploy directory, host and port for the XML Web Services Compatible Implementation.
      The supported web container for the XML Web Services Compatible Implementation is the Jakarta EE 9 Compatible Platform. So the default settings for these properties are as follows:

          impl.vi.deploy.dir=${webcontainer.home}/domains/domain1/autodeploy
          impl.vi=glassfish
          impl.vi.host=${webServerHost}
          impl.vi.port=${webServerPort}

   6. Set the `webcontainer.home` property to the location where the web server is installed for the XML Web Services Compatible Implementation. This will be where the Jakarta EE 9 Compatible Implementation is installed.

   7. Set the `porting.ts.url.class.1` property to the porting implementation class that is used for obtaining URLs.
      The default setting for the XML Web Services Compatible Implementation porting implementation is:

          com.sun.ts.lib.implementation.sun.common.SunRIURL

   8. Set the `user` and `password` properties to the user name and password used for the basic authentication tests.
      The default setting is `j2ee` for both.

   9. Set the `authuser` and `authpassword` properties to the user name and password used for the basic authentication tests.
      The default setting for both is `javajoe`.

   10. Set the `http.server.supports.endpoint.publish` property based on whether Endpoint Publish APIs are supported on the container.

3. If you use the Standalone JAX-WS 3.0 Compatible Implementation software with the ApacheTomcat web container, set the following environment variables in your `<TS_HOME>/bin/ts.jte` file:

   1. Set `webcontainer.home` value to the location where the Apache Tomcat web container is installed (value of `${CATALINA_HOME}`).

   2. Keep `jaxws.home` default value, which is `${webcontainer.home}`.

   3. Set `jaxws.lib` value to the location where JAR files/classes were copied: `${CATALINA_HOME}/shared/lib`

   4. Set the `jaxws.classes` to contain all libraries copied to `${jaxws.home}/shared/lib` directory. This shell script can generate proper value,

          cd ${CATALINA_HOME}/shared/lib && unset first && \
          for lib in `ls *.jar`; do
            if [ -n "${first}" ]; then
              echo -n '${pathsep}'
            else
              echo -n 'jaxws.classes=' && first='false'
            fi
            echo -n '${jaxws.lib}/'${lib}
          done && echo

      which shall contain following list of `jaxws.classes`:

      - ${jaxws.lib}/FastInfoset.jar

      - ${jaxws.lib}/gmbal-api-only.jar

      - ${jaxws.lib}/ha-api.jar

      - ${jaxws.lib}/jakarta.activation.jar

      - ${jaxws.lib}/jakarta.annotation-api.jar

      - ${jaxws.lib}/jakarta.jws-api.jar

      - ${jaxws.lib}/jakarta.mail.jar

      - ${jaxws.lib}/jakarta.xml.bind-api.jar

      - ${jaxws.lib}/jakarta.xml.soap-api.jar

      - ${jaxws.lib}/jakarta.xml.ws-api.jar

      - ${jaxws.lib}/jaxb-core.jar

      - ${jaxws.lib}/jaxb-impl.jar

      - ${jaxws.lib}/jaxb-jxc.jar

      - ${jaxws.lib}/jaxb-xjc.jar

      - ${jaxws.lib}/jaxws-rt.jar

      - ${jaxws.lib}/jaxws-tools.jar

      - ${jaxws.lib}/jaxwstck.jar

      - ${jaxws.lib}/management-api.jar

      - ${jaxws.lib}/mimepull.jar

      - ${jaxws.lib}/resolver.jar

      - ${jaxws.lib}/saaj-impl.jar

      - ${jaxws.lib}/stax-ex.jar

      - ${jaxws.lib}/stax2-api.jar

      - ${jaxws.lib}/streambuffer.jar

      - ${jaxws.lib}/tsharness.jar

      - ${jaxws.lib}/woodstox-core.jar

        separated by `${pathsep}`

        `resolver.jar` should be required only on non-Oracle/non-OpenJDK based JDKs.

   5. Set the `impl.vi` and `impl.vi.deploy.dir` properties to the supported web container and deploy directory for ApacheTomcat web container:

          impl.vi.deploy.dir=${webcontainer.home}/webapps/
          impl.vi=tomcat

   6. Comment out `javaee.home` and all `s1as.` properties.

4. Edit the catalog file `<TS_HOME>/src/com/sun/ts/tests/jaxws/common/xml/catalog/META-INF/jax-ws-catalog.xml`, replacing the host and port settings of `systemId` with the value of your host and port setting where the WSDL is published.

### 4.2 Configuring Your Environment to Repackage and Run the TCK Against the Vendor Implementation

After configuring your environment as described in this section, continue with the instructions in Section 4.4, "Using the JavaTest Harness Software."

Note | In these instructions, variables in angle brackets need to be expanded for each platform. For example, `<TS_HOME>` becomes `$TS_HOME` on Solaris/Linux and `%TS_HOME%` on Windows. In addition, the forward slashes (`/`) used in all of the examples need to be replaced with backslashes (`\`) for Windows. Finally, be sure to use the appropriate separator for your operating system when specifying multiple path entries (`;` on Windows, `:` on UNIX/Linux). 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 XML Web Services implementation the tests will be run and determine to which Servlet–compliant Web server the XML Web Services TCK applications will be published.

Package the XML Web Services test applications for that XML Web Services 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 XML Web Services test application.

1. Set the following environment variables in your shell environment:

   1. `JAVA_HOME` to the directory in which Java SE 8 is installed

   2. `TS_HOME` to the directory in which the XML Web Services TCK 3.0 software is installed

   3. `PATH` to include the following directories: `JAVA_HOME/bin`, `JAXWS_HOME/bin`, and `ANT_HOME/bin`

2. Edit your `<TS_HOME>/bin/ts.jte` file and set the following environment variables:

   1. Set the `webServerHost` property to the hostname where the web server that is configured with the Vendor Implementation is running.
      The default setting is `localhost`.

   2. Set the `webServerPort` property to the port number where the web server that is configured with the Vendor Implementation is running.
      The default setting is `8080`.

   3. Set the `jaxws.home` property to the location where the Vendor Implementation is installed.
      The default setting is `${webcontainer.home}`. The value of this property must match the value of the `webcontainer.home` property that is set in step g.

   4. Set the `jaxws.classes` property to point to the Vendor Implementation classes/JAR files.
      As an example, the `ts.jte` file contains the property `jaxws.classes.ri`, which contains the classes/jar files that the Jakarta EE 9 Compatible Platform uses. The `jaxws.classes.ri` settings for the Jakarta EE 9 Compatible Platform web container are as follows:

          jaxws.home.ri=${webcontainer.home.ri}
          jaxws.lib.ri=${jaxws.home.ri}/modules
          jaxws.classes.ri=${jaxws.lib.ri}/webservices-api-osgi.jar${pathsep}
          ${jaxws.lib.ri}/jakarta.xml.bind-api.jar${pathsep}
          ${jaxws.lib.ri}/jaxb-api-osgi.jar${pathsep}
          ${jaxws.lib.ri}/webservices-osgi.jar${pathsep}
          ${jaxws.lib.ri}/jaxb-osgi.jar${pathsep}
          ${jaxws.lib.ri}/gmbal.jar${pathsep}
          ${jaxws.lib.ri}/management-api.jar${pathsep}
          ${jaxws.lib.ri}/mimepull.jar${pathsep}
          ${jaxws.lib.ri}/ha-api.jar${pathsep}
          ${jaxws.lib.ri}/webservices-api.jar${pathsep}
          ${jaxws.lib.ri}/jakarta.activation.jar

      The `jaxws.classes.ri` settings if using the Apache Tomcat web container with the Standalone XML Web Services 3.0 Compatible Implementation should contain all classes copied to `${jaxws.home.ri}/shared/lib`.

   5. Set the `impl.vi`, `impl.vi.deploy.dir`, `impl.vi.host`, and `impl.vi.port` properties to the supported web container, deploy directory, host and port for the Vendor Implementation.
      As an example, the `ts.jte` file contains the settings for the Jakarta EE 9 Compatible Implementation, which are as follows:

          webcontainer.home.ri=/sun/javaee6
          impl.ri.deploy.dir=${webcontainer.home.ri}/domains/domain1/autodeploy
          impl.ri=glassfish
          impl.ri.host=${webServerHost.2}
          impl.ri.port=${webServerPort.2}

      The Compatible Implementation settings using the Apache Tomcat web container with the Standalone XML Web Services 3.0 Compatible Implementation would be as follows:

          webcontainer.home.ri=/tomcat
          impl.ri=tomcat
          impl.ri.deploy.dir=${webcontainer.home.ri}/webapps
          impl.ri.host=${webServerHost.2}
          impl.ri.port=${webServerPort.2}

   6. Set the `webcontainer.home` property to the location where the web container for the Vendor Implementation is installed.

   7. Set the `porting.ts.url.class.1` property to the porting implementation class that is used for obtaining URLs.
      The default setting for the XML Web Services Compatible Implementation porting implementation is:

          com.sun.ts.lib.implementation.sun.common.SunRIURL

   8. Set the `user` and `password` properties to the user name and password used for the basic authentication tests.
      The default setting for both is `j2ee`.

   9. Set the `authuser` and `authpassword` properties to the user name and password used for the basic authentication tests.
      The default setting for both is `javajoe`.

   10. Set the `http.server.supports.endpoint.publish` property based on whether Endpoint Publish APIs are supported on the container.

3. Edit the catalog file `<TS_HOME>/src/com/sun/ts/tests/jaxws/common/xml/catalog /META-INF/jax-ws-catalog.xml`, replacing the host and port settings of `systemId` with the value of your host and port setting where the WSDL is published.

4. Provide your own implementation of the porting package interface provided with the XML Web Services 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 XML Web Services TCK documentation bundle.
   The `<TS_HOME>/bin/jaxws-url-props.dat` file contains the webservice endpoint and WSDL URLs that the TCK tests use when running against the XML Web Services Compatible Implementation. In the porting package that the TCK uses, the URLs are returned as is since this is the form that the XML Web Services Compatible Implementation expects. You may need an alternate form of these URLs in order to run the TCK tests in your environment. However, you MUST NOT modify the `jaxws-url-props.dat` file, but instead make any necessary changes in your own porting implementation class to transform the URLs appropriately for your environment.

### 4.3 Additional XML Web Services TCK Instructions

#### 4.3.1 Configuring Your Environment to Rebuild and Run the XML Web Services TCK Against the XML Web Services Compatible Implementation

This section describes the steps needed to configure the XML Web Services TCK so that the tests can be rebuilt (using the Vendor Implementation toolset), and then deployed and run against the XML Web Services Compatible Implementation.

If you are not ready to proceed with this portion of the testing process, skip this section for now and proceed to Configuring and Starting Your Application Server or Servers. After configuring your environment, continue with the instructions in Using the JavaTest Harness Software.

Note | In these instructions, variables in angle brackets need to be expanded for each platform. For example, `<TS_HOME>` becomes `$TS_HOME` on Solaris/Linux and `%TS_HOME%` on Windows XP/Vista. In addition, the forward slashes (`/`) used in all of the examples need to be replaced with backslashes (`\`) for Windows XP/Vista. Finally, be sure to use the appropriate separator for your operating system when specifying multiple path entries (`;` on Windows, `:` on UNIX/Linux). 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. For example, if the Jakarta EE 9 Compatible Platform installation is `C:\JakartaEE9`, you must specify it as `C:\\JakartaEE9` or `C:/JakartaEE9`.

1. Set the following environment variables in your shell environment:

   1. `JAVA_HOME` to the directory in which Java SE is installed

   2. `TS_HOME` to the directory in which the XML Web Services TCK 3.0 software is installed

   3. `ANT_HOME` should be set in your environment.

2. Edit your `<TS_HOME>/bin/ts.jte` file and set the following environment variables:

   1. Set the `webServerHost` property to the hostname where the web server for the Vendor Implementation is running.
      The default setting is `localhost`.

   2. Set the `webServerPort` property to the port number where the web server for the Vendor Implementation is running.
      The default setting is`8080`

   3. Set the `webServerHost.2` property to the hostname where the web server for the XML Web Services Compatible Implementation is running.

   4. Set the `webServerPort.2` property to the port number where the web server for the XML Web Services Compatible Implementation is running.

   5. Set the `jaxws.home` property to the location where the Vendor Implementation is installed.
      The default setting is `${webcontainer.home}`. The value of this property must match the value of the `webcontainer.home` property that is set in step m.

   6. Set the `jaxws.classes` property to point to the Vendor Implementation classes/JAR files.

   7. Set the `jaxws.home.ri` property to the location where the XML Web Services Compatible Implementation is installed.
      The default setting is `${webcontainer.home.ri}`. The value of this property must match the value of the `webcontainer.home.ri` property that is set in step n.

   8. The `jaxws.classes.ri` property is already configured to point to the XML Web Services Compatible Implementation classes/JAR files.
      No changes are necessary for this property.

   9. Set the `wsgen.ant.classname` property to the Vendor Implementation class that mimics the XML Web Services Compatible Implementation Ant task, which in turn calls the `wsgen` Java-to-WSDL tool.

   10. Set the `wsimport.ant.classname` property to the Vendor Implementation class that mimics the XML Web Services Compatible Implementation Ant task, which in turn calls the `wsimport` WSDL-to-Java tool.

   11. Set the `impl.vi`, `impl.vi.deploy.dir`, `impl.vi.host`, and `impl.vi.port` properties to the supported web container, deploy directory, host and port used for the Vendor Implementation.

   12. Set the `impl.ri`, `impl.ri.deploy.dir`, `impl.ri.host`, and `impl.ri.port` properties to the supported web container, deploy directory, host and port used for the XML Web Services Reference Implementation.
       The supported web container for standalone web applications is the Jakarta EE 9 Compatible Implementation. The default settings for these properties are as follows:

           impl.ri.deploy.dir=${webcontainer.home.ri}/domains/domain1/autodeploy
           impl.ri=glassfish
           impl.ri.host=${webServerHost.2}
           impl.ri.port=${webServerPort.2}

   13. Set the `webcontainer.home` property to the location where the web container for the Vendor Implementation is installed.

   14. Set the `webcontainer.home.ri` property to the location where the web container for the XML Web Services Reference Implementation is installed.

   15. Set the `porting.ts.url.class.1` property to your porting implementation class that is used for obtaining URLs.
       The default setting points to the XML Web Services Compatible Implementation porting implementation which is:

           com.sun.ts.lib.implementation.sun.common.SunRIURL

   16. Set the `porting.ts.url.class.2` property to the XML Web Services Compatible Implementation porting implementation class that is used for obtaining URLs.
       No changes are necessary for this property.

   17. Set the `user` and `password` properties to the user name and password used for the basic authentication tests.
       The default setting for both is `j2ee`.

   18. Set the `authuser` and `authpassword` properties to the user name and password used for the basic authentication tests.
       The default setting for both is `javajoe`.

   19. Set the `http.server.supports.endpoint.publish` property based on whether Endpoint Publish APIs are supported on the container.

3. Edit the catalog file `<TS_HOME>/src/com/sun/ts/tests/jaxws/common/xml/catalog /META-INF/jax-ws-catalog.xml`, replacing the host and port settings of `systemId` with the value of your host and port setting where the WSDL is published.

#### 4.3.2 Configuring Your Environment to Simultaneously Run the XML Web Services TCK Against the VI and the XML Web Services Compatible Implementation

This section describes the steps needed to configure the XML Web Services TCK so that all tests can be run; forward tests against the Vendor Implementation and reverse tests against the XML Web Services Reference Implementation.

Since the XML Web Services TCK needs to be tested against both the XML Web Services Reference Implementation and the Vendor Implementation, two separate Web servers need to be configured. Two individual Web servers are required, and the same steps, below, must be performed to configure each Web server.

If you are not going to perform this kind of testing at this time, skip this section and proceed to Configuring and Starting Your Application Server or Servers, otherwise perform the steps described in the following sections:

- Configuring Your Environment to Run the XML Web Services TCK Against the Vendor Implementation

- Configuring Your Environment to Rebuild and Run the XML Web Services TCK Against the XML Web Services Compatible Implementation

#### 4.3.3 Configuring and Starting Your Application Server or Servers

Complete the following two procedures to configure your application server environments for the Compatible Implementation and VI.

#### 4.3.3.1 To Configure the Vendor Implementation as your VI Environment

1. Set the following environment variables in your shell environment:

   1. `JAVA_HOME` to the directory in which Java SE is installed

   2. `TS_HOME` to the directory in which the XML Web Services TCK 3.0 software is installed

   3. `ANT_HOME` should be set in your environment.

2. Ensure that the `ts.jte` settings for Vendor specific properties have been configured.

3. Run the `ant config.vi` target to configure for the Vendor Implementation.

       cd <TS_HOME>/bin
       ant config.vi

#### 4.3.3.2 Configure the provided XML Web Services Compatible Implementation as your Compatible Implementation environment

1. Set the following environment variables in your shell environment:

   1. `JAVA_HOME` to the directory in which Java SE is installed

   2. `TS_HOME` to the directory in which the XML Web Services TCK 3.0 software is installed

   3. `ANT_HOME` should be set in your environment.

2. Ensure that the `ts.jte` settings for Compatible Implementation specific properties have been configured.

3. Run the `ant config.ri` target to configure for Compatible Implementation implementation.

       cd <TS_HOME>/bin
       ant config.ri

#### 4.3.4 Deploying the XML Web Services TCK Tests

The XML Web Services TCK provides an automatic way of deploying both the prebuilt and Vendor-built archives to the configured web container or container by using deployment handlers.

The handler file (`<TS_HOME>/bin/xml/impl/glassfish/deploy.xml`) is written to be used with the Jakarta EE 9 Compatible Platform. If the Vendor chooses not to use Jakarta EE 9 Compatible Platform with their implementation, or chooses to rebuild the XML Web Services TCK tests using some other method than the infrastructure provided, they should create their own version handler file to provide this functionality.

This section describes the various commands used for deploying the WAR files to the configured web container.

- Generic Deployment Command Scenarios

- Deploying the XML Web Services TCK Prebuilt Archives

- Deploying the Rebuilt XML Web Services TCK Tests Against the XML Web Services Reference Implementation

#### 4.3.4.1 Generic Deployment Command Scenarios

The `keywords` system property enables you to deploy a subset of the tests that would normally be deployed in batch mode by means of `ant deploy`. To specify it, add the option `-Dkeywords=`value to the `ant` command, where value is either `forward`, `reverse`, or `all`. The supported values control the directions in which the rebuildable tests are deployed.

- Setting this property to `all` (the default) deploys both the prebuilt and Vendor build tests.

- Setting the property to `forward` deploys the prebuilt tests in the forward direction only.

- Setting the property to `reverse` deploys the Vendor rebuilt tests in the reverse direction only.

##### 4.3.4.1.1 To Deploy all the WAR Files From the `<TS_HOME>/dist` Directory to Both Web Servers

Enter the following command:

    ant deploy.all

or

    ant -Dkeywords=all deploy.all

##### 4.3.4.1.2 To Deploy a Single Test Directory in the Forward Direction

Enter the following commands:

    cd <TS_HOME>/src/com/sun/ts/tests/jaxws/api/jakarta_xml_ws/Dispatch
    ant -Dkeywords=forward deploy

##### 4.3.4.1.3 To Deploy a Subset of Test Directories in the Reverse Direction

Enter the following commands:

    cd <TS_HOME>/src/com/sun/ts/tests/jaxws/api
    ant -Dkeywords=reverse deploy

Note | The `-Dkeywords` option is supported by the `deploy`, `undeploy`, `deploy.all`, and `undeploy.all` commands.

#### 4.3.4.2 Deploying the XML Web Services TCK Prebuilt Archives

This section explains issues regarding the deployment of the XML Web Services TCK prebuilt archives. Before conducting any deployment, ensure that your environment has been configured by following the instructions in either the Configuring Your Environment to Run the XML Web Services TCK Against the XML Web Services Reference Implementation or the Configuring Your Environment to Run the XML Web Services TCK Against the Vendor Implementation sections.

The `<TS_HOME>/dist` directory contains all the WAR files for the XML Web Services TCK web service endpoint tests that have been compiled and generated using the XML Web Services Reference Implementation and packaged for deployment on a Servlet-compliant web container using the standard Web Archive (WAR) format.

These WAR files contain only portable artifacts for all the TCK web service endpoint tests, and are tailored to run against the XML Web Services Reference Implementation via the `web.xml` file in addition to a runtime file, `sun-jaxws.xml`. These WAR files allow you to deploy (without any additional setup or modification) against the XML Web Services Reference Implementation to test the various features and functionality of this implementation.

A Vendor is required to deploy the prebuilt WAR files as is on their XML Web Services implementation without any changes to the WAR archives with the exception of replacing and/or removing only the `web.xml` and the `sun-jaxws.xml` files.

To deploy the tests, the Vendor should perform a deployment using either the `deploy` or `deployall` batch command as described in Generic Deployment Command Scenarios, and specify the `-Dkeywords=forward` option.

#### 4.3.4.3 Deploying the Rebuilt XML Web Services TCK Tests Against the XML Web Services Reference Implementation

This section describes how to deploy the Vendor rebuilt XML Web Services TCK tests against the Vendor Implementation. Before conducting the deployment, ensure that you have followed the instructions in Configuring Your Environment to Run the XML Web Services TCK Against the XML Web Services Reference Implementation.

This deployment scenario assumes that the Vendor has rebuilt all the XML Web Services TCK tests using the existing infrastructure, and that the WAR files exist alongside the prebuilt war files in the `<TS_HOME>/dist` directory. The rebuilt WAR files will be prepended with the text `vi_built_`.

If the Vendor chooses some other method of rebuilding the tests, they may still be able to use this deployment method as long as the WAR files are built correctly and are prepended with the text `vi_built_`. Refer to the Appendix B, "Rebuilding the XML Web Services TCK Using the Vendor’s Toolset" to learn about rebuilding the XML Web Services TCK tests.

To deploy the tests, the Vendor should perform a deployment using either the `deploy` or `deployall` batch command, as described in Generic Deployment Command Scenarios, and specify the `-Dkeywords=reverse` option

### 4.4 Custom Configuration Handlers

Configuration handlers are used to configure and unconfigure a XML Web Services 3.0 implementation during the certification process. These are similar to deployment handlers but used for configuration. A configuration handler is an Ant build file that contains at least the required targets listed below:

- `config.vi` - to configure the vendor implementation

- `clean.vi` - to unconfigure the vendor implementation

These targets are called from the `<TS_HOME>/bin/build.xml` file and call down into the implementation-specific configuration handlers.

To provide your own configuration handler, create a config.vi.xml file with the necessary configuration steps for your implementation and place the file under the `<TS_HOME>/bin/xml/impl/<your_impl>` directory.

For more information, you may wish to view `<TS_HOME>/bin/xml/impl/glassfish/config.vi.xml`, the configuration file for Jakarta EE 9 Compatible Implementation, Eclipse GlassFish.

### 4.5 Custom Deployment Handlers

Deployment handlers are used to deploy and undeploy the WAR files that contain the tests to be run during the certification process. A deployment handler is an Ant build file that contains at least the required targets listed in the table below.

The XML Web Services TCK provides these deployment handlers:

- `<TS_HOME>/bin/xml/impl/none/deploy.xml`

- `<TS_HOME>/bin/xml/impl/glassfish/deploy.xml`

- `<TS_HOME>/bin/xml/impl/tomcat/deploy.xml`

The `deploy.xml` files in each of these directories are used to control deployment to a specific container (no deployment, deployment to the Eclipse GlassFish Web container, deployment to the Tomcat Web container) denoted by the name of the directory in which each `deploy.xml` file resides. The primary `build.xml` file in the `<TS_HOME>/bin` directory has a target to invoke any of the required targets (`-deploy`, `-undeploy`, `-deploy.all`, `-undeploy.all`).

#### 4.5.1 To Create a Custom Deployment Handler

To deploy tests to another XML Web Services implementation, you must create a custom handler.

1. Create a new directory in the `<TS_HOME>/bin/xml/impl` directory tree. For example, create the `<TS_HOME>/bin/xml/impl/my_deployment_handler` directory. Replace my_deployment_handler with the value of the impl.vi property that you set in Step 5 of the configuration procedure described in Section 4.2, "Configuring Your Environment to Repackage and Run the TCK Against the Vendor Implementation".

2. Copy the deploy.xml file from the `<TS_HOME>/bin/xml/impl/none` directory to the directory that you created.

3. Modify the required targets in the `deploy.xml` file. This is what the `deploy.xml` file for the "none" deployment handler looks like.

       <project name="No-op Deployment" default="deploy">
           <!-- No-op deployment target -->
           <target name="-deploy">
               <echo message="No deploy target implemented for this deliverable"/>
           </target>
           <target name="-undeploy">
               <echo message="No undeploy target implemented for this deliverable"/>
           </target>
           <target name="-deploy.all">
               <echo message="No deploy target implemented for this deliverable"/>
           </target>
           <target name="-undeploy.all">
               <echo message="No undeploy target implemented for this deliverable"/>
           </target>
       </project>

   Although this example just echoes messages, it does include the four required Ant targets (`-deploy`, `-undeploy`, `-deploy.all`, `-undeploy.all`) that your custom `deploy.xml` file must contain. With this as your starting point, look at the required targets in the `deploy.xml` files in the Tomcat and Eclipse Glassfish directories for guidance as you create the same targets for the Web container in which you will run your implementation of XML Web Services.

The following Ant targets can be called from anywhere under the `<TS_HOME>/src` directory:

- `deploy`

- `undeploy`

- `deploy.all`

- `undeploy.all`

The `deploy.all` and `undeploy.all` targets can also be called from the `<TS_HOME>/bin` directory.

Note | The targets in the `deploy.xml` file are never called directly. They are called indirectly by the targets listed above.

### 4.6 Using the JavaTest Harness Software

There are two general ways to run the XML Web Services TCK test suite using the JavaTest harness software:

- Through the JavaTest GUI; if using this method, please continue on to Section 4.7, "Using the JavaTest Harness Configuration GUI."

- In JavaTest batch mode, from the command line in your shell environment; if using this method, please proceed directly to Chapter 5, "Executing Tests."

### 4.7 Using the JavaTest Harness Configuration GUI

You can use the JavaTest harness GUI to modify general test settings and to quickly get started with the default XML Web Services TCK test environment. This section covers the following topics:

- Configuration GUI Overview

- Starting the Configuration GUI

- To Configure the JavaTest Harness to Run the XML Web Services TCK Tests

- Modifying the Default Test Configuration

Note | It is only necessary to proceed with this section if you want to run the JavaTest harness in GUI mode. If you plan to run the JavaTest harness in command-line mode, skip the remainder of this chapter, and continue with Chapter 5, "Executing Tests."

#### 4.7.1 Configuration GUI Overview

In order for the JavaTest harness to execute the test suite, it requires information about how your computing environment is configured. The JavaTest harness requires two types of configuration information:

- Test environment: This is data used by the tests. For example, the path to the Java runtime, how to start the product being tested, network resources, and other information required by the tests in order to run. This information does not change frequently and usually stays constant from test run to test run.

- Test parameters: This is information used by the JavaTest harness to run the tests. Test parameters are values used by the JavaTest harness that determine which tests in the test suite are run, how the tests should be run, and where the test reports are stored. This information often changes from test run to test run.

The first time you run the JavaTest harness software, you are asked to specify the test suite and work directory that you want to use. (These parameters can be changed later from within the JavaTest harness GUI.)

Once the JavaTest harness GUI is displayed, whenever you choose Start, then Run Tests to begin a test run, the JavaTest harness determines whether all of the required configuration information has been supplied:

- If the test environment and parameters have been completely configured, the test run starts immediately.

- If any required configuration information is missing, the configuration editor displays a series of questions asking you the necessary information. This is called the configuration interview. When you have entered the configuration data, you are asked if you wish to proceed with running the test.

#### 4.7.2 Starting the Configuration GUI

Before you start the JavaTest harness software, you must have a valid test suite and Java SE 8 installed on your system.

The XML Web Services TCK includes an Ant script that is used to execute the JavaTest harness from the `<TS_HOME>` directory. Using this Ant script to start the JavaTest harness is part of the procedure described in Section 4.7.3, "To Configure the JavaTest Harness to Run the TCK Tests."

When you execute the JavaTest harness software for the first time, the JavaTest harness displays a Welcome dialog box that guides you through the initial startup configuration.

- If it is able to open a test suite, the JavaTest harness displays a Welcome to JavaTest dialog box that guides you through the process of either opening an existing work directory or creating a new work directory as described in the JavaTest online help.

- If the JavaTest harness is unable to open a test suite, it displays a Welcome to JavaTest dialog box that guides you through the process of opening both a test suite and a work directory as described in the JavaTest documentation.

After you specify a work directory, you can use the Test Manager to configure and run tests as described in Section 4.7.3, "To Configure the JavaTest Harness to Run the TCK Tests."

#### 4.7.3 To Configure the JavaTest Harness to Run the TCK Tests

The answers you give to some of the configuration interview questions are specific to your site. For example, the name of the host on which the JavaTest harness is running. Other configuration parameters can be set however you wish. For example, where you want test report files to be stored.

Note that you only need to complete all these steps the first time you start the JavaTest test harness. After you complete these steps, you can either run all of the tests by completing the steps in Section 5.1, "Starting JavaTest," or run a subset of the tests by completing the steps in Section 5.2, "Running a Subset of the Tests."

1. Change to the `<TS_HOME>/bin` directory and start the JavaTest test harness:
   `cd <TS_HOME>/bin`
   `ant gui`

2. From the File menu, click Open Quick Start Wizard.
   The Welcome screen displays.

3. Select Start a new test run, and then click Next.
   You are prompted to create a new configuration or use a configuration template.

4. Select Create a new configuration, and then click Next.
   You are prompted to select a test suite.

5. Accept the default suite (`<TS_HOME>/src`), and then click Next.
   You are prompted to specify a work directory to use to store your test results.

6. Type a work directory name or use the Browse button to select a work directory, and then click Next.
   You are prompted to start the configuration editor or start a test run. At this point, the XML Web Services TCK is configured to run the default test suite.

7. Deselect the Start the configuration editor option, and then click Finish.

8. Click Run Tests, then click Start.
   The JavaTest harness starts running the tests.

9. To reconfigure the JavaTest test harness, do one of the following:

   - Click Configuration, then click New Configuration.

   - Click Configuration, then click Change Configuration.

10. Click Report, and then click Create Report.

11. Specify the directory in which the JavaTest test harness will write the report, and then click OK.
    A report is created, and you are asked whether you want to view it.

12. Click Yes to view the report.

#### 4.7.4 Modifying the Default Test Configuration

The JavaTest GUI enables you to configure numerous test options. These options are divided into two general dialog box groups:

- Group 1: Available from the JavaTest Configure/Change Configuration submenus, the following options are displayed in a tabbed dialog box:

  - Tests to Run

  - Exclude List

  - Keywords

  - Prior Status

  - Test Environment

  - Concurrency

  - Timeout Factor

- Group 2: Available from the JavaTest Configure/Change Configuration/Other Values submenu, or by pressing `Ctrl+E`, the following options are displayed in a paged dialog box:

  - Environment Files

  - Test Environment

  - Specify Tests to Run

  - Specify an Exclude List

Note that there is some overlap between the functions in these two dialog boxes; for those functions use the dialog box that is most convenient for you. Please refer to the JavaTest Harness documentation or the online help for complete information about these various options.

Copyright © 2018, 2020 Oracle and/or its affiliates. All rights reserved.