Package org.jboss.resteasy.spi

Examples of org.jboss.resteasy.spi.ApplicationException


      {
         throw new InternalServerErrorException(e);
      }
      catch (InvocationTargetException e)
      {
         throw new ApplicationException(e.getCause());
      }
   }
View Full Code Here


public class ApplicationExceptionMapperTest extends TestExceptionMapperBase {

    @Test
    public void withCause() {
        EOFException eofe = new EOFException("screwed");
        ApplicationException ae = new ApplicationException("oops", eofe);
        ApplicationExceptionMapper aem =
            injector.getInstance(ApplicationExceptionMapper.class);
        Response r = aem.toResponse(ae);
        assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), r.getStatus());
        verifyMessage(r, rtmsg("oops"));
View Full Code Here

        verifyMessage(r, rtmsg("oops"));
    }

    @Test
    public void noCause() {
        ApplicationException ae = new ApplicationException("oops", null);
        ApplicationExceptionMapper aem =
            injector.getInstance(ApplicationExceptionMapper.class);
        Response r = aem.toResponse(ae);
        assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), r.getStatus());
        verifyMessage(r, rtmsg("oops"));
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.spi.ApplicationException

Copyright © 2018 www.massapicom. 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.