cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Updating JAXRS failover test to also use a POST with a body
Date Thu, 29 Oct 2015 22:09:16 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 21eb43d29 -> 426206197


Updating JAXRS failover test to also use a POST with a body


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

Branch: refs/heads/2.7.x-fixes
Commit: 426206197ab5babec4ee7a775529bb3c1163dcb1
Parents: 21eb43d
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Thu Oct 29 22:00:22 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Thu Oct 29 22:08:56 2015 +0000

----------------------------------------------------------------------
 .../java/org/apache/cxf/systest/jaxrs/BookStore.java    |  7 +++++++
 .../apache/cxf/systest/jaxrs/failover/FailoverTest.java | 12 ++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/42620619/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
index ee9c071..ff6bb64 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
@@ -1054,6 +1054,13 @@ public class BookStore {
     public Book echoBookElement(Book element) throws Exception {
         return element;
     }
+    @POST
+    @Path("/books/json/echo")
+    @Consumes("application/json")
+    @Produces("application/json")
+    public Book echoBookElementJson(Book element) throws Exception {
+        return element;
+    }
     
     @SuppressWarnings("unchecked")
     @POST

http://git-wip-us.apache.org/repos/asf/cxf/blob/42620619/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/failover/FailoverTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/failover/FailoverTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/failover/FailoverTest.java
index 729a097..32050c3 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/failover/FailoverTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/failover/FailoverTest.java
@@ -275,12 +275,16 @@ public class FailoverTest extends AbstractBusClientServerTestBase {
             verifyStrategy(bookStore, expectRandom 
                               ? RandomStrategy.class
                               : SequentialStrategy.class);
-            String bookId = expectServerException ? "9999" : "123";
             Exception ex = null;
             try {
-                Book book = bookStore.getBook(bookId);
-                assertNotNull("expected non-null response", book);
-                assertEquals("unexpected id", 123L, book.getId());
+                if (expectServerException) {
+                    bookStore.getBook("9999");
+                    fail("Exception expected");
+                } else {
+                    Book book = bookStore.echoBookElementJson(new Book("CXF", 123));
+                    assertNotNull("expected non-null response", book);
+                    assertEquals("unexpected id", 123L, book.getId());
+                }
             } catch (Exception error) {
                 if (!expectServerException) {
                     //String currEndpoint = getCurrentEndpointAddress(bookStore);


Mime
View raw message