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:02:15 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 29c538e8d -> dcec2eee1


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/dcec2eee
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/dcec2eee
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/dcec2eee

Branch: refs/heads/3.0.x-fixes
Commit: dcec2eee1a2a864fee56f8f9186b2a7d34cc6a16
Parents: 29c538e
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:01:14 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/dcec2eee/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 544f326..81a1644 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
@@ -1153,6 +1153,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/dcec2eee/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 beedff9..30e274c 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