Author: veithen
Date: Tue May 19 02:11:46 2015
New Revision: 1680148

URL: http://svn.apache.org/r1680148
Log:
Move SwA and MTOM samples to soap-testsuite.

Added:
    
webservices/axiom/trunk/testing/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/mtom/
    
webservices/axiom/trunk/testing/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/mtom/sample1.msg
      - copied unchanged from r1679888, 
webservices/axiom/trunk/modules/axiom-api/src/test/resources/mtom/MTOMAttachmentStream.bin
    
webservices/axiom/trunk/testing/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/mtom/sample2.msg
      - copied unchanged from r1679888, 
webservices/axiom/trunk/modules/axiom-api/src/test/resources/mtom/MTOMBuilderTestIn.txt
    
webservices/axiom/trunk/testing/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/swa/
    
webservices/axiom/trunk/testing/soap-testsuite/src/main/resources/org/apache/axiom/ts/soap/swa/sample1.msg
      - copied unchanged from r1679888, 
webservices/axiom/trunk/modules/axiom-api/src/test/resources/soap/soap11/SWAAttachmentStream.txt
Removed:
    
webservices/axiom/trunk/modules/axiom-api/src/test/resources/mtom/MTOMAttachmentStream.bin
    
webservices/axiom/trunk/modules/axiom-api/src/test/resources/mtom/MTOMBuilderTestIn.txt
    
webservices/axiom/trunk/modules/axiom-api/src/test/resources/soap/soap11/SWAAttachmentStream.txt
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/TestConstants.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
    
webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/MIMESample.java
    
webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/MTOMSample.java
    
webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SwASample.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=1680148&r1=1680147&r2=1680148&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
 Tue May 19 02:11:46 2015
@@ -46,13 +46,13 @@ import org.apache.axiom.attachments.life
 import org.apache.axiom.ext.activation.SizeAwareDataSource;
 import org.apache.axiom.om.AbstractTestCase;
 import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.TestConstants;
 import org.apache.axiom.om.impl.MTOMConstants;
 import org.apache.axiom.testutils.activation.RandomDataSource;
 import org.apache.axiom.testutils.io.ExceptionInputStream;
 import org.apache.axiom.testutils.io.IOTestUtils;
 import org.apache.axiom.ts.soap.MIMESample;
 import org.apache.axiom.ts.soap.MTOMSample;
+import org.apache.axiom.ts.soap.SwASample;
 import org.apache.axiom.util.UIDGenerator;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.io.output.NullOutputStream;
@@ -65,22 +65,22 @@ public class AttachmentsTest extends Abs
     }
     
     public void testGetDataHandler() throws Exception {
-        InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
-        Attachments attachments = new Attachments(inStream, 
TestConstants.MTOM_MESSAGE.getContentType());
+        InputStream inStream = MTOMSample.SAMPLE1.getInputStream();
+        Attachments attachments = new Attachments(inStream, 
MTOMSample.SAMPLE1.getContentType());
 
         DataHandler dh = attachments
                 
.getDataHandler("2.urn:uuid:[email protected]");
         InputStream dataIs = dh.getDataSource().getInputStream();
 
-        InputStream expectedDataIs = TestConstants.MTOM_MESSAGE.getPart(2);
+        InputStream expectedDataIs = MTOMSample.SAMPLE1.getPart(2);
 
         // Compare data across streams
         IOTestUtils.compareStreams(dataIs, expectedDataIs);
     }
 
     public void testGetDataHandlerNonExistingMIMEPart() throws Exception {
-        InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
-        Attachments attachments = new Attachments(inStream, 
TestConstants.MTOM_MESSAGE.getContentType());
+        InputStream inStream = MTOMSample.SAMPLE1.getInputStream();
+        Attachments attachments = new Attachments(inStream, 
MTOMSample.SAMPLE1.getContentType());
 
         DataHandler dh = attachments.getDataHandler("ThisShouldReturnNull");
         assertNull(dh);
@@ -93,8 +93,8 @@ public class AttachmentsTest extends Abs
     }
 
     public void testGetAllContentIDs() throws Exception {
-        InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
-        Attachments attachments = new Attachments(inStream, 
TestConstants.MTOM_MESSAGE.getContentType());
+        InputStream inStream = MTOMSample.SAMPLE1.getInputStream();
+        Attachments attachments = new Attachments(inStream, 
MTOMSample.SAMPLE1.getContentType());
 
         String[] contentIDs = attachments.getAllContentIDs();
         assertEquals(3, contentIDs.length);
@@ -118,8 +118,8 @@ public class AttachmentsTest extends Abs
     }
     
     public void testGetContentIDSet() {
-        InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
-        Attachments attachments = new Attachments(inStream, 
TestConstants.MTOM_MESSAGE.getContentType());
+        InputStream inStream = MTOMSample.SAMPLE1.getInputStream();
+        Attachments attachments = new Attachments(inStream, 
MTOMSample.SAMPLE1.getContentType());
 
         Set idSet = attachments.getContentIDSet();
         
assertTrue(idSet.contains("0.urn:uuid:[email protected]"));
@@ -140,12 +140,12 @@ public class AttachmentsTest extends Abs
     }
     
     public void testGetContentLength() throws IOException {
-        InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
-        Attachments attachments = new Attachments(inStream, 
TestConstants.MTOM_MESSAGE.getContentType());
+        InputStream inStream = MTOMSample.SAMPLE1.getInputStream();
+        Attachments attachments = new Attachments(inStream, 
MTOMSample.SAMPLE1.getContentType());
         
         // Make sure the length is correct
         long length = attachments.getContentLength();
-        long fileSize = 
IOUtils.toByteArray(TestConstants.MTOM_MESSAGE.getInputStream()).length;
+        long fileSize = 
IOUtils.toByteArray(MTOMSample.SAMPLE1.getInputStream()).length;
         assertEquals("Return value of getContentLength()", fileSize, length);
     }
     
