You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Joel Wiegman <Jo...@btservices.com> on 2007/06/12 23:15:41 UTC

T5: Swapping out Spring definitions

Hello all,

During the execution of our end-to-end (out-of-container) unit tests,
I'd like to load my service definitions as mock objects from Spring
configuration files that are different from the ones defined in my
container (web.xml file).

Believe it or not, the Tapestry PageTester class has a hooks in there to
do this.  You pass in the appropriate "appName" argument (say
"testHarness") and then define the module class
<app-package>.services.TestHarnessModule, where you're allowed to
configure your services.

I've figured out how to spot-override services (via the
"contributeAlias" method), but for my unit tests I'd really just like to
create the service registry from scratch using a batch of "mock object"
Spring configuration files.

Can anyone out there get me started on this path?  Perhaps point me to
the correct hook(s)/method name(s) to build this service registry in the
module?

Thanks!

Joel

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org