You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/10/24 11:33:22 UTC

[camel] branch master updated (38d01b1 -> 4b39570)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 38d01b1  Removed generated stuff: it wasn't rendered correctly
     new 0e6abd0  Camel-Seda: Added the example code
     new 4b39570  Regen docs

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../camel-seda/src/main/docs/seda-component.adoc   | 60 +++++++++++++++++++++-
 .../modules/ROOT/pages/seda-component.adoc         | 60 +++++++++++++++++++++-
 2 files changed, 116 insertions(+), 4 deletions(-)


[camel] 01/02: Camel-Seda: Added the example code

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 0e6abd0d858340a57535fef23ee97af4b53a122f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Oct 24 13:30:19 2019 +0200

    Camel-Seda: Added the example code
---
 .../camel-seda/src/main/docs/seda-component.adoc   | 60 +++++++++++++++++++++-
 1 file changed, 58 insertions(+), 2 deletions(-)

diff --git a/components/camel-seda/src/main/docs/seda-component.adoc b/components/camel-seda/src/main/docs/seda-component.adoc
index f63dcab..4c4c00d 100644
--- a/components/camel-seda/src/main/docs/seda-component.adoc
+++ b/components/camel-seda/src/main/docs/seda-component.adoc
@@ -238,14 +238,70 @@ to the original caller.
 
 [source,java]
 ----
-include::{examplesdir}/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaAsyncRouteTest.java[tags=example]
+    @Test
+    public void testSendAsync() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedBodiesReceived("Hello World");
+
+        // START SNIPPET: e2
+        Object out = template.requestBody("direct:start", "Hello World");
+        assertEquals("OK", out);
+        // END SNIPPET: e2
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            // START SNIPPET: e1
+            public void configure() throws Exception {
+                from("direct:start")
+                    // send it to the seda queue that is async
+                    .to("seda:next")
+                    // return a constant response
+                    .transform(constant("OK"));
+
+                from("seda:next").to("mock:result");
+            }
+            // END SNIPPET: e1
+        };
+    }
 ----
 
 Here we send a Hello World message and expects the reply to be OK.
 
 [source,java]
 ----
-include::{examplesdir}/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaAsyncRouteTest.java[tags=example]
+    @Test
+    public void testSendAsync() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedBodiesReceived("Hello World");
+
+        // START SNIPPET: e2
+        Object out = template.requestBody("direct:start", "Hello World");
+        assertEquals("OK", out);
+        // END SNIPPET: e2
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            // START SNIPPET: e1
+            public void configure() throws Exception {
+                from("direct:start")
+                    // send it to the seda queue that is async
+                    .to("seda:next")
+                    // return a constant response
+                    .transform(constant("OK"));
+
+                from("seda:next").to("mock:result");
+            }
+            // END SNIPPET: e1
+        };
+    }
 ----
 
 


[camel] 02/02: Regen docs

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 4b39570892717f49a941da13355fdf8b70a7b749
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Oct 24 13:33:03 2019 +0200

    Regen docs
---
 .../modules/ROOT/pages/seda-component.adoc         | 60 +++++++++++++++++++++-
 1 file changed, 58 insertions(+), 2 deletions(-)

diff --git a/docs/components/modules/ROOT/pages/seda-component.adoc b/docs/components/modules/ROOT/pages/seda-component.adoc
index 5f5b971..c9fc671 100644
--- a/docs/components/modules/ROOT/pages/seda-component.adoc
+++ b/docs/components/modules/ROOT/pages/seda-component.adoc
@@ -239,14 +239,70 @@ to the original caller.
 
 [source,java]
 ----
-include::{examplesdir}/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaAsyncRouteTest.java[tags=example]
+    @Test
+    public void testSendAsync() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedBodiesReceived("Hello World");
+
+        // START SNIPPET: e2
+        Object out = template.requestBody("direct:start", "Hello World");
+        assertEquals("OK", out);
+        // END SNIPPET: e2
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            // START SNIPPET: e1
+            public void configure() throws Exception {
+                from("direct:start")
+                    // send it to the seda queue that is async
+                    .to("seda:next")
+                    // return a constant response
+                    .transform(constant("OK"));
+
+                from("seda:next").to("mock:result");
+            }
+            // END SNIPPET: e1
+        };
+    }
 ----
 
 Here we send a Hello World message and expects the reply to be OK.
 
 [source,java]
 ----
-include::{examplesdir}/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaAsyncRouteTest.java[tags=example]
+    @Test
+    public void testSendAsync() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedBodiesReceived("Hello World");
+
+        // START SNIPPET: e2
+        Object out = template.requestBody("direct:start", "Hello World");
+        assertEquals("OK", out);
+        // END SNIPPET: e2
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            // START SNIPPET: e1
+            public void configure() throws Exception {
+                from("direct:start")
+                    // send it to the seda queue that is async
+                    .to("seda:next")
+                    // return a constant response
+                    .transform(constant("OK"));
+
+                from("seda:next").to("mock:result");
+            }
+            // END SNIPPET: e1
+        };
+    }
 ----