You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by se...@apache.org on 2007/03/30 04:45:21 UTC
svn commit: r523914 -
/db/torque/runtime/trunk/src/test/org/apache/torque/util/CriteriaTest.java
Author: seade
Date: Thu Mar 29 19:45:20 2007
New Revision: 523914
URL: http://svn.apache.org/viewvc?view=rev&rev=523914
Log:
Updated for TORQUE-87 changes.
Modified:
db/torque/runtime/trunk/src/test/org/apache/torque/util/CriteriaTest.java
Modified: db/torque/runtime/trunk/src/test/org/apache/torque/util/CriteriaTest.java
URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/test/org/apache/torque/util/CriteriaTest.java?view=diff&rev=523914&r1=523913&r2=523914
==============================================================================
--- db/torque/runtime/trunk/src/test/org/apache/torque/util/CriteriaTest.java (original)
+++ db/torque/runtime/trunk/src/test/org/apache/torque/util/CriteriaTest.java Thu Mar 29 19:45:20 2007
@@ -425,13 +425,13 @@
String toStringExpect = "Criteria:: TABLE.DATE_COLUMN<=>TABLE.DATE_COLUMN=CURRENT_DATE: "
+ "\nCurrent Query SQL (may not be complete or applicable): "
- + "SELECT FROM TABLE WHERE TABLE.DATE_COLUMN=CURRENT_DATE LIMIT 3, 5";
+ + "SELECT FROM TABLE WHERE TABLE.DATE_COLUMN=CURRENT_DATE LIMIT 5 OFFSET 3";
String cString = c.toString();
//System.out.println(cString);
assertEquals(toStringExpect, cString);
- // Note that this is intentially the same as above as the behaviour is
+ // Note that this is intentionally the same as above as the behaviour is
// only observed on subsequent invocations of toString().
cString = c.toString();
//System.out.println(cString);
@@ -439,6 +439,30 @@
}
/**
+ * TORQUE-87
+ */
+ public void testCriteriaWithOffsetNoLimit()
+ {
+ Criteria c = new Criteria()
+ .add("TABLE.DATE_COLUMN", Criteria.CURRENT_DATE)
+ .setOffset(3);
+
+ String toStringExpect = "Criteria:: TABLE.DATE_COLUMN<=>TABLE.DATE_COLUMN=CURRENT_DATE: "
+ + "\nCurrent Query SQL (may not be complete or applicable): "
+ + "SELECT FROM TABLE WHERE TABLE.DATE_COLUMN=CURRENT_DATE LIMIT 18446744073709551615 OFFSET 3";
+
+ String cString = c.toString();
+ //System.out.println(cString);
+ assertEquals(toStringExpect, cString);
+
+ // Note that this is intentionally the same as above as the behaviour is
+ // only observed on subsequent invocations of toString().
+ cString = c.toString();
+ //System.out.println(cString);
+ assertEquals(toStringExpect, cString);
+ }
+
+ /**
* This test case has been written to try out the fix applied to resolve
* TRQS73 - i.e. ensuring that Criteria.toString() does not alter any limit
* or offset that may be stored in the Criteria object. This testcase
@@ -459,7 +483,7 @@
//System.out.println(cString);
assertEquals(toStringExpect, cString);
- // Note that this is intentially the same as above as the behaviour is
+ // Note that this is intentionally the same as above as the behaviour is
// only observed on subsequent invocations of toString().
cString = c.toString();
//System.out.println(cString);
@@ -613,7 +637,7 @@
*/
public void testOrderBy() throws TorqueException
{
- // we need a rudementary databaseMap for this test case to work
+ // we need a rudimentary databaseMap for this test case to work
DatabaseMap dbMap = Torque.getDatabaseMap(Torque.getDefaultDB());
TableMap tableMap = new TableMap("AUTHOR", dbMap);
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org