cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1411563 - in /cxf/branches/2.5.x-fixes: rt/core/src/main/java/org/apache/cxf/attachment/ rt/core/src/test/java/org/apache/cxf/attachment/ systests/jaxws/src/test/java/org/apache/cxf/systest/provider/datasource/
Date Tue, 20 Nov 2012 06:47:01 GMT
Author: ffang
Date: Tue Nov 20 06:47:00 2012
New Revision: 1411563

URL: http://svn.apache.org/viewvc?rev=1411563&view=rev
Log:
 [CXF-4482]remove the explicitly writer.write(n) as it's not needed actually

Modified:
    cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
    cxf/branches/2.5.x-fixes/rt/core/src/test/java/org/apache/cxf/attachment/AttachmentSerializerTest.java
    cxf/branches/2.5.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/datasource/DataSourceProviderTest.java

Modified: cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java?rev=1411563&r1=1411562&r2=1411563&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
Tue Nov 20 06:47:00 2012
@@ -151,7 +151,6 @@ public class AttachmentSerializer {
             encoding = "UTF-8";
         }
         StringWriter writer = new StringWriter();
-        writer.write("\n");
         writer.write("--");
         writer.write(bodyBoundary);
         

Modified: cxf/branches/2.5.x-fixes/rt/core/src/test/java/org/apache/cxf/attachment/AttachmentSerializerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/core/src/test/java/org/apache/cxf/attachment/AttachmentSerializerTest.java?rev=1411563&r1=1411562&r2=1411563&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/core/src/test/java/org/apache/cxf/attachment/AttachmentSerializerTest.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/core/src/test/java/org/apache/cxf/attachment/AttachmentSerializerTest.java
Tue Nov 20 06:47:00 2012
@@ -27,6 +27,7 @@ import java.util.Collection;
 import java.util.Properties;
 
 import javax.activation.DataHandler;
+import javax.activation.DataSource;
 import javax.mail.Session;
 import javax.mail.internet.MimeBodyPart;
 import javax.mail.internet.MimeMessage;
@@ -90,8 +91,11 @@ public class AttachmentSerializerTest ex
         
         out.flush();
         
+        DataSource source = new ByteArrayDataSource(new ByteArrayInputStream(out.toByteArray()),
ct);
+        MimeMultipart mpart = new MimeMultipart(source);
         Session session = Session.getDefaultInstance(new Properties());
-        MimeMessage inMsg = new MimeMessage(session, new ByteArrayInputStream(out.toByteArray()));
+        MimeMessage inMsg = new MimeMessage(session);
+        inMsg.setContent(mpart);
         inMsg.addHeaderLine("Content-Type: " + ct);
         
         MimeMultipart multipart = (MimeMultipart) inMsg.getContent();
@@ -158,9 +162,12 @@ public class AttachmentSerializerTest ex
         serializer.writeAttachments();
         
         out.flush();
-        
+        DataSource source = new ByteArrayDataSource(new ByteArrayInputStream(out.toByteArray()),
ct);
+        MimeMultipart mpart = new MimeMultipart(source);
         Session session = Session.getDefaultInstance(new Properties());
-        MimeMessage inMsg = new MimeMessage(session, new ByteArrayInputStream(out.toByteArray()));
+        MimeMessage inMsg = new MimeMessage(session);
+        inMsg.setContent(mpart);
+        
         inMsg.addHeaderLine("Content-Type: " + ct);
         
         MimeMultipart multipart = (MimeMultipart) inMsg.getContent();

Modified: cxf/branches/2.5.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/datasource/DataSourceProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/datasource/DataSourceProviderTest.java?rev=1411563&r1=1411562&r2=1411563&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/datasource/DataSourceProviderTest.java
(original)
+++ cxf/branches/2.5.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/datasource/DataSourceProviderTest.java
Tue Nov 20 06:47:00 2012
@@ -28,10 +28,12 @@ import java.net.URL;
 import java.util.Properties;
 import java.util.logging.Logger;
 
+import javax.activation.DataSource;
 import javax.mail.MessagingException;
 import javax.mail.Session;
 import javax.mail.internet.MimeMessage;
 import javax.mail.internet.MimeMultipart;
+import javax.mail.util.ByteArrayDataSource;
 import javax.xml.transform.OutputKeys;
 import javax.xml.transform.Source;
 import javax.xml.transform.Transformer;
@@ -116,8 +118,11 @@ public class DataSourceProviderTest exte
     
     public static MimeMultipart readAttachmentParts(String contentType, InputStream bais)
throws 
         MessagingException, IOException {
+        DataSource source = new ByteArrayDataSource(bais, contentType);
+        MimeMultipart mpart = new MimeMultipart(source);
         Session session = Session.getDefaultInstance(new Properties());
-        MimeMessage mm = new MimeMessage(session, bais);
+        MimeMessage mm = new MimeMessage(session);
+        mm.setContent(mpart);
         mm.addHeaderLine("Content-Type:" + contentType);
         return (MimeMultipart) mm.getContent();
     }



Mime
View raw message