db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From torque-...@db.apache.org
Subject [DB Torque Wiki] Updated: UnitTestingWithTorque
Date Mon, 17 May 2004 16:21:32 GMT
   Date: 2004-05-17T09:21:32
   Editor: <>
   Wiki: DB Torque Wiki
   Page: UnitTestingWithTorque
   URL: http://wiki.apache.org/db-torque/UnitTestingWithTorque


Change Log:

@@ -3,11 +3,11 @@
  * the DbUnit approach, which actually runs the SQL in a database and determines if the correct
records are returned;
  * testing the contents of the Criteria object
-== DbUnit Testing
+== DbUnit Testing ==
 This is a straight-forward application of the DbUnit package.  It's easy but the runtime
costs add up, and a lot of the code needed for testing is specific to the table being tested.
-== Criteria Testing
+== Criteria Testing ==
 Unit-testing with the Criteria object is a little tricky but very fast at runtime.  The main
reason this page exists is because I've struggled with one simple fact about the Criteria
object: the predicate (OR, AND, IN, etc.) information is in a package-scoped class.  As a
result, my natural tendency to dig around in the Criteria object and find what I need has
been blocked.  Hmmmm, there must be another way.
@@ -18,18 +18,18 @@
 * creating a Criteria that the Criteria-under-test should match, and comparing them for equality.
 * comparing the toString() output of Criteria
-=== Simple Assertions
+=== Simple Assertions ===
 Simple assertions work great unless dealing with a non-trivial query.  They rapidly become
exercises in understanding the internal construction of the Criteria object, which eventually
run into the packaged-scope predicate problem.
-=== Helper Class
+=== Helper Class ===
 I've been experimenting with a helper class that knows how to introspect the Criteria object,
but it's an ugly job and of course vulnerable to changes in the Criteria class.  Not to mention
that once again, the packaged-scope predicates will prevent complete testing.
-=== Criteria.equal()
+=== Criteria.equal() ===
 Just stumbled on this today, haven't tried it yet.  Could be the elegant solution, if equal()
is written to ignore ordering issues.
-=== Criteria.toString()
+=== Criteria.toString() ===
 Just another untried idea.

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

View raw message