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 2008/08/21 17:39:34 UTC

svn commit: r687785 - /activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/util/IntrospectionSupportTest.java

Author: davsclaus
Date: Thu Aug 21 08:39:34 2008
New Revision: 687785

URL: http://svn.apache.org/viewvc?rev=687785&view=rev
Log:
CAMEL-840: IntrospectionSupport to support overloaded setter methods for setting properties. Test for using type converted even for overloaded setter methods. Yes Camel starts to rock ;)

Modified:
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/util/IntrospectionSupportTest.java

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/util/IntrospectionSupportTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/util/IntrospectionSupportTest.java?rev=687785&r1=687784&r2=687785&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/util/IntrospectionSupportTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/util/IntrospectionSupportTest.java Thu Aug 21 08:39:34 2008
@@ -38,6 +38,14 @@
         assertEquals("Claus", overloadedBean.getName());
     }
 
+    public void testOverloadSetterChooseUsingTypeConverter() throws Exception {
+        MyOverloadedBean overloadedBean = new MyOverloadedBean();
+        Object value = "Willem".getBytes();
+        // should use byte[] -> String type converter and call the setBean(String) setter method 
+        IntrospectionSupport.setProperty(context.getTypeConverter(), overloadedBean, "bean", value);
+        assertEquals("Willem", overloadedBean.getName());
+    }
+
     public class MyOverloadedBean {
         private ExampleBean bean;