Sun Java Solaris Communities My SDN Account Join SDN
 
Documentation

Installing and Running the JDBC[tm] API Test Suite 1.3.1

 

Contents

Introduction
Support
Conformance
Steps to Install and Run the Tests
Solaris/Linux
Windows
Test Output
Excluded Tests
Customization of SQL Statements

Introduction

The JDBCTM API test suite contains tests useful for testing a driver based on JDBC technology ("JDBC driver") for its conformance to the requirements of the JavaTM 2 Platform Enterprise Edition (J2EETM). This test suite is intended to assist driver vendors in preparing their drivers for certification in a J2EE compatible configuration using the J2EE Compatibility Test Suite. We have attempted to make the JDBC API Test Suite comprehensive enough that it covers the JDBC requirements tested by the J2EE CTS.

Support

The tests provided in the JDBC API Test Suite are provided as is. The team at Sun working on the JDBC API does not have the resources to help with running these tests. Questions, comments and feedback regarding this test suite should be sent to the following alias:

jdbc-tests@sun.com
We cannot respond to all queries but will attempt to provide an FAQ to answer the common questions.

Questions regarding all other aspects of the JDBC Specification and API should continue to be sent to:

jdbc@sun.com
Vendors wishing to buy support may do so by licensing the J2EE Platform. Please visit the following page for details:
/logos/

Conformance

The JDBC API test suite is provided solely for the purpose of evaluating the compatibility of JDBC drivers that are intended to run on the Java 2 Enterprise Edition Platform. Running the tests does not allow any public claims of conformance to be made. (see License)

Programs are available for vendors who wish to certify a JDBC driver as compliant with the J2EE platform. Please contact Sun's Java Software Division marketing department at the following email address for further details:

jdbc-certification@sun.com

Steps to Install and Run the Tests

The tests are run using GNU Make. GNU Make can be downloaded from the following location:

ftp://ftp.gnu.org/pub/gnu/make
The version make-3.79.1 builds on both Unix and Win32 platforms.

The version of GNU Make used to test this distribution on Solaris 2.8 is shown below:

% gnumake --version
GNU Make version 3.78.1, by Richard Stallman and Roland McGrath.
Built for sparc-sun-solaris2.6
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

Report bugs to <bug-make@gnu.org>.
The version of GNU Make used to test this distribution on Windows NT/2000 is shown below:
[C:/] gnumake --version
GNU Make version 3.78.1, by Richard Stallman and Roland McGrath.
Built for Windows32
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

Report bugs to <bug-make@gnu.org>.
For the convenience of the JDBC(TM) API Test Suite, ensure gnumake is available in the $PATH. Also to minimize unnecessary editing of the Test Suite configuration files, the following should be performecd on both Solaris/Linux and Windows platforms. OR
% cp gnumake gmake

OR

[C:/] cp gnumake.exe gmake.exe
Additionally installations of the JavaTM 2 Standard Edition 1.3.1(J2SETM) and JavaTM 2 Enterprise Edition 1.3.1 (J2EETM) are required.
http://java.sun.com/products/

Solaris/Linux

Download the 'jdbccts-1_3_1.zip' file.

Unzip the 'jdbccts-1_3_1.zip' file:

% unzip jdbccts-1_3_1.zip
Set the CTS_HOME environment variable to the directory where you have unzipped the 'jdbccts-1_3_1.zip' file:
% setenv CTS_HOME /local/jdbccts
Change the current directory to the install directory:
% cd $CTS_HOME/install
Run the setup scripts, which generates the '$CTS_HOME/bin' directory containing scripts and configuration files used for the JDBC Test Suite.
% ./setup
Set the following environment variable to the appropriate values for your system:
% setenv J2EE_HOME /local/j2sdkee1.3.1
% setenv JAVA_HOME /local/jdk1.3.1
Set the following environment variable:
% setenv NO_JAVATEST Y
Next, the following configuration files require some modifications:
  • CTS.JTE
Edit the file '$CTS_HOME/bin/cts.jte' and provide values for the following properties. The values shown below show the values that should be used when running against the J2EE platform Reference Implementation:
    webServerHost=localhost
    webServerPort=8000
  • CTS_ENV
