Examples of resolveException()


Examples of org.grails.web.errors.GrailsExceptionResolver.resolveException()

        // test exception resolver
        GrailsExceptionResolver er = getBean(ctx, GrailsApplication.EXCEPTION_HANDLER_BEAN);

        assertNotNull(er);
        ModelAndView mv = er.resolveException(new MockHttpServletRequest(),new MockHttpServletResponse(),null, new Exception());
        assertEquals("/error",mv.getViewName());

        // test multipart support
        assertTrue(ctx.getBean(GrailsApplication.MULTIPART_RESOLVER_BEAN) instanceof StandardServletMultipartResolver);
View Full Code Here

Examples of org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver.resolveException()

    LocaleContextHolder.setLocale(Locale.ENGLISH);
    try {
      ResponseStatusExceptionResolver rser = (ResponseStatusExceptionResolver) expectedResolvers.get(1);
      MockHttpServletRequest request = new MockHttpServletRequest("GET", "/");
      MockHttpServletResponse response = new MockHttpServletResponse();
      rser.resolveException(request, response, context.getBean(TestController.class), new UserAlreadyExistsException());
      assertEquals("User already exists!", response.getErrorMessage());
    }
    finally {
      LocaleContextHolder.resetLocaleContext();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.