You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2015/11/19 08:13:12 UTC

[03/12] camel git commit: Fixed test

Fixed test


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

Branch: refs/heads/master
Commit: 405d3d2d12c407ce93ac92704b61e6591444a67f
Parents: 93af770
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Nov 19 07:42:59 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Nov 19 07:42:59 2015 +0100

----------------------------------------------------------------------
 .../camel/coap/CoAPRestComponentTest.java       | 28 +++-----------------
 1 file changed, 4 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/405d3d2d/components/camel-coap/src/test/java/org/apache/camel/coap/CoAPRestComponentTest.java
----------------------------------------------------------------------
diff --git a/components/camel-coap/src/test/java/org/apache/camel/coap/CoAPRestComponentTest.java b/components/camel-coap/src/test/java/org/apache/camel/coap/CoAPRestComponentTest.java
index d201578..a104804 100644
--- a/components/camel-coap/src/test/java/org/apache/camel/coap/CoAPRestComponentTest.java
+++ b/components/camel-coap/src/test/java/org/apache/camel/coap/CoAPRestComponentTest.java
@@ -16,15 +16,9 @@
  */
 package org.apache.camel.coap;
 
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.net.URLConnection;
-
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.converter.IOConverter;
 import org.apache.camel.test.AvailablePortFinder;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.eclipse.californium.core.CoapClient;
@@ -35,28 +29,13 @@ import org.junit.Test;
 
 public class CoAPRestComponentTest extends CamelTestSupport {
     static int coapport = AvailablePortFinder.getNextAvailable();
-    static int jettyport = AvailablePortFinder.getNextAvailable();
-    
-    
-    /*
-    public boolean isCreateCamelContextPerClass() {
-        return true;
-    } 
-    */   
-    
+
     @Test
     public void testCoAP() throws Exception {
         NetworkConfig.createStandardWithoutFile();
         CoapClient client;
         CoapResponse rsp;
-        
-        
-        URL url = new URL("http://localhost:" + jettyport + "/TestResource/Ducky");
-        URLConnection connect = url.openConnection();
-        InputStream ins = connect.getInputStream();
-        assertEquals("Hello Ducky", IOConverter.toString(new InputStreamReader(ins)));
 
-        
         client = new CoapClient("coap://localhost:" + coapport + "/TestResource/Ducky");
         client.setTimeout(1000000);
         rsp = client.get();
@@ -71,7 +50,6 @@ public class CoAPRestComponentTest extends CamelTestSupport {
         rsp = client.post("data", MediaTypeRegistry.TEXT_PLAIN);
         assertEquals("Hello Ducky: data", rsp.getResponseText());
         assertEquals(MediaTypeRegistry.TEXT_PLAIN, rsp.getOptions().getContentFormat());
-        
     }
 
     @Override
@@ -80,10 +58,11 @@ public class CoAPRestComponentTest extends CamelTestSupport {
             @Override
             public void configure() throws Exception {
                 restConfiguration("coap").host("localhost").port(coapport);
-                restConfiguration("jetty").host("localhost").port(jettyport);
+
                 rest("/TestParms")
                     .get().to("direct:get1")
                     .post().to("direct:post1");
+
                 rest("/TestResource")
                     .get("/{id}").to("direct:get1")
                     .post("/{id}").to("direct:post1");
@@ -94,6 +73,7 @@ public class CoAPRestComponentTest extends CamelTestSupport {
                         exchange.getOut().setBody("Hello " + id);
                     }
                 });
+
                 from("direct:post1").process(new Processor() {
                     public void process(Exchange exchange) throws Exception {
                         String id = exchange.getIn().getHeader("id", String.class);