Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 744D7200C11 for ; Sat, 4 Feb 2017 08:59:32 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 72E25160B63; Sat, 4 Feb 2017 07:59:32 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 972C7160B56 for ; Sat, 4 Feb 2017 08:59:31 +0100 (CET) Received: (qmail 19815 invoked by uid 500); 4 Feb 2017 07:59:30 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 19806 invoked by uid 99); 4 Feb 2017 07:59:30 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Feb 2017 07:59:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9558EDFC31; Sat, 4 Feb 2017 07:59:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: nferraro@apache.org To: commits@camel.apache.org Message-Id: <12456221932942d4aaea1526750f8c02@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: camel git commit: CAMEL-10612: fixing API signature Date: Sat, 4 Feb 2017 07:59:30 +0000 (UTC) archived-at: Sat, 04 Feb 2017 07:59:32 -0000 Repository: camel Updated Branches: refs/heads/master 5f566e096 -> 36dbf9d8a CAMEL-10612: fixing API signature Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/36dbf9d8 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/36dbf9d8 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/36dbf9d8 Branch: refs/heads/master Commit: 36dbf9d8a7a7ad8b54d46a01a598fddceba83997 Parents: 5f566e0 Author: Nicola Ferraro Authored: Sat Feb 4 08:58:57 2017 +0100 Committer: Nicola Ferraro Committed: Sat Feb 4 08:59:09 2017 +0100 ---------------------------------------------------------------------- .../api/CamelReactiveStreamsService.java | 2 +- .../engine/CamelReactiveStreamsServiceImpl.java | 2 +- .../reactive/streams/DirectClientAPITest.java | 59 ++++++++++++++++++++ .../support/ReactiveStreamsTestService.java | 2 +- 4 files changed, 62 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/36dbf9d8/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/api/CamelReactiveStreamsService.java ---------------------------------------------------------------------- diff --git a/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/api/CamelReactiveStreamsService.java b/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/api/CamelReactiveStreamsService.java index 3e3e17c..1c1ea40 100644 --- a/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/api/CamelReactiveStreamsService.java +++ b/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/api/CamelReactiveStreamsService.java @@ -174,7 +174,7 @@ public interface CamelReactiveStreamsService extends CamelContextAware, Service * @param uri the producer uri * @return a function that returns a publisher with the resulting exchange */ - Function> requestURI(String uri); + Function> requestURI(String uri); /** * Creates a new route that uses the endpoint URI as producer, pushes the given data to the route http://git-wip-us.apache.org/repos/asf/camel/blob/36dbf9d8/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/engine/CamelReactiveStreamsServiceImpl.java ---------------------------------------------------------------------- diff --git a/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/engine/CamelReactiveStreamsServiceImpl.java b/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/engine/CamelReactiveStreamsServiceImpl.java index ec279b8..eb3a767 100644 --- a/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/engine/CamelReactiveStreamsServiceImpl.java +++ b/components/camel-reactive-streams/src/main/java/org/apache/camel/component/reactive/streams/engine/CamelReactiveStreamsServiceImpl.java @@ -212,7 +212,7 @@ public class CamelReactiveStreamsServiceImpl implements CamelReactiveStreamsServ } @Override - public Function> requestURI(String uri) { + public Function> requestURI(String uri) { return data -> requestURI(uri, data); } http://git-wip-us.apache.org/repos/asf/camel/blob/36dbf9d8/components/camel-reactive-streams/src/test/java/org/apache/camel/component/reactive/streams/DirectClientAPITest.java ---------------------------------------------------------------------- diff --git a/components/camel-reactive-streams/src/test/java/org/apache/camel/component/reactive/streams/DirectClientAPITest.java b/components/camel-reactive-streams/src/test/java/org/apache/camel/component/reactive/streams/DirectClientAPITest.java index cd62bcf..3663476 100644 --- a/components/camel-reactive-streams/src/test/java/org/apache/camel/component/reactive/streams/DirectClientAPITest.java +++ b/components/camel-reactive-streams/src/test/java/org/apache/camel/component/reactive/streams/DirectClientAPITest.java @@ -94,6 +94,64 @@ public class DirectClientAPITest extends ReactiveStreamsTestSupport { } @Test + public void testDirectCallOverload() throws Exception { + context.start(); + + BlockingQueue queue = new LinkedBlockingDeque<>(); + + Flowable.just(1, 2, 3) + .flatMap(e -> camel.requestURI("bean:hello", e, String.class)) + .doOnNext(queue::add) + .subscribe(); + + for (int i = 1; i <= 3; i++) { + String res = queue.poll(1, TimeUnit.SECONDS); + assertEquals("Hello " + i, res); + } + + } + + @Test + public void testDirectCallWithExchange() throws Exception { + context.start(); + + BlockingQueue queue = new LinkedBlockingDeque<>(); + + Flowable.just(1, 2, 3) + .flatMap(camel.requestURI("bean:hello")::apply) + .map(ex -> ex.getOut().getBody(String.class)) + .doOnNext(queue::add) + .subscribe(); + + for (int i = 1; i <= 3; i++) { + String res = queue.poll(1, TimeUnit.SECONDS); + assertEquals("Hello " + i, res); + } + + } + + @Test + public void testDirectCallWithExchangeOverload() throws Exception { + context.start(); + + BlockingQueue queue = new LinkedBlockingDeque<>(); + + Flowable.just(1, 2, 3) + .flatMap(e -> camel.requestURI("bean:hello", e)) + .map(ex -> ex.getOut().getBody(String.class)) + .doOnNext(queue::add) + .subscribe(); + + for (int i = 1; i <= 3; i++) { + String res = queue.poll(1, TimeUnit.SECONDS); + assertEquals("Hello " + i, res); + } + + } + + + + @Test public void testProxiedDirectCall() throws Exception { context.start(); @@ -159,6 +217,7 @@ public class DirectClientAPITest extends ReactiveStreamsTestSupport { } } + @Test public void testDirectCallFromCamelWithConversion() throws Exception { http://git-wip-us.apache.org/repos/asf/camel/blob/36dbf9d8/components/camel-reactive-streams/src/test/java/org/apache/camel/component/reactive/streams/support/ReactiveStreamsTestService.java ---------------------------------------------------------------------- diff --git a/components/camel-reactive-streams/src/test/java/org/apache/camel/component/reactive/streams/support/ReactiveStreamsTestService.java b/components/camel-reactive-streams/src/test/java/org/apache/camel/component/reactive/streams/support/ReactiveStreamsTestService.java index 822f41a..cdbcc08 100644 --- a/components/camel-reactive-streams/src/test/java/org/apache/camel/component/reactive/streams/support/ReactiveStreamsTestService.java +++ b/components/camel-reactive-streams/src/test/java/org/apache/camel/component/reactive/streams/support/ReactiveStreamsTestService.java @@ -142,7 +142,7 @@ public class ReactiveStreamsTestService implements CamelReactiveStreamsService { } @Override - public Function> requestURI(String uri) { + public Function> requestURI(String uri) { return null; }