Java Mailing List Archive

http://www.gg3721.com/

Home » user.jmock »

[jmock-user] Re: How to test a method that is wrapped in a private method?

sparks

2008-07-02

Replies: Find Java Web Hosting

Author LoginPost Reply
Nat Pryce <nat.pryce@(protected):
>
> You're on the right track.
>
> But... how does the ServiceClass object get a reference to the DAO it
> uses? In your test you need to give it a mock instance, not a real
> one.
>
> --Nat

Thanks for your reply Nat. The ServiceClass has a setter method for the DAO so
that the test class can inject the mock DAO into the ServiceClass and I am sure
the setter is called before the method to test is called.

Anymore hints?


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


©2008 gg3721.com - Jax Systems, LLC, U.S.A.