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 ODMGRollbackTest.java
Date Fri, 16 Jan 2004 18:25:05 GMT
arminw      2004/01/16 10:25:05

  Modified:    src/test/org/apache/ojb/odmg ODMGRollbackTest.java
  Log:
  do cast to TransactionExt instead of TransactionImpl
  
  Revision  Changes    Path
  1.20      +12 -18    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.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- ODMGRollbackTest.java	7 Jan 2004 19:08:50 -0000	1.19
  +++ ODMGRollbackTest.java	16 Jan 2004 18:25:05 -0000	1.20
  @@ -102,7 +102,7 @@
           Implementation ojb = OJB.getInstance();
           Database db = ojb.newDatabase();
           db.open(databaseName, Database.OPEN_READ_WRITE);
  -		Transaction tx = ojb.newTransaction();
  +		TransactionExt tx = (TransactionExt) ojb.newTransaction();
           try
           {
               int odmgZoosBefore = getDBObjectCountWithNewPB(ODMGZoo.class);
  @@ -121,11 +121,9 @@
               int projectsWhile = getDBObjectCountViaOqlQuery(ojb, Project.class);
               int odmgZoosWhilePB = 0;
               int projectsWhilePB = 0;
  -            if (tx instanceof TransactionImpl)
  -            {
  -                odmgZoosWhilePB = getDBObjectCount(((TransactionImpl) tx).getBroker(),
ODMGZoo.class);
  -                projectsWhilePB = getDBObjectCount(((TransactionImpl) tx).getBroker(),
Project.class);
  -            }
  +
  +            odmgZoosWhilePB = getDBObjectCount(tx.getBroker(), ODMGZoo.class);
  +            projectsWhilePB = getDBObjectCount(tx.getBroker(), Project.class);
   
               //store more
               storeObjects(tx, getNewODMGZoos(5));
  @@ -138,11 +136,9 @@
               int projectsWhile2 = getDBObjectCountViaOqlQuery(ojb, Project.class);
               int odmgZoosWhilePB2 = 0;
               int projectsWhilePB2 = 0;
  -            if (tx instanceof TransactionImpl)
  -            {
  -                odmgZoosWhilePB2 = getDBObjectCount(((TransactionImpl) tx).getBroker(),
ODMGZoo.class);
  -                projectsWhilePB2 = getDBObjectCount(((TransactionImpl) tx).getBroker(),
Project.class);
  -            }
  +
  +            odmgZoosWhilePB2 = getDBObjectCount(tx.getBroker(), ODMGZoo.class);
  +            projectsWhilePB2 = getDBObjectCount(tx.getBroker(), Project.class);
   
               tx.commit();
               int odmgZoosAfter = getDBObjectCountWithNewPB(ODMGZoo.class);
  @@ -159,13 +155,11 @@
               Here we test if we can see our changes while the transaction runs. IMO it must
be
               possible to see all changes made in a transaction.
               */
  -            if (tx instanceof TransactionImpl)
  -            {
  -                assertEquals("Wrong number of odmgZoos found while transaction", (odmgZoosBefore
+ 5), odmgZoosWhilePB);
  -                assertEquals("Wrong number of projects found while transaction", (projectsBefore
+ 3), projectsWhilePB);
  -                assertEquals("Wrong number of odmgZoos found while transaction", (odmgZoosBefore
+ 10), odmgZoosWhilePB2);
  -                assertEquals("Wrong number of projects found while transaction", (projectsBefore
+ 5), projectsWhilePB2);
  -            }
  +
  +            assertEquals("Wrong number of odmgZoos found while transaction", (odmgZoosBefore
+ 5), odmgZoosWhilePB);
  +            assertEquals("Wrong number of projects found while transaction", (projectsBefore
+ 3), projectsWhilePB);
  +            assertEquals("Wrong number of odmgZoos found while transaction", (odmgZoosBefore
+ 10), odmgZoosWhilePB2);
  +            assertEquals("Wrong number of projects found while transaction", (projectsBefore
+ 5), projectsWhilePB2);
               assertEquals("Wrong number of odmgZoos found while transaction", (odmgZoosBefore
+ 5), odmgZoosWhile);
               assertEquals("Wrong number of projects found while transaction", (projectsBefore
+ 3), projectsWhile);
               assertEquals("Wrong number of odmgZoos found while transaction", (odmgZoosBefore
+ 10), odmgZoosWhile2);
  
  
  

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