From: Vincent M. <vm...@pi...> - 2003-05-16 07:49:28
|
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 |