ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1165002 - /webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java
Date Sun, 04 Sep 2011 12:17:49 GMT
Author: veithen
Date: Sun Sep  4 12:17:49 2011
New Revision: 1165002

URL: http://svn.apache.org/viewvc?rev=1165002&view=rev
Log:
Eliminated usage of the now deprecated setInlineMTOM method in one of the test cases.

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java?rev=1165002&r1=1165001&r2=1165002&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java
Sun Sep  4 12:17:49 2011
@@ -21,7 +21,6 @@ package org.apache.axiom.om.impl.mtom;
 
 import org.apache.axiom.attachments.Attachments;
 import org.apache.axiom.om.AbstractTestCase;
-import org.apache.axiom.om.OMAttachmentAccessor;
 import org.apache.axiom.om.OMDocument;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNode;
@@ -34,6 +33,7 @@ import org.apache.axiom.om.util.StAXUtil
 import org.apache.axiom.soap.SOAP12Constants;
 import org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder;
 import org.apache.axiom.util.stax.XMLStreamReaderUtils;
+import org.apache.axiom.util.stax.xop.XOPEncodedStream;
 import org.apache.axiom.util.stax.xop.XOPUtils;
 
 import javax.activation.DataHandler;
@@ -311,10 +311,9 @@ public class MTOMStAXSOAPModelBuilderTes
         root.build();
         
         // Use tree as input to XMLStreamReader
-        OMXMLStreamReader xmlStreamReader = (OMXMLStreamReader) root.getXMLStreamReader();
-        
         // Issue XOP:Include events for optimized MTOM text nodes
-        xmlStreamReader.setInlineMTOM(false);
+        XOPEncodedStream xopEncodedStream = XOPUtils.getXOPEncodedStream(root.getXMLStreamReader());
+        XMLStreamReader xmlStreamReader = xopEncodedStream.getReader();
         
         DataHandler dh = null;
         while(xmlStreamReader.hasNext() && dh == null) {
@@ -324,7 +323,8 @@ public class MTOMStAXSOAPModelBuilderTes
                 if (XOP_INCLUDE.equals(qName)) {
                     String hrefValue = xmlStreamReader.getAttributeValue("", "href");
                     if (hrefValue != null) {
-                        dh =((OMAttachmentAccessor)xmlStreamReader).getDataHandler(hrefValue);
+                        dh = xopEncodedStream.getMimePartProvider().getDataHandler(
+                                XOPUtils.getContentIDFromURL(hrefValue));
                     }
                 }
             }



Mime
View raw message