camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r674790 - /activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/DirectNoToTypeTest.java
Date Tue, 08 Jul 2008 12:11:35 GMT
Author: davsclaus
Date: Tue Jul  8 05:11:34 2008
New Revision: 674790

URL: http://svn.apache.org/viewvc?rev=674790&view=rev
Log:
Unit test inspired by user request on user forum

Added:
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/DirectNoToTypeTest.java
  (with props)

Added: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/DirectNoToTypeTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/DirectNoToTypeTest.java?rev=674790&view=auto
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/DirectNoToTypeTest.java
(added)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/DirectNoToTypeTest.java
Tue Jul  8 05:11:34 2008
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.direct;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Processor;
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+
+/**
+ * Simple unit test based on user forum question.
+ */
+public class DirectNoToTypeTest extends ContextTestSupport {
+
+    public void testNoToType() throws Exception {
+        Object response = template.requestBody("direct:in", "Hello");
+        assertEquals("Hello World", response);
+    }
+
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                from("direct:in").process(new Processor() {
+                    public void process(Exchange exchange) throws Exception {
+                        String body = exchange.getIn().getBody(String.class);
+                        exchange.getOut(true).setBody(body + " World");
+                    }
+                });
+            }
+        };
+    }
+    
+}

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/DirectNoToTypeTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/DirectNoToTypeTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message