cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6889] Adding another completion stage test
Date Mon, 10 Oct 2016 13:16:55 GMT
Repository: cxf
Updated Branches:
  refs/heads/master bbda68b6d -> 183a2a402


[CXF-6889] Adding another completion stage test


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

Branch: refs/heads/master
Commit: 183a2a4022b912a6c32c1d3e268982b2f78f7631
Parents: bbda68b
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Mon Oct 10 14:16:39 2016 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Mon Oct 10 14:16:39 2016 +0100

----------------------------------------------------------------------
 .../cxf/systest/jaxrs/JAXRSAsyncClientTest.java     | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/183a2a40/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java
index 4d32750..b313070 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java
@@ -376,6 +376,22 @@ public class JAXRSAsyncClientTest extends AbstractBusClientServerTestBase
{
         assertEquals(123L, book.getId());
     }
     @Test
+    public void testGetBookAsyncStageThenAcceptAsync() throws Exception {
+        String address = "http://localhost:" + PORT + "/bookstore/books";
+        WebClient wc = createWebClient(address);
+        CompletionStage<Book> stage = wc.path("123").rx().get(Book.class);
+        Holder<Book> holder = new Holder<Book>();
+        stage.thenApply(v -> {
+            v.setId(v.getId() * 2);
+            return v;
+        }).thenAcceptAsync(v -> {
+            holder.value = v;
+        });
+        Thread.sleep(3000);
+        assertEquals(246L, holder.value.getId());
+    }
+    
+    @Test
     public void testGetBookAsyncStage404() throws Exception {
         String address = "http://localhost:" + PORT + "/bookstore/bookheaders/404";
         WebClient wc = createWebClient(address);


Mime
View raw message