Java Mailing List Archive

http://www.gg3721.com/

Home » user.jmock »

[jmock-user] Is it possible to get the setter getter relationship to work using a mock object?

Kent Larsson

2008-06-02

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi,

I have a class which I create a mock object of (using class
imposterizer) in our tests, let's call the class SomeEntity. Then I
have another class which I'm testing, it adds an instance of
SomeEntity to a collection, while at the same time giving the instance
a unique identity using the setId(int id) method of SomeEntity. On the
calls after setId I would like to return the value which our
SomeEntity instance was given. Is it possible and how should I go
about doing it?

Best regards,
Kent Larsson

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

  http://xircles.codehaus.org/manage_email


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