cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [1/3] git commit: Allow for ignorable spaces in the return values for the tests.
Date Thu, 07 Aug 2014 18:42:59 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 6256b7c7c -> 470bdcb40


Allow for ignorable spaces in the return values for the tests.


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

Branch: refs/heads/master
Commit: 478de215af2da2c03f439bbbd8341b234bb7bee8
Parents: 6256b7c
Author: Daniel Kulp <dkulp@apache.org>
Authored: Thu Aug 7 10:37:02 2014 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Thu Aug 7 10:37:02 2014 -0400

----------------------------------------------------------------------
 .../apache/cxf/systest/jaxws/ClientServerTest.java    | 14 +++++++++++---
 .../apache/cxf/systest/jaxws/ClientServerXMLTest.java | 10 +++++++++-
 2 files changed, 20 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/478de215/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
index 1c15a17..abc9ed8 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
@@ -728,7 +728,7 @@ public class ClientServerTest extends AbstractBusClientServerTestBase
{
                 BindingProvider bp = (BindingProvider)greeter;
                 Map<String, Object> responseContext = bp.getResponseContext();
                 String contentType = (String) responseContext.get(Message.CONTENT_TYPE);
-                assertEquals("text/xml;charset=utf-8", contentType.toLowerCase());
+                assertEquals("text/xml;charset=utf-8", stripSpaces(contentType.toLowerCase()));
                 Integer responseCode = (Integer) responseContext.get(Message.RESPONSE_CODE);
                 assertEquals(500, responseCode.intValue());                
                 assertNotNull(brlf.getFaultInfo());
@@ -772,7 +772,7 @@ public class ClientServerTest extends AbstractBusClientServerTestBase
{
         
         assertEquals(200, httpConnection.getResponseCode());
     
-        assertEquals("text/xml;charset=utf-8", httpConnection.getContentType().toLowerCase());
+        assertEquals("text/xml;charset=utf-8", stripSpaces(httpConnection.getContentType().toLowerCase()));
         assertEquals("OK", httpConnection.getResponseMessage());
         
         InputStream in = httpConnection.getInputStream();
@@ -782,6 +782,14 @@ public class ClientServerTest extends AbstractBusClientServerTestBase
{
         assertNotNull(doc);
     }
     
+    String stripSpaces(String s) {
+        String s2 = s.replace(" ", "");
+        while (!s2.equals(s)) {
+            s = s2;
+            s2 = s.replace(" ", "");
+        }
+        return s2;
+    }
     @Test
     public void testGetWSDLWithGzip() throws Exception {
         String url = "http://localhost:" + PORT + "/SoapContext/SoapPortWithGzip?wsdl";
@@ -789,7 +797,7 @@ public class ClientServerTest extends AbstractBusClientServerTestBase
{
         httpConnection.setRequestProperty("Accept-Encoding", "gzip, deflate");
         httpConnection.connect();
         assertEquals(200, httpConnection.getResponseCode());
-        assertEquals("text/xml;charset=utf-8", httpConnection.getContentType().toLowerCase());
+        assertEquals("text/xml;charset=utf-8", stripSpaces(httpConnection.getContentType().toLowerCase()));
         assertEquals("OK", httpConnection.getResponseMessage());
         assertEquals("gzip", httpConnection.getContentEncoding());
         InputStream in = httpConnection.getInputStream();

http://git-wip-us.apache.org/repos/asf/cxf/blob/478de215/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerXMLTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerXMLTest.java
b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerXMLTest.java
index 796dc55..d6a5ba7 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerXMLTest.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerXMLTest.java
@@ -223,6 +223,14 @@ public class ClientServerXMLTest extends AbstractBusClientServerTestBase
{
         }
        
     }
+    String stripSpaces(String s) {
+        String s2 = s.replace(" ", "");
+        while (!s2.equals(s)) {
+            s = s2;
+            s2 = s.replace(" ", "");
+        }
+        return s2;
+    }
 
     @Test
     public void testXMLFault() throws Exception {
@@ -243,7 +251,7 @@ public class ClientServerXMLTest extends AbstractBusClientServerTestBase
{
             BindingProvider bp = (BindingProvider) greeter;
             Map<String, Object> responseContext = bp.getResponseContext();
             String contentType = (String) responseContext.get(Message.CONTENT_TYPE);
-            assertEquals("text/xml;charset=utf-8", contentType.toLowerCase());
+            assertEquals("text/xml;charset=utf-8", stripSpaces(contentType.toLowerCase()));
             Integer responseCode = (Integer) responseContext.get(Message.RESPONSE_CODE);
             assertEquals(500, responseCode.intValue());
         }


Mime
View raw message