db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r429005 - /db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java
Date Sat, 05 Aug 2006 14:50:21 GMT
Author: tfischer
Date: Sat Aug  5 07:50:21 2006
New Revision: 429005

URL: http://svn.apache.org/viewvc?rev=429005&view=rev
Log:
added Testcase to check that correctBooleans works for aliased tables and joined tables.

Modified:
    db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java

Modified: db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java
URL: http://svn.apache.org/viewvc/db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java?rev=429005&r1=429004&r2=429005&view=diff
==============================================================================
--- db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java (original)
+++ db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java Sat Aug  5
07:50:21 2006
@@ -467,6 +467,22 @@
         assertTrue("Primary key of data set should be f1 but is "
                 + booleanCheck.getTestKey().trim(),
                 "f1".equals(booleanCheck.getTestKey().trim()));
+        
+        // checks whether booleanint and booleanchar values are also
+        // replaced in joined tables
+        criteria.clear();
+        criteria.addAlias("bc", BooleanCheckPeer.TABLE_NAME);
+        criteria.addJoin(BooleanCheckPeer.TEST_KEY, "bc.test_key");
+        criteria.add("bc.bint_value", new Boolean(false));
+        criteria.add("bc.bchar_value", new Boolean(false));
+        booleanCheckList = BooleanCheckPeer.doSelect(criteria);
+        assertTrue("Should have read 1 dataset with both values false "
+                + "but read " + booleanCheckList.size(),
+                booleanCheckList.size() == 1);
+        booleanCheck = (BooleanCheck) booleanCheckList.get(0);
+        assertTrue("Primary key of data set should be f1 but is "
+                + booleanCheck.getTestKey().trim(),
+                "f1".equals(booleanCheck.getTestKey().trim()));
     }
 
     /**



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