You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2015/03/13 06:22:57 UTC

camel git commit: CAMEL-8479 Fixed the TrapReceiveTest failure

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 <wi...@gmail.com>
Authored: Fri Mar 13 13:22:31 2015 +0800
Committer: Willem Jiang <wi...@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
             }
         };