From: <Vin...@ge...> - 2003-06-02 22:22:12
|
Hi all, I've been playing with the new dynamocks recently and I really like it. Nice job ;-) What's the status on this concern raised by Vincent some time ago? I came accross the same situation recently and I wuold have loved an expectNotCalled method. It makes the test code easier to understand. What is the recommandation here? Thanks, Vincent > -----Original Message----- > From: moc...@li... > [mailto:moc...@li...]On Behalf Of > Vincent Massol > Sent: Friday, May 16, 2003 3:30 AM > 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 > |