db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/test/org/apache/ojb repository_junit_reference.xml
Date Mon, 21 Jun 2004 11:10:00 GMT
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 @@
           </foreign-key>
       </table>
   
  -    <table name="COLLECTION_COLLECTIBLE_CCC">
  +    <table name="COLLECTION_COLLECTIBLE_C2">
           <column name="COL_ID" required="true" primaryKey="true" type="INTEGER"/>
           <column name="NAME" type="VARCHAR" size="150"/>
           <column name="GAT_ID" type="INTEGER"/>
  
  
  
  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 @@
           </collection-descriptor>
   
           <collection-descriptor
  -            name="collectiblesCCC"
  -            element-class-ref="org.apache.ojb.broker.CollectionTest$CollectibleCCC"
  +            name="collectiblesC2"
  +            element-class-ref="org.apache.ojb.broker.CollectionTest$CollectibleC2"
               proxy="false"
               auto-retrieve="false"
               auto-update="true"
  @@ -861,7 +861,7 @@
           class="org.apache.ojb.broker.CollectionTest$CollectibleC"
           table="COLLECTION_COLLECTIBLE_C">
           <!-- extent-class class-ref="org.apache.ojb.broker.CollectionTest$CollectibleCC"
/ -->
  -        <!-- extent-class class-ref="org.apache.ojb.broker.CollectionTest$CollectibleCCC"
/ -->
  +        <!-- extent-class class-ref="org.apache.ojb.broker.CollectionTest$CollectibleC2"
/ -->
           <field-descriptor
            name="colId"
            column="COL_ID"
  @@ -943,8 +943,8 @@
       </class-descriptor>
   
       <class-descriptor
  -        class="org.apache.ojb.broker.CollectionTest$CollectibleCCC"
  -        table="COLLECTION_COLLECTIBLE_CCC">
  +        class="org.apache.ojb.broker.CollectionTest$CollectibleC2"
  +        table="COLLECTION_COLLECTIBLE_C2">
   
           <field-descriptor
            name="colId"
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message