Search in sources :

Example 1 with AttachmentsMimePartProvider

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();
    }
}
Also used : XMLStreamReader(javax.xml.stream.XMLStreamReader) XMLStreamReaderComparator(org.apache.axiom.testutils.stax.XMLStreamReaderComparator) AttachmentsMimePartProvider(org.apache.axiom.om.impl.builder.AttachmentsMimePartProvider) Attachments(org.apache.axiom.attachments.Attachments)

Aggregations

XMLStreamReader (javax.xml.stream.XMLStreamReader)1 Attachments (org.apache.axiom.attachments.Attachments)1 AttachmentsMimePartProvider (org.apache.axiom.om.impl.builder.AttachmentsMimePartProvider)1 XMLStreamReaderComparator (org.apache.axiom.testutils.stax.XMLStreamReaderComparator)1