qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aidan Skinner <ai...@apache.org>
Subject Mock/TestableObjects in the JUnit tests
Date Mon, 27 Apr 2009 18:22:26 GMT
There are quite a few MockFoo and TestableFoo classes in the various
unit tests which extend or re-implement certain core objects like
AMQProtocolSession and MessageStore. There's also a number of
used-by-tests-only constructors kicking about.

I know some people feel quite strongly about Mocks (and their tendency
to grow limbs), and some of the TestableFoos we have are a pain to
maintain. One option might be to define a generic class which exposed
all the protected members of the class it's passed as public, and then
things which need to add test constructors can do that there. This
would reduce the maintainence necessary for new things. We could
convert old ones as we found ourselves in there, much like we did with
QpidTestCase.

I'm not sure if that approach solves all of the use cases for the
existing Mock things, but it certainly would solve some of them.

How much use do other people think this would be, and (I guess
slightly more pertinently) would it be worth the effort?

- Aidan
-- 
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-subscribe@qpid.apache.org


Mime
View raw message