Examples of WriterException


Examples of org.jboss.resteasy.spi.WriterException

         httpHeaders.putSingle("Content-Type", MediaType.valueOf(mimeMultipart.getContentType()));
         mimeMultipart.writeTo(entityStream);
      }
      catch (MessagingException e)
      {
         throw new WriterException(e);
      }

   }
View Full Code Here

Examples of org.jboss.resteasy.spi.WriterException

            {
               value = method.invoke(obj);
            }
            catch (IllegalAccessException e)
            {
               throw new WriterException(e);
            }
            catch (InvocationTargetException e)
            {
               throw new WriterException(e.getCause());
            }
            PartType partType = method.getAnnotation(PartType.class);
            String filename = getFilename(method);

            multipart.addFormData(param.value(), value, method.getReturnType(), method.getGenericReturnType(), MediaType.valueOf(partType.value()), filename);
View Full Code Here

Examples of org.jboss.resteasy.spi.WriterException

            {
               value = field.get(obj);
            }
            catch (IllegalAccessException e)
            {
               throw new WriterException(e);
            }
            PartType partType = field.getAnnotation(PartType.class);
            String filename = getFilename(field);

            output.addFormData(param.value(), value, field.getType(), field.getGenericType(), MediaType.valueOf(partType.value()), filename);
View Full Code Here

Examples of org.jboss.resteasy.spi.WriterException

         StreamResult result = new StreamResult(output);
         transformerFactory.newTransformer().transform(source, result);
      }
      catch (TransformerException te)
      {
         throw new WriterException(te);
      }
   }
View Full Code Here

Examples of org.jboss.resteasy.spi.WriterException

*/
public class WriterExceptionMapperTest extends TestExceptionMapperBase {

    @Test
    public void handleExceptionWithoutResponse() {
        WriterException nfe = new WriterException("unacceptable");
        WriterExceptionMapper nfem = injector.getInstance(WriterExceptionMapper.class);
        Response r = nfem.toResponse(nfe);
        assertEquals(500, r.getStatus());
        verifyMessage(r, rtmsg("unacceptable"));
    }
View Full Code Here

Examples of org.jboss.resteasy.spi.WriterException

    @Test
    public void handleExceptionWithResponse() {
        Response mockr = mock(Response.class);
        when(mockr.getStatus()).thenReturn(400);
        WriterException nfe = new WriterException("unacceptable", mockr);
        WriterExceptionMapper nfem = injector.getInstance(WriterExceptionMapper.class);
        Response r = nfem.toResponse(nfe);
        assertEquals(400, r.getStatus());
        verifyMessage(r, rtmsg("unacceptable"));
    }
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.