camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nferr...@apache.org
Subject camel git commit: CAMEL-10612: fixing API signature
Date Sat, 04 Feb 2017 07:59:30 GMT
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 <ni.ferraro@gmail.com>
Authored: Sat Feb 4 08:58:57 2017 +0100
Committer: Nicola Ferraro <ni.ferraro@gmail.com>
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<?, ? extends Publisher<Exchange>> requestURI(String uri);
+    Function<Object, Publisher<Exchange>> 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<?, ? extends Publisher<Exchange>> requestURI(String uri)
{
+    public Function<Object, Publisher<Exchange>> 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<String> 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<String> 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<String> 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<?, ? extends Publisher<Exchange>> requestURI(String uri)
{
+    public Function<Object, Publisher<Exchange>> requestURI(String uri) {
         return null;
     }
 


Mime
View raw message