TCK5Guide

Preamble

This guide details the instructions for running TCK5 against EAP 5. Running TCK 5 against AS 5 or 6 is no longer supported.

 

You must be logged onto the Red Hat VPN to have access to all needed resources.

Hudson web application for TCK5 results.

The TCK5 tests are automated on hudson to run continuously on a daily basis.

(for TCK6, see instead TCK6Guide)

 

http://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/EAP5/view/TCK5/

Prerequites

  1. A build of EAP 5 (/ JBPAPP_5_x)
  2. A JDK 6 installation. (JDK 5 is EOL and no longer supported.)
  3. On Unix, Korn shell (ksh; http://www.kornshell.com/)

How to Run the TCK5 tests

Setup files for TCK are available in the internal SVN repository accessible through the JBoss LDAP UserId/Pwd

Repo: https://svn.devel.redhat.com/repos/jboss-tck/

Install the TCK

  1. Checkout TCK 5 bundle.

    1. svn co https://svn.devel.redhat.com/repos/jboss-tck/tck5/branches/EAP_5_1 work_dir. (The porting layer is now a part of the tck5 module. tck5/trunk/j2eetck-mods which is checked out in this step.)

  2. Obtain the JavaEE 5 RI

  3. Install JavaEE 5 RI

    1. This requires libXp.so (sudo yum install -y libXp)
    2. Run "java -Xmx256m -jar javaee5_ri-v2.1.1-b28-linux.jar" to install the RI

  4. Setup Environment

    You might want to save the following steps in a shell script.
    1. Set TS_HOME environment variable to work_dir

    2. Set JBOSS_HOME to the EAP 5 build

    3. Set JAVAEE_HOME to the Glassfish RI

    4. Set JAVA_HOME to your JDK 6 installation

Prepare the TCK

  1. Prepare TCK for use with JBoss

    1. Run "ant clean" from work_dir/j2eetck-mods (Not required when setting up TCK for the first time)

    2. Run ant from work_dir/j2eetck-mods folder( This prepares the TCK5 package for use with JBoss)

      1. For running the interop/tx tests build j2eetck-mods with the flag -Dtxcp-enabled=true (This copies iiop-service.xml with TxCP enabled)

  2. Prepare glassfish for TCK

    1. Run "ant -buildfile setup.xml setup" from JAVAEE_HOME

  3. Prepare the cts config to run the tests with

    1. Clean the cts config. $TS_HOME/bin/tsant.bat clean.vi (Not required if the cts config does not exist).

    2. Run $TS_HOME/bin/tsant.bat config.vi (make sure JBoss is not running).

      This creates a custom $JBOSS_HOME/server/cts configuration that is a subset of the all configuration.
  4. Start and initialize javadb (This has to be done before running tests)

    1. To start javadb, run $TS_HOME/bin/tsant -f xml/s1as.xml start.javadb

    2. Initialize javadb, $TS_HOME/bin/tsant init.javadb

    3. To stop javadb, run $TS_HOME/bin/tsant -f xml/s1as.xml stop.javadb

  5. Start JBoss cts config before running TCK tests.

    1. $JBOSS_HOME/bin/run.sh -c cts

      1. * We recently started having problem starting the cts server instance in windows. We have not looked into the issue in detail but the temporary solution is to hard code log.file.location in jboss-service.xml under cts/conf. Mine looks like: log.file.location=C:/jboss-tck/build/output/jboss-5.0.0.Beta/server/cts/log

Run the TCK tests

  • GUI mode

    1. $TS_HOME/bin/tsant gui

  • Command Line

    1. To run all the tests $TS_HOME/bin/tsant.sh runclient

    2. To run a set of tests run tsant runclient from the folder under $TS_HOME/src/com/sun/ts/tests/MODULE_NAME.

    3. If you want to run a single test, you can use:

      • tsant -Dtest.client=<relative path of Java test class> -Dtests=<name of the test in java file> runclient

        eg: Assuming you are at $TS_HOME/src/com/sun/ts/tests/samples, you can use

        tsant -Dtest.client=javamail/ee/transport/send_Test.java -Dtest=testconnect_from_jsp runclient

 

Please note, that you need to set the correct timezone (tz variable) in the j2eetck-mods/bin/.jte files in order to make timezone related tests pass. Also please note that in order to successfully run the jaxr module tests, the en_US.utf-8 locale needs to be set before starting the application server (export LANG=en_US.utf-8; export LC_ALL=en_US.utf-8).

 

 

=== Carlo, 2013-01-08: Steps beyond this point have not been scrutinized yet ===

 

 

How to build the reverse tests/run jws and jaxws tests

  1. Build Reverse Tests

    1. cd $TS_HOME/src/com/sun/ts/tests/jws

      1. $TS_HOME/bin/tsant  -Dbuild.vi=true clean build

    2. cd $TS_HOME/src/com/sun/ts/tests/jaxws

      1. $TS_HOME/bin/tsant  -Dbuild.vi=true clean build

  2. Start RI

    1. $TS_HOME/bin/tsant.bat config.ri (This also starts up the RI)

  3. Start JBoss

  4. Run Tests

 

Please note that spaces and symbolic links in the work_dir name can make the build of reverse tests fail. For instance be sure to set TS_HOME and the other environment variables to something like /home/user/data/tck5 and not /data/tck5 even if you have a link data -> /home/user/data.

How do i update my TCK setup when i resume work.

  1. Run "svn update" from work_dir. (This automatically updates the TCK5 package if any patches from SUN have been applied. This also updates the porting package which was automatically checked out under work_dir)

  2. Update jbossas and rebuild JBoss 5.

  3. Execute steps 6, 8, 9, 10 from the above section and step 11 to run the tests.

 

 

Customizations (Optional, only if you want to change the defaults)

  1. Before running tests set the following parameters in $TS_HOME/bin/ts.jte

    1. work.dir

    2. report.dir

    3. mailuser1,mailFrom,mailHost

 

 

How to run the interop tests

  1. Startup JBoss cts config and javadb with javadb initialized

  2. Startup glassfish. glassfish/bin/asadmin start-domain (make sure you have done $TS_HOME/bin/tsant config.ri before you start glassfish, Note: the $TS_HOME/bin/tsant config.ri can take quite a while to finish on Windows in particular.  Wait for it to say BUILD SUCCESSFUL. Note: config.ri changes glassfish to bind different ports and thus avoid conflicts with JBossAS. However, to do that it first starts the default server, which uses default ports. Therefore, JBoss must not be running during the config.ri step or conflicts will arise and the config will fail.

  3. Run the interop tests as explained in the section above.

 

 

 

How to run the interop/tx tests

  1. Startup JBoss cts config and javadb with javadb initialized

  2. The interop-tx tests run twice, once with RI Tx Interop set to true (default) and once set to false.

    • From the CTS user guide:

      • To set the Java EE 5 RI Transaction Interoperability setting to False:

      • cd $TS_HOME/bin

      • tsant disable.ri.tx.interop

      • To set the Java EE 5 RI Transaction Interoperability setting to True:

      • tsant enable.ri.tx.interop

      • The default Java EE 5 RI Transaction Interoperability setting is True.

  3. Run the tests as explained in the section above.

 

 

 

 

How to run the csiv2 interop tests

  1. Startup JBoss cts config and javadb with javadb initialized

  2. Run $TS_HOME/bin/tsant.bat enable.csiv2 . This prepares tck for csiv2 tests and starts up glassfish.

  3. Run the csiv2 tests as explained in the section above.

  4. To disable csiv2 run $TS_HOME/bin/tsant.bat disable.csiv2

 

 

 

How to manually override JBoss DD's in the porting layer

Generally jboss DD are generated via XSLT on every testrun. For debugging purposes they are but next to the Sun DD in the dist directory.

On jboss the JSR88 deployment layer is setup such that deployments do not get removed. Hence, the ultimate source of information of what
actually gets deployed lives in server/cts/tmp/jsr88

This is also useful when you need to manually (re)eploy a CTS archive without starting the test through the gui. Sometimes the XSLT
transformation cannot generate the desired jboss DD, in that case you can manually create the jboss DD and put it under

        resources/com/sun/ts/<testpath>/<jboss-dd-name>.xml

before you build the porting layer with

        ant -Dnormic=true clean main

There are however tests where the harness does a preprocessing phase on the Sun DD and writes them to $TS_HOME/tmp. In that case we 
loose the testpath and could not use the override pattern described above.

I made a small change that allows you to put a predefined DD in

        resources/org/jboss/extras/<jboss-dd-name>.xml

and it will be picked up from there.

Be aware though that this relies on the name of the DD only (i.e. there is no testpath associated) and the DD might unintentionally 
be reused by another test. It is generally preferred to modify the XSLT such that it produces the desired jboss DD.

 

 

 

How to run the TCK with a different database

  1. Clean j2eetck-mods. Run "ant clean" from j2eetck-mods folder

  2. Build j2eetck-mods for the specific database. Run "ant -Dcts.db=DbName" from j2eetck-mods, where DbName is postgresql.

  3. Clean jboss cts config. $TS_HOME/bin/tsant.bat clean.vi

  4. Build jboss cts config for the specific db. $TS_HOME/bin/tsant.bat config.vi -Dcts.db=DbName, where DbName is postgresql.

 

NOTE: All the databases have been initialized with the tables necessary for TCK.

To reinitilize use:

  • $TS_HOME/bin/tsant.bat init.postgresql

 

The remaining steps are similar to the regular TCK setup. Both jboss and cts use the database that is configured. No needed to start derby. The tests connect to the DB instances that are configured in the QA lab. So connect to the VPN to connect to these database instances.

 

To run the TCK against a local installation of PostgreSQL follow these instructions.

 

 

How to run the CTS Tests in a Debugger

  • Open in Text Editor $TS_HOME/j2eetck-mods/bin/ts-jboss.jte

  • Uncomment (and modify as appropriate) the variable jboss.test.debugging

# JPDA options. Uncomment and modify as appropriate to enable remote debugging.
#jboss.test.debugging=-Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y
  • Attach a remote socket debugger per normal when running the tests in the TestRunner

 

 

 

Running Stax TCK against JBoss AS 5

Checkout STAX TCK bundle:

  1. Stax 1.0 TCK:

    1. svn co https://svn.devel.redhat.com/repos/jboss-tck/staxtck10

  2. Stax 1.1 TCK:

    1. svn co https://svn.devel.redhat.com/repos/jboss-tck/staxtck11
  3. Stax 1.2 TCK:
    1. svn co https://svn.devel.redhat.com/repos/jboss-tck/standalone-tck/stax/jsr173_1.2_tck.zip

 

NOTE:  This is a standalone TCK which should be run against the JBoss Application Server targeted for certification but the server does not need to be running for test execution.

  1. Configure TCK for use with JBoss

    1. Change directory to $TCK_HOME/com/bea/ts directory where TCK_HOME is the location of the TCK checkout.

    2. Create a binary configuration file for the test run.

      1. Follow the instructions in the README.txt file which will guide you in creating a test configuration file for your environment and start the test run.

 

Note:  It is recommended to save the configuration file. Future runs can be performed using the follow command options:

    1. GUI Mode

      1. java -jar ./lib/javatest.jar myconfig.jti

    2. Batch mode:

      1. java -jar lib/javatest.jar -batch myconfig.jti -report /MY_REPORT_DIR/JTreport

 

 

Running TCK 5 with JBoss EAP 5.1

If you are running the Java EE 5 TCK against JBoss EAP 5.1, check out this TCK branch:

  1. https://svn.devel.redhat.com/repos/jboss-tck/tck5/branches/EAP_5_1/

 

  1. Changing the Messaging Provider.

The default messaging provider in JBoss EAP 5.1 is JBoss Messaging.   You can also use HornetQ as the messaging provider. To run the TCK with HornetQ as the messaging provider, refer to the the instructions found in README-hornetq.txt which is located in the j2eetck-mods/docs directory of the EAP_5_1 branch referenced above.

 

 

Referenced by: