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/broker BlobTest.java
Date Wed, 23 Jun 2004 10:20:08 GMT
arminw      2004/06/23 03:20:08

  Modified:    src/test/org/apache/ojb/broker BlobTest.java
  Log:
  fix, add tx demarcation
  
  Revision  Changes    Path
  1.9       +8 -22     db-ojb/src/test/org/apache/ojb/broker/BlobTest.java
  
  Index: BlobTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/BlobTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- BlobTest.java	7 Feb 2004 11:18:14 -0000	1.8
  +++ BlobTest.java	23 Jun 2004 10:20:08 -0000	1.9
  @@ -5,15 +5,15 @@
   import junit.framework.TestCase;
   import org.apache.ojb.broker.platforms.Platform;
   import org.apache.ojb.broker.platforms.PlatformHsqldbImpl;
  +import org.apache.ojb.junit.PBTestCase;
   
   /**
    * This TestClass tests storimg and retrieving Objects with BLOB/CLOB Attributes.
    * Does currently not work with HSQLDB, as it doen't support Blobs/Clobs.
    */
  -public class BlobTest extends TestCase
  +public class BlobTest extends PBTestCase
   {
       boolean skipTest;
  -    private PersistenceBroker broker;
       private static final String msg = "# Skip "+BlobTest.class.getName()+", DB does not
support Blob/Clob #";
   
       public BlobTest(String name)
  @@ -29,7 +29,8 @@
   
       public void setUp() throws Exception
       {
  -        broker = PersistenceBrokerFactory.defaultPersistenceBroker();
  +        super.setUp();
  +
           Platform platform = broker.serviceConnectionManager().getSupportedPlatform();
           /*
           hsqldb does not support Blob/Clob, so we skip test for this DB
  @@ -40,21 +41,6 @@
           }
       }
   
  -    public void tearDown()
  -    {
  -        try
  -        {
  -            if (broker != null)
  -            {
  -                broker.clearCache();
  -                broker.close();
  -            }
  -        }
  -        catch (PersistenceBrokerException e)
  -        {
  -        }
  -    }
  -
       public void testBlobInsertion() throws Exception
       {
           if(skipTest)
  @@ -78,9 +64,9 @@
           // obj.setId(1); we use autoincrement
           obj.setBlob(barr);
           obj.setClob(new String(carr));
  -
  +        broker.beginTransaction();
           broker.store(obj);
  -
  +        broker.commitTransaction();
           broker.clearCache();
   
           Identity oid = new Identity(obj, broker);
  @@ -104,9 +90,9 @@
           // obj.setId(1); we use autoincrement
           obj.setBlob(null);
           obj.setClob(null);
  -
  +        broker.beginTransaction();
           broker.store(obj);
  -
  +        broker.commitTransaction();
           broker.clearCache();
   
           Identity oid = new Identity(obj, broker);
  
  
  

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