Index: cpactf/src/test/ddl/org/castor/cpa/test/test31/progress.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test31/progress.sql (revision 0)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test31/progress.sql (revision 0)
@@ -0,0 +1,46 @@
+DROP TABLE test31_relation;
+DROP TABLE test31_extends2;
+DROP TABLE test31_extends1;
+DROP TABLE test31_related;
+DROP TABLE test31_persistent;
+DROP TABLE test31_group;
+
+CREATE TABLE test31_group (
+ id numeric(10,0) not null,
+ value1 varchar(200) not null
+);
+CREATE UNIQUE INDEX test31_group_pk ON test31_group ( id );
+
+CREATE TABLE test31_persistent (
+ id integer not null,
+ ctime timestamp without time zone not null,
+ mtime timestamp without time zone null,
+ value1 varchar(200) not null,
+ parent_id integer null,
+ group_id numeric(10,0) not null
+);
+CREATE UNIQUE INDEX test31_persistent_pk ON test31_persistent ( id );
+
+CREATE TABLE test31_related (
+ id integer not null,
+ persist_id integer not null
+);
+CREATE UNIQUE INDEX test31_related_pk ON test31_related ( id );
+
+CREATE TABLE test31_extends1 (
+ ident integer not null,
+ ext integer not null
+);
+CREATE UNIQUE INDEX test31_extends1_pk ON test31_extends1 ( ident );
+
+CREATE TABLE test31_extends2 (
+ id integer not null,
+ ext integer not null
+);
+CREATE UNIQUE INDEX test31_extends2_pk ON test31_extends2 ( id );
+
+CREATE TABLE test31_relation (
+ id1 integer not null,
+ id2 integer not null
+);
+CREATE UNIQUE INDEX test31_relation_pk ON test31_relation ( id1, id2 );
Index: cpactf/src/test/ddl/org/castor/cpa/test/test31/mssql.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test31/mssql.sql (revision 0)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test31/mssql.sql (revision 0)
@@ -0,0 +1,76 @@
+DROP TABLE test31_relation
+GO
+DROP TABLE test31_extends2
+GO
+DROP TABLE test31_extends1
+GO
+DROP TABLE test31_related
+GO
+DROP TABLE test31_persistent
+GO
+DROP TABLE test31_group
+GO
+
+CREATE TABLE test31_group (
+ id numeric(10,0) not null,
+ value1 varchar(200) not null
+)
+GO
+CREATE UNIQUE INDEX test31_group_pk ON test31_group ( id )
+GO
+GRANT ALL ON test31_group TO test
+GO
+
+CREATE TABLE test31_persistent (
+ id integer not null,
+ ctime datetime not null,
+ mtime datetime null,
+ value1 varchar(200) not null,
+ parent_id integer null,
+ group_id numeric(10,0) not null
+)
+GO
+CREATE UNIQUE INDEX test31_persistent_pk ON test31_persistent ( id )
+GO
+GRANT ALL ON test31_persistent TO test
+GO
+
+CREATE TABLE test31_related (
+ id integer not null,
+ persist_id integer not null
+)
+GO
+CREATE UNIQUE INDEX test31_related_pk ON test31_related ( id )
+GO
+GRANT ALL ON test31_related TO test
+GO
+
+CREATE TABLE test31_extends1 (
+ ident integer not null,
+ ext integer not null
+)
+GO
+CREATE UNIQUE INDEX test31_extends1_pk ON test31_extends1 ( ident )
+GO
+GRANT ALL ON test31_extends1 TO test
+GO
+
+CREATE TABLE test31_extends2 (
+ id integer not null,
+ ext integer not null
+)
+GO
+CREATE UNIQUE INDEX test31_extends2_pk ON test31_extends2 ( id )
+GO
+GRANT ALL ON test31_extends2 TO test
+GO
+
+CREATE TABLE test31_relation (
+ id1 integer not null,
+ id2 integer not null
+)
+GO
+CREATE UNIQUE INDEX test31_relation_pk ON test31_relation ( id1, id2 )
+GO
+GRANT ALL ON test31_relation TO test
+GO
Index: cpactf/src/test/ddl/org/castor/cpa/test/test31/sybase.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test31/sybase.sql (revision 0)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test31/sybase.sql (revision 0)
@@ -0,0 +1,76 @@
+DROP TABLE test31_relation
+GO
+DROP TABLE test31_extends2
+GO
+DROP TABLE test31_extends1
+GO
+DROP TABLE test31_related
+GO
+DROP TABLE test31_persistent
+GO
+DROP TABLE test31_group
+GO
+
+CREATE TABLE test31_group (
+ id numeric(10,0) not null,
+ value1 varchar(200) not null
+)
+GO
+CREATE UNIQUE INDEX test31_group_pk ON test31_group ( id )
+GO
+GRANT ALL ON test31_group TO test
+GO
+
+CREATE TABLE test31_persistent (
+ id integer not null,
+ ctime datetime not null,
+ mtime datetime null,
+ value1 varchar(200) not null,
+ parent_id integer null,
+ group_id numeric(10,0) not null
+)
+GO
+CREATE UNIQUE INDEX test31_persistent_pk ON test31_persistent ( id )
+GO
+GRANT ALL ON test31_persistent TO test
+GO
+
+CREATE TABLE test31_related (
+ id integer not null,
+ persist_id integer not null
+)
+GO
+CREATE UNIQUE INDEX test31_related_pk ON test31_related ( id )
+GO
+GRANT ALL ON test31_related TO test
+GO
+
+CREATE TABLE test31_extends1 (
+ ident integer not null,
+ ext integer not null
+)
+GO
+CREATE UNIQUE INDEX test31_extends1_pk ON test31_extends1 ( ident )
+GO
+GRANT ALL ON test31_extends1 TO test
+GO
+
+CREATE TABLE test31_extends2 (
+ id integer not null,
+ ext integer not null
+)
+GO
+CREATE UNIQUE INDEX test31_extends2_pk ON test31_extends2 ( id )
+GO
+GRANT ALL ON test31_extends2 TO test
+GO
+
+CREATE TABLE test31_relation (
+ id1 integer not null,
+ id2 integer not null
+)
+GO
+CREATE UNIQUE INDEX test31_relation_pk ON test31_relation ( id1, id2 )
+GO
+GRANT ALL ON test31_relation TO test
+GO
Index: cpactf/src/test/ddl/org/castor/cpa/test/test30/oracle.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test30/oracle.sql (revision 8022)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test30/oracle.sql (working copy)
@@ -6,23 +6,18 @@
value1 varchar(200) not null,
value2 varchar(200)
);
-
-CREATE UNIQUE INDEX test30_entity_pk on test30_entity ( id );
+CREATE UNIQUE INDEX test30_entity_pk ON test30_entity ( id );
CREATE TABLE test30_extends (
id int not null,
value3 varchar(200) null,
value4 varchar(200) null
);
-
-CREATE UNIQUE INDEX test30_extends_pk on test30_extends ( id );
-
+CREATE UNIQUE INDEX test30_extends_pk ON test30_extends ( id );
DROP TABLE test30_group CASCADE CONSTRAINTS;
-
CREATE TABLE test30_group (
id numeric(10,0) not null,
value1 varchar(200) not null
);
-
-CREATE UNIQUE INDEX test30_group_pk on test30_group ( id );
+CREATE UNIQUE INDEX test30_group_pk ON test30_group ( id );
Index: cpactf/src/test/ddl/org/castor/cpa/test/test31/mysql.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test31/mysql.sql (revision 8022)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test31/mysql.sql (working copy)
@@ -9,8 +9,7 @@
id numeric(10,0) not null,
value1 varchar(200) not null
);
-
-CREATE UNIQUE INDEX test31_group_pk on test31_group ( id );
+CREATE UNIQUE INDEX test31_group_pk ON test31_group ( id );
CREATE TABLE test31_persistent (
id integer not null,
@@ -20,33 +19,28 @@
parent_id integer null,
group_id numeric(10,0) not null
);
-
-CREATE UNIQUE INDEX test31_persistent_pk on test31_persistent ( id );
+CREATE UNIQUE INDEX test31_persistent_pk ON test31_persistent ( id );
CREATE TABLE test31_related (
id integer not null,
persist_id integer not null
);
-
-CREATE UNIQUE INDEX test31_related_pk on test31_related ( id );
+CREATE UNIQUE INDEX test31_related_pk ON test31_related ( id );
CREATE TABLE test31_extends1 (
ident integer not null,
ext integer not null
);
-
-CREATE UNIQUE INDEX test31_extends1_pk on test31_extends1 ( ident );
+CREATE UNIQUE INDEX test31_extends1_pk ON test31_extends1 ( ident );
CREATE TABLE test31_extends2 (
id integer not null,
ext integer not null
);
-
-CREATE UNIQUE INDEX test31_extends2_pk on test31_extends2 ( id );
+CREATE UNIQUE INDEX test31_extends2_pk ON test31_extends2 ( id );
CREATE TABLE test31_relation (
id1 integer not null,
id2 integer not null
);
-
-CREATE UNIQUE INDEX test31_relation_pk on test31_relation ( id1, id2 );
+CREATE UNIQUE INDEX test31_relation_pk ON test31_relation ( id1, id2 );
Index: cpactf/src/test/ddl/org/castor/cpa/test/test30/sapdb.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test30/sapdb.sql (revision 0)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test30/sapdb.sql (revision 0)
@@ -0,0 +1,32 @@
+DROP TABLE test30_extends
+//
+DROP TABLE test30_entity
+//
+
+CREATE TABLE test30_entity (
+ id int not null,
+ value1 varchar(200) not null,
+ value2 varchar(200)
+)
+//
+CREATE UNIQUE INDEX test30_entity_pk ON test30_entity ( id )
+//
+
+CREATE TABLE test30_extends (
+ id int not null,
+ value3 varchar(200) null,
+ value4 varchar(200) null
+)
+//
+CREATE UNIQUE INDEX test30_extends_pk ON test30_extends ( id )
+//
+
+DROP TABLE test30_group
+//
+CREATE TABLE test30_group (
+ id fixed(10,0) not null,
+ value1 varchar(200) not null
+)
+//
+CREATE UNIQUE INDEX test30_group_pk ON test30_group ( id )
+//
Index: cpactf/src/test/ddl/org/castor/cpa/test/test30/postgresql.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test30/postgresql.sql (revision 0)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test30/postgresql.sql (revision 0)
@@ -0,0 +1,23 @@
+DROP TABLE test30_extends;
+DROP TABLE test30_entity;
+
+CREATE TABLE test30_entity (
+ id int not null,
+ value1 varchar(200) not null,
+ value2 varchar(200)
+);
+CREATE UNIQUE INDEX test30_entity_pk ON test30_entity ( id );
+
+CREATE TABLE test30_extends (
+ id int not null,
+ value3 varchar(200) null,
+ value4 varchar(200) null
+);
+CREATE UNIQUE INDEX test30_extends_pk ON test30_extends ( id );
+
+DROP TABLE test30_group;
+CREATE TABLE test30_group (
+ id numeric(10,0) not null,
+ value1 varchar(200) not null
+);
+CREATE UNIQUE INDEX test30_group_pk ON test30_group ( id );
Index: cpactf/src/old/java/ctf/jdo/tc3x/TestOqlExtends.java
===================================================================
--- cpactf/src/old/java/ctf/jdo/tc3x/TestOqlExtends.java (revision 8022)
+++ cpactf/src/old/java/ctf/jdo/tc3x/TestOqlExtends.java (working copy)
@@ -1,240 +0,0 @@
-/**
- * Redistribution and use of this software and associated documentation
- * ("Software"), with or without modification, are permitted provided
- * that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright
- * statements and notices. Redistributions must also contain a
- * copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the
- * above copyright notice, this list of conditions and the
- * following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. The name "Exolab" must not be used to endorse or promote
- * products derived from this Software without prior written
- * permission of Intalio, Inc. For written permission,
- * please contact info@exolab.org.
- *
- * 4. Products derived from this Software may not be called "Exolab"
- * nor may "Exolab" appear in their names without prior written
- * permission of Intalio, Inc. Exolab is a registered
- * trademark of Intalio, Inc.
- *
- * 5. Due credit should be given to the Exolab Project
- * (http://www.exolab.org/).
- *
- * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
- * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Copyright 1999 (C) Intalio, Inc. All Rights Reserved.
- */
-package ctf.jdo.tc3x;
-
-import harness.CastorTestCase;
-import harness.TestHarness;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.util.Date;
-
-import jdo.JDOCategory;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.castor.jdo.util.JDOUtils;
-import org.exolab.castor.jdo.Database;
-import org.exolab.castor.jdo.OQLQuery;
-import org.exolab.castor.jdo.PersistenceException;
-import org.exolab.castor.jdo.QueryResults;
-
-public final class TestOqlExtends extends CastorTestCase {
- private static final Log LOG = LogFactory.getLog(TestOqlExtends.class);
-
- private JDOCategory _category;
- private Database _db;
-
- public TestOqlExtends(final TestHarness category) {
- super(category, "TC31", "OQL queries for extends");
- _category = (JDOCategory) category;
- }
-
- public void setUp() throws PersistenceException {
- _db = _category.getDatabase();
-
- // XXX [SMH]: We need to clear some tables because "TC23 ManyToMany"
- // is doing something unwise, see bug 1445.
- Connection conn = null;
- try {
- conn = _category.getJDBCConnection();
- conn.setAutoCommit(false);
- conn.createStatement().executeUpdate("DELETE FROM tc3x_extends2");
- conn.createStatement().executeUpdate("DELETE FROM tc3x_extends1");
- conn.createStatement().executeUpdate("DELETE FROM tc3x_persistent");
- conn.commit();
- } catch (SQLException ex) {
- ex.printStackTrace();
- } finally {
- JDOUtils.closeConnection (conn);
- }
- }
-
- public void runTest() throws Exception {
- OQLQuery oqlAll;
- OQLQuery oql;
- QueryResults res;
- int cnt;
-
- // remove old test objects
- _db.begin();
- oqlAll = _db.getOQLQuery(
- "SELECT t FROM " + ExtendsEntity1.class.getName() + " t");
- res = oqlAll.execute();
- while (res.hasMore()) { _db.remove(res.next()); }
- oqlAll.close();
-
- oql = _db.getOQLQuery(
- "SELECT t FROM " + GroupEntity.class.getName() + " t");
- res = oql.execute();
- while (res.hasMore()) { _db.remove(res.next()); }
- oql.close();
-
- oql = _db.getOQLQuery(
- "SELECT t FROM " + ExtendsEntity2.class.getName() + " t");
- res = oql.execute();
- while (res.hasMore()) { _db.remove(res.next()); }
- oql.close();
-
- oql = _db.getOQLQuery(
- "SELECT t FROM " + PersistentEntity.class.getName() + " t");
- res = oql.execute();
- while (res.hasMore()) { _db.remove(res.next()); }
- oql.close();
- _db.commit();
-
- // create data objects for test
- _db.begin();
-
- GroupEntity group1 = new GroupEntity();
- LOG.debug("Creating group: " + group1);
- _db.create(group1);
-
- GroupEntity group2 = new GroupEntity();
- group2.setId(GroupEntity.DEFAULT_ID + 1);
- LOG.debug("Creating group: " + group2);
- _db.create(group2);
-
- ExtendsEntity2 entity2 = new ExtendsEntity2();
- entity2.setId(PersistentEntity.DEFAULT_ID + 20);
- entity2.setGroup(group2);
- LOG.debug("Creating new object: " + entity2);
- _db.create(entity2);
-
- Date date = new Date();
- Thread.sleep(2000);
-
- ExtendsEntity1 entity1 = new ExtendsEntity1();
- entity1.setId(PersistentEntity.DEFAULT_ID + 10);
- entity1.setGroup(group1);
- entity1.getList().add(entity2);
- LOG.debug("Creating new object: " + entity1);
- _db.create(entity1);
-
- entity2 = new ExtendsEntity2();
- entity2.setId(PersistentEntity.DEFAULT_ID + 21);
- entity2.setGroup(group2);
- LOG.debug("Creating new object: " + entity2);
- _db.create(entity2);
-
- entity1 = new ExtendsEntity1();
- entity1.setId(PersistentEntity.DEFAULT_ID + 11);
- entity1.setGroup(group2);
- entity1.getList().add(entity2);
- LOG.debug("Creating new object: " + entity1);
- _db.create(entity1);
-
- _db.commit();
-
- // query on extends object
- _db.begin();
-
- oql = _db.getOQLQuery("SELECT t FROM " + ExtendsEntity1.class.getName()
- + " t WHERE t.group.id=$1");
- oql.bind(group1.getId());
- res = oql.execute();
- for (cnt = 0; res.hasMore(); cnt++) {
- entity1 = (ExtendsEntity1) res.next();
- LOG.debug("Retrieved object: " + entity1);
- if (entity1.getExt() != 0) {
- LOG.debug("Error: ext field = " + entity1.getExt());
- fail("ext field retrieval failed");
- }
- }
- oql.close();
- if (cnt == 1) {
- LOG.info("OK");
- } else {
- LOG.info("Error: retrieved " + cnt + " objects");
- fail("result size mismatch in the query on extends object");
- }
-
- oql = _db.getOQLQuery("SELECT t FROM " + PersistentEntity.class.getName()
- + " t WHERE t.creationTime<=$1");
- oql.bind(date);
- res = oql.execute();
- for (cnt = 0; res.hasMore(); cnt++) {
- PersistentEntity p = (PersistentEntity) res.next();
- LOG.debug("Retrieved object: " + p);
- }
- oql.close();
- if (cnt == 1) {
- LOG.info("OK");
- } else {
- LOG.info("Error: retrieved " + cnt + " objects");
- fail("result size mismatch in the query on base object");
- }
-
- _db.commit();
-
- // query on many-to-many relation
- _db.begin();
-
- oql = _db.getOQLQuery("SELECT t FROM " + ExtendsEntity1.class.getName()
- + " t WHERE t.list.id=$1");
- oql.bind(entity2.getId());
- res = oql.execute();
- for (cnt = 0; res.hasMore(); cnt++) {
- entity1 = (ExtendsEntity1) res.next();
- LOG.debug("Retrieved object: " + entity1);
- }
- oql.close();
- if (cnt == 1) {
- LOG.info("OK");
- } else {
- LOG.info("Error: retrieved " + cnt + " objects");
- fail("result size mismatch in the query on many-to-many");
- }
-
- res = oqlAll.execute();
- while (res.hasMore()) { _db.remove(res.next()); }
- oqlAll.close();
-
- _db.commit();
- }
-
- public void tearDown() throws PersistenceException {
- if (_db.isActive()) { _db.rollback(); }
- _db.close();
- }
-}
Index: cpactf/src/test/ddl/org/castor/cpa/test/test31/db2.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test31/db2.sql (revision 0)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test31/db2.sql (revision 0)
@@ -0,0 +1,46 @@
+DROP TABLE test31_relation;
+DROP TABLE test31_extend2;
+DROP TABLE test31_extend1;
+DROP TABLE test31_related;
+DROP TABLE test31_persistent;
+DROP TABLE test31_group;
+
+CREATE TABLE test31_group (
+ id numeric(10,0) not null,
+ value1 varchar(200) not null
+);
+CREATE UNIQUE INDEX test31_group_pk ON test31_group ( id );
+
+CREATE TABLE test31_persistent (
+ id integer not null,
+ ctime timestamp not null,
+ mtime timestamp ,
+ value1 varchar(200) not null,
+ parent_id integer ,
+ group_id numeric(10,0) not null
+);
+CREATE UNIQUE INDEX test31_persistent_pk ON test31_persistent ( id );
+
+CREATE TABLE test31_related (
+ id integer not null,
+ persist_id integer not null
+);
+CREATE UNIQUE INDEX test31_related_pk ON test31_related ( id );
+
+CREATE TABLE test31_extend1 (
+ ident integer not null,
+ ext integer not null
+);
+CREATE UNIQUE INDEX test31_extend1_pk ON test31_extend1 ( ident );
+
+CREATE TABLE test31_extend2 (
+ id integer not null,
+ ext integer not null
+);
+CREATE UNIQUE INDEX test31_extend2_pk ON test31_extend2 ( id );
+
+CREATE TABLE test31_relation (
+ id1 integer not null,
+ id2 integer not null
+);
+CREATE UNIQUE INDEX test31_relation_pk ON test31_relation ( id1, id2 );
Index: cpactf/src/test/ddl/org/castor/cpa/test/test31/hsql.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test31/hsql.sql (revision 0)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test31/hsql.sql (revision 0)
@@ -0,0 +1,46 @@
+DROP TABLE IF EXISTS test31_relation;
+DROP TABLE IF EXISTS test31_extends2;
+DROP TABLE IF EXISTS test31_extends1;
+DROP TABLE IF EXISTS test31_related;
+DROP TABLE IF EXISTS test31_persistent;
+DROP TABLE IF EXISTS test31_group;
+
+CREATE TABLE test31_group (
+ id numeric(10,0) not null,
+ value1 varchar(200) not null
+);
+CREATE UNIQUE INDEX test31_group_pk ON test31_group ( id );
+
+CREATE TABLE test31_persistent (
+ id integer not null,
+ ctime datetime not null,
+ mtime datetime null,
+ value1 varchar(200) not null,
+ parent_id integer null,
+ group_id numeric(10,0) not null
+);
+CREATE UNIQUE INDEX test31_persistent_pk ON test31_persistent ( id );
+
+CREATE TABLE test31_related (
+ id integer not null,
+ persist_id integer not null
+);
+CREATE UNIQUE INDEX test31_related_pk ON test31_related ( id );
+
+CREATE TABLE test31_extends1 (
+ ident integer not null,
+ ext integer not null
+);
+CREATE UNIQUE INDEX test31_extends1_pk ON test31_extends1 ( ident );
+
+CREATE TABLE test31_extends2 (
+ id integer not null,
+ ext integer not null
+);
+CREATE UNIQUE INDEX test31_extends2_pk ON test31_extends2 ( id );
+
+CREATE TABLE test31_relation (
+ id1 integer not null,
+ id2 integer not null
+);
+CREATE UNIQUE INDEX test31_relation_pk ON test31_relation ( id1, id2 );
Index: cpactf/src/test/ddl/org/castor/cpa/test/test30/derby.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test30/derby.sql (revision 0)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test30/derby.sql (revision 0)
@@ -0,0 +1,23 @@
+DROP TABLE test30_extends;
+DROP TABLE test30_entity;
+
+CREATE TABLE test30_entity (
+ id int not null,
+ value1 varchar(200) not null,
+ value2 varchar(200)
+);
+CREATE UNIQUE INDEX test30_entity_pk ON test30_entity ( id );
+
+CREATE TABLE test30_extends (
+ id int not null,
+ value3 varchar(200) ,
+ value4 varchar(200)
+);
+CREATE UNIQUE INDEX test30_extends_pk ON test30_extends ( id );
+
+DROP TABLE test30_group;
+CREATE TABLE test30_group (
+ id numeric(10,0) not null,
+ value1 varchar(200) not null
+);
+CREATE UNIQUE INDEX test30_group_pk ON test30_group ( id );
Index: cpactf/src/test/ddl/org/castor/cpa/test/test30/db2.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test30/db2.sql (revision 0)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test30/db2.sql (revision 0)
@@ -0,0 +1,23 @@
+DROP TABLE test30_extends;
+DROP TABLE test30_entity;
+
+CREATE TABLE test30_entity (
+ id int not null,
+ value1 varchar(200) not null,
+ value2 varchar(200)
+);
+CREATE UNIQUE INDEX test30_entity_pk ON test30_entity ( id );
+
+CREATE TABLE test30_extends (
+ id int not null,
+ value3 varchar(200) ,
+ value4 varchar(200)
+);
+CREATE UNIQUE INDEX test30_extends_pk ON test30_extends ( id );
+
+DROP TABLE test30_group;
+CREATE TABLE test30_group (
+ id numeric(10,0) not null,
+ value1 varchar(200) not null
+);
+CREATE UNIQUE INDEX test30_group_pk ON test30_group ( id );
Index: cpactf/src/test/ddl/org/castor/cpa/test/test31/derby.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test31/derby.sql (revision 0)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test31/derby.sql (revision 0)
@@ -0,0 +1,46 @@
+DROP TABLE test31_relation;
+DROP TABLE test31_extends2;
+DROP TABLE test31_extends1;
+DROP TABLE test31_related;
+DROP TABLE test31_persistent;
+DROP TABLE test31_group;
+
+CREATE TABLE test31_group (
+ id numeric(10,0) not null,
+ value1 varchar(200) not null
+);
+CREATE UNIQUE INDEX test31_group_pk ON test31_group ( id );
+
+CREATE TABLE test31_persistent (
+ id integer not null,
+ ctime timestamp not null,
+ mtime timestamp ,
+ value1 varchar(200) not null,
+ parent_id integer ,
+ group_id numeric(10,0) not null
+);
+CREATE UNIQUE INDEX test31_persistent_pk ON test31_persistent ( id );
+
+CREATE TABLE test31_related (
+ id integer not null,
+ persist_id integer not null
+);
+CREATE UNIQUE INDEX test31_related_pk ON test31_related ( id );
+
+CREATE TABLE test31_extends1 (
+ ident integer not null,
+ ext integer not null
+);
+CREATE UNIQUE INDEX test31_extends1_pk ON test31_extends1 ( ident );
+
+CREATE TABLE test31_extends2 (
+ id integer not null,
+ ext integer not null
+);
+CREATE UNIQUE INDEX test31_extends2_pk ON test31_extends2 ( id );
+
+CREATE TABLE test31_relation (
+ id1 integer not null,
+ id2 integer not null
+);
+CREATE UNIQUE INDEX test31_relation_pk ON test31_relation ( id1, id2 );
Index: cpactf/src/old/java/ctf/jdo/tc3x/TestOql.java
===================================================================
--- cpactf/src/old/java/ctf/jdo/tc3x/TestOql.java (revision 8022)
+++ cpactf/src/old/java/ctf/jdo/tc3x/TestOql.java (working copy)
@@ -1,435 +0,0 @@
-/**
- * Redistribution and use of this software and associated documentation
- * ("Software"), with or without modification, are permitted provided
- * that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright
- * statements and notices. Redistributions must also contain a
- * copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the
- * above copyright notice, this list of conditions and the
- * following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. The name "Exolab" must not be used to endorse or promote
- * products derived from this Software without prior written
- * permission of Intalio, Inc. For written permission,
- * please contact info@exolab.org.
- *
- * 4. Products derived from this Software may not be called "Exolab"
- * nor may "Exolab" appear in their names without prior written
- * permission of Intalio, Inc. Exolab is a registered
- * trademark of Intalio, Inc.
- *
- * 5. Due credit should be given to the Exolab Project
- * (http://www.exolab.org/).
- *
- * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
- * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Copyright 1999 (C) Intalio, Inc. All Rights Reserved.
- */
-package ctf.jdo.tc3x;
-
-import harness.CastorTestCase;
-import harness.TestHarness;
-
-import java.math.BigDecimal;
-import java.sql.Connection;
-import java.sql.Statement;
-
-import jdo.JDOCategory;
-
-import org.exolab.castor.jdo.Database;
-import org.exolab.castor.jdo.OQLQuery;
-import org.exolab.castor.jdo.PersistenceException;
-import org.exolab.castor.jdo.QueryResults;
-
-/**
- * A suite of general tests for the Castor JDO OQL engine. This test case may
- * grow out of control trying to cover all the supported QL syntax,
- * especially in the new impl. If/when this happens, we'll just split it up
- * into multiple test cases.
- *
- * @author Bruce Snyder
- */
-public final class TestOql extends CastorTestCase {
- private static final int MIN_ID = 10;
- private static final int MAX_ID = 29;
- private static final int MIN_EXTENDS_ID = 30;
- private static final int MAX_EXTENDS_ID = 49;
-
- private JDOCategory _category;
- private Database _db;
-
- public TestOql(final TestHarness category) {
- super(category, "TC30", "OQL-supported syntax");
- _category = (JDOCategory) category;
- }
-
- public void setUp() throws PersistenceException {
- _db = _category.getDatabase();
- }
-
- public void runTest() throws Exception {
- // Populate the database here rather than in setUp(). The setUp()
- // method is run once before each test (and tearDown() is run once
- // after each test and I don't think that we want to populate/truncate
- // the database for each test. We're just selecting the data we're not
- // manipulating it.
- populateDatabase();
- testBasicSelect();
- testMoreSelect();
-
- populateDatabaseExtends();
- testSelectWithFunctions();
- }
-
- /*
- * This method will truncate everything from the database and then
- * repopulate it. It needs to be generic enough to work across databases
- * so I would prefer to use straight JDBC calls.
- */
- public void populateDatabase() throws Exception {
- _db.begin();
- Connection connection = _db.getJdbcConnection();
- Statement statement = connection.createStatement();
- statement.execute("delete from tc3x_extends");
-
- connection = _db.getJdbcConnection();
- statement = connection.createStatement();
- statement.execute("delete from tc3x_entity");
- _db.commit();
-
- _db.begin();
- for (int i = MIN_ID; i <= MAX_ID; ++i) {
- Entity obj = new Entity();
- obj.setId(i);
- obj.setValue1(Entity.DEFAULT_VALUE_1 + " " + Integer.toString(i));
- _db.create(obj);
- }
- _db.commit();
-
- _db.begin();
- connection = _db.getJdbcConnection();
- statement = connection.createStatement();
- statement.execute("delete from tc3x_group");
- _db.commit();
-
- _db.begin();
- GroupEntity group = new GroupEntity();
- _db.create(group);
- _db.commit();
- }
-
- /*
- * This method will truncate everything from the database and then
- * repopulate it. It needs to be generic enough to work across databases
- * so I would prefer to use straight JDBC calls.
- */
- public void populateDatabaseExtends() throws Exception {
- _db.begin();
- Connection connection = _db.getJdbcConnection();
- Statement statement = connection.createStatement();
- statement.execute("delete from tc3x_extends");
-
- connection = _db.getJdbcConnection();
- statement = connection.createStatement();
- statement.execute("delete from tc3x_entity");
- _db.commit();
-
- _db.begin();
- for (int i = MIN_ID; i <= MAX_ID; ++i) {
- Entity obj = new Entity();
- obj.setId(i);
- obj.setValue1(Entity.DEFAULT_VALUE_1 + " " + Integer.toString(i));
- _db.create(obj);
- }
- _db.commit();
-
- _db.begin();
- for (int i = MIN_EXTENDS_ID; i <= MAX_EXTENDS_ID; ++i) {
- ExtendsEntity ext = new ExtendsEntity();
- ext.setId(i);
- ext.setValue1(Entity.DEFAULT_VALUE_1 + " " + Integer.toString(i));
- _db.create(ext);
- }
- _db.commit();
- }
-
- /*
- * Test even more variations of the basic SELECT statement.
- */
- public void testMoreSelect() throws PersistenceException {
- OQLQuery query;
-
- _db.begin();
- query = _db.getOQLQuery(
- "CALL SQL "
- + "select id, value1 "
- + "from tc3x_group entity "
- + "where entity.id >= $1 and entity.id <= $1 "
- + " AS " + GroupEntity.class.getName());
- query.bind(GroupEntity.DEFAULT_ID);
- QueryResults res = query.execute();
-
- assertTrue(res.hasMore());
- GroupEntity obj = (GroupEntity) res.next();
- assertEquals(GroupEntity.DEFAULT_ID, obj.getId());
- assertEquals(GroupEntity.DEFAULT_VALUE, obj.getValue1());
-
- assertFalse (res.hasMore());
-
- _db.commit();
-
- _db.begin();
- query = _db.getOQLQuery(
- "CALL SQL "
- + "select id, value1 "
- + "from tc3x_group entity "
- + "where entity.id >= $1 and entity.id <= $1 and "
- + "entity.value1 = $2 "
- + " AS " + GroupEntity.class.getName());
- query.bind(GroupEntity.DEFAULT_ID);
- query.bind(GroupEntity.DEFAULT_VALUE);
- res = query.execute();
-
- assertTrue(res.hasMore());
- obj = (GroupEntity) res.next();
- assertEquals(GroupEntity.DEFAULT_ID, obj.getId());
- assertEquals(GroupEntity.DEFAULT_VALUE, obj.getValue1());
-
- assertFalse (res.hasMore());
-
- _db.commit();
-
- }
-
- /*
- * Test many different variations of the basic SELECT statement.
- */
- public void testBasicSelect() throws PersistenceException {
- OQLQuery query;
-
- _db.begin();
-
- // fetch all available data
- query = _db.getOQLQuery(
- "select x from " + Entity.class.getName() + " x");
- tryQuery(query, MAX_ID - MIN_ID + 1);
-
- // query only one object, expecting one
- assertTrue("internal error: MIN_ID<=15 && MAX_ID>=15",
- (MIN_ID <= 15) && (MAX_ID >= 15));
- query = _db.getOQLQuery(
- "select x from " + Entity.class.getName() + " x where id=15");
- assertTrue("internal error", MIN_ID > 1);
- tryQuery(query, 1);
-
- // query only one object, expecting none
- assertTrue("internal error: MIN_ID>1", MIN_ID > 1);
- query = _db.getOQLQuery(
- "select x from " + Entity.class.getName() + " x where id=1");
- tryQuery(query, 0);
-
- // query using bind variable parameter, find one object
- query = _db.getOQLQuery(
- "select x from " + Entity.class.getName() + " x where id=$1");
- query.bind(MIN_ID);
- tryQuery(query, 1);
-
- // query using bind variable parameter, find nothing
- query = _db.getOQLQuery(
- "select x from " + Entity.class.getName() + " x where id=$1");
- query.bind(MIN_ID - 1);
- tryQuery(query, 0);
-
- // query using comparison between bind variable parameter and constant,
- // find all objects
- query = _db.getOQLQuery(
- "select x from " + Entity.class.getName() + " x where $(int)1 = 1000");
- query.bind(1000);
- tryQuery(query, MAX_ID + 1 - MIN_ID);
-
- // query using comparison between bind variable parameter and constant,
- // find no objects
- query = _db.getOQLQuery(
- "select x from " + Entity.class.getName() + " x where $(int)1 = 1000");
- query.bind(2000);
- tryQuery(query, 0);
-
- // query using 1 bind variable parameters in two places
- query = _db.getOQLQuery(
- "select x from " + Entity.class.getName() + " x where id>$1 and id<$2");
- query.bind(MIN_ID);
- query.bind(MAX_ID);
- tryQuery(query, MAX_ID + 1 - MIN_ID - 2);
-
- // query using 1 bind variable parameter, find all but the first and last object
- query = _db.getOQLQuery(
- "select x from " + Entity.class.getName() + " x where id>$1 and id<$2");
- query.bind(MIN_ID);
- query.bind(MAX_ID);
- tryQuery(query, MAX_ID + 1 - MIN_ID - 2);
-
- // query using 2 bind variable parameters, find all but the first and last object
- query = _db.getOQLQuery(
- "select x from " + Entity.class.getName() + " x where id<$2 and id>$1");
- query.bind(MIN_ID);
- query.bind(MAX_ID);
- tryQuery(query, MAX_ID + 1 - MIN_ID - 2);
-
- // query using "BETWEEN" operator, finding all records
- query = _db.getOQLQuery(
- "select x from " + Entity.class.getName()
- + " x where id between $1 and $2");
- query.bind(MIN_ID);
- query.bind(MAX_ID);
- tryQuery(query, MAX_ID + 1 - MIN_ID);
-
- // query using "BETWEEN" operator, finding no records
- query = _db.getOQLQuery(
- "select x from " + Entity.class.getName()
- + " x where id between $2 and $1");
- query.bind(MIN_ID);
- query.bind(MAX_ID);
- tryQuery(query, 0);
-
- // query using string constants containing a question mark in the WHERE clause,
- // finding all records
- query = _db.getOQLQuery(
- "select x from " + Entity.class.getName()
- + " x where \"abc123?���\" = \"abc123?���\"");
- tryQuery(query, MAX_ID + 1 - MIN_ID);
-
- // query using string constants containing a question mark in the WHERE clause,
- // finding no records
- query = _db.getOQLQuery(
- "select x from " + Entity.class.getName()
- + " x where \"abc\" = \"?123\"");
- tryQuery(query, 0);
-
- // query using "IN" operator
- assertTrue("internal error: MIN_ID<=15 && MAX_ID>=18",
- (MIN_ID <= 15) && (MAX_ID >= 15));
- assertTrue("internal error: MIN_ID>5", MIN_ID > 5);
- query = _db.getOQLQuery(
- "select x from " + Entity.class.getName()
- + " x where id in list(5, 15, 18)");
- tryQuery(query, 2);
-
- // query using "IN" operator and bind variables, find all objects
- query = _db.getOQLQuery(
- "select x from " + Entity.class.getName()
- + " x where id in list($1, $2, $3)");
- query.bind(MIN_ID);
- query.bind((MIN_ID + MAX_ID) / 2);
- query.bind(MAX_ID);
- tryQuery(query, 3);
-
- // query using "IN" operator and bind variables, find some objects
- query = _db.getOQLQuery(
- "select x from " + Entity.class.getName()
- + " x where id in list($1, $2)");
- query.bind(MIN_ID);
- query.bind(MAX_ID + 5);
- tryQuery(query, 1);
-
- // query using "IN" operator and string values, find one object
- query = _db.getOQLQuery(
- "select x from " + Entity.class.getName()
- + " x where value1 in list(\"XXX\", \"one 21\", 'A')");
- tryQuery(query, 1);
-
- _db.commit();
- }
-
- /*
- * test received result set
- */
- public void tryQuery(final OQLQuery query, final int countExpected)
- throws PersistenceException {
- QueryResults res = query.execute();
- int count = 0;
-
- try {
- while (res.hasMore()) {
- Entity obj = (Entity) res.next();
-
- String val = Entity.DEFAULT_VALUE_1 + " " + Integer.toString(obj.getId());
- assertEquals("value1", val, obj.getValue1());
- assertEquals("value2", Entity.DEFAULT_VALUE_2, obj.getValue2());
-
- ++count;
- }
- } finally {
- res.close();
- }
-
- assertEquals("number of objects found", countExpected, count);
- }
-
- /*
- * test received result set
- */
- public void tryFunctionQuery(final OQLQuery query, final int countExpected)
- throws PersistenceException {
- QueryResults res = query.execute();
- long functionValue = 0;
-
- try {
- if (res.hasMore()) {
- Object obj = res.next();
- if (obj instanceof Long) {
- functionValue = ((Long) obj).longValue();
- } else if (obj instanceof BigDecimal) {
- functionValue = ((BigDecimal) obj).longValue();
- } else if (obj instanceof Integer) {
- functionValue = ((Integer) obj).longValue();
- }
- }
- } finally {
- res.close();
- }
-
- assertEquals("number of objects found", countExpected, functionValue);
- }
-
- /*
- * Test SQL functions (e.g. count(), max(), first(), last(), avg(), etc.).
- */
- public void testSelectWithFunctions() throws PersistenceException {
- _db.begin();
-
- // obtain number of TestObject instances
- OQLQuery query = _db.getOQLQuery(
- "SELECT count(x.id) FROM " + Entity.class.getName() + " x");
- tryFunctionQuery(query, 40);
-
- // obtain distinct number of TestObject instances
- query = _db.getOQLQuery(
- "SELECT count(distinct x.id) FROM " + Entity.class.getName() + " x");
- tryFunctionQuery(query, 40);
-
- // obtain number of TestObjectExtends instances
- query = _db.getOQLQuery(
- "SELECT count(x.id) FROM " + ExtendsEntity.class.getName() + " x");
- tryFunctionQuery(query, 20);
- }
-
- public void tearDown() throws PersistenceException {
- if (_db.isActive()) { _db.rollback(); }
- _db.close();
- }
-}
Index: cpactf/src/test/ddl/org/castor/cpa/test/test30/sybase.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test30/sybase.sql (revision 0)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test30/sybase.sql (revision 0)
@@ -0,0 +1,38 @@
+DROP TABLE test30_extends
+GO
+DROP TABLE test30_entity
+GO
+
+CREATE TABLE test30_entity (
+ id int not null,
+ value1 varchar(200) not null,
+ value2 varchar(200) null
+)
+GO
+CREATE UNIQUE INDEX test30_entity_pk ON test30_entity ( id )
+GO
+GRANT ALL ON test30_entity TO test
+GO
+
+CREATE TABLE test30_extends (
+ id int not null,
+ value3 varchar(200) null,
+ value4 varchar(200) null
+)
+GO
+CREATE UNIQUE INDEX test30_extends_pk ON test30_extends ( id )
+GO
+GRANT ALL ON test30_extends TO test
+GO
+
+DROP TABLE test30_group
+GO
+CREATE TABLE test30_group (
+ id numeric(10,0) not null,
+ value1 varchar(200) not null
+)
+GO
+CREATE UNIQUE INDEX test30_group_pk ON test30_group ( id )
+GO
+GRANT ALL ON test30_group TO test
+GO
Index: cpactf/src/test/ddl/org/castor/cpa/test/test30/mssql.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test30/mssql.sql (revision 0)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test30/mssql.sql (revision 0)
@@ -0,0 +1,38 @@
+DROP TABLE test30_extends
+GO
+DROP TABLE test30_entity
+GO
+
+CREATE TABLE test30_entity (
+ id int not null,
+ value1 varchar(200) not null,
+ value2 varchar(200) null
+)
+GO
+CREATE UNIQUE INDEX test30_entity_pk ON test30_entity ( id )
+GO
+GRANT ALL ON test30_entity TO test
+GO
+
+CREATE TABLE test30_extends (
+ id int not null,
+ value3 varchar(200) null,
+ value4 varchar(200) null
+)
+GO
+CREATE UNIQUE INDEX test30_extends_pk ON test30_extends ( id )
+GO
+GRANT ALL ON test30_extends TO test
+GO
+
+DROP TABLE test30_group
+GO
+CREATE TABLE test30_group (
+ id numeric(10,0) not null,
+ value1 varchar(200) not null
+)
+GO
+CREATE UNIQUE INDEX test30_group_pk ON test30_group ( id )
+GO
+GRANT ALL ON test30_group TO test
+GO
Index: cpactf/src/test/ddl/org/castor/cpa/test/test31/sapdb.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test31/sapdb.sql (revision 0)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test31/sapdb.sql (revision 0)
@@ -0,0 +1,64 @@
+DROP TABLE test31_relation
+//
+DROP TABLE test31_extends2
+//
+DROP TABLE test31_extends1
+//
+DROP TABLE test31_related
+//
+DROP TABLE test31_persistent
+//
+DROP TABLE test31_group
+//
+
+CREATE TABLE test31_group (
+ id fixed(10,0) not null,
+ value1 varchar(200) not null
+)
+//
+CREATE UNIQUE INDEX test31_group_pk ON test31_group ( id )
+//
+
+CREATE TABLE test31_persistent (
+ id integer not null,
+ ctime timestamp not null,
+ mtime timestamp null,
+ value1 varchar(200) not null,
+ parent_id integer null,
+ group_id fixed(10,0) not null
+)
+//
+CREATE UNIQUE INDEX test31_persistent_pk ON test31_persistent ( id )
+//
+
+CREATE TABLE test31_related (
+ id integer not null,
+ persist_id integer not null
+)
+//
+CREATE UNIQUE INDEX test31_related_pk ON test31_related ( id )
+//
+
+CREATE TABLE test31_extends1 (
+ ident integer not null,
+ ext integer not null
+)
+//
+CREATE UNIQUE INDEX test31_extends1_pk ON test31_extends1 ( ident )
+//
+
+CREATE TABLE test31_extends2 (
+ id integer not null,
+ ext integer not null
+)
+//
+CREATE UNIQUE INDEX test31_extends2_pk ON test31_extends2 ( id )
+//
+
+CREATE TABLE test31_relation (
+ id1 integer not null,
+ id2 integer not null
+)
+//
+CREATE UNIQUE INDEX test31_relation_pk ON test31_relation ( id1, id2 )
+//
Index: cpactf/src/test/ddl/org/castor/cpa/test/test31/oracle.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test31/oracle.sql (revision 8022)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test31/oracle.sql (working copy)
@@ -9,8 +9,7 @@
id numeric(10,0) not null,
value1 varchar(200) not null
);
-
-CREATE UNIQUE INDEX test31_group_pk on test31_group ( id );
+CREATE UNIQUE INDEX test31_group_pk ON test31_group ( id );
CREATE TABLE test31_persistent (
id integer not null,
@@ -20,33 +19,28 @@
parent_id integer null,
group_id numeric(10,0) not null
);
-
-CREATE UNIQUE INDEX test31_persistent_pk on test31_persistent ( id );
+CREATE UNIQUE INDEX test31_persistent_pk ON test31_persistent ( id );
CREATE TABLE test31_related (
id integer not null,
persist_id integer not null
);
-
-CREATE UNIQUE INDEX test31_related_pk on test31_related ( id );
+CREATE UNIQUE INDEX test31_related_pk ON test31_related ( id );
CREATE TABLE test31_extends1 (
ident integer not null,
ext integer not null
);
-
-CREATE UNIQUE INDEX test31_extends1_pk on test31_extends1 ( ident );
+CREATE UNIQUE INDEX test31_extends1_pk ON test31_extends1 ( ident );
CREATE TABLE test31_extends2 (
id integer not null,
ext integer not null
);
-
-CREATE UNIQUE INDEX test31_extends2_pk on test31_extends2 ( id );
+CREATE UNIQUE INDEX test31_extends2_pk ON test31_extends2 ( id );
CREATE TABLE test31_relation (
id1 integer not null,
id2 integer not null
);
-
-CREATE UNIQUE INDEX test31_relation_pk on test31_relation ( id1, id2 );
+CREATE UNIQUE INDEX test31_relation_pk ON test31_relation ( id1, id2 );
Index: cpactf/src/test/ddl/org/castor/cpa/test/test30/hsql.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test30/hsql.sql (revision 0)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test30/hsql.sql (revision 0)
@@ -0,0 +1,23 @@
+DROP TABLE IF EXISTS test30_extends;
+DROP TABLE IF EXISTS test30_entity;
+
+CREATE TABLE test30_entity (
+ id int not null,
+ value1 varchar(200) not null,
+ value2 varchar(200)
+);
+CREATE UNIQUE INDEX test30_entity_pk ON test30_entity ( id );
+
+CREATE TABLE test30_extends (
+ id int not null,
+ value3 varchar(200) null,
+ value4 varchar(200) null
+);
+CREATE UNIQUE INDEX test30_extends_pk ON test30_extends ( id );
+
+DROP TABLE IF EXISTS test30_group;
+CREATE TABLE test30_group (
+ id numeric(10,0) not null,
+ value1 varchar(200) not null
+);
+CREATE UNIQUE INDEX test30_group_pk ON test30_group ( id );
Index: cpactf/src/test/ddl/org/castor/cpa/test/test31/pointbase.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test31/pointbase.sql (revision 0)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test31/pointbase.sql (revision 0)
@@ -0,0 +1,46 @@
+DROP TABLE test31_relation;
+DROP TABLE test31_extends2;
+DROP TABLE test31_extends1;
+DROP TABLE test31_related;
+DROP TABLE test31_persistent;
+DROP TABLE test31_group;
+
+CREATE TABLE test31_group (
+ id numeric(10,0) not null,
+ value1 varchar(200) not null
+);
+CREATE UNIQUE INDEX test31_group_pk ON test31_group ( id );
+
+CREATE TABLE test31_persistent (
+ id integer not null,
+ ctime timestamp not null,
+ mtime timestamp ,
+ value1 varchar(200) not null,
+ parent_id integer ,
+ group_id numeric(10,0) not null
+);
+CREATE UNIQUE INDEX test31_persistent_pk ON test31_persistent ( id );
+
+CREATE TABLE test31_related (
+ id integer not null,
+ persist_id integer not null
+);
+CREATE UNIQUE INDEX test31_related_pk ON test31_related ( id );
+
+CREATE TABLE test31_extends1 (
+ ident integer not null,
+ ext integer not null
+);
+CREATE UNIQUE INDEX test31_extends1_pk ON test31_extends1 ( ident );
+
+CREATE TABLE test31_extends2 (
+ id integer not null,
+ ext integer not null
+);
+CREATE UNIQUE INDEX test31_extends2_pk ON test31_extends2 ( id );
+
+CREATE TABLE test31_relation (
+ id1 integer not null,
+ id2 integer not null
+);
+CREATE UNIQUE INDEX test31_relation_pk ON test31_relation ( id1, id2 );
Index: src/doc/release-notes.xml
===================================================================
--- src/doc/release-notes.xml (revision 8026)
+++ src/doc/release-notes.xml (working copy)
@@ -73,6 +73,26 @@
+
+
+ Removed TC30 and TC31 from old test suite.
+
+
+ Ralf Joachim
+ ralf.joachim@syscon.eu
+
+
+ Ralf Joachim
+ ralf.joachim@syscon.eu
+
+
+ Ralf Joachim
+ ralf.joachim@syscon.eu
+
+ Enh.
+ JDO
+ 20090124
+
Added comments why tests are included/excluded in new test suite.
Index: cpactf/src/test/ddl/org/castor/cpa/test/test30/pointbase.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test30/pointbase.sql (revision 0)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test30/pointbase.sql (revision 0)
@@ -0,0 +1,23 @@
+DROP TABLE test30_extends;
+DROP TABLE test30_entity;
+
+CREATE TABLE test30_entity (
+ id int not null,
+ value1 varchar(200) not null,
+ value2 varchar(200)
+);
+CREATE UNIQUE INDEX test30_entity_pk ON test30_entity ( id );
+
+CREATE TABLE test30_extends (
+ id int not null,
+ value3 varchar(200) ,
+ value4 varchar(200)
+);
+CREATE UNIQUE INDEX test30_extends_pk ON test30_extends ( id );
+
+DROP TABLE test30_group;
+CREATE TABLE test30_group (
+ id numeric(10,0) not null,
+ value1 varchar(200) not null
+);
+CREATE UNIQUE INDEX test30_group_pk ON test30_group ( id );
Index: cpactf/src/test/ddl/org/castor/cpa/test/test31/postgresql.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test31/postgresql.sql (revision 0)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test31/postgresql.sql (revision 0)
@@ -0,0 +1,46 @@
+DROP TABLE test31_relation;
+DROP TABLE test31_extends2;
+DROP TABLE test31_extends1;
+DROP TABLE test31_related;
+DROP TABLE test31_persistent;
+DROP TABLE test31_group;
+
+CREATE TABLE test31_group (
+ id numeric(10,0) not null,
+ value1 varchar(200) not null
+);
+CREATE UNIQUE INDEX test31_group_pk ON test31_group ( id );
+
+CREATE TABLE test31_persistent (
+ id integer not null,
+ ctime timestamp without time zone not null,
+ mtime timestamp without time zone null,
+ value1 varchar(200) not null,
+ parent_id integer null,
+ group_id numeric(10,0) not null
+);
+CREATE UNIQUE INDEX test31_persistent_pk ON test31_persistent ( id );
+
+CREATE TABLE test31_related (
+ id integer not null,
+ persist_id integer not null
+);
+CREATE UNIQUE INDEX test31_related_pk ON test31_related ( id );
+
+CREATE TABLE test31_extends1 (
+ ident integer not null,
+ ext integer not null
+);
+CREATE UNIQUE INDEX test31_extends1_pk ON test31_extends1 ( ident );
+
+CREATE TABLE test31_extends2 (
+ id integer not null,
+ ext integer not null
+);
+CREATE UNIQUE INDEX test31_extends2_pk ON test31_extends2 ( id );
+
+CREATE TABLE test31_relation (
+ id1 integer not null,
+ id2 integer not null
+);
+CREATE UNIQUE INDEX test31_relation_pk ON test31_relation ( id1, id2 );
Index: cpactf/src/old/resources/tests.xml
===================================================================
--- cpactf/src/old/resources/tests.xml (revision 8022)
+++ cpactf/src/old/resources/tests.xml (working copy)
@@ -40,8 +40,6 @@
-
-
@@ -147,8 +145,6 @@
-
-
@@ -247,8 +243,6 @@
-
-
@@ -348,8 +342,6 @@
-
-
@@ -449,8 +441,6 @@
-
-
@@ -553,8 +543,6 @@
-
-
@@ -653,8 +641,6 @@
-
-
@@ -753,8 +739,6 @@
-
-
@@ -855,8 +839,6 @@
-
-
-
-
-
-
Index: cpactf/src/test/ddl/org/castor/cpa/test/test30/progress.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test30/progress.sql (revision 0)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test30/progress.sql (revision 0)
@@ -0,0 +1,23 @@
+DROP TABLE test30_extends;
+DROP TABLE test30_entity;
+
+CREATE TABLE test30_entity (
+ id int not null,
+ value1 varchar(200) not null,
+ value2 varchar(200)
+);
+CREATE UNIQUE INDEX test30_entity_pk ON test30_entity ( id );
+
+CREATE TABLE test30_extends (
+ id int not null,
+ value3 varchar(200) ,
+ value4 varchar(200)
+);
+CREATE UNIQUE INDEX test30_extends_pk ON test30_extends ( id );
+
+DROP TABLE test30_group;
+CREATE TABLE test30_group (
+ id numeric(10,0) not null,
+ value1 varchar(200) not null
+);
+CREATE UNIQUE INDEX test30_group_pk ON test30_group ( id );
Index: cpactf/src/test/ddl/org/castor/cpa/test/test30/mysql.sql
===================================================================
--- cpactf/src/test/ddl/org/castor/cpa/test/test30/mysql.sql (revision 8022)
+++ cpactf/src/test/ddl/org/castor/cpa/test/test30/mysql.sql (working copy)
@@ -6,23 +6,18 @@
value1 varchar(200) not null,
value2 varchar(200)
);
-
-CREATE UNIQUE INDEX test30_entity_pk on test30_entity ( id );
+CREATE UNIQUE INDEX test30_entity_pk ON test30_entity ( id );
CREATE TABLE test30_extends (
id int not null,
value3 varchar(200) null,
value4 varchar(200) null
);
-
-CREATE UNIQUE INDEX test30_extends_pk on test30_extends ( id );
-
+CREATE UNIQUE INDEX test30_extends_pk ON test30_extends ( id );
DROP TABLE IF EXISTS test30_group;
-
CREATE TABLE test30_group (
id numeric(10,0) not null,
value1 varchar(200) not null
);
-
-CREATE UNIQUE INDEX test30_group_pk on test30_group ( id );
+CREATE UNIQUE INDEX test30_group_pk ON test30_group ( id );