Search in sources :

Example 1 with OperationException

use of org.apache.tapestry5.ioc.internal.OperationException in project tapestry-5 by apache.

the class DefaultRequestExceptionHandlerTest method handleRequestExceptionWithConfiguredPage.

@Test
public void handleRequestExceptionWithConfiguredPage() throws IOException {
    train_resolvePageClassNameToPageName(componentClassResolver, MyPage.class.getName(), "mypage");
    Link link = mockLink();
    expect(linkSource.createPageRenderLink("mypage", false, new Object[] { "accesscontrol" })).andReturn(link);
    expect(request.isXHR()).andReturn(false);
    response.sendRedirect(link);
    EasyMock.expectLastCall();
    replay();
    // also test unwrapping TapestryExceptions
    exceptionHandler.handleRequestException(new OperationException(new RenderQueueException("renderqueue", new Object[0], new TapestryException("tapestryexception", new AccessControlException("No permission"))), new String[0]));
}
Also used : AccessControlException(java.security.AccessControlException) Link(org.apache.tapestry5.http.Link) OperationException(org.apache.tapestry5.ioc.internal.OperationException) TapestryException(org.apache.tapestry5.commons.internal.util.TapestryException) Test(org.testng.annotations.Test)

Aggregations

AccessControlException (java.security.AccessControlException)1 TapestryException (org.apache.tapestry5.commons.internal.util.TapestryException)1 Link (org.apache.tapestry5.http.Link)1 OperationException (org.apache.tapestry5.ioc.internal.OperationException)1 Test (org.testng.annotations.Test)1