Search in sources :

Example 6 with Escape

use of com.github.bordertech.wcomponents.Escape in project wcomponents by BorderTech.

the class AjaxErrorInterceptor_Test method testHandlePreparePaintEscape.

@Test(expected = Escape.class)
public void testHandlePreparePaintEscape() throws IOException {
    // Throw escape exception in chain
    InterceptorComponent chain = new InterceptorComponent() {

        @Override
        public void preparePaint(final Request request) {
            throw new Escape();
        }
    };
    // Setup interceptor
    AjaxErrorInterceptor ajax = new AjaxErrorInterceptor();
    ajax.setBackingComponent(chain);
    // Prepare paint
    ajax.preparePaint(new MockRequest());
}
Also used : Escape(com.github.bordertech.wcomponents.Escape) ErrorCodeEscape(com.github.bordertech.wcomponents.ErrorCodeEscape) MockRequest(com.github.bordertech.wcomponents.util.mock.MockRequest) Request(com.github.bordertech.wcomponents.Request) MockRequest(com.github.bordertech.wcomponents.util.mock.MockRequest) Test(org.junit.Test)

Aggregations

Escape (com.github.bordertech.wcomponents.Escape)6 Request (com.github.bordertech.wcomponents.Request)5 ErrorCodeEscape (com.github.bordertech.wcomponents.ErrorCodeEscape)4 MockRequest (com.github.bordertech.wcomponents.util.mock.MockRequest)4 Test (org.junit.Test)4 ActionEscape (com.github.bordertech.wcomponents.ActionEscape)2 UIContext (com.github.bordertech.wcomponents.UIContext)2 Environment (com.github.bordertech.wcomponents.Environment)1 Response (com.github.bordertech.wcomponents.Response)1 WApplication (com.github.bordertech.wcomponents.WApplication)1 WComponent (com.github.bordertech.wcomponents.WComponent)1 WebXmlRenderContext (com.github.bordertech.wcomponents.servlet.WebXmlRenderContext)1 SystemException (com.github.bordertech.wcomponents.util.SystemException)1 PrintWriter (java.io.PrintWriter)1