CAMEL-8168 Added an unit test in camel-mina

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

Branch: refs/heads/master
Commit: cefb210efecfaa8659c213b45ecc63524a96b11f
Parents: 4e4cc18
Author: Willem Jiang <willem.ji...@gmail.com>
Authored: Mon Dec 22 08:50:04 2014 +0800
Committer: Willem Jiang <willem.ji...@gmail.com>
Committed: Mon Dec 22 09:08:30 2014 +0800

----------------------------------------------------------------------
 .../org/apache/camel/component/mina/MinaTcpTest.java | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/cefb210e/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaTcpTest.java
----------------------------------------------------------------------
diff --git 
a/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaTcpTest.java
 
b/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaTcpTest.java
index f5a8d8e..ffa9f46 100644
--- 
a/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaTcpTest.java
+++ 
b/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaTcpTest.java
@@ -26,7 +26,18 @@ import org.junit.Test;
 public class MinaTcpTest extends BaseMinaTest {
 
     @Test
-    public void testMinaRoute() throws Exception {
+    public void testMinaRoute1() throws Exception {
+        MockEndpoint endpoint = getMockEndpoint("mock:result");
+        Object body = "Hello there!";
+        endpoint.expectedBodiesReceived(body);
+
+        
template.sendBodyAndHeader("mina:tcp://localhost:{{port}}?sync=false&minaLogger=true",
 body, "cheese", 123);
+
+        assertMockEndpointsSatisfied();
+    }
+    
+    @Test
+    public void testMinaRoute2() throws Exception {
         MockEndpoint endpoint = getMockEndpoint("mock:result");
         Object body = "Hello there!";
         endpoint.expectedBodiesReceived(body);
@@ -39,7 +50,7 @@ public class MinaTcpTest extends BaseMinaTest {
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {
-                
from("mina:tcp://localhost:{{port}}?sync=false&minaLogger=true")
+                from("mina:tcp://0.0.0.0:{{port}}?sync=false&minaLogger=true")
                         
.to("log:before?showAll=true").to("mock:result").to("log:after?showAll=true");
             }
         };

Reply via email to