db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject cvs commit: db-torque/src/rttest/org/apache/torque DataTest.java
Date Sun, 24 Aug 2003 14:38:50 GMT
seade       2003/08/24 07:38:50

  Modified:    src/rttest test-schema.xml
               src/rttest/org/apache/torque DataTest.java
  Log:
  New runtime test case that shows booleanchar is not currently working.
  
  Revision  Changes    Path
  1.16      +9 -1      db-torque/src/rttest/test-schema.xml
  
  Index: test-schema.xml
  ===================================================================
  RCS file: /home/cvs/db-torque/src/rttest/test-schema.xml,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- test-schema.xml	7 Aug 2003 21:27:46 -0000	1.15
  +++ test-schema.xml	24 Aug 2003 14:38:50 -0000	1.16
  @@ -145,5 +145,13 @@
       <column name="class" javaName="JavaClass" required="false" type="VARCHAR"/>
       <column name="package" javaName="JavaPackage" required="false" type="VARCHAR"/>
     </table>
  --->  
  +-->
  +
  +  <!-- BOOLEANCHAR not working? -->
  +  <table name="boolean_check" idMethod="none">
  +    <column name="test_key" required="true" primaryKey="true" type="CHAR" size="10"
/>
  +    <column name="bint_value" required="true" type="BOOLEANINT" />
  +    <column name="bchar_value" required="true" type="BOOLEANCHAR" />
  +  </table>
  +  
   </database>
  
  
  
  1.8       +39 -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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DataTest.java	3 Aug 2003 13:42:40 -0000	1.7
  +++ DataTest.java	24 Aug 2003 14:38:50 -0000	1.8
  @@ -58,9 +58,12 @@
   import java.util.HashMap;
   import java.util.List;
   import java.util.Iterator;
  +import org.apache.torque.om.StringKey;
   import org.apache.torque.test.Author;
   import org.apache.torque.test.Book;
   import org.apache.torque.test.BookPeer;
  +import org.apache.torque.test.BooleanCheck;
  +import org.apache.torque.test.BooleanCheckPeer;
   import org.apache.torque.test.NullValueTable;
   import org.apache.torque.util.Criteria;
   import org.apache.torque.test.MultiPk;
  @@ -109,6 +112,16 @@
                       book.save();
                   }
               }
  +            BooleanCheck bc = new BooleanCheck();
  +            bc.setTestKey("t1");
  +            bc.setBintValue(true);
  +            bc.setBcharValue(true);
  +            bc.save();
  +            bc = new BooleanCheck();
  +            bc.setTestKey("f1");
  +            bc.setBintValue(false);
  +            bc.setBcharValue(false);
  +            bc.save();
           }
           catch (Exception ex)
           {
  @@ -193,4 +206,29 @@
   			ex.printStackTrace();
   		}
       }
  +    
  +    /**
  +     * test boolean values
  +     */
  +    public void testBooleanValues()
  +    {
  +        try
  +        {
  +            BooleanCheck bc = BooleanCheckPeer.retrieveByPK(new StringKey("t1"));
  +            assertTrue("BOOLEANINT should be true but is: " 
  +                    + bc.getBintValue(), bc.getBintValue());
  +            assertTrue("BOOLEANCHAR should be true but is: " 
  +                    + bc.getBcharValue(), bc.getBcharValue());
  +            bc = BooleanCheckPeer.retrieveByPK(new StringKey("f1"));
  +            assertFalse("BOOLEANINT should be false but is: " 
  +                    + bc.getBintValue(), bc.getBintValue());
  +            assertFalse("BOOLEANCHAR should be false but is: " 
  +                    + bc.getBcharValue(), bc.getBcharValue());
  +        }
  +        catch (Exception ex)
  +        {
  +            ex.printStackTrace();
  +        }
  +    }
  +    
   }
  
  
  

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