On Thursday, Oct 2, 2003, at 11:14 Europe/Rome, Dirk Olmes wrote:
>> I think it would be excellent to start all this discussion writing
>> down
>> a few test cases that describe exactly the problem we are trying to
>> solve, how we want to write the application code to use express these
>> feature, and then add the code to Cayenne until all the new tests
>> pass.
>
> very XP style, I like that :-)
That's what I have done while implementing these same feature for EOF,
and it was really helpful.
>> I have tried to look for Cayenne and DBUnit, but did not find anything
>> relevant.
>>
>> Is there anybody doing any work to integrate Cayenne with a DB testing
>> framework like DBUnit or something like that?
>
> I investigated into a cayenne-DBUnit cooperation some time ago,
> especially
> since it seems to be the perfect match: let cayenne do its work and
> check
> with DBUnit whether the database is in expected state afterwards.
I didn't look at the Cayenne source tree very carefully, and missed the
test package.
I am going to take a closer look.
> [...]
> I think it will take some effort to integrate DBUnit into the cayenne
> test
> cases. In that process there's still a number of decisions to make:
> should
> DBUnit fill the database upon each test run? each TestCase? only once?
> I've used DBUnit successfully in conjunction with EOF and TopLink in
> the
> past and can share what I found out, even some code though it may be
> only of
> limited use.
We have written the DBTestingKit, and extension to OCUnit written by
Sente (www.sente.ch).
Our approach was to allow every testCase if its tests where read-only
or not.
If the tests where read-only, you could also specify if the DB had to
be created before running the tests, or whether the tests should use an
already available DB (as the tests were read-only, you could safely run
them against an already running DB).
Anyway, these are only test performance tuning; it's true you should
run these tests often, but even if they are not optimally tuned, I
would be much more interested in great framework code!! ;-]
Anyway, I think that all experiences on these topics should be welcome.
Giulio Cesare
This archive was generated by hypermail 2.0.0 : Fri Oct 03 2003 - 04:38:27 EDT