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 2009/07/29 06:47:50 UTC

svn commit: r798781 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/impl/DefaultMessage.java test/java/org/apache/camel/component/bean/FromBeanTest.java

Author: davsclaus
Date: Wed Jul 29 04:47:50 2009
New Revision: 798781

URL: http://svn.apache.org/viewvc?rev=798781&view=rev
Log:
Polished javadoc and added from bean unit test

Added:
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/FromBeanTest.java   (with props)
Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java?rev=798781&r1=798780&r2=798781&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java Wed Jul 29 04:47:50 2009
@@ -43,9 +43,6 @@
         return fault;
     }
 
-    /**
-     * Sets the fault flag on this message
-     */
     public void setFault(boolean fault) {
         this.fault = fault;
     }

Added: camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/FromBeanTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/FromBeanTest.java?rev=798781&view=auto
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/FromBeanTest.java (added)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/FromBeanTest.java Wed Jul 29 04:47:50 2009
@@ -0,0 +1,62 @@
+/**
+ * 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.bean;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.JndiRegistry;
+
+/**
+ * @version $Revision$
+ */
+public class FromBeanTest extends ContextTestSupport {
+
+    public void testFromBean() throws Exception {
+        getMockEndpoint("mock:bar").expectedBodiesReceived("Hello");
+        getMockEndpoint("mock:bar").expectedMinimumMessageCount(1);
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected JndiRegistry createRegistry() throws Exception {
+        JndiRegistry jndi = super.createRegistry();
+        jndi.bind("foo", new MyFooBean());
+        return jndi;
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("bean:foo?method=hello").to("mock:bar");
+            }
+        };
+    }
+
+    private static class MyFooBean {
+
+        public String hello() {
+            return "Hello";
+        }
+
+        public String bye() {
+            return "Bye";
+        }
+    }
+}

Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/FromBeanTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/FromBeanTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date