From: Tim M. <tim...@po...> - 2003-04-17 01:48:04
|
No problems Nat - we have made some good progress, and things are pretty much how you would expect them. Mostly like your diagram but a few things haven't materialised as you drew them yet (I forget which, but it was trivial). I'm not going to be at XtC next week as I am in America for two weeks (leaving this Sunday). If you are near Liverpool St. today (Thurs) give me a call and drop by the e2x offices. CallSequence has been completed - so no need to worry on that one. The last big one is ANY_ARGS - it should be an object in its own right (we shouldn't use Constraint[] in a CallMatch it should be a Contraints object with an interface which AnyContraints can implement and just always return true ). The callable interface may be ok - I'm divided on this one - we can discuss it later. As for the before/after idea - I like how the functional test proposes it. It should be easy to implement too - just decorate an ExpectedCall with a before field - when you call, make sure the before object wasCalled (may need to add wasCalled to the Callable interface though). Anyway - the current stuff is very usuable for most cases now, I'm really enjoying using it. Tim -----Original Message----- From: Nat Pryce [mailto:nat...@b1...] Sent: 16 April 2003 11:08 To: Tim Mackinnon; Mockobjects-Java-Dev Subject: Re: [MO-java-dev] Java Dynamic Mocks - going to Head? Sorry for being incomunicado for the last few days. I haven't had a chance to see the latest changes -- it seems next to impossible to get BT to acknowledge that they can install a phone line to my boat let alone broadband! I'd like the chance to meet up and check out / comment on the latest updates. Are you (Tim) going to be at XTC this week? Perhaps we could hammer out the CallSequence class. > 2) The Callable interface has a "matches" method, this doesn't feel right > for all callables, its required for CallBag to operate - others don't need > it. This should be removed and implemented as a private decoration for > CallBag. For a CallSequence it will also need a "complete" method that returns true if the Callable can be removed from the front of the sequence. Personally, I feel comfortable having these methods in the Callable interface, but if the Decorator approach works that will be great. > 3) Steve's exellent suggestion of having: > > Callable c1 = mock.expect("setContentType".....) > Callable c2 = mock.expect("getWriter".....) > c1.expectBefore(c2) > > has not yet been implemented. This should work quite easily, but the focus > has been on UnorderdMock and OrderedMock. In the new design, this would be accomplished by organising "setContentType" and "getWriter" into a CallSequence and adding the call sequence to the Mock. CallCollection seq = mock.expectSequence(); seq.expectVoid( "setContentType", ... ); seq.expectAndReturn( "getWriter", ... ); The expectBefore method will be quite messy to implement in the current design. Since there is already a way to achieve the same effect, I'd suggest not implementing expectBefore. --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.467 / Virus Database: 266 - Release Date: 01/04/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.467 / Virus Database: 266 - Release Date: 01/04/2003 |