OPENJPA-2326 - Enable 21x and 221x running TCK 2 against databases other then Derby. Fixed a few configuration problems.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/2.1.x@1445201 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Albert Lee 2013-02-12 15:40:38 +00:00
parent 25ac722fbc
commit 757b4cf4de
6 changed files with 315 additions and 28 deletions

View File

@ -48,7 +48,7 @@
property to specify the parent directory of the tests you want to run.
E.g.:
mvn integration-test -Ptck-profile -Djpatck.pkg.dir=com/sun/ts/tests/ejb30/persistence/inheritance/mappedsc/descriptors
mvn integration-test -Ptck2-profile -Djpatck.pkg.dir=com/sun/ts/tests/ejb30/persistence/inheritance/mappedsc/descriptors
You can also run using another database (e.g., oracle) using command
line properties. For example:
@ -57,7 +57,7 @@
The TCK running process will do the following:
1. Fine the TCK zip file and extract it
1. Find the TCK zip file and extract it
2. Create an openjpa-provier.properties file with the OpenJPA config
3. Modify the TCK's main configuration file (ts.jte) to use OpenJPA
4. Run the database initialization script
@ -86,7 +86,7 @@
<properties>
<openjpa.Log>DefaultLevel=WARN</openjpa.Log>
<tck2.level>20101205</tck2.level>
<tck2.level>20110815</tck2.level>
</properties>
<build>
@ -104,7 +104,10 @@
<profiles>
<profile>
<!-- vvvvvvvvvvvvvvvvvvv -->
<!-- JPA 2.0 TCK Profile -->
<!-- vvvvvvvvvvvvvvvvvvv -->
<id>tck2-profile</id>
<build>
<plugins>
@ -186,9 +189,22 @@
<path id="cp">
<path refid="maven.compile.classpath" />
</path>
<path id="cp.test">
<pathelement location="${basedir}/../../target/classes"/>
<path refid="maven.test.classpath" />
</path>
<pathconvert property="cp.test.classpath" refid="cp.test" />
<!-- create missing directory for maven compile classpath -->
<mkdir dir="${basedir}/target/classes" />
<ant antfile="${basedir}/tck2-${tck2.level}.xml" inheritRefs="true">
<target name="run-tck" />
<property name="tck.db.name" value="${tck.db.name}" />
<property name="connection.driver.name" value="${connection.driver.name}" />
<property name="connection.url" value="${connection.url}" />
<property name="connection.username" value="${connection.username}" />
<property name="connection.password" value="${connection.password}" />
</ant>
</tasks>
</configuration>
@ -208,10 +224,17 @@
<version>${project.version}</version>
</dependency>
</dependencies>
<!-- ^^^^^^^^^^^^^^^^^^^ -->
<!-- JPA 2.0 TCK Profile -->
<!-- ^^^^^^^^^^^^^^^^^^^ -->
</profile>
<profile>
<!-- vvvvvvvvvvvvvvvvvvvv -->
<!-- JPA 1.0b TCK Profile -->
<!-- vvvvvvvvvvvvvvvvvvvv -->
<id>tck-profile</id>
<build>
<plugins>
@ -437,7 +460,94 @@ databaseName=${db.name}
<version>${project.version}</version>
</dependency>
</dependencies>
<!-- ^^^^^^^^^^^^^^^^^^^^ -->
<!-- JPA 1.0b TCK Profile -->
<!-- ^^^^^^^^^^^^^^^^^^^^ -->
</profile>
<profile>
<!--
Example db2 profile. You can use this profile if you:
1) have the DB2 artifacts installed in a local repo and supply the URL:
-Ddb2.maven.repo=http://my.local.repo
2) have a copy of the DB2 JCC driver and run the following commands :
mvn install:install-file -Dfile=${path to db2jcc.jar} \
-DgroupId=com.ibm.db2 \
-DartifactId=jcc-driver \
-Dversion=9.5 \
-Dpackaging=jar
mvn install:install-file -Dfile=${path to db2jcc_license.jar} \
-DgroupId=com.ibm.db2 \
-DartifactId=jcc-license \
-Dversion=9.5 \
-Dpackaging=jar
You must also set the following properties:
-Dopenjpa.db2.url=jdbc:db2://<HOST>:<PORT>/<DBNAME>
-Dopenjpa.db2.username=<db2_uid>
-Dopenjpa.db2.password=<db2_pwd>
Optionally, you can override the default DB2 groupId,
artifactIds and version by also supplying the following
properties:
-Ddb2.groupid=com.ibm.db2
-Dids.driver.artifactid=jcc-driver
-Dids.license.artifactid=jcc-license
-Ddb2.version=9.5
-->
<id>test-db2-jcc</id>
<activation>
<property>
<name>test-db2-jcc</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>${db2.groupid}</groupId>
<artifactId>${db2.driver.artifactid}</artifactId>
<version>${db2.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${db2.groupid}</groupId>
<artifactId>${db2.license.artifactid}</artifactId>
<version>${db2.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<db2.maven.repo>http://not.a.real.repository</db2.maven.repo>
<db2.groupid>com.ibm.db2</db2.groupid>
<db2.driver.artifactid>jcc-driver</db2.driver.artifactid>
<db2.license.artifactid>jcc-license</db2.license.artifactid>
<db2.version>9.5</db2.version>
<connection.driver.name>com.ibm.db2.jcc.DB2Driver</connection.driver.name>
<connection.url>jdbc:db2://localhost:50000/tck</connection.url>
<connection.url>${openjpa.db2.url}</connection.url>
<connection.username>${openjpa.db2.username}</connection.username>
<connection.password>${openjpa.db2.password}</connection.password>
<jdbc.DBDictionary />
<tck.db.name>db2</tck.db.name>
</properties>
<repositories>
<repository>
<id>db2.repository</id>
<name>DB2 Repository</name>
<url>${db2.maven.repo}</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
<checksumPolicy>ignore</checksumPolicy>
</releases>
</repository>
</repositories>
</profile>
</profiles>
<dependencies>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project name="ExecSQL" default="create-sql" basedir=".">
<target name="create-sql">
<echo>Creating OpenJPA specific sql for JPA 2.0 TCK tests</echo>
<!-- Use tsant force to change the working directory to @{dir}. -->
<tsant dir="${tck.dir}/bin" buildfile="${basedir}/sql/create.openjpa.sql.xml" target="exec-sql"/>
<echo>Create TCK specific database tables returned result=${tsant.result}</echo>
</target>
<target name="exec-sql">
<echo>databaseName=${databaseName}</echo>
<antcall target="init.${databaseName}"/>
</target>
<target name="init.common">
<sql driver="${database.driver}"
url="${database.url}"
userid="${database.user}"
password="${database.passwd}"
classpath="${jdbc.lib.classpath}"
delimiter="${db.delimiter}"
autocommit="true"
onerror="continue" >
<transaction src="../../../../sql/${databaseName}.sql"/>
</sql>
</target>
<target name="init.derby">
<antcall target="init.common">
<param name="db.delimiter" value=";"/>
</antcall>
</target>
<target name="init.db2">
<antcall target="init.common">
<param name="db.delimiter" value="!"/>
</antcall>
</target>
</project>

View File

@ -0,0 +1,36 @@
-- =======================================================================
-- com.sun.ts.tests.ejb30.persistence.entitytest.cascadeall.oneXone
DROP TABLE AEJB_1X1_BI_BTOB !
CREATE TABLE AEJB_1X1_BI_BTOB (id VARCHAR(255) NOT NULL, name VARCHAR(255), value INTEGER, PRIMARY KEY (id)) !
DROP TABLE BEJB_1X1_BI_BTOB !
CREATE TABLE BEJB_1X1_BI_BTOB (id VARCHAR(255) NOT NULL, name VARCHAR(255), value INTEGER, FK_FOR_AEJB_1X1_BI_BTOB VARCHAR(255), PRIMARY KEY (id)) !
CREATE INDEX I_BJ1X1B_BTB_A1 ON BEJB_1X1_BI_BTOB (FK_FOR_AEJB_1X1_BI_BTOB) !
-- ALTER TABLE BEJB_1X1_BI_BTOB ADD CONSTRAINT FK_FOR_AEJB_1X1_BI FOREIGN KEY (FK_FOR_AEJB_1X1_BI_BTOB) REFERENCES AEJB_1X1_BI_BTOB (ID) !
-- =======================================================================
-- com.sun.ts.tests.ejb30.persistence.entitytest.cascadeall.oneXmany
DROP TABLE AEJB_1XM_BI_BTOB !
CREATE TABLE AEJB_1XM_BI_BTOB (id VARCHAR(255) NOT NULL, name VARCHAR(255), value INTEGER, PRIMARY KEY (id)) !
DROP TABLE BEJB_1XM_BI_BTOB !
CREATE TABLE BEJB_1XM_BI_BTOB (id VARCHAR(255) NOT NULL, name VARCHAR(255), value INTEGER, FK_FOR_AEJB_1XM_BI_BTOB VARCHAR(255), PRIMARY KEY (id)) !
CREATE INDEX I_BJ1XMTB_A1 ON BEJB_1XM_BI_BTOB (FK_FOR_AEJB_1XM_BI_BTOB) !
-- ALTER TABLE BEJB_1XM_BI_BTOB ADD CONSTRAINT FK_FOR_AEJB_1XM_BI FOREIGN KEY (FK_FOR_AEJB_1XM_BI_BTOB) REFERENCES AEJB_1XM_BI_BTOB (ID) !
-- =======================================================================
-- com.sun.ts.tests.ejb30.persistence.entitytest.cascadeall.manyXone
DROP TABLE AEJB_MX1_UNI_BTOB !
CREATE TABLE AEJB_MX1_UNI_BTOB (id VARCHAR(255) NOT NULL, name VARCHAR(255), value INTEGER, PRIMARY KEY (id)) !
DROP TABLE BEJB_MX1_UNI_BTOB !
CREATE TABLE BEJB_MX1_UNI_BTOB (id VARCHAR(255) NOT NULL, name VARCHAR(255), value INTEGER, FK_FOR_AEJB_MX1_UNI_BTOB VARCHAR(255), PRIMARY KEY (id)) !
CREATE INDEX I_BJMX1TB_A1 ON BEJB_MX1_UNI_BTOB (FK_FOR_AEJB_MX1_UNI_BTOB) !
-- ALTER TABLE BEJB_MX1_UNI_BTOB ADD CONSTRAINT FK_FOR_AEJB_MX1_UN FOREIGN KEY (FK_FOR_AEJB_MX1_UNI_BTOB) REFERENCES AEJB_MX1_UNI_BTOB (ID) !
-- =======================================================================
-- com/sun/ts/tests/ejb30/persistence/entitytest/biginteger
DROP TABLE A_BIGINTEGER !
CREATE TABLE A_BIGINTEGER ( ID VARCHAR(255), NAME VARCHAR(255) , VALUE INT, BASICINTEGER INT, BASICSHORT SMALLINT, BASICBIGSHORT SMALLINT, BASICFLOAT FLOAT, BASICBIGFLOAT FLOAT, BASICLONG BIGINT, BASICBIGLONG BIGINT, BASICDOUBLE DOUBLE, BASICBIGDOUBLE DOUBLE, BASICCHAR INTEGER, BASICCHARARRAY VARCHAR(448), BASICBIGCHARARRAY VARCHAR(448), BASICBYTEARRAY LONG VARCHAR FOR BIT DATA, BASICBIGBYTEARRAY LONG VARCHAR FOR BIT DATA, BASICBIGINTEGER DECIMAL(18,0) PRIMARY KEY NOT NULL, BASICBIGDECIMAL DECIMAL(18,0), BASICDATE DATE, BASICTIME TIME, BASICCALENDAR DATE, BASICTIMESTAMP TIMESTAMP ) !
-- =======================================================================
-- com/sun/ts/tests/ejb30/persistence/entitytest/bigdecimal
DROP TABLE A_BIGDECIMAL !
CREATE TABLE A_BIGDECIMAL ( ID VARCHAR(255), NAME VARCHAR(255) , VALUE INT, BASICINTEGER INT, BASICSHORT SMALLINT, BASICBIGSHORT SMALLINT, BASICFLOAT FLOAT, BASICBIGFLOAT FLOAT, BASICLONG BIGINT, BASICBIGLONG BIGINT, BASICDOUBLE DOUBLE, BASICBIGDOUBLE DOUBLE, BASICCHAR INTEGER, BASICCHARARRAY VARCHAR(448), BASICBIGCHARARRAY VARCHAR(448), BASICBYTEARRAY LONG VARCHAR FOR BIT DATA, BASICBIGBYTEARRAY LONG VARCHAR FOR BIT DATA, BASICBIGINTEGER DECIMAL(18,0), BASICBIGDECIMAL DECIMAL(18,0) PRIMARY KEY NOT NULL, BASICDATE DATE, BASICTIME TIME, BASICCALENDAR DATE, BASICTIMESTAMP TIMESTAMP ) !

View File

@ -0,0 +1,36 @@
-- =======================================================================
-- com.sun.ts.tests.ejb30.persistence.entitytest.cascadeall.oneXone
DROP TABLE AEJB_1X1_BI_BTOB ;
CREATE TABLE AEJB_1X1_BI_BTOB (id VARCHAR(255) NOT NULL, name VARCHAR(255), value INTEGER, PRIMARY KEY (id)) ;
DROP TABLE BEJB_1X1_BI_BTOB ;
CREATE TABLE BEJB_1X1_BI_BTOB (id VARCHAR(255) NOT NULL, name VARCHAR(255), value INTEGER, FK_FOR_AEJB_1X1_BI_BTOB VARCHAR(255), PRIMARY KEY (id)) ;
CREATE INDEX I_BJ1X1B_BTB_A1 ON BEJB_1X1_BI_BTOB (FK_FOR_AEJB_1X1_BI_BTOB) ;
-- ALTER TABLE BEJB_1X1_BI_BTOB ADD CONSTRAINT FK_FOR_AEJB_1X1_BI FOREIGN KEY (FK_FOR_AEJB_1X1_BI_BTOB) REFERENCES AEJB_1X1_BI_BTOB (ID) ;
-- =======================================================================
-- com.sun.ts.tests.ejb30.persistence.entitytest.cascadeall.oneXmany
DROP TABLE AEJB_1XM_BI_BTOB ;
CREATE TABLE AEJB_1XM_BI_BTOB (id VARCHAR(255) NOT NULL, name VARCHAR(255), value INTEGER, PRIMARY KEY (id)) ;
DROP TABLE BEJB_1XM_BI_BTOB ;
CREATE TABLE BEJB_1XM_BI_BTOB (id VARCHAR(255) NOT NULL, name VARCHAR(255), value INTEGER, FK_FOR_AEJB_1XM_BI_BTOB VARCHAR(255), PRIMARY KEY (id)) ;
CREATE INDEX I_BJ1XMTB_A1 ON BEJB_1XM_BI_BTOB (FK_FOR_AEJB_1XM_BI_BTOB) ;
-- ALTER TABLE BEJB_1XM_BI_BTOB ADD CONSTRAINT FK_FOR_AEJB_1XM_BI FOREIGN KEY (FK_FOR_AEJB_1XM_BI_BTOB) REFERENCES AEJB_1XM_BI_BTOB (ID) ;
-- =======================================================================
-- com.sun.ts.tests.ejb30.persistence.entitytest.cascadeall.manyXone
DROP TABLE AEJB_MX1_UNI_BTOB ;
CREATE TABLE AEJB_MX1_UNI_BTOB (id VARCHAR(255) NOT NULL, name VARCHAR(255), value INTEGER, PRIMARY KEY (id)) ;
DROP TABLE BEJB_MX1_UNI_BTOB ;
CREATE TABLE BEJB_MX1_UNI_BTOB (id VARCHAR(255) NOT NULL, name VARCHAR(255), value INTEGER, FK_FOR_AEJB_MX1_UNI_BTOB VARCHAR(255), PRIMARY KEY (id)) ;
CREATE INDEX I_BJMX1TB_A1 ON BEJB_MX1_UNI_BTOB (FK_FOR_AEJB_MX1_UNI_BTOB) ;
-- ALTER TABLE BEJB_MX1_UNI_BTOB ADD CONSTRAINT FK_FOR_AEJB_MX1_UN FOREIGN KEY (FK_FOR_AEJB_MX1_UNI_BTOB) REFERENCES AEJB_MX1_UNI_BTOB (ID) ;
-- =======================================================================
-- com/sun/ts/tests/ejb30/persistence/entitytest/biginteger
DROP TABLE A_BIGINTEGER ;
CREATE TABLE A_BIGINTEGER ( ID VARCHAR(255), NAME VARCHAR(255) , VALUE INT, BASICINTEGER INT, BASICSHORT SMALLINT, BASICBIGSHORT SMALLINT, BASICFLOAT FLOAT, BASICBIGFLOAT FLOAT, BASICLONG BIGINT, BASICBIGLONG BIGINT, BASICDOUBLE DOUBLE, BASICBIGDOUBLE DOUBLE, BASICCHAR INTEGER, BASICCHARARRAY VARCHAR(448), BASICBIGCHARARRAY VARCHAR(448), BASICBYTEARRAY LONG VARCHAR FOR BIT DATA, BASICBIGBYTEARRAY LONG VARCHAR FOR BIT DATA, BASICBIGINTEGER DECIMAL(18,0) PRIMARY KEY NOT NULL, BASICBIGDECIMAL DECIMAL(18,0), BASICDATE DATE, BASICTIME TIME, BASICCALENDAR DATE, BASICTIMESTAMP TIMESTAMP ) ;
-- =======================================================================
-- com/sun/ts/tests/ejb30/persistence/entitytest/bigdecimal
DROP TABLE A_BIGDECIMAL ;
CREATE TABLE A_BIGDECIMAL ( ID VARCHAR(255), NAME VARCHAR(255) , VALUE INT, BASICINTEGER INT, BASICSHORT SMALLINT, BASICBIGSHORT SMALLINT, BASICFLOAT FLOAT, BASICBIGFLOAT FLOAT, BASICLONG BIGINT, BASICBIGLONG BIGINT, BASICDOUBLE DOUBLE, BASICBIGDOUBLE DOUBLE, BASICCHAR INTEGER, BASICCHARARRAY VARCHAR(448), BASICBIGCHARARRAY VARCHAR(448), BASICBYTEARRAY LONG VARCHAR FOR BIT DATA, BASICBIGBYTEARRAY LONG VARCHAR FOR BIT DATA, BASICBIGINTEGER DECIMAL(18,0), BASICBIGDECIMAL DECIMAL(18,0) PRIMARY KEY NOT NULL, BASICDATE DATE, BASICTIME TIME, BASICCALENDAR DATE, BASICTIMESTAMP TIMESTAMP ) ;

View File

@ -23,7 +23,7 @@
the TCK, config and patches zip files located at:
${user.home}/.m2/privaterepos/jpatck-2.0_15-Aug-2011.zip
${user.home}/.m2/privaterepos/jpatck-2.0_15-Aug-2011_config.zip
${user.home}/.m2/privaterepos/jpatck-2.0_15-Aug-2011_config.zip (may not exist)
If you have that file in a different location, it can be specified with
the "tck.zip" and "tck_patches.zip" system property.
@ -58,12 +58,11 @@
<property name="tck.zip" value="${LOCAL_M2_REPO}/../privaterepos/${tck.level}.zip" />
<available property="tck.available" file="${tck.zip}" />
<fail unless="tck.available">The TCK file specified in the "tck.zip" system property (${tck.zip}) does not exist. This file must be downloaded separately in order to be able to run the JPA 2.0 TCK</fail>
<!--
<property name="tck_config.zip" value="${LOCAL_M2_REPO}/../privaterepos/${tck.level}_config.zip" />
<available property="tck_config.available" file="${tck_config.zip}" />
<fail unless="tck_config.available">The TCK config file specified in the "tck_config.zip" system property (${tck_config.zip}) does not exist. This file must be downloaded separately in order to be able to run the JPA 2.0 TCK</fail>
<!--
<property name="tck_patches.zip" value="${LOCAL_M2_REPO}/../privaterepos/${tck.level}_patches.zip" />
<available property="tck_patches.available" file="${tck_patches.zip}" />
<fail unless="tck_patches.available">The TCK patches file specified in the "tck_patches.zip" system property (${tck_patches.zip}) does not exist. This file must be downloaded separately in order to be able to run the JPA 2.0 TCK</fail>
@ -71,8 +70,8 @@
<delete dir="${tck.dir}" />
<unzip overwrite="false" src="${tck.zip}" dest="${tck.base}" />
<unzip overwrite="true" src="${tck_config.zip}" dest="${tck.base}" />
<!--
<unzip overwrite="true" src="${tck_config.zip}" dest="${tck.base}" />
<unzip overwrite="true" src="${tck_patches.zip}" dest="${tck.base}" />
-->
<copy overwrite="true"
@ -91,11 +90,11 @@
Description: This updates the TCK configuration for OpenJPA.
-->
<target name="setup">
<property name="db.name" value="derby" />
<property name="db.driver" value="org.apache.derby.jdbc.EmbeddedDriver" />
<property name="db.url" value="jdbc:derby:derby-database;create=true" />
<property name="db.username" value="nousername" />
<property name="db.password" value="nopassword" />
<property name="db.name" value="${tck.db.name}" />
<property name="db.driver" value="${connection.driver.name}" />
<property name="db.url" value="${connection.url}" />
<property name="db.username" value="${connection.username}" />
<property name="db.password" value="${connection.password}" />
<property name="openjpa.Log" value="DefaultLevel=TRACE" />
@ -117,11 +116,21 @@ openjpa.FetchBatchSize: -1
openjpa.Compatibility: StrictIdentityValues=true
openjpa.Sequence: time
openjpa.Log: ${openjpa.Log}
openjpa.jdbc.DBDictionary: StoreCharsAsNumbers=true
openjpa.jdbc.DBDictionary: NumericTypeName="DECIMAL(18,2)"
# openjpa.jdbc.DBDictionary: StoreCharsAsNumbers=true
# openjpa.jdbc.DBDictionary: (StoreCharsAsNumbers=true,NumericTypeName=DECIMAL)
openjpa.jdbc.SchemaFactory: native(ForeignKeys=true)
openjpa.jdbc.SynchronizeMappings: buildSchema(ForeignKeys=true)
openjpa.ConnectionFactoryProperties: PrintParameters=True
</echo>
<path id="javart">
<fileset dir="${java.home}/lib">
<include name="**/*.jar" />
</fileset>
</path>
<pathconvert property="javart.property" refid="javart" />
<!-- Append OpenJPA-specific configuration -->
<property name="jpatck.config" value="${tck.dir}/bin/ts.jte" />
@ -144,13 +153,20 @@ toplink.properties=${toplink.properties}
# Need to specify java.* classes, both in Windows/UNIX locations as well as Mac.
# This includes a few different possible locations; only one of them needs to
# actually work for a given environment.
sigTestClasspath=${JAVA_HOME}/lib/rt.jar${path.separator}${JAVA_HOME}/jre/lib/rt.jar${path.separator}${JAVA_HOME}/../Classes/classes.jar${path.separator}$${jpa.classes}
sigTestClasspath=${javart.property}${path.separator}${cp.property}
persistence.unit.properties.file.full.path=${provider.properties}
javax.persistence.jdbc.driver: ${db.driver}
javax.persistence.jdbc.url: ${db.url}
javax.persistence.jdbc.user: ${db.username}
javax.persistence.jdbc.password: ${db.password}
database.driver=${db.driver}
database.url=${db.url}
database.user=${db.username}
database.passwd=${db.password}
database.url=${db.url}
database.driver=${db.driver}
databaseName=${db.name}
jdbc.lib.classpath=${cp.test.classpath}
# disable initdb.xml table creation
create.cmp.tables=false
</echo>
@ -171,6 +187,7 @@ databaseName=${db.name}
<fileset dir="../../openjpa/target">
<include name="*.jar" />
<exclude name="*-sources.jar" />
<exclude name="*-shaded.jar" />
<exclude name="original-*.jar" />
<exclude name="*-tests.jar" />
<exclude name="*-javadoc.jar" />
@ -180,6 +197,10 @@ databaseName=${db.name}
<property name="agent.properties" value="" />
<echo>AGENT: ${agent}${agent.properties}</echo>
<!-- Use the following values to start Eclipse remote debug
<property name="DEBUG" value="-Djava.compiler=NONE -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=7777" />
-->
<property name="DEBUG" value="" />
<!--
Add in a javaagent argument (optional in JPA2 TCK.)
Also, we need to specify the default MetaDataFactory
@ -187,7 +208,7 @@ databaseName=${db.name}
persistent classes to work (like the SignatureTest)
-->
<replace file="${jpatck.config}">
<replacefilter token="-Ddeliverable.class=${deliverable.class}" value="-Ddeliverable.class=${deliverable.class} -javaagent:${agent}${agent.properties} -Dopenjpa.MetaDataFactory=jpa(DefaultAccessType=PROPERTY)"/>
<replacefilter token="-Ddeliverable.class=${deliverable.class}" value="-Ddeliverable.class=${deliverable.class} -javaagent:${agent}${agent.properties} ${DEBUG} -Dopenjpa.MetaDataFactory=jpa(DefaultAccessType=PROPERTY)"/>
</replace>
<!-- Fix path for java.security.policy -->
@ -288,7 +309,7 @@ databaseName=${db.name}
Input: jpatck.pkg.dir System property defines a commna-spearated list of test cases to be run.
If not set or set to empty string, all tck tests will be exercised.
Note: Beaware if jpatck.pkg.dir includes pluggability test in the dir hierarchy, the pluggability
test will fail (5 failures) due to [enable|disable].ts.persistence.provider targets are
test will fail (5 failures) due to [enable|disable].ts.persistence.provider targets are
not invoked, which is required for the pluggability tests.
-->
<target name="run-tck">
@ -317,31 +338,48 @@ databaseName=${db.name}
<tsant dir="${tck.dir}/bin" buildfile="${tck.dir}/bin/initdb.xml" target="init.database" />
<echo>TCK initdb.xml returned result=${tsant.result}</echo>
<!-- Database table set up -->
<!-- OpenJPA relies on SynchronizeMappings to create the database tables...
... except in a couple of cases where we will pre-create the tables. -->
<echo>Calling OpenJPA create.openjpa.sql.xml</echo>
<ant antfile="${basedir}/sql/create.openjpa.sql.xml" inheritRefs="true" />
<!-- We are attempting to change TCK build.xml;s incorrect property name
for the pluggability test enablement... -->
<replace file="${tck.dir}/bin/build.xml">
<replacefilter token="persistence.properties.file"
value="persistence.unit.properties.file.full.path"/>
</replace>
<replace file="${tck.dir}/bin/build.xml">
<replacetoken><![CDATA[<replaceregexp file="${bin.dir}/ts.jte"]]></replacetoken>
<replacevalue><![CDATA[<replaceregexp flags="g" file="${bin.dir}/ts.jte"]]></replacevalue>
</replace>
<property name="jpatck.run.tmo" value="7200000" />
<!-- now run the TCK -->
<if>
<and>
<and>
<isset property="jpatck.pkg.dir" />
<not>
<length string="${jpatck.pkg.dir}" trim="true" length="0" />
</not>
<not>
<length string="${jpatck.pkg.dir}" trim="true" length="0" />
</not>
</and>
<then>
<for list="${jpatck.pkg.dir}" param="for.test" trim="true">
<sequential>
<if>
<sequential>
<if>
<contains string="@{for.test}" substring="pluggability"/>
<then>
<echo>Calling enable.ts.persistence.provider for pluggability test.</echo>
<tsant buildfile="${tck.dir}/bin/build.xml" target="enable.ts.persistence.provider" />
</then>
</if>
<echo>Calling TCK build.xml for pkg.dir=@{for.test}</echo>
<property name="dir" value="${tck.dir}/src/@{for.test}" />
<tsant dir="${dir}" buildfile="${dir}/build.xml" target="runclient" tmo="${jpatck.run.tmo}" />
<if>
<if>
<contains string="@{for.test}" substring="pluggability"/>
<then>
<echo>Calling disable.ts.persistence.provider for pluggability test.</echo>
@ -349,7 +387,7 @@ databaseName=${db.name}
</then>
</if>
</sequential>
</for>
</for>
</then>
<else>
<echo>Calling TCK build.xml for ALL tests</echo>

View File

@ -366,6 +366,8 @@
<connection.url>jdbc:derby:target/database/openjpa-derby-database;create=true</connection.url>
<connection.username />
<connection.password />
<!-- TCK specific properties -->
<tck.db.name>derby</tck.db.name>
</properties>
</profile>