Thiago H. de Paula Figueiredo wrote:
> 
> 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. ;)
> 

Is it possible to get the Page class itself from PageTester? I only see the
ability to get the Document using renderPage. 

You're right about POJOs, I guess I can just create a new instance, inject
the mock services and call methods that way. I guess I was hoping for better
built-in integration testing support.

Matt

-- 
View this message in context: 
http://www.nabble.com/-T5--Testing-Pages-with-injected-Spring-beans-tp21057429p21058383.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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

Reply via email to