You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ve...@apache.org on 2009/01/27 16:58:58 UTC

svn commit: r738117 - /webservices/axis2/trunk/java/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java

Author: veithen
Date: Tue Jan 27 15:58:57 2009
New Revision: 738117

URL: http://svn.apache.org/viewvc?rev=738117&view=rev
Log:
Removed test case that is no longer relevant since AXIS2-4202 is solved.

Modified:
    webservices/axis2/trunk/java/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java

Modified: webservices/axis2/trunk/java/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java?rev=738117&r1=738116&r2=738117&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java Tue Jan 27 15:58:57 2009
@@ -243,63 +243,6 @@
 
     }
 
-    // TODO: check why this doesn't work with Sun's SAAJ implementation
-    @Test
-    public void testSendReceiveNonRefAttachment() throws Exception {
-        MessageFactory mf = MessageFactory.newInstance();
-        SOAPMessage request = mf.createMessage();
-
-        //create the SOAPPart
-        createSimpleSOAPPart(request);
-
-        //Attach a text/plain object with the SOAP request
-        String sampleMessage = "Sample Message: Hello World!";
-        AttachmentPart textAttach = request.createAttachmentPart(sampleMessage, "text/plain");
-        request.addAttachmentPart(textAttach);
-
-        //Attach a java.awt.Image object to the SOAP request
-        String jpgfilename =
-                System.getProperty("basedir", ".") + "/" + "target/test-resources/axis2.jpg";
-        File myfile = new File(jpgfilename);
-        FileDataSource fds = new FileDataSource(myfile);
-        DataHandler imageDH = new DataHandler(fds);
-        AttachmentPart jpegAttach = request.createAttachmentPart(imageDH);
-        jpegAttach.addMimeHeader("Content-Transfer-Encoding", "binary");
-        jpegAttach.setContentType("image/jpg");
-        request.addAttachmentPart(jpegAttach);
-
-
-        SOAPConnection sCon = SOAPConnectionFactory.newInstance().createConnection();
-        SOAPMessage response = sCon.call(request, getAddress());
-
-        assertEquals(2, response.countAttachments());
-
-        Iterator attachIter = response.getAttachments();
-
-        while (attachIter.hasNext()) {
-            AttachmentPart attachment = (AttachmentPart)attachIter.next();
-            final Object content = attachment.getDataHandler().getContent();
-            if (content instanceof String) {
-                assertEquals(sampleMessage, (String)content);
-            } else if (content instanceof ByteArrayInputStream) {
-                ByteArrayInputStream bais = (ByteArrayInputStream)content;
-                byte[] b = new byte[15000];
-                final int lengthRead = bais.read(b);
-                FileOutputStream fos =
-                        new FileOutputStream(new File(System.getProperty("basedir", ".") + "/" +
-                                "target/target/test-resources/axis2.jpg"));
-                fos.write(b, 0, lengthRead);
-                fos.flush();
-                fos.close();
-
-                assertTrue(attachment.getContentType().equals("image/jpeg")
-                        || attachment.getContentType().equals("text/plain"));
-            }
-        }
-
-        sCon.close();
-    }
-
     private void createSOAPPart(SOAPMessage message) throws SOAPException {
         SOAPPart sPart = message.getSOAPPart();
         SOAPEnvelope env = sPart.getEnvelope();