Hi Thorsten,

In article <[EMAIL PROTECTED]>,
Fri, 12 Mar 2004 09:44:18 +0100,
Thorsten Frank <[EMAIL PROTECTED]> wrote: 
tfrank> but i discovered something else. a little more background: we are using the 
tfrank> JUnitEE servlet to run the tests within the container. The site is entirely 
tfrank> tunneled through SSL, although IMO that shouldn't be the problem, since we 
tfrank> trigger them through a browser. Also, there are no complaints from cactus 
tfrank> about not being able to connect, etc.

Could you try followings?
1. provide a simple Servlet to test and its test-case as subclass
   of ServletTestCase (not CactusStrutsTestCase)
2. run a test by using Cactus's ServletTestRunner

   Above two are to make the situation simple.
   I think its better for you to find out a working situation, first.

3. use plain HTTP and monitor NW traffics
   Cactus's form-based authentication is expectiong following sequence:
   Step 1: C->S connect to secured ServletRedirector to start authentication
        GET /target-app/ServletRedirectorSecure HTTP/1.1
   Step 2: S->C redirect to (or return) the login form page
        HTT/1.1 302 Moved Temporarily
        set-cookie: ....
        Location: http://localhost:8080/target-app/login.jsp
   Step 3: C->S send credentials to server
        POST /target-app/j_session_check HTTP/1.1
        Cookie: ....
   Step 4: S->C redirect to the protected resource
        HTTP/1.1 302 Moved Temporarily
   Step 5: C->S start to test as normal ServletRedirector does
        GET /target-app/ServletRedirectorSecure?Cactus_Service=... HTTP/1.1
        Cookie: ....

   The set-cookie header field in the Step 2 is important.
   If the one to set JSESSIONID is not exists,
   that may causes "missing cookie name".



tfrank> in our cactus.properties file, we have the following:
tfrank> cactus.contextURL = https:///localhost:9443/test
tfrank> 
tfrank> When setting logging output for cactus to debug though, i get the following 
tfrank> statement:
tfrank> 
tfrank> ...(AbstractWebConfiguration.java:236) - > getRedirectorURL = 
tfrank> [http://localhost:9080/test/ServletRedirectorSecure]
tfrank> 
tfrank> why???
tfrank> how should cactus now to NOT use the context url supplied in the properties 
tfrank> file?

If one uses ServletTestRunner, cactus.contextURL of cactus.properties
will not be used, but the servlet set the property by following code:
        "http://"; + theRequest.getServerName() + ":"
        + theRequest.getServerPort()
        + theRequest.getContextPath()

This is a case I know, but it maybe not yours, since you are using
JUnitEE servlet. I feel strange....
----
Kazuhito SUGURI
E-mail: [EMAIL PROTECTED]

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

Reply via email to