cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [5/6] git commit: Send the appropriate charset so the server does the right thing
Date Thu, 07 Aug 2014 20:58:27 GMT
Send the appropriate charset so the server does the right thing


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/46838d8a
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/46838d8a
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/46838d8a

Branch: refs/heads/master
Commit: 46838d8a346687e9f8ff2f6e279e3ba83f99c5f3
Parents: 91d6630
Author: Daniel Kulp <dkulp@apache.org>
Authored: Thu Aug 7 16:09:12 2014 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Thu Aug 7 16:09:12 2014 -0400

----------------------------------------------------------------------
 .../cxf/systest/soap12/Soap12ClientServerTest.java     | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/46838d8a/systests/uncategorized/src/test/java/org/apache/cxf/systest/soap12/Soap12ClientServerTest.java
----------------------------------------------------------------------
diff --git a/systests/uncategorized/src/test/java/org/apache/cxf/systest/soap12/Soap12ClientServerTest.java
b/systests/uncategorized/src/test/java/org/apache/cxf/systest/soap12/Soap12ClientServerTest.java
index 1bbd092..8abc9ba 100644
--- a/systests/uncategorized/src/test/java/org/apache/cxf/systest/soap12/Soap12ClientServerTest.java
+++ b/systests/uncategorized/src/test/java/org/apache/cxf/systest/soap12/Soap12ClientServerTest.java
@@ -83,7 +83,14 @@ public class Soap12ClientServerTest extends AbstractBusClientServerTestBase
{
             assertEquals("PingMeFault raised by server", ex.getMessage());            
         }
     }
-    
+    String stripSpaces(String s) {
+        String s2 = s.replace(" ", "");
+        while (!s2.equals(s)) {
+            s = s2;
+            s2 = s.replace(" ", "");
+        }
+        return s2;
+    }    
     @Test
     public void testSayHiSoap12ToSoap11() throws Exception {
         HttpURLConnection httpConnection = 
@@ -94,7 +101,7 @@ public class Soap12ClientServerTest extends AbstractBusClientServerTestBase
{
         assertNotNull("could not load test data", reqin);
 
         httpConnection.setRequestMethod("POST");
-        httpConnection.addRequestProperty("Content-Type", "text/xml");
+        httpConnection.addRequestProperty("Content-Type", "text/xml;charset=utf-8");
         OutputStream reqout = httpConnection.getOutputStream();
         IOUtils.copy(reqin, reqout);
         reqout.close();
@@ -105,7 +112,7 @@ public class Soap12ClientServerTest extends AbstractBusClientServerTestBase
{
         assertNotNull(respin);
         
         // we expect a soap 1.1 fault from the soap 1.1 test service that does not support
soap 1.2
-        assertEquals("text/xml;charset=utf-8", httpConnection.getContentType().toLowerCase());
+        assertEquals("text/xml;charset=utf-8", stripSpaces(httpConnection.getContentType().toLowerCase()));
        
         Document doc = StaxUtils.read(respin);
         assertNotNull(doc);


Mime
View raw message