Hi Russel,

Very interesting! possible to have a very simple sample project that get us
started? thanks.

Angelo


Russell Brown-6 wrote:
> 
> Hi Alex,
> Testing pages as POJOs is quite simple. You can roll your own very,
> very, very simple service injector and inject EasyMock services into the
> pojo. I have done it using reflection. So I have a class that takes the
> page instance being tested in the constructor (and the test class too)
> and for each field annotated with @Inject it creates a strict mock and
> sets the field to that value. It also adds the mock to an internal List
> if mocks. Then the class provides convenience replay, reset, verify
> methods that iterate over the whole list. The test class also has fields
> that use a custom annotation (@Mock) these are injected with the same
> values as those added to the page under test. So you end up with a test
> class with populated mocks, a page class with populated services and a
> helper class with the same mocks held in an iterable fashion for
> convenience.
> 
> 
> 
> Russell
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-testing-using-PageTester-and-EasyMock-tp19496126p19531051.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to