Re: Unit testing Tapestry 4.1 components with TestNG and Easymock

2007-06-04 Thread Ray McBride
Thanks for you advice. I think I'm a bit further forward. viewProductDetail is actually a Tapestry component and is instantiated using the com.javaforge.tapestry.testng.TestBase; library. I have removed the expect call from my testGetSaving method and moved the replay/verify to my setUp metho

Re: Unit testing Tapestry 4.1 components with TestNG and Easymock

2007-06-01 Thread Jesse Kuhnert
Hmm .I can't pinpoint the exact problem but if it were up to me I would start out by changing things to look more like: public void setUp() { ... webRequest = createMock(WebRequest.class); expect(webRequest.getSession(true)).andReturn(webSession); ... } public void testGetSaving

Re: Unit testing Tapestry 4.1 components with TestNG and Easymock

2007-06-01 Thread Ray McBride
Hi, Thanks for you quick reply. Sorry, my fault, I must have deleted these while removing my sysouts for this post. I have tried using these but unfortunately receive the same exception. I have also done several searches on google, which seems to suggest the exception is caused by the omiss

Re: Unit testing Tapestry 4.1 components with TestNG and Easymock

2007-06-01 Thread Jesse Kuhnert
You still need to call the replay() / verify() easymock methods, which can be examined further here: http://easymock.org/EasyMock2_2_Documentation.html I think getSession(boolean) also returns a value - so you'd have to define what that return value is with a statement like: expect(webRequest.g