For those that are interested,
I've extended the wicketTester with this method
public void assertNextPageIs(final Class clazz) {
final IPageFactory pageFactory =
getApplication().getSessionSettings().getPageFactory();
getApplication().getSessionSettings().setPageFactory(new
IPageFactory() {
public Page newPage(Class pageClass) {
assertEquals(pageClass, clazz);
getApplication().getSessionSettings().setPageFactory(pageFactory);
return null;
}
public Page newPage(Class pageClass, PageParameters parameters)
{
// todo - assert page parameters
return newPage(pageClass);
}
});
}
I've had to "respondSuspend" mentioned in the link in my first post.
Pretty handy tho, I can now go
wicketTester.assertNextPageIs(SomeComplexPage.class)
formTester.submit()
Obviously early days at the moment :)
Rgds
Ned
--
View this message in context:
http://www.nabble.com/How-to-test-setResponsePage-tp16802302p16803012.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]