Em Wed, 17 Dec 2008 14:20:26 -0300, mraible <m...@raibledesigns.com>
escreveu:
Is the following still the best way to inject Spring beans into a page
when testing?
http://wiki.apache.org/tapestry/Tapestry5SpringIntegrationAlternative1
This page is quite old . . . it talks about Tapestry 5.0.2, released at
least one year and a half ago.
I would simply use a dedicated Tapestry-IoC module and mock the services
there. Don't forget that, regardless where the services come from
(Tapestry-IoC, Spring, whatever), Tapestry-IoC injects them the same way.
With Tapestry 4, I could populate a Map with with the bean name and a
real (or mock) implementation and instantiate the page, then call methods
accordingly. Is this possible with Tapestry 5 w/o creating a lot of
infrastructure code (which the above seems to require)?
You can add service setters for you page classes (they're POJOs!) and
inject them yourself easily. ;)
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org