Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 50130 invoked from network); 26 May 2010 09:10:20 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 May 2010 09:10:20 -0000 Received: (qmail 21522 invoked by uid 500); 26 May 2010 09:10:20 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 21400 invoked by uid 500); 26 May 2010 09:10:18 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 21392 invoked by uid 500); 26 May 2010 09:10:18 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 21389 invoked by uid 99); 26 May 2010 09:10:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 May 2010 09:10:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 May 2010 09:10:15 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o4Q99r3n006146 for ; Wed, 26 May 2010 09:09:53 GMT Message-ID: <21261809.3311274864993588.JavaMail.jira@thor> Date: Wed, 26 May 2010 05:09:53 -0400 (EDT) From: "Claus Ibsen (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Assigned: (CAMEL-2750) org.apache.camel.component.bean.BeanInfo not working properly with mocked Interfaces In-Reply-To: <629635.2911274797671784.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-2750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen reassigned CAMEL-2750: ---------------------------------- Assignee: Claus Ibsen > org.apache.camel.component.bean.BeanInfo not working properly with mocked Interfaces > ------------------------------------------------------------------------------------ > > Key: CAMEL-2750 > URL: https://issues.apache.org/activemq/browse/CAMEL-2750 > Project: Apache Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 2.2.0 > Environment: Windows XP, JDK 1.6.0.17, Eclipse Ganymed, Maven 2.2.1, ActiveMQ 5.3.1, Apache Camel 2.2 > Reporter: Didier Gutacker > Assignee: Claus Ibsen > > The BeanInfo-Class shows the same behaviour as ClassUtils-Class from Spring 3.0.x (see Spring Issue 7066, https://jira.springsource.org/browse/SPR-7066). > When working with mock objects created by mockito using an interface the getSuperclass()-Method returns java.lang.Object and the method to called on the mock can't be found. > While looking around for a solution I found the path applied in Spring (see https://fisheye.springsource.org/browse/spring-framework/trunk/org.springframework.core/src/main/java/org/springframework/util/ClassUtils.java?content-type=text/vnd.viewcvs-markup&r1=3227&r2=3228). > In method > public static Class getUserClass(Class clazz) > the code > return (clazz != null && clazz.getName().contains(CGLIB_CLASS_SEPARATOR) ? clazz.getSuperclass() : clazz); > is replaced by > if (clazz != null && clazz.getName().contains(CGLIB_CLASS_SEPARATOR)) { > Class superClass = clazz.getSuperclass(); > if (superClass != null && !Object.class.equals(superClass)) { > return superClass; > } > } > return clazz; > While waiting for a fix in BeanInfo class a workaround is to mock the concrete class not the interface, but this makes the test code more complicated if several classes implement the same interface. > A Wor -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.