In general I think we need test to interfaces rather than implementations. Of course this requires us to clearly define the public interfaces of classes. I am always disturbed when the act of writing a test causes the implementation to change to accommodate the test - it's clearly an indication that something is wrong. I *hate* extending real implementations to make test classes - it only ends up with finding lots of bugs in the test objects and nothing in the actual code.
The fact that we can't unit test individual classes in isolation would seem to point to errors in our design more than anything else. -- Rob 2009/4/28 Aidan Skinner <ai...@apache.org>: > On Tue, Apr 28, 2009 at 9:44 AM, Martin Ritchie <ritch...@apache.org> wrote: > >> Having a common base class for the Java broker tests like we do with >> QpidTestCase in systests would be a good change. > > I'm not proposing having a common base case (and I'm not sure what > that would give us), it's about having something like > TestableMaker<Class T> and passing in AMQMesage to that instead of > having MockAMQMessage. The new TestableAMQMessage would then magically > expose the relevant bits and add the two constructors. > > - Aidan (who realises MockAMQMessage is a really bad example since it > actually extends AMQMessage and isn't really a Mock at all) > > -- > Apache Qpid - Give me convenience or give me death > http://qpid.apache.org > > --------------------------------------------------------------------- > Apache Qpid - AMQP Messaging Implementation > Project: http://qpid.apache.org > Use/Interact: mailto:dev-subscr...@qpid.apache.org > > --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:dev-subscr...@qpid.apache.org