The Callable interface only defines three methods. It's very easy to
implement. More details are on the Wiki.
Cheers,
Nat.
_______________________
Dr. Nathaniel Pryce
B13media Ltd.
http://www.b13media.com
+44 (0)7712 526 661
----- Original Message -----
From: "veny" <ve...@p2...>
To: "MockObject users (E-mail)"
<moc...@li...>; "MockObjects devs (E-mail)"
<moc...@li...>
Sent: Wednesday, September 24, 2003 3:42 AM
Subject: [MO-java-users] Re: A kind of "don't care" Mock?
>
> Hi,
>
> I am having the same problem. Any easier way than writing a custom
Callable
> objects?
> or how to easily write a Callable object that fulfils what is required.
>
> Thanks.
>
> Veny
>
> From: Nat Pryce <nat@b1...>
> Re: A kind of "don't care" Mock?
> 2003-09-23 14:17
> With the dynamic mocks you can write your own Callable objects to match
> against any method or in some other custom manner.
>
> Cheers,
> Nat.
>
> _______________________
> Dr. Nathaniel Pryce
> B13media Ltd.
> http://www.b13media.com
> +44 (0)7712 526 661
>
> ----- Original Message -----
> From: "Frederic Donckels" <frederic.donckels@ac...>
> To: <mockobjects-java-users@li...>
> Sent: Tuesday, September 23, 2003 11:11 AM
> Subject: [MO-java-users] A kind of "don't care" Mock?
>
>
> > Hi all,
> >
> > I must confess I haven't thoroughly searched through either Wiki,
> > the lists or the source code (Flame disclaimer :) )
> >
> > Is there a way to create a mock with a default 'I don't care'
> > behaviour for most of the methods?
> > What I mean is that, for some tests, there might be a bunch of
> > methods called, for which I don't want to set expectations (because
> > sometimes I don't know which methods will be called, how many times,
> > ..., or if the mock-proxy is temporarily handled to an outside object
> > for which I don''t have the source code, or I just don't care to
> > provide an 'implementation' (hashcode, toString, ..)).
> > For those methods, I'd just like to set a global default behaviour:
> > - match any call, with any args (or no args)
> > - return a default value (true or false for boolean, 0 for numeric
> > values, null for objects) (with this default value that could be
> > changed).
> >
> > but still to be able to set expectations on methods I care.
> >
> > In the same way, is there a way to say "this method will be called,
> > I don't care how many times, just return always this value" ?
> >
> > Thanks!!
> >
> > Regards
> >
> > Frederic
>
>
|