Search in sources :

Example 1 with ViewProcessor

use of org.nutz.mvc.impl.processor.ViewProcessor in project nutz by nutzam.

the class EViewProcessor method test_error_processor.

@Test
public void test_error_processor() throws Throwable {
    ViewProcessor p = new EViewProcessor();
    ActionContext ac = new ActionContext();
    ac.setRequest(request).setResponse(response).setServletContext(servletContext);
    Throwable t = new Throwable();
    ac.setError(t);
    p.process(ac);
    Object obj = request.getAttribute(ViewProcessor.DEFAULT_ATTRIBUTE);
    assertNotNull(obj);
    assertTrue(obj instanceof Throwable);
    assertEquals(t, obj);
}
Also used : ActionContext(org.nutz.mvc.ActionContext) ViewProcessor(org.nutz.mvc.impl.processor.ViewProcessor) AbstractMvcTest(org.nutz.mvc.AbstractMvcTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 AbstractMvcTest (org.nutz.mvc.AbstractMvcTest)1 ActionContext (org.nutz.mvc.ActionContext)1 ViewProcessor (org.nutz.mvc.impl.processor.ViewProcessor)1