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 AllTests.java
Date Sat, 07 Feb 2004 11:18:14 GMT
arminw      2004/02/07 03:18:14

  Modified:    src/test/org/apache/ojb/broker BlobTest.java AllTests.java
  Log:
  enable Blob/Clob test for all DB except hsql
  
  Revision  Changes    Path
  1.8       +30 -19    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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- BlobTest.java	27 Jan 2004 20:45:24 -0000	1.7
  +++ BlobTest.java	7 Feb 2004 11:18:14 -0000	1.8
  @@ -3,6 +3,8 @@
   import java.io.Serializable;
   
   import junit.framework.TestCase;
  +import org.apache.ojb.broker.platforms.Platform;
  +import org.apache.ojb.broker.platforms.PlatformHsqldbImpl;
   
   /**
    * This TestClass tests storimg and retrieving Objects with BLOB/CLOB Attributes.
  @@ -10,36 +12,34 @@
    */
   public class BlobTest extends TestCase
   {
  -    public static void main(String[] args)
  -    {
  -        String[] arr = {BlobTest.class.getName()};
  -        junit.textui.TestRunner.main(arr);
  -    }
  -
  +    boolean skipTest;
       private PersistenceBroker broker;
  +    private static final String msg = "# Skip "+BlobTest.class.getName()+", DB does not
support Blob/Clob #";
   
  -    /**
  -     * Insert the method's description here.
  -     * Creation date: (24.12.2000 00:33:40)
  -     */
       public BlobTest(String name)
       {
           super(name);
       }
   
  -    /**
  -     * Insert the method's description here.
  -     * Creation date: (06.12.2000 21:58:53)
  -     */
  +    public static void main(String[] args)
  +    {
  +        String[] arr = {BlobTest.class.getName()};
  +        junit.textui.TestRunner.main(arr);
  +    }
  +
       public void setUp() throws Exception
       {
           broker = PersistenceBrokerFactory.defaultPersistenceBroker();
  +        Platform platform = broker.serviceConnectionManager().getSupportedPlatform();
  +        /*
  +        hsqldb does not support Blob/Clob, so we skip test for this DB
  +        */
  +        if(platform.getClass().equals(PlatformHsqldbImpl.class))
  +        {
  +            skipTest = true;
  +        }
       }
   
  -    /**
  -     * Insert the method's description here.
  -     * Creation date: (06.12.2000 21:59:14)
  -     */
       public void tearDown()
       {
           try
  @@ -57,6 +57,12 @@
   
       public void testBlobInsertion() throws Exception
       {
  +        if(skipTest)
  +        {
  +            System.out.println(msg);
  +            return;
  +        }
  +
           int size = 5000;
   
           ObjectWithBlob obj = new ObjectWithBlob();
  @@ -87,6 +93,12 @@
   
       public void testReadNullBlob()
       {
  +        if(skipTest)
  +        {
  +            System.out.println(msg);
  +            return;
  +        }
  +
           ObjectWithBlob obj = new ObjectWithBlob();
   
           // obj.setId(1); we use autoincrement
  @@ -171,5 +183,4 @@
               this.id = id;
           }
       }
  -
   }
  
  
  
  1.40      +1 -1      db-ojb/src/test/org/apache/ojb/broker/AllTests.java
  
  Index: AllTests.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/AllTests.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- AllTests.java	5 Feb 2004 17:43:12 -0000	1.39
  +++ AllTests.java	7 Feb 2004 11:18:14 -0000	1.40
  @@ -61,7 +61,7 @@
           suite.addTestSuite(SMMultiThreadedTest.class);
           suite.addTestSuite(KeyConstraintViolationTest.class);
           suite.addTestSuite(RsIteratorTest.class);
  -        // suite.addTestSuite(BlobTest.class); /* doesn't work for hsqldb */
  +        suite.addTestSuite(BlobTest.class); /* doesn't work for hsqldb */
           suite.addTestSuite(LogServiceTest.class);
           suite.addTestSuite(ManyToManyTest.class);
           suite.addTestSuite(OneToOneTest.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