camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [1/6] camel git commit: CAMEL-10319, SNMP Producer (fix test)
Date Thu, 15 Sep 2016 08:54:09 GMT
Repository: camel
Updated Branches:
  refs/heads/master 404fae80b -> 406b97ecf


CAMEL-10319, SNMP Producer (fix test)


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

Branch: refs/heads/master
Commit: a2486d23f79bea40277bc6b3ae71cd550787acd7
Parents: 0ed2840
Author: Fabryprog <fabryprog@gmail.com>
Authored: Thu Sep 15 07:32:32 2016 +0200
Committer: Andrea Cosentino <ancosen@gmail.com>
Committed: Thu Sep 15 10:52:13 2016 +0200

----------------------------------------------------------------------
 .../apache/camel/component/snmp/ProducerTest.java | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a2486d23/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/ProducerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/ProducerTest.java
b/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/ProducerTest.java
index d667f36..45d8ff4 100644
--- a/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/ProducerTest.java
+++ b/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/ProducerTest.java
@@ -18,25 +18,35 @@ package org.apache.camel.component.snmp;
 
 import java.util.concurrent.TimeUnit;
 
+import org.apache.camel.CamelExecutionException;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Rule;
 import org.junit.Test;
+import org.junit.rules.ExpectedException;
 
 public class ProducerTest extends CamelTestSupport {
 
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+
     private String host = "192.168.0.254";
     private String port = "161";
     private String oids = "1.3.6.1.2.1.1.3.0,1.3.6.1.2.1.25.3.2.1.5.1,1.3.6.1.2.1.25.3.5.1.1.1,1.3.6.1.2.1.43.5.1.1.11.1";
-
+    private Integer timeout = 5; // 5ms
+    
     @Test
     public void testSnmpProducer() throws Exception {
-        template.sendBody("direct:in", "");
+        thrown.expect(CamelExecutionException.class);
 
+        template.sendBody("direct:in", "");
+        
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMinimumMessageCount(1);
 
-        assertMockEndpointsSatisfied(60, TimeUnit.SECONDS);
+        assertMockEndpointsSatisfied(5, TimeUnit.SECONDS);
     }
 
     @Override
@@ -44,7 +54,7 @@ public class ProducerTest extends CamelTestSupport {
         return new RouteBuilder() {
             public void configure() {
                 from("direct:in")
-                        .to("snmp://" + host + ":" + port + "?oids=" + oids)
+                        .to("snmp://" + host + ":" + port + "?oids=" + oids + "&timeout="
+ timeout)
                         .log("${body}")
                         .to("mock:result");
             }


Mime
View raw message