use of org.apache.wicket.util.tester.WicketTester in project midpoint by Evolveum.
the class PageTest method testBasicRender.
@Test
public void testBasicRender() {
WicketTester tester = new WicketTester();
tester.startPage(page);
tester.assertRenderedPage(page);
}
use of org.apache.wicket.util.tester.WicketTester in project midpoint by Evolveum.
the class PageUserTest method testBasicRender.
@Test(enabled = false)
public void testBasicRender() {
WicketTester tester = new WicketTester();
PageUser page = tester.startPage(PageUser.class);
tester.assertRenderedPage(PageUser.class);
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class AjaxBehaviorEnabledTest method before.
/**
*/
@Before
public void before() {
final IAuthorizationStrategy strategy = new CustomStrategy();
tester = new WicketTester(new MockApplication() {
@Override
public Session newSession(Request request, Response response) {
return new WebSession(request) {
private static final long serialVersionUID = 1L;
@Override
public IAuthorizationStrategy getAuthorizationStrategy() {
return strategy;
}
};
}
});
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class InternalErrorCallsAjaxOnFailureTest method callsOnFailure.
/**
* Setup {@link org.apache.wicket.settings.ExceptionSettings.AjaxErrorStrategy#INVOKE_FAILURE_HANDLER}
* so Wicket will not redirect to the configured {@link InternalErrorPage}/{@link ExceptionErrorPage}
* but will preserve the current page and send http status 500 to wicket-ajax.js
*/
@Test
public void callsOnFailure() {
WicketTester tester = new WicketTester(new DummyApplication() {
/**
* @see org.apache.wicket.protocol.http.WebApplication#init()
*/
@Override
protected void init() {
super.init();
getExceptionSettings().setAjaxErrorHandlingStrategy(ExceptionSettings.AjaxErrorStrategy.INVOKE_FAILURE_HANDLER);
}
});
tester.setExposeExceptions(false);
tester.startPage(InternalErrorCallsAjaxOnFailurePage.class);
tester.clickLink("failure-link", true);
MockHttpServletResponse errorPageResponse = tester.getLastResponse();
assertEquals(500, errorPageResponse.getStatus());
// assert that the original page is still the last rendered one
tester.assertRenderedPage(InternalErrorCallsAjaxOnFailurePage.class);
tester.destroy();
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class RequestEncodingTest method setUp.
@Before
public void setUp() {
application = new RedirectApplication();
tester = new WicketTester(application);
tester.startPage(RedirectHomePage.class);
tester.assertRenderedPage(RedirectHomePage.class);
}
Aggregations