Hi all,
I've recently been working through GOOS and I've learned a lot from it. Congratulations on a well-written book. I've been storing my code in the following GitHub repo:
github.com/dchetwynd/GOOS-Auction-Sniper
I'm currently stuck at the end of Chapter 19, the final chapter for the Auction Sniper example. At the end of the chapter I should have been at the stage where all tests were green, but the sniperBidsForMultipleItems() end-to-end test was failing. My GitHub commit where I was left with this single failing end-to-end test was 31ba62fdfd6dfd60a0bd65b41e950107e0959a32. I've since reverted a few commits to return to the last place that I was green. I've then tried again and reached the point where sniperBidsForMultipleItems() first starts failing. This corresponds to my most recent GitHub commit of bd6f752ca7bd3ffabb5809e15338495c68728e48.
In commit bd6f752ca7bd3ffabb5809e15338495c68728e48 I have the following four failing tests:
AuctionMessageTranslatorTest/notifiesAuctionFailedWhenBadMessageReceived() (unit)
AuctionMessageTranslatorTest/notifiesAuctionFailedWhenEventTypeMissing() (unit)
AuctionSniperEndToEndTest/notifiesAuctionFailedWhenEventTypeMissing()
AuctionSniperEndToEndTest/sniperBidsForMultipleItems()
The first three of these failures are expected failures, as I have not yet implemented the code for the XMPPFailureReporter. I cannot see why sniperBidsForMultipleItems() is failing for me here though. Even when I implement the remaining code from chapter 19, sniperBidsForMultipleItems() continues to fail for me (GitHub commit 31ba62fdfd6dfd60a0bd65b41e950107e0959a32). This end-to-end test fails at the following statement:
auction1.hasReceivedBid(1098, ApplicationRunner.SNIPER_XMPP_ID); (line 70 in AuctionSniperEndToEndTest in my code).
If I comment out later assertions for auction1 in sniperBidsForMultipleItems() then the test passes. At the start of this test I have the line:
application.startBiddingIn(auction1, auction2);
If I reverse this line to:
application.startBiddingIn(auction2, auction1);
then instead of the assertions for auction1 failing, the assertions for auction2 start failing from startBiddingIn(). It's as if connecting to the second auction somehow affects the behaviour of the first auction.
What's strangest of all though is when the end-to-end test sniperBidsForMultipleItems() starts failing for me. In AuctionMessageTranslatorTest I have the helper method expectFailureWithMessage(), where this has the following two JMock expectations:
context.checking(new Expectations()
{{
oneOf(listener).auctionFailed();
oneOf(failureReporter).cannotTranslateMessage(
with(ApplicationRunner.SNIPER_ID),
with(badMessage),
with(any(Exception.class)));
}});
The sniperBidsForMultipleItems() end-to-end test only starts failing for me when the second of these expectations is added. If I comment out the second JMock expectation (lines 107-110 of my AuctionMessageTranslatorTest code), sniperBidsForMultipleItems() then passes. Adding an extra JMock expectation in a unit test is causing an end-to-end test in a different test file to fail for me. I've examined Steve Freeman's auction sniper code at github.com/sf105/goos-code and I can't see any difference between his code and mine to cause this failure. I'm running Mac OS X 10.8.2 with Eclipse 4.2.1 and JMock 2.6.0.
Has anyone else encountered this same problem? I'd be grateful if someone could pull my GitHub code from either commit 31ba62fdfd6dfd60a0bd65b41e950107e0959a32 or bd6f752ca7bd3ffabb5809e15338495c68728e48 and see if they get the same failure of sniperBidsForMultipleItems().
Thanks for your help and keep up the good work,
Daley
--
---
You received this message because you are subscribed to the Google Groups "Growing Object-Oriented Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriented-software+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit
https://groups.google.com/groups/opt_out.