Paul,
I tried the trick w/ the RequestCache; however, it blows up when I try to
cast the page instance that I pick up from the cache. When I debug it, it
does show that it's the same class (as is stated in the exception); however,
because of the class transformations (or maybe some classloader
Paul,
thanks for the help on this. I'll try it out soon.
On why I'm using the page class : I guess this goes back to using POJOs
for unit testing. What I mean is that in my tapestry page class I have a
couple of methods (e.g. like setupRender , event handlers) which mean
something special fo
akochnev wrote on 31/01/2010 11:26:53:
>The next thing I'm trying to work out is use Testify for unit-like
> testing. The idea was that I could possibly instantiate the page class
> myself (e.g. w/o having to ask the tester to render the page), inject
the
> dependencies (using tester.inject
= new ZdUser(new EmailAddress("f...@bar.com"));
expect(userRepo.getUser(isA(EmailAddress.class))).andStubReturn(testUser);
replay(userRepo);
Stupid s = new Stupid();
tester.injectInto(s);
s.setupRender();
}
}
--
View this
ay(userRepo);
> > >> Document page = tester.renderPage("stupid");
> > >>System.out.println("Rendered page: " + page.toString());
> > >>
> > >>}
> > >> }
> > >>
> > >> public abs
>> }
> >>
> >> public abstract class AbstractZdTapTest extends TapestryTest {
> >> private static final TapestryTester SHARED_TESTER = new
> >> TapestryTester("com.troymaxventures.zadachite",
ZdTestAppModule.class);
> >>
>
gt;>
>>> public abstract class AbstractZdTapTest extends TapestryTest {
>>> private static final TapestryTester SHARED_TESTER = new
>>> TapestryTester("com.troymaxventures.zadachite", ZdTestAppModule.class);
>>>
>>> public AbstractZdTapT
RequestHandler handler) throws IOException {
>>
>> requestGlobals.storeServletRequestResponse(EasyMock.
>> createMock(HttpServletRequest.class),
>> EasyMock.createMock(HttpServletResponse.class));
>> return handler.service(request
k(HttpServletResponse.class));
> return handler.service(request, response);
> }
> };
> config.add("EnsureNonNullHttpRequestAndResponse", filter,
> "before:*");
> }
> }
>
> public class Stupid {
&g
ser(new EmailAddress("f...@bar.com"));
}
}
--
View this message in context:
http://old.nabble.com/TestNG---Injecting-Testify-services-into-pages-tp27370621p27370621.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
--
10 matches
Mail list logo