use of org.apache.wicket.request.flow.ResetResponseException in project wicket by apache.
the class DefaultPageFactoryTest method abortAndRespondContract.
/**
* Verifies page factory bubbles ResetResponseException
*/
@Test
void abortAndRespondContract() {
try {
pageFactory.newPage(AbortAndRespondPage1.class);
fail();
} catch (ResetResponseException e) {
// noop
}
try {
pageFactory.newPage(AbortAndRespondPage2.class);
fail();
} catch (ResetResponseException e) {
// noop
}
try {
pageFactory.newPage(AbortAndRespondPage2.class, new PageParameters());
fail();
} catch (ResetResponseException e) {
// noop
}
try {
pageFactory.newPage(AbortAndRespondPage3.class);
fail();
} catch (ResetResponseException e) {
// noop
}
try {
pageFactory.newPage(AbortAndRespondPage3.class, new PageParameters());
fail();
} catch (ResetResponseException e) {
// noop
}
try {
pageFactory.newPage(PageThrowingCheckedException.class);
fail();
} catch (WicketRuntimeException e) {
assertNotNull(e.getCause());
assertNotNull(e.getCause().getCause());
assertEquals(PageThrowingCheckedException.EXCEPTION, e.getCause().getCause());
} catch (Exception e) {
fail();
}
}
Aggregations