Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BCE9F116D4 for ; Thu, 7 Aug 2014 20:58:23 +0000 (UTC) Received: (qmail 13390 invoked by uid 500); 7 Aug 2014 20:58:23 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 13238 invoked by uid 500); 7 Aug 2014 20:58:23 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 12832 invoked by uid 99); 7 Aug 2014 20:58:23 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Aug 2014 20:58:23 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 4DAD094AE4A; Thu, 7 Aug 2014 20:58:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dkulp@apache.org To: commits@cxf.apache.org Date: Thu, 07 Aug 2014 20:58:27 -0000 Message-Id: <4630406e79d0420a956471ba7ec84125@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [5/6] git commit: Send the appropriate charset so the server does the right thing 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 Authored: Thu Aug 7 16:09:12 2014 -0400 Committer: Daniel Kulp 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);