Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 18813 invoked from network); 21 Jun 2004 11:10:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 21 Jun 2004 11:10:11 -0000 Received: (qmail 45877 invoked by uid 500); 21 Jun 2004 11:10:05 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 45804 invoked by uid 500); 21 Jun 2004 11:10:03 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 45782 invoked by uid 500); 21 Jun 2004 11:10:02 -0000 Received: (qmail 45731 invoked by uid 99); 21 Jun 2004 11:10:02 -0000 Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Mon, 21 Jun 2004 04:10:01 -0700 Received: (qmail 18686 invoked by uid 1510); 21 Jun 2004 11:10:00 -0000 Date: 21 Jun 2004 11:10:00 -0000 Message-ID: <20040621111000.18685.qmail@minotaur.apache.org> From: arminw@apache.org To: db-ojb-cvs@apache.org Subject: cvs commit: db-ojb/src/test/org/apache/ojb repository_junit_reference.xml X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N arminw 2004/06/21 04:10:00 Modified: src/schema ojbtest-schema.xml src/test/org/apache/ojb/broker CollectionTest.java src/test/org/apache/ojb repository_junit_reference.xml Log: fix issue #263, Oracle RDBMS has a limitation of 30 characters for unique identifiers such as table-, foreign key- and index names. Revision Changes Path 1.79 +1 -1 db-ojb/src/schema/ojbtest-schema.xml Index: ojbtest-schema.xml =================================================================== RCS file: /home/cvs/db-ojb/src/schema/ojbtest-schema.xml,v retrieving revision 1.78 retrieving revision 1.79 diff -u -r1.78 -r1.79 --- ojbtest-schema.xml 12 Jun 2004 14:00:30 -0000 1.78 +++ ojbtest-schema.xml 21 Jun 2004 11:09:59 -0000 1.79 @@ -976,7 +976,7 @@ - +
1.10 +35 -36 db-ojb/src/test/org/apache/ojb/broker/CollectionTest.java Index: CollectionTest.java =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/CollectionTest.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- CollectionTest.java 31 May 2004 22:57:21 -0000 1.9 +++ CollectionTest.java 21 Jun 2004 11:10:00 -0000 1.10 @@ -1,6 +1,12 @@ package org.apache.ojb.broker; -import junit.framework.TestCase; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; import org.apache.ojb.broker.query.Criteria; @@ -9,13 +15,6 @@ import org.apache.ojb.broker.query.QueryFactory; import org.apache.ojb.junit.PBTestCase; -import java.io.Serializable; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Iterator; -import java.util.ArrayList; - /** * Test case for collection handling. * @@ -372,11 +371,11 @@ // create gatherer with collections Gatherer gatherer = new Gatherer(null, name); - List colsList = Arrays.asList(prepareCollectibleCCC(colPrefix)); - gatherer.setCollectiblesCCC(colsList); + List colsList = Arrays.asList(prepareCollectibleC2(colPrefix)); + gatherer.setCollectiblesC2(colsList); for (Iterator iterator = colsList.iterator(); iterator.hasNext();) { - ((CollectibleCCC) iterator.next()).setGatherer(gatherer); + ((CollectibleC2) iterator.next()).setGatherer(gatherer); } @@ -384,20 +383,20 @@ broker.store(gatherer); broker.commitTransaction(); - assertNotNull(gatherer.getCollectiblesCCC()); - assertEquals(5, gatherer.getCollectiblesCCC().size()); - assertEquals(gatherer.getGatId(), ((CollectibleCCC) gatherer.getCollectiblesCCC().get(0)).getGathererId()); + assertNotNull(gatherer.getCollectiblesC2()); + assertEquals(5, gatherer.getCollectiblesC2().size()); + assertEquals(gatherer.getGatId(), ((CollectibleC2) gatherer.getCollectiblesC2().get(0)).getGathererId()); broker.clearCache(); Identity oid = new Identity(gatherer, broker); gatherer = (Gatherer) broker.getObjectByIdentity(oid); assertNotNull(gatherer); // auto-retierve is set false - assertNull(gatherer.getCollectiblesCCC()); + assertNull(gatherer.getCollectiblesC2()); Criteria criteria = new Criteria(); criteria.addLike("name", colPrefix + "*"); - Query q = new QueryByCriteria(CollectibleCCC.class, criteria); + Query q = new QueryByCriteria(CollectibleC2.class, criteria); Collection result = broker.getCollectionByQuery(q); assertNotNull(result); assertEquals("Wrong number of queried objects", 5, result.size()); @@ -405,8 +404,8 @@ broker.beginTransaction(); // auto-retieve is false, so get references manually broker.retrieveAllReferences(gatherer); - assertNotNull(gatherer.getCollectiblesCCC()); - List colList = gatherer.getCollectiblesCCC(); + assertNotNull(gatherer.getCollectiblesC2()); + List colList = gatherer.getCollectiblesC2(); for (Iterator iterator = colList.iterator(); iterator.hasNext();) { // delete all references first @@ -417,7 +416,7 @@ criteria = new Criteria(); criteria.addLike("name", colPrefix + "*"); - q = new QueryByCriteria(CollectibleCCC.class, criteria); + q = new QueryByCriteria(CollectibleC2.class, criteria); result = broker.getCollectionByQuery(q); assertNotNull(result); assertEquals("Wrong number of queried objects", 0, result.size()); @@ -821,14 +820,14 @@ return colCC; } - private CollectibleCCC[] prepareCollectibleCCC(String namePrefix) + private CollectibleC2[] prepareCollectibleC2(String namePrefix) { - CollectibleCCC[] colCC = new CollectibleCCC[]{ - new CollectibleCCC(namePrefix + "_colCCC_1", "ext1"), - new CollectibleCCC(namePrefix + "_colCCC_2", "ext2"), - new CollectibleCCC(namePrefix + "_colCCC_3", "ext3"), - new CollectibleCCC(namePrefix + "_colCCC_4", "ext4"), - new CollectibleCCC(namePrefix + "_colCCC_5", "ext5") + CollectibleC2[] colCC = new CollectibleC2[]{ + new CollectibleC2(namePrefix + "_colC2_1", "ext1"), + new CollectibleC2(namePrefix + "_colC2_2", "ext2"), + new CollectibleC2(namePrefix + "_colC2_3", "ext3"), + new CollectibleC2(namePrefix + "_colC2_4", "ext4"), + new CollectibleC2(namePrefix + "_colC2_5", "ext5") }; return colCC; } @@ -900,7 +899,7 @@ private List collectiblesB; private List collectiblesC; private List collectiblesCC; - private List collectiblesCCC; + private List collectiblesC2; private List collectiblesD; private List collectiblesDD; private CollectionClassDummy collectionDummy; @@ -985,14 +984,14 @@ this.collectiblesCC = collectiblesCC; } - public List getCollectiblesCCC() + public List getCollectiblesC2() { - return collectiblesCCC; + return collectiblesC2; } - public void setCollectiblesCCC(List collectiblesCCC) + public void setCollectiblesC2(List collectiblesC2) { - this.collectiblesCCC = collectiblesCCC; + this.collectiblesC2 = collectiblesC2; } public List getCollectiblesD() @@ -1194,18 +1193,18 @@ } } - public static class CollectibleCCC extends CollectibleC + public static class CollectibleC2 extends CollectibleC { - public CollectibleCCC() + public CollectibleC2() { } - public CollectibleCCC(String name) + public CollectibleC2(String name) { super(name); } - public CollectibleCCC(String name, String extentName) + public CollectibleC2(String name, String extentName) { super(name, extentName); } 1.16 +6 -6 db-ojb/src/test/org/apache/ojb/repository_junit_reference.xml Index: repository_junit_reference.xml =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/repository_junit_reference.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- repository_junit_reference.xml 15 Jun 2004 11:44:36 -0000 1.15 +++ repository_junit_reference.xml 21 Jun 2004 11:10:00 -0000 1.16 @@ -761,8 +761,8 @@ - + + class="org.apache.ojb.broker.CollectionTest$CollectibleC2" + table="COLLECTION_COLLECTIBLE_C2">