Testing a Standalone Jakarta Messaging Resource Adapter

Previous Contents

F Testing a Standalone Jakarta Messaging Resource Adapter

This appendix explains how to set up and configure a Jakarta EE 9 CI and Jakarta EE 9 Platform TCK so a standalone Jakarta Messaging resource adapter can be tested.

This appendix covers the following topics:

F.1 Setting Up Your Environment

Before you can run the Jakarta Messaging TCK tests against a standalone Jakarta Messaging Resource Adapter using a Jakarta EE 9 CI, you must install the following components:

  • Java SE 8 software

  • Jakarta EE 9 CI software such as Eclipse GlassFish 6.0

  • Jakarta EE 9 Platform TCK software

Complete the following steps to set up Eclipse GlassFish 6.0 in your environment:

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

    • JAVA_HOME to the directory where the Java SE 8 software has been installed

    • JAVAEE_HOME to the directory where the Jakarta EE 9 CI (Eclipse GlassFish 6.0) software has been installed

    • TS_HOME to the directory where the Jakarta EE 9 Platform TCK software has been installed

  2. Update your PATH environment variable to include the following directories: JAVA_HOME/bin, JAVAEE_HOME/bin, TS_HOME/bin, and ANT_HOME/bin.

F.2 Configuring Jakarta EE 9 Platform TCK

The ts.jte file includes properties that must be set for testing a standalone Jakarta Messaging Resource Adapter using the Jakarta EE 9 CI. The Jakarta Messaging Resource Adapter documentation in the ts.jte file should help you understand what you need to set in this step of the testing process.

  1. Set the following properties in the ts.jte file:

    • javaee.home to the location where the Jakarta EE 9 CI is installed

    • Use the default value or enter a new host name for the orb.host property

    • Use the default value or enter a new port number for the `orb.port`property

    • test.sa.jmsra to true

    • jmsra.rarfile to the location of the standalone Jakarta Messaging Resource Adapter RAR file

    • jmsra.jarfile to the location of the standalone Jakarta Messaging Resource Adapter JAR file

    • jmsra.name to the name of the Jakarta Messaging Resource Adapter under test

  2. Add $\{jmsra.jarfile} to the beginning or at the end of the AppClient classpath:
    APPCPATH= list of classes and jars followed by $\{pathsep}$\{jmsra.jarfile}\
    The jmsra.jarfile, which contains all the Jakarta Messaging Resource Adapter classes, needs to be added to the AppClient classpath in the ts.jte file. This JAR file will also be copied to the appropriate directory in your Jakarta EE 9 environment when the config.vi Ant task, which is described in the next section, is invoked. For the Jakarta EE 9 CI Eclipse GlassFish 6.0, the file is copied to the JAVAEE_HOME/lib directory.

F.3 Configuring a Jakarta EE 9 CI for the Standalone Jakarta Messaging Resource Adapter

Invoke the config.vi Ant task to configure the Jakarta EE 9 CI, Eclipse GlassFish 6.0 for TCK 9 and the standalone Jakarta Messaging Resource Adapter:

  1. Change to the TS_HOME/bin directory.

  2. Execute the config.vi Ant task.
    The config.vi Ant task executes scripts, which configure your Jakarta EE 9 environment for TCK 9. One of the ant scripts that gets executed will configure and deploy the standalone Jakarta Messaging Resource Adapter, copy the JAR file containing the classes for the standalone Jakarta Messaging Resource Adapter to the JAVAEE_HOME/lib directory, create the Jakarta Messaging connector connect ion pools and resources, and create the necessary Jakarta Messaging administration objects. The following Ant scripts are called by the config.vi Ant task:

    • TS_HOME/bin/xml/impl/glassfish/jmsra.xml

    • TS_HOME/bin/xml/impl/glassfish/templates/create.jmsra.template
      The script TS_HOME/bin/xml/impl/glassfish/jmsra.xml calls the template file TS_HOME/bin/xml/impl/glassfish/templates/create.jmsra.template, which handles the creation of the Jakarta Messaging connector connection pools, the Jakarta Messaging connector resources and the Jakarta Messaging administration objects.
      These scripts are written for the standalone Generic Jakarta Messaging Resource Adapter (GenericJMSRA) for the Jakarta EE 9 CI. If you are using a different Jakarta EE 9 environment, you will need to rewrite these scripts for that environment. If you are using a different standalone Jakarta Messaging resource adapter, you will need to rewrite these scripts for that Jakarta Messaging resource adapter.

