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/03/08 08:49:42 UTC

[6/7] camel git commit: CAMEL-8459: Java DSL - Align beanRef as bean to be similar to xml dsl

CAMEL-8459: Java DSL - Align beanRef as bean to be similar to xml dsl


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

Branch: refs/heads/master
Commit: a547300711ce7b688be8e24dd794ce8a8eb89f79
Parents: a299039
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Mar 7 16:19:41 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Mar 8 07:18:16 2015 +0100

----------------------------------------------------------------------
 .../org/apache/camel/model/BeanDefinition.java  |  2 +-
 .../camel/processor/BeanValidateTypeTest.java   | 66 --------------------
 2 files changed, 1 insertion(+), 67 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a5473007/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java b/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java
index b1e77e8..d3733ed 100644
--- a/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java
@@ -285,7 +285,7 @@ public class BeanDefinition extends NoOutputDefinition<BeanDefinition> {
             // to a bean name but the String is being invoke instead
             if (bean instanceof String) {
                 throw new IllegalArgumentException("The bean instance is a java.lang.String type: " + bean
-                    + ". We suppose you want to refer to a bean instance by its id instead. Please use beanRef.");
+                    + ". We suppose you want to refer to a bean instance by its id instead. Please use ref.");
             }
 
             // the holder should either be bean or type based

http://git-wip-us.apache.org/repos/asf/camel/blob/a5473007/camel-core/src/test/java/org/apache/camel/processor/BeanValidateTypeTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/BeanValidateTypeTest.java b/camel-core/src/test/java/org/apache/camel/processor/BeanValidateTypeTest.java
deleted file mode 100644
index 143d040..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/BeanValidateTypeTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * 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.processor;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.FailedToCreateRouteException;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.impl.JndiRegistry;
-
-/**
- * @version 
- */
-public class BeanValidateTypeTest extends ContextTestSupport {
-
-    public static class MyCoolBean {
-
-        public String hello(String s) {
-            return "Hello " + s;
-        }
-
-    }
-
-    @Override
-    public boolean isUseRouteBuilder() {
-        return false;
-    }
-
-    @Override
-    protected JndiRegistry createRegistry() throws Exception {
-        JndiRegistry jndi = super.createRegistry();
-        jndi.bind("cool", new MyCoolBean());
-        return jndi;
-    }
-
-    public void testBeanValidateType() throws Exception {
-        context.addRoutes(new RouteBuilder() {
-            @Override
-            public void configure() throws Exception {
-                // we should use beanRef instead to refer to cool
-                from("direct:start").bean("cool");
-            }
-        });
-        try {
-            context.start();
-            fail("Should have thrown exception");
-        } catch (FailedToCreateRouteException e) {
-            assertIsInstanceOf(IllegalArgumentException.class, e.getCause());
-            assertTrue(e.getCause().getMessage().startsWith("The bean instance is a java.lang.String type: cool."));
-        }
-    }
-
-}