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 LockingTest.java
Date Sat, 27 Nov 2004 02:11:30 GMT
arminw      2004/11/26 18:11:30

  Modified:    src/test/org/apache/ojb/odmg Tag: OJB_1_0_RELEASE
                        LockingTest.java
  Log:
  minor refactoring
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.13.2.2  +9 -18     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.13.2.1
  retrieving revision 1.13.2.2
  diff -u -r1.13.2.1 -r1.13.2.2
  --- LockingTest.java	18 Sep 2004 13:06:40 -0000	1.13.2.1
  +++ LockingTest.java	27 Nov 2004 02:11:30 -0000	1.13.2.2
  @@ -39,20 +39,11 @@
       private Implementation odmg2;
       private Database db2;
   
  -    /**
  -     * Insert the method's description here.
  -     * Creation date: (24.12.2000 00:33:40)
  -     */
       public LockingTest(String name)
       {
           super(name);
       }
   
  -
  -    /**
  -     * Insert the method's description here.
  -     * Creation date: (06.12.2000 21:58:53)
  -     */
       public void setUp() throws Exception
       {
           super.setUp();
  @@ -68,10 +59,6 @@
   
       }
   
  -    /**
  -     * Insert the method's description here.
  -     * Creation date: (06.12.2000 21:59:14)
  -     */
       public void tearDown() throws Exception
       {
           if (odmg1.currentTransaction() != null) odmg1.currentTransaction().abort();
  @@ -216,18 +203,22 @@
   		tx2.lock(obj,Transaction.WRITE);
   
   		obj.setValue("tx2");
  -		boolean signalOLException = false;
   		try
   		{
   			tx2.commit();
  +            // OL exceptions should be signalled as ODMG LockNotGrantedExceptions
  +            // so that users can react accordingly
  +            fail("Optimistic locking exception expected");
   		}
  -		// OL exceptions should be signalled as ODMG LockNotGrantedExceptions
  -		// so that users can react accordingly
   		catch (LockNotGrantedException ex)
   		{
  -			signalOLException = true;
  +			assertTrue("expected that a OL exception is caught", true);
   		}
  -		assertTrue("expected that a OL exception is caught", signalOLException);
  +        catch(Exception e)
  +        {
  +            e.printStackTrace();
  +            fail("Wrong kind of exception thrown, expected 'LockNotGrantedException', but
was " + e.getMessage());
  +        }
       }
   
   
  
  
  

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