camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r687785 - /activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/util/IntrospectionSupportTest.java
Date Thu, 21 Aug 2008 15:39:34 GMT
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;
 



Mime
View raw message