Repository: camel
Updated Branches:
  refs/heads/camel-2.15.x f75a68706 -> d8353cbd7


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/d8353cbd
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d8353cbd
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d8353cbd

Branch: refs/heads/camel-2.15.x
Commit: d8353cbd7a170d4b022f0bc25194e97787e7d899
Parents: f75a687
Author: Willem Jiang <willem.ji...@gmail.com>
Authored: Fri Mar 13 13:22:31 2015 +0800
Committer: Willem Jiang <willem.ji...@gmail.com>
Committed: Fri Mar 13 15:50:36 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/d8353cbd/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/d8353cbd/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/d8353cbd/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
             }
         };

Reply via email to