Hi John,

In article <[EMAIL PROTECTED]>,
Fri, 8 Oct 2004 10:47:29 -0400,
[EMAIL PROTECTED] wrote: 
John> I am trying setup testcases with for an application that has
John> a security-constraint on the front controller (struts ActionServlet),
John> running on Tomcat 4.1.27. We are using FormAuthentication with a JOB realm.
John>
John> I am using StrutsTestCase, and I saw the documentation located at
John> http://strutstestcase.sourceforge.net/. Since we cannot predetermine
John> which testcase will run first, and the documented technique cannot run
John> in the setup, this means that every testcase is going have to be coded
John> to do the the login action, prior to doing the testing the action
John> that is the subject of the testcase.
John> 
John> My first solution was to create a mock or stub of the principle and
John> credential objects and put them into session. However,
John> the setPrincipal method is not exposed in the standard HttpSession api,
John> and the implemented sessionObject is not visible.

I'm not sure how StrutsTestCase work with Cactus, however,
you might try use CactusStrutsTestCase instead of MockStrutsTestCase
as described at URL you mentioned.

The authentication mechanism provided by Cactus may helps you.
See also: http://jakarta.apache.org/cactus/writing/howto_security.html

Regards,
----
Kazuhito SUGURI
mailto:[EMAIL PROTECTED]

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

Reply via email to