You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2012/11/20 07:18:44 UTC

svn commit: r1411557 - in /cxf/branches/2.6.x-fixes: ./ api/src/main/java/org/apache/cxf/attachment/ api/src/test/java/org/apache/cxf/attachment/ systests/jaxws/src/test/java/org/apache/cxf/systest/provider/datasource/

Author: ffang
Date: Tue Nov 20 06:18:43 2012
New Revision: 1411557

URL: http://svn.apache.org/viewvc?rev=1411557&view=rev
Log:
Merged revisions 1411506,1411519,1411547 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1411506 | ffang | 2012-11-20 09:56:17 +0800 (二, 20 11 2012) | 1 line
  
  [CXF-4482]get line.separator system property ensure CR/LF works across platforms
........
  r1411519 | ffang | 2012-11-20 10:59:05 +0800 (二, 20 11 2012) | 1 line
  
  [CXF-4482]use org.apache.cxf.common.util.SystemPropertyAction instead of sun.security.action.GetPropertyAction
........
  r1411547 | ffang | 2012-11-20 13:43:00 +0800 (二, 20 11 2012) | 1 line
  
  [CXF-4482]remove the explicitly line.separator as it's not needed actually
........

Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
    cxf/branches/2.6.x-fixes/api/src/test/java/org/apache/cxf/attachment/AttachmentSerializerTest.java
    cxf/branches/2.6.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/datasource/DataSourceProviderTest.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
    svn:mergeinfo = /cxf/trunk:1411506-1411547

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java?rev=1411557&r1=1411556&r2=1411557&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java (original)
+++ cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java Tue Nov 20 06:18:43 2012
@@ -153,7 +153,6 @@ public class AttachmentSerializer {
             encoding = "UTF-8";
         }
         StringWriter writer = new StringWriter();
-        writer.write("\n");
         writer.write("--");
         writer.write(bodyBoundary);
         

Modified: cxf/branches/2.6.x-fixes/api/src/test/java/org/apache/cxf/attachment/AttachmentSerializerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/api/src/test/java/org/apache/cxf/attachment/AttachmentSerializerTest.java?rev=1411557&r1=1411556&r2=1411557&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/api/src/test/java/org/apache/cxf/attachment/AttachmentSerializerTest.java (original)
+++ cxf/branches/2.6.x-fixes/api/src/test/java/org/apache/cxf/attachment/AttachmentSerializerTest.java Tue Nov 20 06:18:43 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.6.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/datasource/DataSourceProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/datasource/DataSourceProviderTest.java?rev=1411557&r1=1411556&r2=1411557&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/datasource/DataSourceProviderTest.java (original)
+++ cxf/branches/2.6.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/datasource/DataSourceProviderTest.java Tue Nov 20 06:18:43 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();
     }