Hi Vincent,

Thanks for the reply.

Nice to know that Cactus by itself passes on "real request".

I checked the source code of CactusStrutsTestCase & saw that it initialized a 
new request & passes that one to the caller. Little weird but does not help me.

So I wrote a small servlet that extends "ServletTestRunner" & override doGet() 
method, get the request parameter (set in the System.setProperty() as they do 
for some cactus property) & then call super.doGet().

So my Cactus Test class now calls System.getProperty() to retrieve the 
parameter passed to the servlet by Jmeter. I know this is not an elegant 
solution but hey, it works for me.

Thanks vincent again for the help.

Have a great day.

Regards,
 
Sanket Desai

-----Original Message-----
From: Vincent Massol [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 22, 2004 4:12 PM
To: 'Cactus Users List'
Subject: RE: Passing argument to Cactus using servlet

Hi Sankeet,

> -----Original Message-----
> From: Sanket Desai [mailto:[EMAIL PROTECTED]
> Sent: mercredi 22 d�cembre 2004 21:31
> To: [email protected]
> Subject: Passing argument to Cactus using servlet
> 
> Hi there,
> 
> I'm calling onto cactus using JMeter.
> 
> Basically calling "ServletTestRunner" servlet while passing
> 1) suite="Fully_Qualified_TestSuiteName"
> 2) myArg=myValue
> 
> 
> I see that the test gets called but I need to access my passed 
> argument
> (myArg) in my test class that I passed from JMeter. Unfortunately that 
> parameter is not available.I guess the "request" parameter that we 
> have using "getRequest()" method of "CactusStrutsTestCase" or "public 
> request variable" of ServletTestCase is actually provided by Cactus itself.
> 

No, that should work fine. The "request" object that you're getting is the real 
request object. To my knowledge, we have several tests in the Cactus test suite 
that pass HTTP parameters to the server side.

Ah, I can think of only possible reason why it wouldn't work: maybe 
StrutsTestCase does not pass the original request? I have never used 
strutstestcase so I don't know but try without strutstestcase as a test and it 
should work fine. You can ask on the strutstestcase mailing list. Maybe they'll 
be able to help?

> Does anyone know a way of retrieving the passed request parameter to 
> cactus in the test class?
> 
> I really apreciate any help / pointers in this scenario.
> 
> Thanking you in advance.
> 
> Regards,
> 
> Sanket Desai
> 


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




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

Reply via email to