From: Dmitri C. <col...@gm...> - 2005-05-30 05:20:50
|
Hi Steve, Thanks for the feedback, criticism always welcome. I hope you don't mind me asking a few points though. > - the jdbc API is all interfaces, so I'd still suggest using jmock > because it's easier to work with I'm not sure how this would change the structure of the test. I'd still be doing much the same as I am now yeah? > - yes, the jmock library is largely about mocking your own interfaces, > but there's a reason for that. The intention is to drive the design. At > first glance, it looks like your code would benefit from being broken > up into smaller objects, which can be tested individually. MO tests > should be focussed and readable. Yeah fair call, I've extracted the method out into a method object to facilitate this, thanks for the heads up. As an excuse I'm going to state that I've just returned from a month long holiday (o: > - if you want to test at this level, then it's more like a little > integration test. Frankly, I'd think seriously about having little > database and container instances to run against. Yep, know what you're saying. But I also wanted to do something test-driven, and was stuck trying to think of where I should put a test that made me write the code. > - What's all this mock container and aspect weaving about? If you want > to use mocks, then write a domain layer that fits just insider the > container and test that independently. Then all the container does is > assemble the pieces and pass them through to the domain layer. I have no idea (o: I just copied that from http://www.mockejb.org, most of the setup method is from there. > - Also consider a domain layer to manage persistence. This can be > mocked out when testing the domain application code, and its real DB > implementation tested separately. Yeah, fighting that battle elsewhere (o: cheers dim |