camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1103696 - /camel/trunk/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletRecipientListTest.java
Date Mon, 16 May 2011 11:15:54 GMT
Author: davsclaus
Date: Mon May 16 11:15:54 2011
New Revision: 1103696

URL: http://svn.apache.org/viewvc?rev=1103696&view=rev
Log:
Added test based on user forum issue

Added:
    camel/trunk/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletRecipientListTest.java
      - copied, changed from r1103622, camel/trunk/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletProducerGetTest.java

Copied: camel/trunk/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletRecipientListTest.java
(from r1103622, camel/trunk/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletProducerGetTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletRecipientListTest.java?p2=camel/trunk/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletRecipientListTest.java&p1=camel/trunk/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletProducerGetTest.java&r1=1103622&r2=1103696&rev=1103696&view=diff
==============================================================================
--- camel/trunk/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletProducerGetTest.java
(original)
+++ camel/trunk/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletRecipientListTest.java
Mon May 16 11:15:54 2011
@@ -16,8 +16,6 @@
  */
 package org.apache.camel.component.restlet;
 
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
@@ -25,12 +23,17 @@ import org.junit.Test;
 /**
  * @version 
  */
-public class RestletProducerGetTest extends CamelTestSupport {
+public class RestletRecipientListTest extends CamelTestSupport {
 
     @Test
-    public void testRestletProducerGet() throws Exception {
-        String out = template.requestBodyAndHeader("direct:start", null, "id", 123, String.class);
-        assertEquals("123;Donald Duck", out);
+    public void testRestlet() throws Exception {
+        getMockEndpoint("mock:oracle").expectedBodiesReceived("110");
+        getMockEndpoint("mock:apple").expectedBodiesReceived("150");
+
+        template.sendBody("restlet:http://0.0.0.0:9080/stock/ORCL?restletMethod=post", "110");
+        template.sendBody("restlet:http://0.0.0.0:9080/stock/APPL?restletMethod=post", "150");
+
+        assertMockEndpointsSatisfied();
     }
 
     @Override
@@ -38,15 +41,11 @@ public class RestletProducerGetTest exte
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("restlet:http://localhost:9080/users/123/basic").to("log:reply");
+                from("restlet:http://0.0.0.0:9080/stock/{symbol}?restletMethods=post")
+                    .recipientList().simple("seda:${header.symbol}");
 
-                from("restlet:http://localhost:9080/users/{id}/basic")
-                    .process(new Processor() {
-                        public void process(Exchange exchange) throws Exception {
-                            String id = exchange.getIn().getHeader("id", String.class);
-                            exchange.getOut().setBody(id + ";Donald Duck");
-                        }
-                    });
+                from("seda:ORCL").to("mock:oracle");
+                from("seda:APPL").to("mock:apple");
             }
         };
     }



Mime
View raw message