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 OQLTest.java OneToManyTest.java LockingTest.java
Date Tue, 08 Apr 2003 16:51:27 GMT
arminw      2003/04/08 09:51:25

  Modified:    src/test/org/apache/ojb/odmg OQLTest.java OneToManyTest.java
                        LockingTest.java
  Log:
  fix test cases, close broker instances,
  commit open tx
  
  Revision  Changes    Path
  1.9       +3 -0      db-ojb/src/test/org/apache/ojb/odmg/OQLTest.java
  
  Index: OQLTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/OQLTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- OQLTest.java	5 Feb 2003 20:04:40 -0000	1.8
  +++ OQLTest.java	8 Apr 2003 16:51:25 -0000	1.9
  @@ -362,15 +362,18 @@
                       " where age=$1");
               query.bind(new Integer(4));
               List animals = (List) query.execute();
  +            tx.commit();
               assertEquals(3, animals.size());
   
   
               //test independent objects
               query = odmg.newOQLQuery();
  +            tx.begin();
               query.create("select food from " + InterfaceFood.class.getName() +
                       " where calories=$1");
               query.bind(new Integer(1000));
               List food = (List) query.execute();
  +            tx.commit();
               assertEquals(3, food.size());
           }
           catch (ODMGException e)
  
  
  
  1.8       +1 -0      db-ojb/src/test/org/apache/ojb/odmg/OneToManyTest.java
  
  Index: OneToManyTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/OneToManyTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- OneToManyTest.java	5 Feb 2003 20:04:40 -0000	1.7
  +++ OneToManyTest.java	8 Apr 2003 16:51:25 -0000	1.8
  @@ -221,6 +221,7 @@
               List zoos = (List) query.execute();
               assertEquals(1, zoos.size());
               ODMGZoo zoo = (ODMGZoo) zoos.get(0);
  +            tx.commit();
               assertEquals(3, zoo.getAnimals().size());
   
   
  
  
  
  1.9       +6 -5      db-ojb/src/test/org/apache/ojb/odmg/LockingTest.java
  
  Index: LockingTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/LockingTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- LockingTest.java	26 Mar 2003 10:37:57 -0000	1.8
  +++ LockingTest.java	8 Apr 2003 16:51:25 -0000	1.9
  @@ -19,7 +19,7 @@
   
   import java.util.List;
   
  -/** 
  +/**
    * Test optimistic and pessimistic locking mechanisms
    */
   public class LockingTest extends TestCase
  @@ -119,14 +119,14 @@
           TransactionImpl tx2 = (TransactionImpl) odmg2.newTransaction();
   
           LockedByVersion obj = new LockedByVersion();
  -		
  +
   
           tx1.begin();
  -        
  +
           tx1.lock(obj,Transaction.WRITE);
   		obj.setValue("tx1");
   		tx1.commit();
  -		
  +
   		obj.setVersion(obj.getVersion() - 1);
   		tx2.begin();
   		tx2.lock(obj,Transaction.WRITE);
  @@ -141,7 +141,7 @@
   		// so that users can react accordingly
   		catch (LockNotGrantedException ex)
   		{
  -			signalOLException = true;	
  +			signalOLException = true;
   		}
   		assertTrue("expected that a OL exception is caught", signalOLException);
       }
  @@ -205,6 +205,7 @@
           Criteria crit = new Criteria();
           crit.addLike("articleName", PRE + "testLockLoop");
           result = broker.getCount(QueryFactory.newQuery(Article.class, crit));
  +        broker.close();
           assertEquals("Wrong number of objects wrote to DB", loops, result);
       }
   
  
  
  

Mime
View raw message