Grokbase Groups Cayenne dev May 2011
FAQ
Between myself and Dzmitry Kazimirchyk we just finished a huge project of converting our unit tests to the DI container. We have a much cleaner test system as a result:

* No more verbose XML files for data sets.
* No more Spring XML configuration.
* Injection into test cases of pretty much anything. This means much less bloat in the tests, so the actual assertions are easy to see and understand.
* Real inversion of control - now it is possible to build test classes (or common superclasses) based on a very specific DI configuration. For now we have 2 such configs - ClientCaseModule and ServerCaseModule plus a few adhoc ones.
* DI container provides correct resource scoping. The only thing in the global scope is DB schema drop/create. The rest (including instantiation of Cayenne stacks) is in per-test-method scope. This means that tests can freely alter DataMaps, etc. without having to worry about resetting them back.

I may still do some refactoring of the DI code, but the main thing is there.

Andrus

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedMay 23, '11 at 3:17p
activeMay 23, '11 at 3:17p
posts1
users1
websitecayenne.apache.org

1 user in discussion

Andrus Adamchik: 1 post

People

Translate

site design / logo © 2022 Grokbase