Search in sources :

Example 1 with ExceptionReporter

use of org.apache.tapestry5.services.ExceptionReporter in project tapestry-5 by apache.

the class DefaultRequestExceptionHandlerTest method setup_tests.

@BeforeMethod
public void setup_tests() throws Exception {
    mockConfiguration.clear();
    pageCache = mockRequestPageCache();
    renderer = mockPageResponseRenderer();
    logger = mockLogger();
    request = mockRequest();
    response = mockResponse();
    componentClassResolver = mockComponentClassResolver();
    linkSource = mockLinkSource();
    serviceResources = mockServiceResources();
    mockConfiguration.put(AccessControlException.class, MyPage.class);
    mockConfiguration.put(MyContextAwareException.class, new ExceptionHandlerAssistant() {

        public Object handleRequestException(Throwable exception, List<Object> exceptionContext) throws IOException {
            return null;
        }
    });
    ExceptionReporter noopExceptionReporter = new ExceptionReporter() {

        @Override
        public void reportException(Throwable exception) {
        }
    };
    exceptionHandler = new DefaultRequestExceptionHandler(pageCache, renderer, logger, "exceptionpage", request, response, componentClassResolver, linkSource, serviceResources, noopExceptionReporter, false, mockConfiguration);
}
Also used : ExceptionHandlerAssistant(org.apache.tapestry5.ExceptionHandlerAssistant) ExceptionReporter(org.apache.tapestry5.services.ExceptionReporter) IOException(java.io.IOException) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

IOException (java.io.IOException)1 ExceptionHandlerAssistant (org.apache.tapestry5.ExceptionHandlerAssistant)1 ExceptionReporter (org.apache.tapestry5.services.ExceptionReporter)1 BeforeMethod (org.testng.annotations.BeforeMethod)1