Hello Aaron, > While writing the dynamic record code, I was wondering if this feature > wouldn't be a valuable addition to jOOQ: A "junit" mode. > > Basically, this mode should allow the developer to register SQL queries and > the desired result (i.e. the records which jOOQ should return for this > query). > > In this mode, jOOQ wouldn't try to open a DB connection. It would allow to > test SQL query building (by registering no results) and creating Record > objects to test result processing and a mix of both. > > Or is something like that already possible?
Ideally, you would: 1. Write a simple JDBC mock layer. Your mock Connection / PreparedStatements would look up mock ResultSets from a file 2. Hook these JDBC mock objects into jOOQ's ExecuteListener lifecycle jOOQ wouldn't notice the difference between your mock objects and an actual database. DBUnit might be a good choice: http://www.dbunit.org Also, H2 has nice, text-based integration tests: http://code.google.com/p/h2database/source/browse/trunk/h2/src/test/org/h2/test/test-1.3.txt On the other hand, using an actual H2 (or Derby, HSQLDB) in-memory database instance might be less work? Cheers Lukas -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
