setenv PATH ${TS_HOME}/bin:${PATH}
|
Building and Debugging Tests |
| Previous | Next | Contents |
For final certification and branding, all tests must be run through the JavaTest test harness. However, you can execute different Ant targets during your build and debug cycle. The following sections describe how to use Ant with the following targets to rebuild, list, and run tests:
runclient
clean
build
ld, lld, lc, llc, pd, pc
Implementers can only run the version of the tests provided with the CTS for certification, except in the case of rebuildable tests.
This chapter includes the following topics:
Complete the following steps to set up your environment to build, deploy, and run the CTS tests using Ant. The following example is for the Solaris platform:
Set the following environment variables in your shell environment to use the build infrastructure that comes with the TCK:
TS_HOME to the directory in which the Jakarta EE 8 CTS software is
installed.
TS_HOME/bin to your PATH in your command shell.
C Shell:
setenv PATH ${TS_HOME}/bin:${PATH}
Bourne Shell:
PATH=${TS_HOME}/bin:${PATH}
export PATH
JAVA_HOME to the directory in which the Java SE 8 software is
installed.
JAVAEE_HOME to the directory in which the Jakarta Platform, Enterprise
Edition Compatible Implementation (CI) is installed.
Unset ANT_HOME, if it is currently set in your environment.
Change to the <TS_HOME>/bin directory and verify that the ts.jte
file has the following properties set:
webserver.home: the directory in which the CI Web Server is
installed
webserver.host: the host on which the CI Web server is running
webserver.port: the port on which the CI Web server is running
javaee.home.ri: the directory in which the Jakarta Platform, Enterprise
Edition CI is installed for reference to the packager tool used by the
build infrastructure
ts.classpath: required classes needed for building/running the TCK
To build the Jakarta EE 8 CTS tests using Ant, complete the following steps:
To build a single test directory, type the following:
cd <TS_HOME>/src/com/sun/ts/tests/test_dir ant clean build
This cleans and builds the tests in the directory specified for
test_dir.
2. To list the classes directory for this test that was built, type the
following:
ant lc
or
ant llc
To list the distribution directory of archives for this test that
was built, type the following:
ant pd
or
ant pc
To run the Jakarta EE 8 CTS tests using Ant, use one of the following procedures.
To run a single test directory, type the following:
cd <TS_HOME>/src/com/sun/ts/tests/test_dir
ant runclient
This runs all tests in test_dir.
To run a single test within a test directory, type the following:
cd <TS_HOME>/src/com/sun/ts/tests/test_dir
ant runclient -Dtest=test_name
This runs only the test_name in the test_dir test directory. To show all
the tests that can be run from a particular test directory, change to
the directory and execute the list.tests Ant task. The actual test
name displays to the right of the pound sign (#), which follows the
fully qualified name of the client class.
You can use various Ant targets to list the contents of corresponding
dist/classes directories from the src directory without leaving the
src directory. All listings are sorted by modification time, with the
most recent modification listed first. Output is redirected to more.
The format may vary on Windows and Unix. Ant does not support changing
directory into the dist/classes directories, but you can copy and
paste the first line of the output, which is the target path.
The Ant list targets are as follows:
ld: Lists the contents of the current test’s dist directory
lld: Provides a long listing of the contents of the current test’s
dist directory
lc: Lists the contents of the current test’s classes directory
llc: Provides a long listing of the contents of the current test’s
classes directory
pd: Starts a new shell placed into the current test’s dist directory
pc: Starts a new shell placed into the current test’s classes
directory
If you run these targets in a directory that is not under the src
directory, they will list the contents of the current directory.
|
Note
|
|
The following listing shows sample output for the Ant lc target.
cd $TS_HOME/src/com/sun/ts/tests/samples/ejb/ee/simpleHello
ant lc
<TS_HOME>/classes/com/sun/ts/tests/samples/ejb/ee/simpleHello
----------------------------------------------------------------
Hello.class
HelloClient.class
HelloEJB.class
HelloHome.class
ant -Dbuild.vi=true lc
<TS_HOME>/classes_vi_built/com/sun/ts/tests/samples/ejb/ee/simpleHello
----------------------------------------------------------------
Hello.class
HelloClient.class
HelloEJB.class
HelloHome.class
The Jakarta EE 8 CTS service tests test the compatibility of the Jakarta Platform, Enterprise Edition Service APIs: Jakarta Mail, JDBC, Jakarta Messaging, Jakarta Transactions, Jakarta XML Web Services, Jakarta Web Services Metadata, Jakarta Annotations, and RMI over IIOP. The test suite contains sets of tests that the JavaTest harness, in conjunction with the Jakarta EE 8 CTS harness extensions, runs from different Jakarta Platform, Enterprise Edition containers (Jakarta Enterprise Beans, Jakarta Server Pages, Jakarta Servlet, and application client). The test suite wraps each of these tests inside generic components, called vehicles. Each Jakarta EE 8 CTS service test has been set up to run in a default set of vehicles. Each technology’s specification determines this set. When run as part of the certification process, all service API tests must pass in their default vehicle set.
Refer to the <TS_HOME>/src/vehicle.properties file to for a list the
default vehicle sets for the Jakarta EE 8 CTS service API tests.
To help you debug service API tests, the test suite provides a mechanism that allows for fine-grained control over which tests you can run in specific vehicles. When you override the default vehicle set for a particular set of service tests, the new set of vehicles must be a subset of the valid vehicle set for that set of tests. If the new set is not a subset of the default set, the test suite will use the default set. Example 10-1 illustrates this mechanism.
|
Note
|
You can only use this mechanism for debugging purposes. For certification, you must run using the default set of vehicles. |
To run the RMI/IIOP enterprise edition tests in the application client
vehicle only, set the following system property in the
<TS_HOME>/bin/build.xml file for the Ant gui or runclient targets:
<sysproperty key="tests_rmiiiop_ee.service_eetest.vehicles"
value="appclient"/>
This property overrides the default vehicle set for all tests under the
specified directory (and in every subdirectory of that directory). Note
that the first part of the property name matches the tests directory
structure as it appears under <TS_HOME> (with the underscore character
(_) replacing any file separator, such as the slash character (/) or
the backslash character (\).
Before you run the test or tests, you should temporarily rename the file
<TS_HOME>/src/testsuite.jtd.
To restrict the JDBC test run to the servlet and Jakarta Server Pages vehicles only, set
the following system property in the <TS_HOME>/bin/build.xml file for
the Ant gui or runclient targets:
<sysproperty key="tests_jdbc_ee.service_eetest.vehicles"
value="servlet jsp"/>
Before you run the test or tests, you should temporarily rename the file
<TS_HOME>/src/testsuite.jtd.
Note that you must remove these properties before you run the Jakarta EE 8 CTS test suite for certification.
When running the JavaTest harness in command-line mode, you can obtain
additional debugging information by setting the HARNESS_DEBUG
environment variable, as follows:
setenv HARNESS_DEBUG=true
Subsequent runs with the Ant runclient command generate additional
debugging information.
You can also generate additional test run information by seting the
<TS_HOME>/bin/ts.jte harness.log.traceflag property as follows:
harness.log.traceflag=true
| Previous | Next | Contents |
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.