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 Thu, 05 May 2005 08:17:11 GMT
tfischer    2005/05/05 01:17:11

  Modified:    src/rttest/org/apache/torque DataTest.java
  Log:
  added a test case to test primary keys which are also foreign keys
  added a test to the orderByTest to check usage of sql functions in the order by clause
  
  Revision  Changes    Path
  1.16      +27 -1     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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- DataTest.java	23 Apr 2005 14:58:14 -0000	1.15
  +++ DataTest.java	5 May 2005 08:17:11 -0000	1.16
  @@ -34,9 +34,12 @@
   import org.apache.torque.test.BooleanCheckPeer;
   import org.apache.torque.test.DateTest;
   import org.apache.torque.test.DateTestPeer;
  +import org.apache.torque.test.IntegerPk;
  +import org.apache.torque.test.IntegerPkPeer;
   import org.apache.torque.test.LargePk;
   import org.apache.torque.test.LargePkPeer;
   import org.apache.torque.test.MultiPk;
  +import org.apache.torque.test.MultiPkForeignKey;
   import org.apache.torque.test.MultiPkPeer;
   import org.apache.torque.test.NullValueTable;
   import org.apache.torque.util.BasePeer;
  @@ -726,6 +729,12 @@
                            + ", should be \"Book 2\"");
               }
               
  +            // test usage of Expressions in order by
  +            criteria = new Criteria();
  +            criteria.addAscendingOrderByColumn("UPPER(" + BookPeer.TITLE + ")");
  +            criteria.setIgnoreCase(true);
  +            BookPeer.doSelect(criteria);
  +            
           }
           catch( Exception e) 
           {
  @@ -1034,6 +1043,23 @@
                        + " : " + e.getMessage());
           }
       }
  +    
  +    
  +    /**
  +     * Tests whether we can handle multiple primary keys some of which are 
  +     * also foreign keys
  +     * @throws Exception if the testfails
  +     */
  +    public void testMultiplePrimaryForeignKey() throws Exception
  +    {
  +        IntegerPk integerPk = new IntegerPk();
  +        integerPk.save();
  +        MultiPkForeignKey multiPkForeignKey = new MultiPkForeignKey();
  +        multiPkForeignKey.setId(10);
  +        multiPkForeignKey.setIntegerPk(integerPk);
  +        multiPkForeignKey.save();
  +        integerPk.save();
  +    }
           
       /**
        * Tests inserting single quotes in Strings.
  
  
  

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