servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r594255 - in /incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src: main/java/org/apache/servicemix/soap/marshalers/SoapWriter.java test/java/org/apache/servicemix/soap/marshalers/SoapWriterTest.java
Date Mon, 12 Nov 2007 18:41:44 GMT
Author: gertv
Date: Mon Nov 12 10:41:43 2007
New Revision: 594255

URL: http://svn.apache.org/viewvc?rev=594255&view=rev
Log:
SM-1119: Taking SourceTransformer.defaultCharset into account

Modified:
    incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/main/java/org/apache/servicemix/soap/marshalers/SoapWriter.java
    incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/test/java/org/apache/servicemix/soap/marshalers/SoapWriterTest.java

Modified: incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/main/java/org/apache/servicemix/soap/marshalers/SoapWriter.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/main/java/org/apache/servicemix/soap/marshalers/SoapWriter.java?rev=594255&r1=594254&r2=594255&view=diff
==============================================================================
--- incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/main/java/org/apache/servicemix/soap/marshalers/SoapWriter.java
(original)
+++ incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/main/java/org/apache/servicemix/soap/marshalers/SoapWriter.java
Mon Nov 12 10:41:43 2007
@@ -97,7 +97,7 @@
             parts = new MimeMultipart("related; type=\"text/xml\"; start=\"<" + SOAP_PART_ID
+ ">\"");
             return parts.getContentType();
         } else {
-            return "text/xml;charset=utf-8";
+            return "text/xml;charset=" + SourceTransformer.defaultCharset;
         }
     }
 

Modified: incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/test/java/org/apache/servicemix/soap/marshalers/SoapWriterTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/test/java/org/apache/servicemix/soap/marshalers/SoapWriterTest.java?rev=594255&r1=594254&r2=594255&view=diff
==============================================================================
--- incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/test/java/org/apache/servicemix/soap/marshalers/SoapWriterTest.java
(original)
+++ incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/test/java/org/apache/servicemix/soap/marshalers/SoapWriterTest.java
Mon Nov 12 10:41:43 2007
@@ -18,13 +18,22 @@
 
 import javax.activation.DataHandler;
 
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+
 import junit.framework.TestCase;
 
 public class SoapWriterTest extends TestCase {
 			
 	public void testGetContentTypeSimpleMessage() throws Exception {
 		SoapWriter writer = new SoapWriter(new SoapMarshaler(), new SoapMessage());
-		assertEquals("text/xml;charset=utf-8", writer.getContentType());
+		assertEquals("text/xml;charset=UTF-8", writer.getContentType());
+	}
+	
+	public void testGetContentTypeSimpleMessageDefaultCharsetChanged() throws Exception {
+		SourceTransformer.defaultCharset = "ISO-8859-1";
+		SoapWriter writer = new SoapWriter(new SoapMarshaler(), new SoapMessage());
+		assertEquals("text/xml;charset=ISO-8859-1", writer.getContentType());
+		SourceTransformer.defaultCharset = "UTF-8";
 	}
 	
 	public void testGetContentTypeComplexMessage() throws Exception {



Mime
View raw message