F.4 Modifying the Runtime Deployment Descriptors for the Jakarta Messaging MDB and Resource Adapter Tests

After the standalone Jakarta Messaging Resource Adapter has been configured and deployed and the required Jakarta Messaging connector connection pools, Jakarta Messaging connector resources, and Jakarta Messaging administration objects have been created, the glassfish-ejb-jar runtime deployment descriptor XML files must be modified for the Jakarta Messaging MDB and Resource Adapter tests. An Ant task handles the modifications.

  1. Change to the TS_HOME/bin directory.

  2. Execute the following Ant task:
    ant -f xml/impl/glassfish/jmsra.xml modify-jmsmdbejbxml

This Ant target modifies the glassfish-ejb-jar runtime deployment descriptor XML files in the distribution directory of the Jakarta Messaging MDB and Resource Adapter test directories that exist under TS_HOME/src/com/sun/ts/tests/jms/ee/mdb and TS_HOME/src/com/sun/ts/tests/jms/ee20/ra.
The modified glassfish-ejb-jar runtime deployment descriptor XML files exist under the
TS_HOME/src/com/sun/ts/tests/jms/commonee/xml/descriptors/genericra directory. These files are copied into the correct distribution test directory under TS_HOME/dist/com/sun/ts/tests/jms/ee/mdb and TS_HOME/dist/com/sun/ts/tests/jms/ee20/ra.
The <mdb-resource-adapter> information for the standalone Jakarta Messaging Resource Adapter being tested is added to the glassfish-ejb-jar runtime deployment descriptor XML files. In the default case, the resource adapter being tested is the Generic Jakarta Messaging Resource Adapter (GenericJMSRA). If you are using a different Jakarta EE 9 environment, your runtime deployment descriptor XML files will need to be vendor specific. In this case, you will need to modify the Ant script to handle your vendor-specific runtime deployment descriptor XML files.

F.5 Running the Jakarta Messaging Tests From the Command Line

Run the Jakarta Messaging tests:

  1. Change to the TS_HOME/src/com/sun/ts/tests/jms directory.

  2. Invoke the runclient Ant target:
    ant runclient

F.6 Restoring the Runtime Deployment Descriptors for the Jakarta Messaging MDB and Resource Adapter Tests

After you run the Jakarta Messaging tests against your standalone Jakarta Messaging Resource Adapter, you need to restore the Jakarta Messaging MDB and Resource Adapter tests. Jakarta EE 9 Platform TCK provides an Ant task that handles the restoration. Invoke the following Ant task to restore the Jakarta Messaging MDB and Resource Adapter glassfish-ejb-jar runtime deployment descriptor XML files to their previous state:

  1. Change to the TS_HOME/bin directory.

  2. Invoke the following Ant target:
    ant -f xml/impl/glassfish/jmsra.xml restore-jmsmdbejbxml

If you are using another Jakarta EE 9 environment, these runtime deployment descriptor XML files will be vendor specific. In this case, you will need to modify the Ant script to handle the vendor-specific runtime deployment descriptor XML files appropriate for your environment.

F.7 Reconfiguring Jakarta EE 9 CI for Jakarta EE 9 Platform TCK After Testing the Standalone Jakarta Messaging Resource Adapter

After you finish testing the standalone Jakarta Messaging Resource Adapter, you need to reconfigure the Jakarta EE 9 CI before you can continue testing with Jakarta EE 9 Platform TCK:

  1. Change to the TS_HOME/bin directory.

  2. Invoke the clean.vi Ant target:
    ant clean.vi

  3. Set the following properties in the ts.jte file:

    • javaee.home to the location where the Jakarta EE 9 CI is installed

    • Use the default value for the orb.host property or enter a new host name

    • Use the default value for the orb.port property or enter a new port number

    • test.sa.jmsra to false

    • Unset the jmsra.rarfile property

    • Unset the jmsra.jarfile property

    • Reset the jmsra.name property to jmsra to refer to the Jakarta Messaging Resource Adapter for the Jakarta EE 9 CI

  4. From the TS_HOME/bin directory, invoke the config.vi Ant task to reconfigure the Jakarta EE 9 CI for Jakarta EE 9 Platform TCK:
    ant config.vi


Previous Contents
Eclipse Foundation Logo  Copyright © 2018, 2020 Oracle and/or its affiliates. All rights reserved.