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/odmg DMapTest.java ODMGRollbackTest.java
Date Wed, 16 Jul 2003 11:21:39 GMT
arminw      2003/07/16 04:21:39

  Modified:    src/test/org/apache/ojb/broker/sequence
                        NativeIdentifierTest.java
               src/test/org/apache/ojb/odmg DMapTest.java
                        ODMGRollbackTest.java
  Log:
  fix bugs in test cases
  
  Revision  Changes    Path
  1.4       +2 -2      db-ojb/src/test/org/apache/ojb/broker/sequence/NativeIdentifierTest.java
  
  Index: NativeIdentifierTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/sequence/NativeIdentifierTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- NativeIdentifierTest.java	5 Jun 2003 18:30:46 -0000	1.3
  +++ NativeIdentifierTest.java	16 Jul 2003 11:21:38 -0000	1.4
  @@ -163,7 +163,7 @@
               stmt.close();
   
               SequenceDescriptor sd = MetadataManager.getInstance().connectionRepository().
  -                    getDescriptor(broker.getPBKey()).getSequenceDescriptor();
  +                    getDescriptor(pb.getPBKey()).getSequenceDescriptor();
               sd.setSequenceManagerClass(oldSequenceManager);
           }
           finally
  
  
  
  1.12      +5 -3      db-ojb/src/test/org/apache/ojb/odmg/DMapTest.java
  
  Index: DMapTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/DMapTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- DMapTest.java	8 Mar 2003 19:22:56 -0000	1.11
  +++ DMapTest.java	16 Jul 2003 11:21:39 -0000	1.12
  @@ -44,7 +44,7 @@
           PersistenceBroker broker = ((HasBroker) odmg.currentTransaction()).getBroker();
           FieldDescriptor fld = broker.getClassDescriptor(Article.class).getFieldDescriptorByName("articleId");
           Integer val = (Integer) broker.serviceSequenceManager().getUniqueValue(fld);
  -        
  +
           a.setArticleId(val.intValue());
           a.setArticleName("New Funny Article " + a.getArticleId());
           a.setStock(234);
  @@ -125,10 +125,12 @@
           tx.commit();
   
   
  -        broker.clearCache();
  -
           tx = odmg.newTransaction();
           tx.begin();
  +
  +        broker = ((HasBroker) tx).getBroker();
  +        broker.clearCache();
  +
           DMap mapA = (DMap) db.lookup(name);
           Article val1A = (Article) mapA.get(key1);
           assertEquals(val1.getArticleId(), val1A.getArticleId());
  
  
  
  1.13      +7 -5      db-ojb/src/test/org/apache/ojb/odmg/ODMGRollbackTest.java
  
  Index: ODMGRollbackTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/ODMGRollbackTest.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ODMGRollbackTest.java	5 Feb 2003 20:04:40 -0000	1.12
  +++ ODMGRollbackTest.java	16 Jul 2003 11:21:39 -0000	1.13
  @@ -217,7 +217,6 @@
   
               Transaction tx = ojb.newTransaction();
               tx.begin();
  -            PersistenceBroker broker = ((HasBroker) tx).getBroker();
               //store
               persistentStoreObjects(db, getNewODMGZoos(5));
               persistentStoreObjects(db, getNewProjects(3));
  @@ -227,7 +226,9 @@
               tx.commit();
   
               //###### hack we clear cache of PB ########
  -            broker.clearCache();
  +            PersistenceBroker tmp = PersistenceBrokerFactory.defaultPersistenceBroker();
  +            tmp.clearCache();
  +            tmp.close();
   
               int odmgZoosAfter = getDBObjectCountWithNewPB(ODMGZoo.class);
               int projectsAfter = getDBObjectCountWithNewPB(Project.class);
  @@ -246,7 +247,6 @@
   
               //tx should be reusable
               tx.begin();
  -            PersistenceBroker broker2 = ((HasBroker) tx).getBroker();
               //store
               persistentStoreObjects(db, getNewODMGZoos(5));
               persistentStoreObjects(db, getNewProjects(3));
  @@ -256,7 +256,9 @@
               tx.commit();
   
               //###### hack we clear cache of PB ########
  -            broker2.clearCache();
  +            tmp = PersistenceBrokerFactory.defaultPersistenceBroker();
  +            tmp.clearCache();
  +            tmp.close();
   
               odmgZoosAfter = getDBObjectCountWithNewPB(ODMGZoo.class);
               projectsAfter = getDBObjectCountWithNewPB(Project.class);
  @@ -286,7 +288,7 @@
           db.open(databaseName, Database.OPEN_READ_WRITE);
           try
           {
  - 
  +
               int odmgZoosBefore = getDBObjectCountWithNewPB(ODMGZoo.class);
               int projectsBefore = getDBObjectCountWithNewPB(Project.class);
   
  
  
  

---------------------------------------------------------------------
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