Edit the file '$CTS_HOME/bin/cts_env' and provide values for the following property:
JAVA_HOME=/local/jdk1.3.1
Additionally,  provide the values for the following properties:
    # Settings for Vendor J2EE Implementation
    J2EE_HOME=/local/j2sdkee1.3.1
    ORB_HOST=localhost
    ORB_PORT=1050
    LOCAL_CLASSES=

    # Settings for Sun RI J2EE Implementation
    J2EE_HOME_RI=/local/j2sdkee1.3.1
    ORB_HOST_RI=localhost
    ORB_PORT_RI=1050
    LOCAL_CLASSES_RI=${J2EE_HOME_RI}/lib/cloudscape/RmiJdbc.jar:${J2EE_HOME_RI}/lib/cloudscape/cloudclient.jar

    Note: The 'LOCAL_CLASSES' property should include details of the JDBC driver under test with the JDBCTM 1.3.1 API Test Suite.
     
  • USER_CONFIG.SH
Edit the file '$J2EE_HOME/bin/userconfig.sh' and add the following jar file to the J2EE RI classpath.
J2EE_CLASSPATH=$CTS_HOME/lib/j2eects.jar
export J2EE_CLASSPATH
    Also add the JAR file(s) of the JDBC driver that you are using to the J2EE classpath.
Next ensure the JDBC driver under test is accessible to the J2EE Reference Implementation. The following example shows how the data source names are defined for the Cloudscape database that is included in the J2EE Reference Implementation.

First add the JDBC Driver name

% $J2EE_HOME/bin/j2eeadmin -addJdbcDriver com.cloudscape.core.JDBCDriver
Add the data source 'jdbc/DB1'
% $J2EE_HOME/bin/j2eeadmin -addJdbcDataSource jdbc/DB1 jdbc:cloudscape:rmi:CloudscapeDB;create=true
Additionally, ensure the JDBC drivers that are being tested should be located in the following directory to ensure the J2EE Reference Implementation can locate the drivers. A copy of  JDBC driver jars should be added to the '$J2EE_HOME/lib/system' directory.

Detailed instructions on adding additional JDBC drivers and data sources to the J2EE Reference Implementation are available at:

http://java.sun.com/j2ee/sdk_1.3/techdocs/release/ConfigGuide.html#12442
Add the '$CTS_HOME/bin' directory to the PATH environment variable.
% setenv PATH $CTS_HOME/bin:${PATH}
Next populate the database with the required tables, entries and stored procedures:
% initdb
Note: For databases and JDBC drivers other than those provided by the J2EE Reference Implementation, options can be set using the following parameters:
[-U <username>]
[-P <password>]
[-S <url>]
[-p <path>]
[-d jdbcDriver]
Now start the J2EE application server and the database and start the tests:
% cd $CTS_HOME/tests/jdbc/ee
% ctsmake jdbc-tests

Note: If errors occur in deployment of all tests to the J2EE application server, ensure the '$CTS_HOME/tmp' directory has read permissions for all groups.

chmod 755 $CTS_HOME/tmp


Windows

Running the tests on the Windows platform requires that you use the MKS Unix Toolkit. The test suite has been successfully run using the MKS Unix Toolkit 6.1a and MKS Unix Toolkit 6.2.

Note the following instructions that the slashes '/' are forward slashes even though they allow for a DOS style driver letter specification 'C:'

Download the 'jdbccts-1_3_1.zip' file.

Unzip the 'jdbccts-1_3_1.zip' file:

[C:/] unzip jdbccts-1_3_1.zip
Open a MKS shell and perform the following environment configuration.

Set the CTS_HOME environment variable to the directory where you have unzipped the 'jdbccts-1_3_1.zip' file:

[C:/] export CTS_HOME=d:/local/jdbccts
Change the current directory to the install directory:
[C:/] cd $CTS_HOME/install
Run the setup scripts, which generates the '$CTS_HOME/bin' directory containing scripts and configuration files used for the JDBC Test Suite. The 'setup.bat' must be renamed as 'setup.win32.bat' so as not to confuse it with the 'setup.sh' script as both are present.
[C:/] mv setup.bat setup.win32.bat
C:/] ./setup.win32.bat
Set the following environment variables to the appropriate values for your system and reset the value of CTS_HOME
[C:/] export CTS_HOME=c:/local/jdbccts
[C:/] export J2EE_HOME=c:/local/j2sdkee1.3.1
[C:/] export JAVA_HOME=c://local/jdk1.3.1
Set the following environment variable:
[C:/] export NO_JAVATEST=Y
Next, the following configuration files require some modifications:
  • CTS.JTE