@@ -164,9 +164,9 @@ public class AttachmentsTest extends Abs
     private void testGetRootPartContentID(String contentTypeStartParam, String 
contentId)
             throws Exception {
         // It doesn't actually matter what the stream *is* it just needs to 
exist
-        String contentType = "multipart/related; boundary=\"" + 
TestConstants.MTOM_MESSAGE.getBoundary() +
+        String contentType = "multipart/related; boundary=\"" + 
MTOMSample.SAMPLE1.getBoundary() +
                 "\"; type=\"text/xml\"; start=\"" + contentTypeStartParam + 
"\"";
-        InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
+        InputStream inStream = MTOMSample.SAMPLE1.getInputStream();
         Attachments attachments = new Attachments(inStream, contentType);
         assertEquals("Did not obtain correct content ID", contentId,
                 attachments.getRootPartContentID());
@@ -208,9 +208,9 @@ public class AttachmentsTest extends Abs
      * is unable to determine the content type.
      */
     public void testGetRootPartContentTypeWithContentIDMismatch() {
-        String contentType = "multipart/related; boundary=\"" + 
TestConstants.MTOM_MESSAGE.getBoundary() +
+        String contentType = "multipart/related; boundary=\"" + 
MTOMSample.SAMPLE1.getBoundary() +
                 "\"; type=\"text/xml\"; 
start=\"<[email protected]>\"";
-        Attachments attachments = new 
Attachments(TestConstants.MTOM_MESSAGE.getInputStream(), contentType);
+        Attachments attachments = new 
Attachments(MTOMSample.SAMPLE1.getInputStream(), contentType);
         try {
             attachments.getRootPartContentType();
             fail("Expected OMException");
@@ -222,8 +222,8 @@ public class AttachmentsTest extends Abs
     }
     
     public void testGetIncomingAttachmentStreams() throws Exception {
-        InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
-        Attachments attachments = new Attachments(inStream, 
TestConstants.MTOM_MESSAGE.getContentType());
+        InputStream inStream = MTOMSample.SAMPLE1.getInputStream();
+        Attachments attachments = new Attachments(inStream, 
MTOMSample.SAMPLE1.getContentType());
 
         // Get the inputstream container
         IncomingAttachmentStreams ias = 
attachments.getIncomingAttachmentStreams();
@@ -254,7 +254,7 @@ public class AttachmentsTest extends Abs
     }
     
     public void testGetIncomingAttachmentStreams2() throws Exception {
-        MTOMSample sample = TestConstants.MTOM_MESSAGE;
+        MTOMSample sample = MTOMSample.SAMPLE1;
 
         IncomingAttachmentInputStream dataIs;
         InputStream expectedDataIs;
@@ -292,8 +292,8 @@ public class AttachmentsTest extends Abs
         InputStream inStream;
         Attachments attachments;
     
-        inStream = TestConstants.MTOM_MESSAGE.getInputStream();
-        attachments = new Attachments(inStream, 
TestConstants.MTOM_MESSAGE.getContentType());
+        inStream = MTOMSample.SAMPLE1.getInputStream();
+        attachments = new Attachments(inStream, 
MTOMSample.SAMPLE1.getContentType());
     
         
attachments.getDataHandler("2.urn:uuid:[email protected]");
     
@@ -308,8 +308,8 @@ public class AttachmentsTest extends Abs
         inStream.close();
     
         // Try the other way around.
-        inStream = TestConstants.MTOM_MESSAGE.getInputStream();
-        attachments = new Attachments(inStream, 
TestConstants.MTOM_MESSAGE.getContentType());
+        inStream = MTOMSample.SAMPLE1.getInputStream();
+        attachments = new Attachments(inStream, 
MTOMSample.SAMPLE1.getContentType());
     
         attachments.getIncomingAttachmentStreams();
     
@@ -357,8 +357,8 @@ public class AttachmentsTest extends Abs
     }
 
     public void testRemoveDataHandlerAfterParsing() {
-        InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
-        Attachments attachments = new Attachments(inStream, 
TestConstants.MTOM_MESSAGE.getContentType());
+        InputStream inStream = MTOMSample.SAMPLE1.getInputStream();
+        Attachments attachments = new Attachments(inStream, 
MTOMSample.SAMPLE1.getContentType());
 
         Collection list = attachments.getContentIDSet();
         assertEquals(3, list.size());
@@ -381,8 +381,8 @@ public class AttachmentsTest extends Abs
      * not yet been processed.
      */
     public void testRemoveDataHandlerBeforeParsing() {
-        InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
-        Attachments attachments = new Attachments(inStream, 
TestConstants.MTOM_MESSAGE.getContentType());
+        InputStream inStream = MTOMSample.SAMPLE1.getInputStream();
+        Attachments attachments = new Attachments(inStream, 
MTOMSample.SAMPLE1.getContentType());
         
attachments.removeDataHandler("1.urn:uuid:[email protected]");
         Set idSet = attachments.getContentIDSet();
         assertEquals(2, idSet.size());
@@ -396,8 +396,8 @@ public class AttachmentsTest extends Abs
      * doesn't contain a MIME part with the specified content ID.
      */
     public void testRemoveDataHandlerNonExistingWithStream() {
-        InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
-        Attachments attachments = new Attachments(inStream, 
TestConstants.MTOM_MESSAGE.getContentType());
+        InputStream inStream = MTOMSample.SAMPLE1.getInputStream();
+        Attachments attachments = new Attachments(inStream, 
MTOMSample.SAMPLE1.getContentType());
         attachments.removeDataHandler("[email protected]");
         assertEquals(3, attachments.getContentIDSet().size());
     }
@@ -678,11 +678,11 @@ public class AttachmentsTest extends Abs
     }
     
     public void testGetAttachmentSpecTypeMTOM() throws Exception {
-        testGetAttachmentSpecType(TestConstants.MTOM_MESSAGE, 
MTOMConstants.MTOM_TYPE);
+        testGetAttachmentSpecType(MTOMSample.SAMPLE1, MTOMConstants.MTOM_TYPE);
     }
     
     public void testGetAttachmentSpecTypeSWA() throws Exception {
-        testGetAttachmentSpecType(TestConstants.SWA_MESSAGE, 
MTOMConstants.SWA_TYPE);
+        testGetAttachmentSpecType(SwASample.SAMPLE1, MTOMConstants.SWA_TYPE);
     }
     
     public void testGetAttachmentSpecTypeWithoutStream() {
@@ -695,14 +695,14 @@ public class AttachmentsTest extends Abs
     }
 
     private void testGetSizeOnDataSource(boolean useFiles) throws Exception {
-        InputStream in = TestConstants.MTOM_MESSAGE.getInputStream();
+        InputStream in = MTOMSample.SAMPLE1.getInputStream();
         try {
             Attachments attachments;
             if (useFiles) {
-                attachments = new Attachments(in, 
TestConstants.MTOM_MESSAGE.getContentType(),
+                attachments = new Attachments(in, 
MTOMSample.SAMPLE1.getContentType(),
                         true, getAttachmentsDir(), "4096");
             } else {
-                attachments = new Attachments(in, 
TestConstants.MTOM_MESSAGE.getContentType());
+                attachments = new Attachments(in, 
MTOMSample.SAMPLE1.getContentType());
             }
             DataHandler dh = attachments
                     
.getDataHandler("2.urn:uuid:[email protected]");
@@ -723,9 +723,9 @@ public class AttachmentsTest extends Abs
     }
     
     public void testIOExceptionInPartHeaders() throws Exception {
-        InputStream in = TestConstants.MTOM_MESSAGE.getInputStream();
+        InputStream in = MTOMSample.SAMPLE1.getInputStream();
         try {
-            Attachments attachments = new Attachments(new 
ExceptionInputStream(in, 1050), TestConstants.MTOM_MESSAGE.getContentType());
+            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:[email protected]");
@@ -739,9 +739,9 @@ public class AttachmentsTest extends Abs
     }
     
     public void testIOExceptionInPartContent() throws Exception {
-        InputStream in = TestConstants.MTOM_MESSAGE.getInputStream();
+        InputStream in = MTOMSample.SAMPLE1.getInputStream();
         try {
-            Attachments attachments = new Attachments(new 
ExceptionInputStream(in, 1500), TestConstants.MTOM_MESSAGE.getContentType());
+            Attachments attachments = new Attachments(new 
ExceptionInputStream(in, 1500), MTOMSample.SAMPLE1.getContentType());
             DataHandler dh = 
attachments.getDataHandler("1.urn:uuid:[email protected]");
             // TODO: decide what exception should be thrown exactly here
             try {

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=1680148&r1=1680147&r2=1680148&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
 Tue May 19 02:11:46 2015
@@ -21,7 +21,7 @@ package org.apache.axiom.attachments;
 
 import static com.google.common.truth.Truth.assertThat;
 
-import org.apache.axiom.om.TestConstants;
+import org.apache.axiom.ts.soap.MTOMSample;
 
 import javax.activation.DataHandler;
 import javax.activation.DataSource;
@@ -51,9 +51,9 @@ public class PartOnFileTest extends Test
 
     public void testHeaderGetSet() throws Exception {
 
-        InputStream inStream = TestConstants.MTOM_MESSAGE.getInputStream();
+        InputStream inStream = MTOMSample.SAMPLE1.getInputStream();
         Attachments attachments =
-                new Attachments(inStream, 
TestConstants.MTOM_MESSAGE.getContentType(), true, temp.getPath(), "1");
+                new Attachments(inStream, MTOMSample.SAMPLE1.getContentType(), 
true, temp.getPath(), "1");
 
         DataHandler dh = attachments
                 
.getDataHandler("1.urn:uuid:[email protected]");

Modified: 
webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/om/TestConstants.java
URL: 
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/om/TestConstants.java?rev=1680148&r1=1680147&r2=1680148&view=diff
==============================================================================
--- 
webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/om/TestConstants.java
 (original)
+++ 
webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/om/TestConstants.java
 Tue May 19 02:11:46 2015
@@ -19,8 +19,6 @@
 
 package org.apache.axiom.om;
 
-import org.apache.axiom.ts.soap.MTOMSample;
-import org.apache.axiom.ts.soap.SwASample;
 
 /** All the various files created 03-Nov-2005 12:02:12 */
 
@@ -32,26 +30,6 @@ public class TestConstants {
     public static final String REALLY_BIG_MESSAGE = 
"soap/soap11/reallyReallyBigMessage.xml";
     public static final String EMPTY_BODY_MESSAGE = 
"soap/soap11/emtyBodymessage.xml";
 
-    public static final MTOMSample MTOM_MESSAGE = new 
MTOMSample("mtom/MTOMAttachmentStream.bin",
-            "multipart/related; " +
-            
"boundary=\"MIMEBoundaryurn:uuid:A3ADBAEE51A1A87B2A11443668160701\"; " +
-            "type=\"application/xop+xml\"; " +
-            
"start=\"<0.urn:uuid:[email protected]>\"; " +
-            "start-info=\"application/soap+xml\"; " +
-            "charset=UTF-8;" +
-            "action=\"mtomSample\"");
-    
-    public static final MTOMSample MTOM_MESSAGE_2 = new 
MTOMSample("mtom/MTOMBuilderTestIn.txt",
-            "multipart/Related; charset=\"UTF-8\"; 
type=\"application/xop+xml\"; " +
-            "boundary=\"----=_AxIs2_Def_boundary_=42214532\"; 
start=\"SOAPPart\"");
-    
-    public static final SwASample SWA_MESSAGE = new SwASample(
-            "soap/soap11/SWAAttachmentStream.txt",
-            "multipart/related; " +
-            
"boundary=\"MIMEBoundaryurn:uuid:A3ADBAEE51A1A87B2A11443668160701\"; " +
-            "type=\"text/xml\"; " +
-            
"start=\"<0.urn:uuid:[email protected]>\"");
-    
     private TestConstants() {
     }
 

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=1680148&r1=1680147&r2=1680148&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
 Tue May 19 02:11:46 2015
@@ -27,16 +27,16 @@ import javax.xml.stream.XMLStreamReader;
 import junit.framework.TestCase;
 
 import org.apache.axiom.attachments.Attachments;
-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;
+import org.apache.axiom.ts.soap.MTOMSample;
 import org.apache.commons.codec.binary.Base64;
 
 public class XOPDecodingStreamReaderTest extends TestCase {
     private XMLStreamReader getXOPDecodingStreamReader() throws Exception {
-        Attachments attachments = new 
Attachments(TestConstants.MTOM_MESSAGE.getInputStream(),
-                TestConstants.MTOM_MESSAGE.getContentType());
+        Attachments attachments = new 
Attachments(MTOMSample.SAMPLE1.getInputStream(),
+                MTOMSample.SAMPLE1.getContentType());
         return new XOPDecodingStreamReader(
                 
StAXUtils.createXMLStreamReader(attachments.getRootPartInputStream()),
                 new OMAttachmentAccessorMimePartProvider(attachments));
@@ -44,7 +44,7 @@ public class XOPDecodingStreamReaderTest
     
     public void testCompareToInlined() throws Exception {
         XMLStreamReader expected = StAXUtils.createXMLStreamReader(
-                TestConstants.MTOM_MESSAGE.getInlinedMessage());
+                MTOMSample.SAMPLE1.getInlinedMessage());
         XMLStreamReader actual = getXOPDecodingStreamReader();
         XMLStreamReaderComparator comparator = new 
XMLStreamReaderComparator(expected, actual);
         comparator.addPrefix("xop");

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=1680148&r1=1680147&r2=1680148&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
 Tue May 19 02:11:46 2015
@@ -24,10 +24,10 @@ import javax.xml.stream.XMLStreamReader;
 import junit.framework.TestCase;
 
 import org.apache.axiom.attachments.Attachments;
-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;
+import org.apache.axiom.ts.soap.MTOMSample;
 
 public class XOPEncodingStreamReaderTest extends TestCase {
     private static ContentIDGenerator contentIDGenerator = new 
ContentIDGenerator() {
@@ -43,8 +43,8 @@ public class XOPEncodingStreamReaderTest
         Attachments[] attachments = new Attachments[2];
         XMLStreamReader[] soapPartReader = new XMLStreamReader[2];
         for (int i=0; i<2; i++) {
-            attachments[i] = new 
Attachments(TestConstants.MTOM_MESSAGE.getInputStream(),
-                    TestConstants.MTOM_MESSAGE.getContentType());
+            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 
OMAttachmentAccessorMimePartProvider(attachments[1])), contentIDGenerator, 
OptimizationPolicy.DEFAULT);

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=1680148&r1=1680147&r2=1680148&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
 Tue May 19 02:11:46 2015
@@ -22,9 +22,9 @@ package org.apache.axiom.attachments;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMOutputFormat;
 import org.apache.axiom.om.OMXMLBuilderFactory;
-import org.apache.axiom.om.TestConstants;
 import org.apache.axiom.om.impl.MIMEOutputUtils;
 import org.apache.axiom.soap.SOAPModelBuilder;
+import org.apache.axiom.ts.soap.SwASample;
 
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
@@ -36,8 +36,8 @@ public class AttachmentsTest extends Tes
     public void testSWAWriteWithIncomingOrder() throws Exception {
 
         // Read the stream that has soap xml followed by BAttachment then 
AAttachment
-        InputStream inStream = TestConstants.SWA_MESSAGE.getInputStream();
-        Attachments attachments = new Attachments(inStream, 
TestConstants.SWA_MESSAGE.getContentType());
+        InputStream inStream = SwASample.SAMPLE1.getInputStream();
+        Attachments attachments = new Attachments(inStream, 
SwASample.SAMPLE1.getContentType());
 
         // Get the contentIDs to force the reading
         String[] contentIDs = attachments.getAllContentIDs();

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=1680148&r1=1680147&r2=1680148&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
 Tue May 19 02:11:46 2015
@@ -27,9 +27,9 @@ import org.apache.axiom.om.OMOutputForma
 import org.apache.axiom.om.OMText;
 import org.apache.axiom.om.OMXMLBuilderFactory;
 import org.apache.axiom.om.OMXMLStreamReader;
-import org.apache.axiom.om.TestConstants;
 import org.apache.axiom.om.impl.builder.StAXBuilder;
 import org.apache.axiom.soap.SOAPModelBuilder;
+import org.apache.axiom.ts.soap.MTOMSample;
 import org.apache.axiom.util.stax.XMLStreamReaderUtils;
 import org.apache.axiom.util.stax.xop.XOPUtils;
 
@@ -53,8 +53,8 @@ public class MTOMStAXSOAPModelBuilderTes
     }
 
     private Attachments createAttachmentsForTestMTOMMessage() throws Exception 
{
-        InputStream inStream = TestConstants.MTOM_MESSAGE_2.getInputStream();
-        return new Attachments(inStream, 
TestConstants.MTOM_MESSAGE_2.getContentType());
+        InputStream inStream = MTOMSample.SAMPLE2.getInputStream();
+        return new Attachments(inStream, MTOMSample.SAMPLE2.getContentType());
     }
 
     private OMElement createTestMTOMMessage() throws Exception {

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=1680148&r1=1680147&r2=1680148&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
 Tue May 19 02:11:46 2015
@@ -27,7 +27,6 @@ import org.apache.axiom.om.OMMetaFactory
 import org.apache.axiom.om.OMOutputFormat;
 import org.apache.axiom.om.OMXMLBuilderFactory;
 import org.apache.axiom.om.OMXMLParserWrapper;
-import org.apache.axiom.om.TestConstants;
 import org.apache.axiom.om.impl.MTOMXMLStreamWriter;
 import org.apache.axiom.om.util.StAXParserConfiguration;
 import org.apache.axiom.ts.AxiomTestCase;
@@ -43,7 +42,7 @@ public class TestSerialize extends Axiom
     }
 
     protected void runTest() throws Throwable {
-        MTOMSample testMessage = TestConstants.MTOM_MESSAGE;
+        MTOMSample testMessage = MTOMSample.SAMPLE1;
 
         // Read in message: SOAPPart and 2 image attachments
         InputStream inStream = testMessage.getInputStream();

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=1680148&r1=1680147&r2=1680148&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
 Tue May 19 02:11:46 2015
@@ -28,7 +28,6 @@ import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.OMText;
 import org.apache.axiom.om.OMXMLBuilderFactory;
-import org.apache.axiom.om.TestConstants;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.testutils.io.IOTestUtils;
 import org.apache.axiom.ts.AxiomTestCase;
@@ -40,7 +39,7 @@ public class TestBuildWithAttachments ex
     }
 
     protected void runTest() throws Throwable {
-        MTOMSample sample = TestConstants.MTOM_MESSAGE;
+        MTOMSample sample = MTOMSample.SAMPLE1;
         InputStream in = sample.getInputStream();
         Attachments attachments = new Attachments(in, sample.getContentType());
         SOAPEnvelope envelope = 
OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory, 
attachments).getSOAPEnvelope();

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=1680148&r1=1680147&r2=1680148&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
 Tue May 19 02:11:46 2015
@@ -28,8 +28,8 @@ import org.apache.axiom.attachments.Atta
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.OMXMLBuilderFactory;
-import org.apache.axiom.om.TestConstants;
 import org.apache.axiom.ts.AxiomTestCase;
+import org.apache.axiom.ts.soap.MTOMSample;
 import org.apache.axiom.util.stax.xop.XOPEncodedStream;
 import org.apache.axiom.util.stax.xop.XOPUtils;
 
@@ -46,8 +46,8 @@ public class TestGetXMLStreamReaderMTOME
     }
 
     protected void runTest() throws Throwable {
-        InputStream inStream = TestConstants.MTOM_MESSAGE_2.getInputStream();
-        Attachments attachments = new Attachments(inStream, 
TestConstants.MTOM_MESSAGE_2.getContentType());
+        InputStream inStream = MTOMSample.SAMPLE2.getInputStream();
+        Attachments attachments = new Attachments(inStream, 
MTOMSample.SAMPLE2.getContentType());
         OMElement root = 
OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory, 
attachments).getDocumentElement();
         
         // Use tree as input to XMLStreamReader

Modified: 
webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/MIMESample.java
URL: 
http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/MIMESample.java?rev=1680148&r1=1680147&r2=1680148&view=diff
==============================================================================
--- 
webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/MIMESample.java
 (original)
+++ 
webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/MIMESample.java
 Tue May 19 02:11:46 2015
@@ -44,7 +44,7 @@ public abstract class MIMESample {
      * @return an input stream with the content of this message
      */
     public InputStream getInputStream() {
-        return MIMESample.class.getClassLoader().getResourceAsStream(name);
+        return MIMESample.class.getResourceAsStream(name);
     }
 
     public String getContentType() {

Modified: 
webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/MTOMSample.java
URL: 
http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/MTOMSample.java?rev=1680148&r1=1680147&r2=1680148&view=diff
==============================================================================
--- 
webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/MTOMSample.java
 (original)
+++ 
webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/MTOMSample.java
 Tue May 19 02:11:46 2015
@@ -36,8 +36,21 @@ import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
 public class MTOMSample extends MIMESample {
-    public MTOMSample(String name, String contentType) {
-        super(name, contentType);
+    public static final MTOMSample SAMPLE1 = new MTOMSample("sample1.msg",
+            "multipart/related; " +
+            
"boundary=\"MIMEBoundaryurn:uuid:A3ADBAEE51A1A87B2A11443668160701\"; " +
+            "type=\"application/xop+xml\"; " +
+            
"start=\"<0.urn:uuid:[email protected]>\"; " +
+            "start-info=\"application/soap+xml\"; " +
+            "charset=UTF-8;" +
+            "action=\"mtomSample\"");
+    
+    public static final MTOMSample SAMPLE2 = new MTOMSample("sample2.msg",
+            "multipart/Related; charset=\"UTF-8\"; 
type=\"application/xop+xml\"; " +
+            "boundary=\"----=_AxIs2_Def_boundary_=42214532\"; 
start=\"SOAPPart\"");
+
+    private MTOMSample(String name, String contentType) {
+        super("mtom/" + name, contentType);
     }
     
     public InputStream getInlinedMessage() {

Modified: 
webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SwASample.java
URL: 
http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SwASample.java?rev=1680148&r1=1680147&r2=1680148&view=diff
==============================================================================
--- 
webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SwASample.java
 (original)
+++ 
webservices/axiom/trunk/testing/soap-testsuite/src/main/java/org/apache/axiom/ts/soap/SwASample.java
 Tue May 19 02:11:46 2015
@@ -19,7 +19,13 @@
 package org.apache.axiom.ts.soap;
 
 public class SwASample extends MIMESample {
-    public SwASample(String name, String contentType) {
-        super(name, contentType);
+    public static final SwASample SAMPLE1 = new SwASample("sample1.msg",
+            "multipart/related; " +
+            
"boundary=\"MIMEBoundaryurn:uuid:A3ADBAEE51A1A87B2A11443668160701\"; " +
+            "type=\"text/xml\"; " +
+            
"start=\"<0.urn:uuid:[email protected]>\"");
+
+    private SwASample(String name, String contentType) {
+        super("swa/" + name, contentType);
     }
 }


Reply via email to