Hi Jacques,

> -----Original Message-----
> From: jacques [mailto:[EMAIL PROTECTED]
> Sent: 28 August 2003 17:03
> To: Cactus Users List
> Subject: [PATCH] Invaliding sessions in AbstractWebTestCaller
> 
> Hi Vincent
> 
> I've included the cvs diff below. Ran this from a
> windows cvs client, so I hope the output is OK. Pls
> let me know what you think.
> 
> The reason for the change is that the application
> server creates a session for each of the three
> requests that's associated with running a test : The
> first to check whether the container is running, 

hmm... Why do you say a session is created? The request goes to the
ServletRedirector (for example) and calls the doRunTest() method:

    public void doRunTest() throws ServletException
    {
        // Do not return any http response (not needed). It is enough to
        // know this point has been reached ... it means the connection
has
        // been established !
    }

There is no HTTP session created to my knowledge (this would require a
call to request.getSession(true).

> the
> second to request the test to execute 

This depends on the test. By default a session is created unless the
test case has explicitely said not to create a session:

WebRequest.setAutomaticSession(false);

> and the third to
> get the result. 

Again the code calls "public void doGetResults() throws
ServletException" which does not create an HTTP Session.

So my belief is that we have at most 1 session created.

> The change will invalidate the session
> on the server side for the first and third requests.
> Since I could find no way to access these session
> objects in my ServletTestCase-derived class 
> (it's
> inside the webImplicitObjects), I figured that these
> sessions were not intended to be used by any user of
> the framework anyway (pls correct me if I'm wrong).

correct

> I've left doTest() alone, since the session bound to
> requests served by this method can be accessed in
> teardown() and invalidated if needed.
> 
> Here's the diff :
> 

[snip]

Before applying your patch I need to understand better why you think
more than 1 session is created.

Thanks for your contribution. Whatever the outcome I really appreciate
people taking the time to dive into the code and suggest improvements!
:-)

-Vincent



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

Reply via email to