cvs commit: db-torque/src/rttest/org/apache/torque DataTest.java

2005-06-11 Thread tfischer
tfischer2005/06/10 23:31:27

  Modified:src/rttest/org/apache/torque DataTest.java
  Log:
  added the testcase testSingleRecords
  changed the position of the exit point in testJoins for HSQLDB just before 
the first right join
  
  Revision  ChangesPath
  1.25  +37 -9 db-torque/src/rttest/org/apache/torque/DataTest.java
  
  Index: DataTest.java
  ===
  RCS file: /home/cvs/db-torque/src/rttest/org/apache/torque/DataTest.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- DataTest.java 10 Jun 2005 06:02:07 -  1.24
  +++ DataTest.java 11 Jun 2005 06:31:27 -  1.25
  @@ -204,6 +204,34 @@
   }
   
   /**
  + * Checks whether the setSingleRecord() method in criteria works
  + */
  +public void testSingleRecord() throws Exception
  +{
  +Criteria criteria = new Criteria();
  +criteria.setSingleRecord(true);
  +criteria.setLimit(1);
  +criteria.setOffset(5);
  +List books = BookPeer.doSelect(criteria);
  +assertTrue(List should have 1 books, not  + books.size(), 
  +books.size() == 1);
  +
  +criteria.clear();
  +criteria.setSingleRecord(true);
  +criteria.setLimit(2);
  +try
  +{
  +books = BookPeer.doSelect(criteria);
  +fail(doSelect should have failed 
  ++ because two records were selected 
  ++  and one was expected);
  +}
  +catch (TorqueException e)
  +{   
  +}
  +}
  +
  +/**
* tests whether null values can be processed successfully by datadump
* For this, a row containing null values is inserted here,
* the actual test is done later 
  @@ -424,13 +452,6 @@
*/
   public void testJoins() throws Exception
   {
  -if (Torque.getDB(Torque.getDefaultDB()) instanceof DBHypersonicSQL)
  -{
  -log.error(testJoins(): Right joins are not supported by 
HSQLDB);
  -// failing is expected, so exit without error
  -return;
  -}
  -
   cleanBookstore();
   
   // insert test data
  @@ -491,7 +512,14 @@
+ authorList.size()
+ , should be 4);
   }
  -
  +
  +if (Torque.getDB(Torque.getDefaultDB()) instanceof DBHypersonicSQL)
  +{
  +log.error(testJoins(): Right joins are not supported by 
HSQLDB);
  +// failing is expected, so exit without error
  +return;
  +}
  +
   // test right join
   criteria = new Criteria();
   criteria.addJoin(
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: db-torque/src/generator/src/java/org/apache/torque/engine/platform PlatformPostgresqlImpl.java

2005-06-11 Thread tfischer
tfischer2005/06/11 02:46:19

  Modified:src/generator/src/java/org/apache/torque/engine/platform
PlatformPostgresqlImpl.java
  Log:
  added Mapping from TorqueType BLOB to Postgres Type BYTEA
  
  Revision  ChangesPath
  1.7   +2 -1  
db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformPostgresqlImpl.java
  
  Index: PlatformPostgresqlImpl.java
  ===
  RCS file: 
/home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformPostgresqlImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PlatformPostgresqlImpl.java   22 Feb 2004 06:27:19 -  1.6
  +++ PlatformPostgresqlImpl.java   11 Jun 2005 09:46:19 -  1.7
  @@ -55,6 +55,7 @@
   setSchemaDomainMapping(new Domain(SchemaType.BINARY, BYTEA));
   setSchemaDomainMapping(new Domain(SchemaType.VARBINARY, BYTEA));
   setSchemaDomainMapping(new Domain(SchemaType.LONGVARBINARY, 
BYTEA));
  +setSchemaDomainMapping(new Domain(SchemaType.BLOB, BYTEA));
   setSchemaDomainMapping(new Domain(SchemaType.CLOB, TEXT));
   }
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]