cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject git commit: fix pmd error in websocket tests and add sendText tests
Date Thu, 13 Mar 2014 16:59:34 GMT
Repository: cxf
Updated Branches:
  refs/heads/master aff4f5d14 -> 66465468f


fix pmd error in websocket tests and add sendText tests


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

Branch: refs/heads/master
Commit: 66465468f1e2aa68a32212437f944bc559cffc03
Parents: aff4f5d
Author: Akitoshi Yoshida <ay@apache.org>
Authored: Thu Mar 13 17:58:33 2014 +0100
Committer: Akitoshi Yoshida <ay@apache.org>
Committed: Thu Mar 13 17:59:08 2014 +0100

----------------------------------------------------------------------
 .../JAXRSClientServerWebSocketTest.java         | 24 ++++++++++++++++++++
 1 file changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/66465468/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketTest.java
index ff3e7c4..2859c6b 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketTest.java
@@ -57,6 +57,18 @@ public class JAXRSClientServerWebSocketTest extends AbstractBusClientServerTestB
             String value = resp.getTextEntity();
             assertEquals("CXF in Action", value);
             
+            // call the same GET service in the text mode
+            wsclient.reset(1);
+            wsclient.sendTextMessage("GET /websocket/web/bookstore/booknames");
+            assertTrue("one book must be returned", wsclient.await(3));
+            received = wsclient.getReceived();
+            assertEquals(1, received.size());
+            resp = new Response(received.get(0));
+            assertEquals(200, resp.getStatusCode());
+            assertEquals("text/plain", resp.getContentType());
+            value = resp.getTextEntity();
+            assertEquals("CXF in Action", value);
+
             // call another GET service
             wsclient.reset(1);
             wsclient.sendMessage("GET /websocket/web/bookstore/books/123".getBytes());
@@ -81,6 +93,18 @@ public class JAXRSClientServerWebSocketTest extends AbstractBusClientServerTestB
             value = resp.getTextEntity();
             assertEquals("123", value);
             
+            // call the same POST service in the text mode 
+            wsclient.reset(1);
+            wsclient.sendTextMessage(
+                "POST /websocket/web/bookstore/booksplain\r\nContent-Type: text/plain\r\n\r\n123");
+            assertTrue("response expected", wsclient.await(3));
+            received = wsclient.getReceived();
+            resp = new Response(received.get(0));
+            assertEquals(200, resp.getStatusCode());
+            assertEquals("text/plain", resp.getContentType());
+            value = resp.getTextEntity();
+            assertEquals("123", value);
+
             // call the GET service returning a continous stream output
             wsclient.reset(6);
             wsclient.sendMessage("GET /websocket/web/bookstore/bookbought".getBytes());


Mime
View raw message