derby
mysql
sybase
db2
mssqlserver
oracle
postgresql
Setup and Configuration |
Previous | Next | Contents |
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 Persistence TCK. 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 Persistence TCK.
Note
|
In these instructions, variables in angle brackets need to be expanded
for each platform. For example, 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. |
Set the following environment variables in your shell environment:
JAVA_HOME
to the directory in which Java SE 17+ is installed
M2_HOME
to the directory in which the Apache Maven build tool is installed.
ECLIPSELINK_HOME
to the directory in which the Persistence
3.2 CI has been installed
PATH
to include the following directories: JAVA_HOME/bin
,
and M2_HOME/bin
set the following system properties:
Set jpa.classes
to include all of the necessary JAR files that
pertain to your implementation using comma separator in the TCK runner.
Set jdbc.lib.classpath
to the location where the JDBC drivers are
installed using comma separator in the TCK runner.
Set jdbc.driver.classes
to the location where the JDBC drivers are
installed using CLASSPATH separator in the TCK runner.
Set jdbc.db
to the name of the database under test. Valid values
include:
derby
mysql
sybase
db2
mssqlserver
oracle
postgresql
Set jakarta.persistence.provider
, jakarta.persistence.jdbc.driver
,
jakarta.persistence.jdbc.url
, jakarta.persistence.jdbc.user
, and
jakarta.persistence.jdbc.password
to the appropriate values for the
database and persistence provider under test.
These properties are passed to the Persistence provider during the
creation of the EntityManagerFactory
. Any additional values, for
example setting an implementation’s logging level, must be set by
following the instructions in Step 2e.
Set the jpa.provider.implementation.specific.properties
property
to include any implementation-specific settings that need to be passed
to the provider when the EntityManagerFactory
is created.
Set sigTestClasspath
to include any additional classes not
specified with the jpa.classes
property.
Set db.supports.sequence to false if the database does not support
the use of SEQUENCE.
The default value is true.
Set persistence.second.level.caching.supported
to false if your
persistence provider does not support second level caching.
The default value is true.
If you are using MySQL or MS SQL Server, do the following:
If you are using MySQL, see Section 4.3.1, "Setup Considerations for MySQL," and proceed to Step 4.
If you are using MS SQL Server, see Section 4.3.2, "Setup Considerations for MS SQL Server," and proceed to Step 4.
Start the database under test.
Initialize the database under test. Execute following SQL scripts for database initilization:
<jdbc.db>.ddl.persistence.sql
<jdbc.db>.ddl.persistence.sprocs.sql
Note
|
In these instructions, variables in angle brackets need to be expanded
for each platform. For example, 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. |
Adapt the instructions above as appropriate for your implementation.
The Jakarta Persistence tests require delimited identifiers for
the native query tests. If you are using delimited identifiers on MySQL,
modify the sql-mode
setting in the my.cnf
file to set the
ANSI_QUOTES option. After setting this option, reboot the MySQL server.
Set the option as shown in this example:
sql-mode=
"STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,ANSI_QUOTES"
If your database already exists and if you use a case-sensitive collation on MS SQL Server, execute the following command to modify the database and avert errors caused by case-sensitive collation:
ALTER DATABASE ctsdb COLLATE Latin1_General_CS_AS ;
Previous | Next | Contents |