From 28d89e95ba5abb2ff3b0cef996b541bd7eeb41e5 Mon Sep 17 00:00:00 2001 From: Albert Lee Date: Tue, 12 Feb 2013 22:09:28 +0000 Subject: [PATCH] OPENJPA-2326 - Enable 20x 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.0.x@1445412 13f79535-47bb-0310-9956-ffa450edef68 --- openjpa-integration/tck/pom.xml | 116 +++++++++++++++++- .../tck/sql/create.openjpa.sql.xml | 65 ++++++++++ openjpa-integration/tck/sql/db2.sql | 36 ++++++ openjpa-integration/tck/sql/derby.sql | 36 ++++++ openjpa-integration/tck/tck2-20110815.xml | 88 +++++++++---- pom.xml | 14 ++- 6 files changed, 321 insertions(+), 34 deletions(-) create mode 100644 openjpa-integration/tck/sql/create.openjpa.sql.xml create mode 100644 openjpa-integration/tck/sql/db2.sql create mode 100644 openjpa-integration/tck/sql/derby.sql diff --git a/openjpa-integration/tck/pom.xml b/openjpa-integration/tck/pom.xml index 146b4abdf..a3a6a28b4 100644 --- a/openjpa-integration/tck/pom.xml +++ b/openjpa-integration/tck/pom.xml @@ -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 @@ DefaultLevel=WARN - 20101205 + 20110815 @@ -104,7 +104,10 @@ + + + tck2-profile @@ -186,9 +189,22 @@ + + + + + + + + + + + + + @@ -208,10 +224,17 @@ ${project.version} + + + + + + + tck-profile @@ -437,7 +460,94 @@ databaseName=${db.name} ${project.version} + + + + + + + + test-db2-jcc + + + test-db2-jcc + + + + + ${db2.groupid} + ${db2.driver.artifactid} + ${db2.version} + test + + + ${db2.groupid} + ${db2.license.artifactid} + ${db2.version} + test + + + + http://not.a.real.repository + com.ibm.db2 + jcc-driver + jcc-license + 9.5 + com.ibm.db2.jcc.DB2Driver + jdbc:db2://localhost:50000/tck + ${openjpa.db2.url} + ${openjpa.db2.username} + ${openjpa.db2.password} + + db2 + + + + db2.repository + DB2 Repository + ${db2.maven.repo} + default + + false + + + true + ignore + + + + + diff --git a/openjpa-integration/tck/sql/create.openjpa.sql.xml b/openjpa-integration/tck/sql/create.openjpa.sql.xml new file mode 100644 index 000000000..f1fe00ccf --- /dev/null +++ b/openjpa-integration/tck/sql/create.openjpa.sql.xml @@ -0,0 +1,65 @@ + + + + + + + Creating OpenJPA specific sql for JPA 2.0 TCK tests + + + Create TCK specific database tables returned result=${tsant.result} + + + + + + databaseName=${databaseName} + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/openjpa-integration/tck/sql/db2.sql b/openjpa-integration/tck/sql/db2.sql new file mode 100644 index 000000000..e369008d5 --- /dev/null +++ b/openjpa-integration/tck/sql/db2.sql @@ -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 ) ! diff --git a/openjpa-integration/tck/sql/derby.sql b/openjpa-integration/tck/sql/derby.sql new file mode 100644 index 000000000..4d2eb9251 --- /dev/null +++ b/openjpa-integration/tck/sql/derby.sql @@ -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 ) ; diff --git a/openjpa-integration/tck/tck2-20110815.xml b/openjpa-integration/tck/tck2-20110815.xml index 6bc80af4b..c2012177c 100644 --- a/openjpa-integration/tck/tck2-20110815.xml +++ b/openjpa-integration/tck/tck2-20110815.xml @@ -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 @@ 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 - + - - - - - + + + + + @@ -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 + + + + + + + @@ -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 @@ -171,6 +187,7 @@ databaseName=${db.name} + @@ -180,6 +197,10 @@ databaseName=${db.name} AGENT: ${agent}${agent.properties} + + - + @@ -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. --> @@ -317,31 +338,48 @@ databaseName=${db.name} TCK initdb.xml returned result=${tsant.result} + + + Calling OpenJPA create.openjpa.sql.xml + + + + + + + + + + + - + - - - + + + - - + + Calling enable.ts.persistence.provider for pluggability test. - + Calling TCK build.xml for pkg.dir=@{for.test} - - + + Calling disable.ts.persistence.provider for pluggability test. @@ -349,7 +387,7 @@ databaseName=${db.name} - + Calling TCK build.xml for ALL tests diff --git a/pom.xml b/pom.xml index 31537c37d..db19b2051 100644 --- a/pom.xml +++ b/pom.xml @@ -15,10 +15,10 @@ "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. + under the License. --> - 4.0.0 @@ -262,10 +262,10 @@ - + --> javadoc-profile @@ -421,6 +421,8 @@ jdbc:derby:target/database/openjpa-derby-database;create=true + + derby @@ -542,7 +544,7 @@ org.apache.geronimo.specs geronimo-validation_1.0_spec 1.1 - + org.apache.bval org.apache.bval.bundle