From: Francois B. <fb...@us...> - 2003-06-29 01:47:48
|
Hi ! I need functionnality equivalent to expect(String, Object), but for match(). Currently, in 0.09, there are matchAndReturn methods, but no simple match(String). In this specific test instance, it does not matter how many times I call method X as it has been asserted elsewhere that the correct number of calls is made. Instead of: mock.expect("eat", C.ANY_ARGS); I would like: mock.match("eat", C.ANY_ARGS); This is something like the nice mock feature I spoke about a few weeks back. What I want is no exception if I call the method 100 times or 10 times. Thanks ! Fran=E7ois -- Francois Beausoleil Developer of Java Gui Builder http://jgb.sourceforge.net/ |
From: Nat P. <nat...@b1...> - 2003-06-29 08:59:04
|
That method is missing in 0.09. In my branch there is a method matchVoid( String, Object ) [and overloads] that does what you want. However, I would not advise using that branch in a production project. Cheers, Nat. _______________________ Dr. Nathaniel Pryce B13media Ltd. http://www.b13media.com +44 (0)7712 526 661 ----- Original Message ----- From: "Francois Beausoleil" <fb...@us...> To: <moc...@li...> Sent: Sunday, June 29, 2003 2:47 AM Subject: [MO-java-dev] How to match and not return ? Hi ! I need functionnality equivalent to expect(String, Object), but for match(). Currently, in 0.09, there are matchAndReturn methods, but no simple match(String). In this specific test instance, it does not matter how many times I call method X as it has been asserted elsewhere that the correct number of calls is made. Instead of: mock.expect("eat", C.ANY_ARGS); I would like: mock.match("eat", C.ANY_ARGS); This is something like the nice mock feature I spoke about a few weeks back. What I want is no exception if I call the method 100 times or 10 times. Thanks ! François -- Francois Beausoleil Developer of Java Gui Builder http://jgb.sourceforge.net/ ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ Mockobjects-java-dev mailing list Moc...@li... https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev |
From: Tim M. <tim...@po...> - 2003-06-29 22:57:14
|
Yes its missing in 0.09 - we should add this into the current head version (its trivial to do). Francois subclass Mock and add the sugar if you need it immediately. I would also advocate adding Chris' toString suggestion as well. In the meantime - while there is some push for Nat's branch going on - Sorry I'm not yet convinced by the direction. I'm particularly not convinced by adding additional names like matchNameAndReturn, nor the explosion of all generated types. There is a lot of discussion required to make that branch acceptable. Tim > -----Original Message----- > From: moc...@li... > [mailto:moc...@li...]On Behalf Of > Francois Beausoleil > Sent: 29 June 2003 02:48 > To: moc...@li... > Subject: [MO-java-dev] How to match and not return ? > > > Hi ! > > I need functionnality equivalent to expect(String, Object), but for > match(). Currently, in 0.09, there are matchAndReturn methods, but no > simple match(String). In this specific test instance, it does not matter > how many times I call method X as it has been asserted elsewhere that the > correct number of calls is made. > > Instead of: > mock.expect("eat", C.ANY_ARGS); > > I would like: > mock.match("eat", C.ANY_ARGS); > > This is something like the nice mock feature I spoke about a few weeks > back. What I want is no exception if I call the method 100 times or 10 > times. > > Thanks ! > François > -- > Francois Beausoleil > Developer of Java Gui Builder > http://jgb.sourceforge.net/ > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.490 / Virus Database: 289 - Release Date: 16/06/2003 > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.490 / Virus Database: 289 - Release Date: 16/06/2003 |
From: Steve F. <st...@m3...> - 2003-07-02 03:47:26
|
Added to CVS. S. Francois Beausoleil wrote: > Hi ! >=20 > I need functionnality equivalent to expect(String, Object), but for > match(). Currently, in 0.09, there are matchAndReturn methods, but no > simple match(String). In this specific test instance, it does not matt= er > how many times I call method X as it has been asserted elsewhere that t= he > correct number of calls is made. >=20 > Instead of: > mock.expect("eat", C.ANY_ARGS); >=20 > I would like: > mock.match("eat", C.ANY_ARGS); >=20 > This is something like the nice mock feature I spoke about a few weeks > back. What I want is no exception if I call the method 100 times or 10 > times. >=20 > Thanks ! > Fran=E7ois > -- > Francois Beausoleil > Developer of Java Gui Builder > http://jgb.sourceforge.net/ >=20 >=20 > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/0= 1 > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev |