You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2015/05/17 21:49:44 UTC
svn commit: r1679893 - in /webservices/axiom/trunk:
modules/axiom-api/src/test/java/org/apache/axiom/attachments/
modules/axiom-api/src/test/java/org/apache/axiom/om/
modules/axiom-api/src/test/java/org/apache/axiom/util/stax/xop/
modules/axiom-compat/...
Author: veithen
Date: Sun May 17 19:49:43 2015
New Revision: 1679893
URL: http://svn.apache.org/r1679893
Log:
Code simplification.
Modified:
webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java
webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/attachments/PartOnFileTest.java
webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/om/MIMEResource.java
webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/xop/XOPDecodingStreamReaderTest.java
webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/xop/XOPEncodingStreamReaderTest.java
webservices/axiom/trunk/modules/axiom-compat/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java
webservices/axiom/trunk/systests/old-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xop/TestSerialize.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/envelope/TestBuildWithAttachments.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/mtom/TestGetXMLStreamReaderMTOMEncoded.java
Modified: webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java?rev=1679893&r1=1679892&r2=1679893&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java (original)
+++ webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java Sun May 17 19:49:43 2015
@@ -64,7 +64,7 @@ public class AttachmentsTest extends Abs
}
public void testGetDataHandler() throws Exception {
- InputStream inStream = getTestResource(TestConstants.MTOM_MESSAGE.getName());
+ InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
Attachments attachments = new Attachments(inStream, TestConstants.MTOM_MESSAGE.getContentType());
DataHandler dh = attachments
@@ -78,7 +78,7 @@ public class AttachmentsTest extends Abs
}
public void testGetDataHandlerNonExistingMIMEPart() throws Exception {
- InputStream inStream = getTestResource(TestConstants.MTOM_MESSAGE.getName());
+ InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
Attachments attachments = new Attachments(inStream, TestConstants.MTOM_MESSAGE.getContentType());
DataHandler dh = attachments.getDataHandler("ThisShouldReturnNull");
@@ -92,7 +92,7 @@ public class AttachmentsTest extends Abs
}
public void testGetAllContentIDs() throws Exception {
- InputStream inStream = getTestResource(TestConstants.MTOM_MESSAGE.getName());
+ InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
Attachments attachments = new Attachments(inStream, TestConstants.MTOM_MESSAGE.getContentType());
String[] contentIDs = attachments.getAllContentIDs();
@@ -117,7 +117,7 @@ public class AttachmentsTest extends Abs
}
public void testGetContentIDSet() {
- InputStream inStream = getTestResource(TestConstants.MTOM_MESSAGE.getName());
+ InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
Attachments attachments = new Attachments(inStream, TestConstants.MTOM_MESSAGE.getContentType());
Set idSet = attachments.getContentIDSet();
@@ -139,12 +139,12 @@ public class AttachmentsTest extends Abs
}
public void testGetContentLength() throws IOException {
- InputStream inStream = getTestResource(TestConstants.MTOM_MESSAGE.getName());
+ InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
Attachments attachments = new Attachments(inStream, TestConstants.MTOM_MESSAGE.getContentType());
// Make sure the length is correct
long length = attachments.getContentLength();
- long fileSize = IOUtils.toByteArray(getTestResource(TestConstants.MTOM_MESSAGE.getName())).length;
+ long fileSize = IOUtils.toByteArray(TestConstants.MTOM_MESSAGE.getInputStream()).length;
assertEquals("Return value of getContentLength()", fileSize, length);
}
@@ -165,7 +165,7 @@ public class AttachmentsTest extends Abs
// It doesn't actually matter what the stream *is* it just needs to exist
String contentType = "multipart/related; boundary=\"" + TestConstants.MTOM_MESSAGE.getBoundary() +
"\"; type=\"text/xml\"; start=\"" + contentTypeStartParam + "\"";
- InputStream inStream = getTestResource(TestConstants.MTOM_MESSAGE.getName());
+ InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
Attachments attachments = new Attachments(inStream, contentType);
assertEquals("Did not obtain correct content ID", contentId,
attachments.getRootPartContentID());
@@ -209,7 +209,7 @@ public class AttachmentsTest extends Abs
public void testGetRootPartContentTypeWithContentIDMismatch() {
String contentType = "multipart/related; boundary=\"" + TestConstants.MTOM_MESSAGE.getBoundary() +
"\"; type=\"text/xml\"; start=\"<wr...@example.org>\"";
- Attachments attachments = new Attachments(getTestResource(TestConstants.MTOM_MESSAGE.getName()), contentType);
+ Attachments attachments = new Attachments(TestConstants.MTOM_MESSAGE.getInputStream(), contentType);
try {
attachments.getRootPartContentType();
fail("Expected OMException");
@@ -221,7 +221,7 @@ public class AttachmentsTest extends Abs
}
public void testGetIncomingAttachmentStreams() throws Exception {
- InputStream inStream = getTestResource(TestConstants.MTOM_MESSAGE.getName());
+ InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
Attachments attachments = new Attachments(inStream, TestConstants.MTOM_MESSAGE.getContentType());
// Get the inputstream container
@@ -257,7 +257,7 @@ public class AttachmentsTest extends Abs
IncomingAttachmentInputStream dataIs;
InputStream expectedDataIs;
- InputStream inStream = getTestResource(TestConstants.MTOM_MESSAGE.getName());
+ InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
Attachments attachments = new Attachments(inStream, TestConstants.MTOM_MESSAGE.getContentType());
// Since SOAP part operated independently of other streams, access it
@@ -290,7 +290,7 @@ public class AttachmentsTest extends Abs
InputStream inStream;
Attachments attachments;
- inStream = getTestResource(TestConstants.MTOM_MESSAGE.getName());
+ inStream = TestConstants.MTOM_MESSAGE.getInputStream();
attachments = new Attachments(inStream, TestConstants.MTOM_MESSAGE.getContentType());
attachments.getDataHandler("2.urn:uuid:A3ADBAEE51A1A87B2A11443668160994@apache.org");
@@ -306,7 +306,7 @@ public class AttachmentsTest extends Abs
inStream.close();
// Try the other way around.
- inStream = getTestResource(TestConstants.MTOM_MESSAGE.getName());
+ inStream = TestConstants.MTOM_MESSAGE.getInputStream();
attachments = new Attachments(inStream, TestConstants.MTOM_MESSAGE.getContentType());
attachments.getIncomingAttachmentStreams();
@@ -355,7 +355,7 @@ public class AttachmentsTest extends Abs
}
public void testRemoveDataHandlerAfterParsing() {
- InputStream inStream = getTestResource(TestConstants.MTOM_MESSAGE.getName());
+ InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
Attachments attachments = new Attachments(inStream, TestConstants.MTOM_MESSAGE.getContentType());
Collection list = attachments.getContentIDSet();
@@ -379,7 +379,7 @@ public class AttachmentsTest extends Abs
* not yet been processed.
*/
public void testRemoveDataHandlerBeforeParsing() {
- InputStream inStream = getTestResource(TestConstants.MTOM_MESSAGE.getName());
+ InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
Attachments attachments = new Attachments(inStream, TestConstants.MTOM_MESSAGE.getContentType());
attachments.removeDataHandler("1.urn:uuid:A3ADBAEE51A1A87B2A11443668160943@apache.org");
Set idSet = attachments.getContentIDSet();
@@ -394,7 +394,7 @@ public class AttachmentsTest extends Abs
* doesn't contain a MIME part with the specified content ID.
*/
public void testRemoveDataHandlerNonExistingWithStream() {
- InputStream inStream = getTestResource(TestConstants.MTOM_MESSAGE.getName());
+ InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
Attachments attachments = new Attachments(inStream, TestConstants.MTOM_MESSAGE.getContentType());
attachments.removeDataHandler("non-existing@apache.org");
assertEquals(3, attachments.getContentIDSet().size());
@@ -666,7 +666,7 @@ public class AttachmentsTest extends Abs
}
private void testGetAttachmentSpecType(MIMEResource resource, String expectedResult) throws Exception {
- InputStream in = getTestResource(resource.getName());
+ InputStream in = resource.getInputStream();
try {
Attachments attachments = new Attachments(in, resource.getContentType());
assertEquals(expectedResult, attachments.getAttachmentSpecType());
@@ -693,7 +693,7 @@ public class AttachmentsTest extends Abs
}
private void testGetSizeOnDataSource(boolean useFiles) throws Exception {
- InputStream in = getTestResource(TestConstants.MTOM_MESSAGE.getName());
+ InputStream in = TestConstants.MTOM_MESSAGE.getInputStream();
try {
Attachments attachments;
if (useFiles) {
@@ -721,7 +721,7 @@ public class AttachmentsTest extends Abs
}
public void testIOExceptionInPartHeaders() throws Exception {
- InputStream in = getTestResource(TestConstants.MTOM_MESSAGE.getName());
+ InputStream in = TestConstants.MTOM_MESSAGE.getInputStream();
try {
Attachments attachments = new Attachments(new ExceptionInputStream(in, 1050), TestConstants.MTOM_MESSAGE.getContentType());
// TODO: decide what exception should be thrown exactly here
@@ -737,7 +737,7 @@ public class AttachmentsTest extends Abs
}
public void testIOExceptionInPartContent() throws Exception {
- InputStream in = getTestResource(TestConstants.MTOM_MESSAGE.getName());
+ InputStream in = TestConstants.MTOM_MESSAGE.getInputStream();
try {
Attachments attachments = new Attachments(new ExceptionInputStream(in, 1500), TestConstants.MTOM_MESSAGE.getContentType());
DataHandler dh = attachments.getDataHandler("1.urn:uuid:A3ADBAEE51A1A87B2A11443668160943@apache.org");
Modified: webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/attachments/PartOnFileTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/attachments/PartOnFileTest.java?rev=1679893&r1=1679892&r2=1679893&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/attachments/PartOnFileTest.java (original)
+++ webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/attachments/PartOnFileTest.java Sun May 17 19:49:43 2015
@@ -21,7 +21,6 @@ package org.apache.axiom.attachments;
import static com.google.common.truth.Truth.assertThat;
-import org.apache.axiom.om.AbstractTestCase;
import org.apache.axiom.om.TestConstants;
import javax.activation.DataHandler;
@@ -30,10 +29,11 @@ import javax.activation.DataSource;
import java.io.File;
import java.io.InputStream;
+import junit.framework.TestCase;
/** Test the PartOnFile class */
-public class PartOnFileTest extends AbstractTestCase {
+public class PartOnFileTest extends TestCase {
public PartOnFileTest(String testName) {
super(testName);
@@ -51,7 +51,7 @@ public class PartOnFileTest extends Abst
public void testHeaderGetSet() throws Exception {
- InputStream inStream = getTestResource(TestConstants.MTOM_MESSAGE.getName());
+ InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
Attachments attachments =
new Attachments(inStream, TestConstants.MTOM_MESSAGE.getContentType(), true, temp.getPath(), "1");
Modified: webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/om/MIMEResource.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/om/MIMEResource.java?rev=1679893&r1=1679892&r2=1679893&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/om/MIMEResource.java (original)
+++ webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/om/MIMEResource.java Sun May 17 19:49:43 2015
@@ -18,6 +18,7 @@
*/
package org.apache.axiom.om;
+import java.io.InputStream;
import java.text.ParseException;
import org.apache.axiom.mime.ContentType;
@@ -31,8 +32,13 @@ public class MIMEResource {
this.contentType = contentType;
}
- public String getName() {
- return name;
+ /**
+ * Get the content of this message.
+ *
+ * @return an input stream with the content of this message
+ */
+ public InputStream getInputStream() {
+ return MIMEResource.class.getClassLoader().getResourceAsStream(name);
}
public String getContentType() {
Modified: webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/xop/XOPDecodingStreamReaderTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/xop/XOPDecodingStreamReaderTest.java?rev=1679893&r1=1679892&r2=1679893&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/xop/XOPDecodingStreamReaderTest.java (original)
+++ webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/xop/XOPDecodingStreamReaderTest.java Sun May 17 19:49:43 2015
@@ -34,7 +34,7 @@ import org.apache.commons.codec.binary.B
public class XOPDecodingStreamReaderTest extends AbstractTestCase {
private XMLStreamReader getXOPDecodingStreamReader() throws Exception {
- Attachments attachments = new Attachments(getTestResource(TestConstants.MTOM_MESSAGE.getName()),
+ Attachments attachments = new Attachments(TestConstants.MTOM_MESSAGE.getInputStream(),
TestConstants.MTOM_MESSAGE.getContentType());
return new XOPDecodingStreamReader(
StAXUtils.createXMLStreamReader(attachments.getRootPartInputStream()),
Modified: webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/xop/XOPEncodingStreamReaderTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/xop/XOPEncodingStreamReaderTest.java?rev=1679893&r1=1679892&r2=1679893&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/xop/XOPEncodingStreamReaderTest.java (original)
+++ webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/xop/XOPEncodingStreamReaderTest.java Sun May 17 19:49:43 2015
@@ -21,14 +21,15 @@ package org.apache.axiom.util.stax.xop;
import javax.xml.stream.XMLStreamReader;
+import junit.framework.TestCase;
+
import org.apache.axiom.attachments.Attachments;
-import org.apache.axiom.om.AbstractTestCase;
import org.apache.axiom.om.TestConstants;
import org.apache.axiom.om.impl.builder.OMAttachmentAccessorMimePartProvider;
import org.apache.axiom.om.util.StAXUtils;
import org.apache.axiom.testutils.stax.XMLStreamReaderComparator;
-public class XOPEncodingStreamReaderTest extends AbstractTestCase {
+public class XOPEncodingStreamReaderTest extends TestCase {
private static ContentIDGenerator contentIDGenerator = new ContentIDGenerator() {
public String generateContentID(String existingContentID) {
if (existingContentID == null) {
@@ -42,7 +43,7 @@ public class XOPEncodingStreamReaderTest
Attachments[] attachments = new Attachments[2];
XMLStreamReader[] soapPartReader = new XMLStreamReader[2];
for (int i=0; i<2; i++) {
- attachments[i] = new Attachments(getTestResource(TestConstants.MTOM_MESSAGE.getName()),
+ attachments[i] = new Attachments(TestConstants.MTOM_MESSAGE.getInputStream(),
TestConstants.MTOM_MESSAGE.getContentType());
soapPartReader[i] = StAXUtils.createXMLStreamReader(attachments[i].getRootPartInputStream());
}
Modified: webservices/axiom/trunk/modules/axiom-compat/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-compat/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java?rev=1679893&r1=1679892&r2=1679893&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-compat/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java (original)
+++ webservices/axiom/trunk/modules/axiom-compat/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java Sun May 17 19:49:43 2015
@@ -19,7 +19,6 @@
package org.apache.axiom.attachments;
-import org.apache.axiom.om.AbstractTestCase;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMOutputFormat;
import org.apache.axiom.om.OMXMLBuilderFactory;
@@ -31,11 +30,13 @@ import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.StringWriter;
-public class AttachmentsTest extends AbstractTestCase {
+import junit.framework.TestCase;
+
+public class AttachmentsTest extends TestCase {
public void testSWAWriteWithIncomingOrder() throws Exception {
// Read the stream that has soap xml followed by BAttachment then AAttachment
- InputStream inStream = getTestResource(TestConstants.SWA_MESSAGE.getName());
+ InputStream inStream = TestConstants.SWA_MESSAGE.getInputStream();
Attachments attachments = new Attachments(inStream, TestConstants.SWA_MESSAGE.getContentType());
// Get the contentIDs to force the reading
Modified: webservices/axiom/trunk/systests/old-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/old-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java?rev=1679893&r1=1679892&r2=1679893&view=diff
==============================================================================
--- webservices/axiom/trunk/systests/old-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java (original)
+++ webservices/axiom/trunk/systests/old-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java Sun May 17 19:49:43 2015
@@ -20,7 +20,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.OMDocument;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMNode;
@@ -45,14 +44,16 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-public class MTOMStAXSOAPModelBuilderTest extends AbstractTestCase {
+import junit.framework.TestCase;
+
+public class MTOMStAXSOAPModelBuilderTest extends TestCase {
protected void setUp() throws Exception {
super.setUp();
}
private Attachments createAttachmentsForTestMTOMMessage() throws Exception {
- InputStream inStream = getTestResource(TestConstants.MTOM_MESSAGE_2.getName());
+ InputStream inStream = TestConstants.MTOM_MESSAGE_2.getInputStream();
return new Attachments(inStream, TestConstants.MTOM_MESSAGE_2.getContentType());
}
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xop/TestSerialize.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xop/TestSerialize.java?rev=1679893&r1=1679892&r2=1679893&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xop/TestSerialize.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xop/TestSerialize.java Sun May 17 19:49:43 2015
@@ -22,7 +22,6 @@ import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import org.apache.axiom.attachments.Attachments;
-import org.apache.axiom.om.AbstractTestCase;
import org.apache.axiom.om.MIMEResource;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMMetaFactory;
@@ -47,7 +46,7 @@ public class TestSerialize extends Axiom
MIMEResource testMessage = TestConstants.MTOM_MESSAGE;
// Read in message: SOAPPart and 2 image attachments
- InputStream inStream = AbstractTestCase.getTestResource(testMessage.getName());
+ InputStream inStream = testMessage.getInputStream();
Attachments attachments = new Attachments(inStream, testMessage.getContentType());
OMOutputFormat oof = new OMOutputFormat();
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/envelope/TestBuildWithAttachments.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/envelope/TestBuildWithAttachments.java?rev=1679893&r1=1679892&r2=1679893&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/envelope/TestBuildWithAttachments.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/envelope/TestBuildWithAttachments.java Sun May 17 19:49:43 2015
@@ -40,7 +40,7 @@ public class TestBuildWithAttachments ex
}
protected void runTest() throws Throwable {
- InputStream in = AbstractTestCase.getTestResource(TestConstants.MTOM_MESSAGE.getName());
+ InputStream in = TestConstants.MTOM_MESSAGE.getInputStream();
Attachments attachments = new Attachments(in, TestConstants.MTOM_MESSAGE.getContentType());
SOAPEnvelope envelope = OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory, attachments).getSOAPEnvelope();
envelope.buildWithAttachments();
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/mtom/TestGetXMLStreamReaderMTOMEncoded.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/mtom/TestGetXMLStreamReaderMTOMEncoded.java?rev=1679893&r1=1679892&r2=1679893&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/mtom/TestGetXMLStreamReaderMTOMEncoded.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/mtom/TestGetXMLStreamReaderMTOMEncoded.java Sun May 17 19:49:43 2015
@@ -25,7 +25,6 @@ import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamReader;
import org.apache.axiom.attachments.Attachments;
-import org.apache.axiom.om.AbstractTestCase;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.om.OMXMLBuilderFactory;
@@ -47,7 +46,7 @@ public class TestGetXMLStreamReaderMTOME
}
protected void runTest() throws Throwable {
- InputStream inStream = AbstractTestCase.getTestResource(TestConstants.MTOM_MESSAGE_2.getName());
+ InputStream inStream = TestConstants.MTOM_MESSAGE_2.getInputStream();
Attachments attachments = new Attachments(inStream, TestConstants.MTOM_MESSAGE_2.getContentType());
OMElement root = OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory, attachments).getDocumentElement();