You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by jacques <in...@yahoo.com> on 2003/08/27 15:40:08 UTC

how do i go about commiting code changes to the project ?

Hi there

I had to change a few lines of code in the Cactus
project. I would like to know whether these changes
could  be added to the project, since they might
improve the workings of the framework. How do I go
about doing this ?

Regards
Jacques

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

RE: [PATCH] Invaliding sessions in AbstractWebTestCaller

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Jacques,

> -----Original Message-----
> From: jacques [mailto:inspired_orange@yahoo.com]
> 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



[PATCH] Invaliding sessions in AbstractWebTestCaller

Posted by jacques <in...@yahoo.com>.
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, the
second to request the test to execute and the third to
get the result. 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).
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 :

cvs diff -w -i AbstractWebTestCaller.java (in
directory D:\dev\cactus-example-dynamo\cactus
source\jakarta-cvs\jakarta-cactus\framework\src\java\share\org\apache\cactus\server\)
Index: AbstractWebTestCaller.java
===================================================================
RCS file:
/home/cvspublic/jakarta-cactus/framework/src/java/share/org/apache/cactus/server/AbstractWebTestCaller.java,v
retrieving revision 1.23
diff -w -i -r1.23 AbstractWebTestCaller.java
203a204,205
>        
webImplicitObjects.getHttpServletRequest().getSession(false).invalidate();
> 
231a234
>        
webImplicitObjects.getHttpServletRequest().getSession(false).invalidate();

*****CVS exited normally with code 1*****


Regards
Jacques

--- Vincent Massol <vm...@pivolis.com> wrote:
> Hi Jacques,
> 
> This is great. The best way is to send a patch
> against CVS HEAD to this
> mailing list, with a subject starting with [PATCH].
> 
> Please have a look at
>
http://jakarta.apache.org/cactus/participating/index.html
> for more
> information.
> 
> Thanks
> -Vincent
> 
> > -----Original Message-----
> > From: jacques [mailto:inspired_orange@yahoo.com]
> > Sent: 27 August 2003 15:40
> > To: cactus
> > Subject: how do i go about commiting code changes
> to the project ?
> > 
> > Hi there
> > 
> > I had to change a few lines of code in the Cactus
> > project. I would like to know whether these
> changes
> > could  be added to the project, since they might
> > improve the workings of the framework. How do I go
> > about doing this ?
> > 
> > Regards
> > Jacques
> > 
> > __________________________________
> > Do you Yahoo!?
> > The New Yahoo! Search - Faster. Easier. Bingo.
> > http://search.yahoo.com
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> cactus-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> cactus-user-help@jakarta.apache.org
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> cactus-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

RE: how do i go about commiting code changes to the project ?

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Jacques,

This is great. The best way is to send a patch against CVS HEAD to this
mailing list, with a subject starting with [PATCH].

Please have a look at
http://jakarta.apache.org/cactus/participating/index.html for more
information.

Thanks
-Vincent

> -----Original Message-----
> From: jacques [mailto:inspired_orange@yahoo.com]
> Sent: 27 August 2003 15:40
> To: cactus
> Subject: how do i go about commiting code changes to the project ?
> 
> Hi there
> 
> I had to change a few lines of code in the Cactus
> project. I would like to know whether these changes
> could  be added to the project, since they might
> improve the workings of the framework. How do I go
> about doing this ?
> 
> Regards
> Jacques
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org