use of org.apache.axiom.om.impl.builder.AttachmentsMimePartProvider in project webservices-axiom by apache.
the class XOPEncodingStreamReaderTest method test.
public void test() throws Exception {
Attachments[] attachments = new Attachments[2];
XMLStreamReader[] soapPartReader = new XMLStreamReader[2];
for (int i = 0; i < 2; i++) {
attachments[i] = new Attachments(MTOMSample.SAMPLE1.getInputStream(), MTOMSample.SAMPLE1.getContentType());
soapPartReader[i] = StAXUtils.createXMLStreamReader(attachments[i].getRootPartInputStream());
}
XMLStreamReader actual = new XOPEncodingStreamReader(new XOPDecodingStreamReader(soapPartReader[1], new AttachmentsMimePartProvider(attachments[1])), contentIDGenerator, OptimizationPolicy.DEFAULT);
new XMLStreamReaderComparator(soapPartReader[0], actual).compare();
for (int i = 0; i < 2; i++) {
soapPartReader[i].close();
}
}
Aggregations