Howdy,

>> Cactus works beautifully with regards to servlet context and general
>> environment setup.
>
>  Should I instantiate a bean with session scope that is expected to be
>present?

Yes, you should instantiate it and place it in the session/application
context as needed by your webapp.  Another test would be to make sure
the webapp doesn't crash if this bean is missing.

>  Also, how do I handle the fact that I need to log in before I can
test
>the parts I need to test?

That depends on your webapp.  You can stuff a username or some other
object in the session, or alternatively do actual authentication.  This
is very specific to how your webapp is written.  Again, another test
would be how the webapp function when this authentication information is
missing.

>  This whole set up is very difficult to unit test, and that is
bothersome,
>as I am certain that this is a source of considerable errors in
>applications.

Yup, sounds like a tough testing environment.  But these are common, and
that's what tools like Cactus and MockObjects are for.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to