db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject cvs commit: db-torque/src/rttest/org/apache/torque DataTest.java
Date Wed, 13 Jul 2005 21:12:08 GMT
tfischer    2005/07/13 14:12:07

  Modified:    src/rttest/org/apache/torque DataTest.java
  Log:
  added a testcase which does a select for prepared statements
  
  Revision  Changes    Path
  1.28      +35 -2     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.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- DataTest.java	13 Jul 2005 20:34:29 -0000	1.27
  +++ DataTest.java	13 Jul 2005 21:12:07 -0000	1.28
  @@ -918,7 +918,7 @@
        */
       public void testLargePk() throws Exception
       {
  -        // clean Date table
  +        // clean LargePk table
           Criteria criteria = new Criteria();
           criteria.add(
           		LargePkPeer.LARGE_PK_ID, 
  @@ -1123,6 +1123,39 @@
       }
       
       /**
  +     * Test whether we can execute queries as prepared statements
  +     * @throws Exception
  +     */
  +    public void testPreparedStatements() throws Exception
  +    {
  +        // clean LargePk table
  +        Criteria criteria = new Criteria();
  +        criteria.add(
  +                LargePkPeer.LARGE_PK_ID, 
  +                (Long) null, 
  +                Criteria.NOT_EQUAL);
  +        LargePkPeer.doDelete(criteria);
  +
  +        LargePk largePk = new LargePk();
  +        largePk.setLargePkId(1);
  +        largePk.setName("testLargePk");
  +        largePk.save();
  +        
  +        largePk = new LargePk();
  +        largePk.setLargePkId(2);
  +        largePk.setName("testLargePk");
  +        largePk.save();
  +        
  +        criteria = new Criteria();
  +        criteria.add(LargePkPeer.LARGE_PK_ID, 2, Criteria.LESS_THAN);
  +        LargePkPeer.addSelectColumns(criteria);
  +        List result = BasePeer.doPSSelect(criteria);
  +        assertTrue("Size of largePk list should be 1 but is " 
  +                + result.size(),
  +                result.size() == 1);
  +    }
  +    
  +    /**
        * Tests whether shutdown complains about anything
        * @throws TorqueException if shutdown does not exit cleanly
        */
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message