jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrei <avso...@mail.ru>
Subject Re: JUnit and Cactus with inner static test-classes
Date Tue, 30 Oct 2001 15:26:42 GMT
Hello Jef,
The answer is: inner static classes successfully work with JUnit and
Cactus. I am already using them.
I can not send a piece of source code but you can take a look at my
initial message.
Some people see these problems (I do not):
1. Your source becomes bigger. And harder to maintain  (use IDE!)
2. You mix code and tests   (but tests are at the very end)
3. You must test only public logic but you have access to private
methods and fields
4. You have some additional import statements only for tests
5. More complex to refactor (???)

I have a question for an XP expert: is it really more difficult to follow
XP using inner test classes?

JC> Hi all,

JC> I've been following the disussion on static inner classes with great
JC> interest. I was using my own static inner classes (and framework) for unit
JC> testing my Java-code and recently switched over to JUnit, mainly because I
JC> want to test server side objects using Cactus.

JC> I feel that using inner classes for testing has more advantages than using
JC> seperate classes. With inner classes you can do "white box" testing (you can
JC> access private methods and fields), tests are always right beside your code
JC> and you are somewhat obliged to keep your tests synchronized with your code
JC> (or at least keep them compilable). And it is no problem to separate your
JC> tests from your code after compiling, since inner classes are packed in
JC> separate class-files.

JC> MY QUESTION now is: What are the consequences of using inner classes
JC> together with JUnit (and Cactus) ??? Is it always possible, are there any
JC> unforseen problems or drawbacks, ... ?? Does someone has any experience with
JC> this ?

JC> Any comment, tips, samples ... would be really appreciated.

JC> Jef Cumps
JC> EGOVA NV
JC> Belgium

JC> --
JC> To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
JC> For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>




-- 
Best regards,
 Andrei                            mailto:avsomov@mail.ru


--
To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>


Mime
View raw message