use of org.apache.axiom.mime.MIMEException in project webservices-axiom by apache.
the class AttachmentsTest method testIOExceptionInPartHeaders.
public void testIOExceptionInPartHeaders() throws Exception {
InputStream in = MTOMSample.SAMPLE1.getInputStream();
try {
Attachments attachments = new Attachments(new ExceptionInputStream(in, 1050), MTOMSample.SAMPLE1.getContentType());
// TODO: decide what exception should be thrown exactly here
try {
attachments.getDataHandler("1.urn:uuid:A3ADBAEE51A1A87B2A11443668160943@apache.org");
fail("Expected exception");
} catch (MIMEException ex) {
// Expected
}
} finally {
in.close();
}
}
use of org.apache.axiom.mime.MIMEException in project webservices-axiom by apache.
the class AttachmentsTest method testIOExceptionInPartContent.
public void testIOExceptionInPartContent() throws Exception {
InputStream in = MTOMSample.SAMPLE1.getInputStream();
try {
Attachments attachments = new Attachments(new ExceptionInputStream(in, 1500), MTOMSample.SAMPLE1.getContentType());
DataHandler dh = attachments.getDataHandler("1.urn:uuid:A3ADBAEE51A1A87B2A11443668160943@apache.org");
// TODO: decide what exception should be thrown exactly here
try {
dh.getInputStream();
fail("Expected exception");
} catch (MIMEException ex) {
// Expected
}
} finally {
in.close();
}
}
Aggregations