Java Mailing List Archive

http://www.gg3721.com/

Home » user.jmock »

Re: [jmock-user] Creating multiple instances of a mock object

Vince O'Sullivan

2010-03-14

Replies: Find Java Web Hosting

Author LoginPost Reply

Sorted. Thanks. Vince.
(On chapter 6 of GOOS;)
---------------------------------------------------------------------------------------------------

JMock enforces that multiple mock instances of the same type should have
different names. That's what the error message is saying. Normally the
instance name is defaulted. You could try:

final Subscriber subscriber1 = context.mock(Subscriber.class, "first");
final Subscriber subscriber2 = context.mock(Subscriber.class, "second");
final Subscriber subscriber3 = context.mock(Subscriber.class, "third");

S.
--
Sent from the jMock - User mailing list archive at Nabble.com.


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

  http://xircles.codehaus.org/manage_email


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