Edit the file '$CTS_HOME/bin/cts.jte' and provide values for the following properties. The values shown below show the values that should be used when running against the J2EE platform Reference Implementation:
    webServerHost=localhost
    webServerPort=8000
  • CTS_ENV
Edit the file '$CTS_HOME/bin/cts_env' and provide values for the following property:
JAVA_HOME=/local/jdk1.3.1
Additionally,  provide the values for the following properties:
    # Settings for Vendor J2EE Implementation
    J2EE_HOME=/local/j2sdkee1.3.1
    ORB_HOST=localhost
    ORB_PORT=1050
    LOCAL_CLASSES=

    # Settings for Sun RI J2EE Implementation
    J2EE_HOME_RI=/local/j2sdkee1.3.1
    ORB_HOST_RI=localhost
    ORB_PORT_RI=1050
    LOCAL_CLASSES_RI=${J2EE_HOME_RI}/lib/cloudscape/RmiJdbc.jar:${J2EE_HOME_RI}/lib/cloudscape/cloudclient.jar

    Note: The 'LOCAL_CLASSES' property should include details of the JDBC driver under test with the JDBCTM 1.3.1 API Test Suite.
     
  • USER_CONFIG.SH
Edit the file '$J2EE_HOME/bin/userconfig.bat' and add the following jar file to the J2EE RI classpath.
J2EE_CLASSPATH=$CTS_HOME/lib/j2eects.jar
export J2EE_CLASSPATH
    Also add the JAR file(s) of the JDBC driver that you are using to the J2EE classpath.
     
  • EXECUTE.MK
Edit the file '$CTS_HOME/build/execute.mk' and make the following change on line 39. Remove the quotes from the CPATH variable.'
TOOL_NO_JAVATEST=$(JAVA) $(NO_JT_SYSTEM_PROPERTIES) -classpath $(CPATH) com.sun.cts.util.PrepareJDBCDeploy
Next ensure the JDBC driver under test is accessible to the J2EE Reference Implementation. The following example shows how the data source names are defined for the Cloudscape database that is included in the J2EE Reference Implementation.

First, add the JDBC Driver name:

% $J2EE_HOME/bin/j2eeadmin -addJdbcDriver com.cloudscape.core.JDBCDriver
Then add the data source 'jdbc/DB1':
% $J2EE_HOME/bin/j2eeadmin -addJdbcDataSource jdbc/DB1 jdbc:cloudscape:rmi:CloudscapeDB;create=true
Additionally, ensure the JDBC drivers that are being tested should be located in the following directory to ensure the J2EE Reference Implementation can locate the drivers. A copy of  JDBC driver jars should be added to the '$J2EE_HOME/lib/system' directory.

Detailed instructions on adding additional JDBC drivers and data sources to the J2EE Reference Implementation are available at:

http://java.sun.com/j2ee/sdk_1.3/techdocs/release/ConfigGuide.html#12442
Add the '$CTS_HOME/bin' directory to the PATH environment variable:
[C:/] export PATH=$CTS_HOME/bin:${PATH}
Next populate the database with the required tables, entries and stored procedures:
[C:/] initdb
Note: For databases and JDBC drivers other than those provided by the J2EE Reference Implementation options can be set using the following parameters:
[-U <username>]
[-P <password>]
[-S <url>]
[-p <path>]
[-d jdbcDriver]
Now start the J2EE application server and the database and start the tests:
[C:/] cd $CTS_HOME/tests/jdbc/ee
[C:/] ctsmake jdbc-tests


Test Output

While the tests are being run, log files are produced in each test sub-directory:

build.out - output from the makefile target 'build'
deploy.out - output from the makefile target 'deploy'
run.out - output from the makefile target 'jdbc-tests'
undeploy.out - output from the makefile target 'undeploy'
As each set of tests is run, the output is appended to:
 $CTS_HOME/tests/jdbc/ee/jdbc-tests.log
When the all of the tests have been run, this file contains a complete log of the test run.
 

Excluded Tests

The JDBC API test suite contains a list of excluded tests ("the exclude list"). Tests on the exclude list are not run by the test harness. Tests on the exclude list may become required in future versions of the test suite.
 

Customization of SQL Statements

The SQL statements that are executed by the tests may need to be customized for certain DBMSs. Two customized DDL files ('ctssql.ddl.cloudscape', 'ctssql.ddl.oracle') are provided as sample customizations. If vendors wish to provide their own customization the following property in '$CTS_HOME/bin/cts_env' must also be edited.

DDLFILE=${CTS_HOME}/bin/ctssql.ddl.cloudscape