Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 4182 invoked from network); 12 Mar 2009 02:43:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Mar 2009 02:43:03 -0000 Received: (qmail 33496 invoked by uid 500); 12 Mar 2009 02:42:59 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 33427 invoked by uid 500); 12 Mar 2009 02:42:59 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 33416 invoked by uid 99); 12 Mar 2009 02:42:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Mar 2009 19:42:59 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of paulus.benedictus@gmail.com designates 74.125.44.156 as permitted sender) Received: from [74.125.44.156] (HELO yx-out-1718.google.com) (74.125.44.156) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Mar 2009 02:42:51 +0000 Received: by yx-out-1718.google.com with SMTP id 6so206276yxn.60 for ; Wed, 11 Mar 2009 19:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=s594rh9LQGXPJViMuTKKyruRs6qNkGnS1HAodzUvHJI=; b=HEkgltNwAaD4o3GomFIs0GYjNjqYDmy96PtOM6IDI3G4ZRXEga4SZj8kmOrzvPEyhQ UyuPpF7fav59iwoxYyR6prg+9qpVrA3smSkACl0h/Sfgp4joH2i1GLUQ0uQ5q+yayBAU xHcDQRt7HL02xhuZBZvRFOdZHZpvKGaBqxO4w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=mYcSJBvZhPkfpuHy1BdXgKh1HoL0eMv5epE5pR1EOguF0NhaWP0Xqrv5jg4J8PWTht SwZBglhAPIx5gHLRfwZQPhJocrmzdrJ6y2jNg/b+85DHFirV4pIUa3MCSqJDTSSkKOW9 x0Vkf/Zk9guwZLJ8fDcBz0I5vUtw+sZ2z1glo= MIME-Version: 1.0 Sender: paulus.benedictus@gmail.com Received: by 10.220.100.142 with SMTP id y14mr3734347vcn.73.1236825750304; Wed, 11 Mar 2009 19:42:30 -0700 (PDT) In-Reply-To: <49AF8BC9.8020203@cyberspaceroad.com> References: <530943.74528.qm@web55102.mail.re4.yahoo.com> <55afdc850902250254q13d33812g636fd64df4a553a5@mail.gmail.com> <49A53F40.7090903@cyberspaceroad.com> <55afdc850902251336r53415ae8nb4939a6ced06d5fe@mail.gmail.com> <49AF8BC9.8020203@cyberspaceroad.com> Date: Wed, 11 Mar 2009 21:42:30 -0500 X-Google-Sender-Auth: 1695b1d613dfd63c Message-ID: Subject: Re: [beanutils] testing around ConvertUtils From: Paul Benedict To: Commons Users List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Why can't you set up the test just like you would in real life? How do you register your converters today? On Thu, Mar 5, 2009 at 3:22 AM, Adam Hardy wrote: > In my unit tests I sometimes have the situation where I need to register my > custom converters for ConvertUtils in order to make everything behave as it > would in real life. > > Normally the conversions are incidental to the test so it seems unnecessary > to need to set up ConvertUtils. > > Seeing inside the ConvertUtils class that there is a ConvertUtilsBean, I had > the idea of using the ConvertUtilsBean in my classes, and initializing it > via dependency injection. > > Then I could mock it. > > However all access to the ConvertUtilsBean via the singleton getInstance > factory method is protected. Would it be unwise to instantiate it myself in > my dependency injection container? > > > Thanks > Adam > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org