camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject camel git commit: CAMEL-8479 Fixed the TrapReceiveTest failure
Date Fri, 13 Mar 2015 05:22:57 GMT
Repository: camel
Updated Branches:
  refs/heads/master d6812ffe4 -> b0d5b435a


CAMEL-8479 Fixed the TrapReceiveTest failure


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

Branch: refs/heads/master
Commit: b0d5b435af6f4d58ad03d9624da20dec6434668c
Parents: d6812ff
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Fri Mar 13 13:22:31 2015 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Fri Mar 13 13:22:31 2015 +0800

----------------------------------------------------------------------
 .../java/org/apache/camel/component/snmp/SnmpEndpoint.java    | 2 +-
 .../java/org/apache/camel/component/snmp/PollOIDTest.java     | 5 +++++
 .../java/org/apache/camel/component/snmp/TrapReceiveTest.java | 7 ++++++-
 3 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b0d5b435/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpEndpoint.java
b/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpEndpoint.java
index 39c253e..fb2fbf4 100644
--- a/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpEndpoint.java
+++ b/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpEndpoint.java
@@ -97,7 +97,7 @@ public class SnmpEndpoint extends DefaultPollingEndpoint {
     public Consumer createConsumer(Processor processor) throws Exception {
         if (this.type == SnmpActionType.TRAP) {
             SnmpTrapConsumer answer = new SnmpTrapConsumer(this, processor);
-            configureConsumer(answer);
+            // As the SnmpTrapConsumer is not a polling consumer we don't need to call the
configureConsumer here.
             return answer;
         } else if (this.type == SnmpActionType.POLL) {
             SnmpOIDPoller answer = new SnmpOIDPoller(this, processor);

http://git-wip-us.apache.org/repos/asf/camel/blob/b0d5b435/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/PollOIDTest.java
----------------------------------------------------------------------
diff --git a/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/PollOIDTest.java
b/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/PollOIDTest.java
index 0774907..9d84302 100644
--- a/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/PollOIDTest.java
+++ b/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/PollOIDTest.java
@@ -45,6 +45,11 @@ public class PollOIDTest extends CamelTestSupport {
             }
         }
     }
+    
+    @Test
+    public void testStartRoute() throws Exception {
+        // do nothing here , just make sure the camel route can started.
+    }
 
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {

http://git-wip-us.apache.org/repos/asf/camel/blob/b0d5b435/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/TrapReceiveTest.java
----------------------------------------------------------------------
diff --git a/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/TrapReceiveTest.java
b/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/TrapReceiveTest.java
index 72dfb08..e5c4862 100644
--- a/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/TrapReceiveTest.java
+++ b/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/TrapReceiveTest.java
@@ -45,12 +45,17 @@ public class TrapReceiveTest extends CamelTestSupport {
             }
         }
     }
+    
+    @Test
+    public void testStartRoute() throws Exception {
+        // do nothing here , just make sure the camel route can started.
+    }
 
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {
                 // START SNIPPET: e1
-                from("snmp:0.0.0.0:1662?protocol=udp&type=TRAP").transform(body().convertToString()).to("mock:result");
+                from("snmp:0.0.0.0:1662?protocol=udp&type=TRAP").id("route1").transform(body().convertToString()).to("mock:result");
                 // END SNIPPET: e1
             }
         };


Mime
View raw message