Vincent
"The only remaining problem is : how to provide that ?...
"Last remaining question : is it possible without incurring
the cost of writing 2 test classes for each class to test ?"
Following the emails between you and Alex, I think Alex's factory pattern
for mock objects is a good start. However, I think your concern of changing
the in-container testing model is a valid one, especially since the test
class code does change dramatically between the in-container testing
offered by Cactus and the creation and population of mock objects directly.
Since Tomcat is the reference implementation for certain parts of the J2EE
architecture, are we saying, by claiming a need for mock objects, that there
is a reference at the *interface* level that is "purer" than the *reference
implementation*? Is this valid?
Is it possible to treat the collection of mock objects as just another
container? If so, are we falling into the trap of effectively writing a new
container, which is a primary reason for Cactus' in-container testing
approach?
Tom
http://calivera.manilasites.com