Re: TestNG & Injecting Testify services into pages

2010-02-06 Thread Alex Kotchnev
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

Re: TestNG & Injecting Testify services into pages

2010-02-04 Thread Alex Kotchnev
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

Re: TestNG & Injecting Testify services into pages

2010-02-02 Thread Paul Field
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

Re: TestNG & Injecting Testify services into pages

2010-01-31 Thread akochnev
= 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

Re: TestNG & Injecting Testify services into pages

2010-01-29 Thread Alex Kotchnev
ay(userRepo); > > >> Document page = tester.renderPage("stupid"); > > >>System.out.println("Rendered page: " + page.toString()); > > >> > > >>} > > >> } > > >> > > >> public abs

Re: TestNG & Injecting Testify services into pages

2010-01-29 Thread Paul Field
>> } > >> > >> public abstract class AbstractZdTapTest extends TapestryTest { > >> private static final TapestryTester SHARED_TESTER = new > >> TapestryTester("com.troymaxventures.zadachite", ZdTestAppModule.class); > >> >

Re: TestNG & Injecting Testify services into pages

2010-01-29 Thread akochnev
gt;> >>> public abstract class AbstractZdTapTest extends TapestryTest { >>> private static final TapestryTester SHARED_TESTER = new >>> TapestryTester("com.troymaxventures.zadachite", ZdTestAppModule.class); >>> >>> public AbstractZdTapT

Re: TestNG & Injecting Testify services into pages

2010-01-29 Thread akochnev
RequestHandler handler) throws IOException { >> >> requestGlobals.storeServletRequestResponse(EasyMock. >> createMock(HttpServletRequest.class), >> EasyMock.createMock(HttpServletResponse.class)); >> return handler.service(request

Re: TestNG & Injecting Testify services into pages

2010-01-29 Thread Paul Field
k(HttpServletResponse.class)); > return handler.service(request, response); > } > }; > config.add("EnsureNonNullHttpRequestAndResponse", filter, > "before:*"); > } > } > > public class Stupid { &g

TestNG & Injecting Testify services into pages

2010-01-29 Thread akochnev
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. --