Repository: cxf Updated Branches: refs/heads/master 28a4e2ea5 -> 0c7f3e166
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/0c7f3e16 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0c7f3e16 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0c7f3e16 Branch: refs/heads/master Commit: 0c7f3e166da9af329fbd100f974ef3e70556909f Parents: 28a4e2e Author: Sergey Beryozkin <[email protected]> Authored: Thu Oct 29 22:00:22 2015 +0000 Committer: Sergey Beryozkin <[email protected]> Committed: Thu Oct 29 22:00:22 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/0c7f3e16/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 5cf6ef1..4837784 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/0c7f3e16/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 4e94c2c..95bfacd 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);
