jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jay Baker" <jbaker.w...@gmail.com>
Subject class hierarchy and extending a Cactus Test Case
Date Tue, 17 Jul 2007 16:11:25 GMT
I searched the archives but, surprisingly, I could not find anything on
this.

I am using ServletTestCase. Extending this test case works just fine. No
problem. However, I have an existing object hierarchy that I would like to
preserve. Although all of the Cactus documentation discusses extending one
of the Cactus tests, I figured I could just implement some appropriate
interface(s) and use delegation. As I read further, I understood the use of
publicly accessible attributes of the various Cactus test cases. If this
access were done through getters and setters, I would have no problem.

It seems that I have four choices.

1. Implement some arcane introspective state listener such that I can
transfer state changes in my base class to a delegate Cactus class. I'm not
even sure how to do that off the top of my head and I don't like the idea
very much.

2. Copy implementation from an appropriate Cactus class to my base class. I
also don't like this. It is poor design and couples my base class too
closely to this version of Cactus. Of course, it would work.

3. Discuss contributing to Cactus such that the framework will permit a
design that could use delegation. This would be fine, but it can not meet
the time frame requirements that I have.

4. Change the design of existing code base that I have so this is not an
issue. I can't really afford to do this at this time due to the effort and
risk involved.

Any suggestions from others that have been down this road before?

-- Jay

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message