From: Vincent M. <vm...@pi...> - 2003-05-17 13:52:50
|
Tim, See Joe's answer on the mockobjects-java-dev mailing list Thanks -Vincent > -----Original Message----- > From: Tim Mackinnon [mailto:tim...@po...] > Sent: 17 May 2003 15:31 > To: Vincent Massol > Subject: RE: [MO-java-dev] [New DynaMock] expectNotCalled deprecated, why? > > So you would like it availabe as a null operation? (i.e. its an empty > method > that does nothing). > > I suppose we could consider this - although it seems a bit strange. My > worry > would be that it could cause people to have a false view of what the > library > does - e.g. you will get an exception if something is called that you > don't > explicity set an expectation for... So other calls that you forget to say > "expectNothing" will fail anyway. > > I could be convinced otherwise though. > > Tim > > p.s. I am bit busy this weekend to look at your example sorry. > > > -----Original Message----- > > From: moc...@li... > > [mailto:moc...@li...]On Behalf Of > > Vincent Massol > > Sent: 16 May 2003 08:49 > > To: 'Mockobjects-Java-Dev' > > Subject: RE: [MO-java-dev] [New DynaMock] expectNotCalled deprecated, > > why? > > > > > > Actually, I've understood the comment now but I still think this method > > should not be deprecated as it explains what the test is trying to do. > > With no method, you'll need to either document the test or hope that the > > reader will understand it... > > > > What do you think? > > > > Thanks > > -Vincent > > > > > -----Original Message----- > > > From: moc...@li... > > > [mailto:moc...@li...] On Behalf Of > > > Vincent Massol > > > Sent: 16 May 2003 09:30 > > > To: 'Mockobjects-Java-Dev' > > > Subject: [MO-java-dev] [New DynaMock] expectNotCalled deprecated, why? > > > > > > Hi, > > > > > > I've just noticed expectNotCalled() has been deprecated in the new > > > DynaMock API. I am wondering why as I've found it quite useful. The > > > javadoc says that "Not required, as if methodName is called, you will > > > get a an exception". I think an example in the javadoc would have been > > > more powerful an explanation. I'm not sure I understand... Here's the > > > current test I am migrating: > > > > > > public void testGetOrderHomeFromCache() throws Exception > > > { > > > // First call to ensure the home is in the cache > > > OrderUtil.getOrderHome(); > > > > > > // Make sure the lookup method is NOT called thus proving the > > > object > > > // is served from the cache > > > jndiTestSetup.getMockContext().expectNotCalled("lookup"); > > > OrderUtil.getOrderHome(); > > > } > > > > > > What should it be now? > > > > > > I liked the expectNotCalled as it expressed very nicely what it means > > > and what the test means. Handling this with an exception seems like a > > > hack to me (and not conveying the test message at all), but I'd like > > to > > > be proved wrong! :-) > > > > > > Thanks > > > -Vincent > > > > > > > > > > > > ------------------------------------------------------- > > > Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara > > > The only event dedicated to issues related to Linux enterprise > > solutions > > > www.enterpriselinuxforum.com > > > > > > _______________________________________________ > > > Mockobjects-java-dev mailing list > > > Moc...@li... > > > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > > > > > > > > ------------------------------------------------------- > > Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara > > The only event dedicated to issues related to Linux enterprise solutions > > www.enterpriselinuxforum.com > > > > _______________________________________________ > > 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.476 / Virus Database: 273 - Release Date: 24/04/2003 > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.476 / Virus Database: 273 - Release Date: 24/04/2003 |