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 Ravi K Choppalli <ra...@aexp.com> on 2002/05/23 20:24:54 UTC

Stress Testing of a Servlet using Cactus !!!

Hello,

I was ableto run the cactus sample tests after carefully correcting mistakes
related to cactus.properties file.
But I'm struck at one place.

Can we use cactus for Stress Testing the Servlet.

I've written cactus test case to test a servlet.
But for that I needed to write this SetUp() method where I had to call
     servlet = new FrontServlet() ;
     config.setInitiParameter("configFile","D:\frontservlet.xml") ;
     servlet.init(config)

It works fine.

If I want to do a stress test on my FrontServlet,  ( I started using JUnitPerf)
it is calling these test methods in different threads,
but, since init() of the servlet is being called all the time and it does not
mean a good stress test.

Can anybody throw some light on this and advise,  how I can do a stress testing
on servlets using any open source software?

Thanks in advance.
Ravi Kiran Choppalli.




From: "Vincent Massol" <vm...@octo.com> on 05/23/2002 09:42 AM CET

To:   Ravi K Choppalli/NonAEXP/TRS/AEXP@AMEX
cc:
Subject:  RE: Help getting Apache Cactus Sample to RUN !!!


Hi Ravi,

You should send Cactus related emails only to the cactus user mailing
list where you'll get help from everyone.

Send an email there and I'll answer you ! :-)

P.S.: I have also added this to the Cactus FAQ.


> -----Original Message-----
> From: Ravi K Choppalli [mailto:ravi.k.choppalli@aexp.com]
> Sent: 02 May 2002 20:44
> To: vmassol@octo.com
> Subject: Help getting Apache Cactus Sample to RUN !!!
>
> Hello Vincent,
>
> I've seen your name very actively associated with Cactus.
> Could you please guide me to overcome the following problem.
> I tried looking for some assistance all over the web, but could find a
> proper
> source.
>
> Thanks,
> - Ravi.
>
> ---------------------- Forwarded by Ravi K Choppalli/NonAEXP/TRS/AEXP
on
> 05/02/2002 12:49 PM ---------------------------
>
> From: Ravi K Choppalli on 05/02/2002 12:17 PM
>
> To:   java@phxjug.org
> cc:
> Subject:  Help getting Apache Cactus Sample to RUN !!!
>
> Hi,
>
> I'm trying to run the sample which came with apache cactus (Testing
> Framework
> to test Servlets/Jsp's/ etc)
> I'm running Websphere3.5 server on my windows 2000 machine and added
the
> SampleServlet & ServletRedirector to it.
>
> When I try to run the sample by saying :
> E:\JAKART~1.3\SAMPLE~1\src\sample\org\apache\cactus\sample>java
> org.apache.cactus.sample.TestSampleServlet
>
> I get the following errors :  13 Test cases are there in that and all
> fail.
>
> 13)
>
testRequestDispatcherInclude(org.apache.cactus.sample.TestSampleServlet)
or
> g.apache.cactus.util.ChainedRuntimeException:
>
> Not a valid response
>         at
>
org.apache.cactus.client.WebTestResultParser.readRootElement(WebTestResu
lt
> Parser.java;org/apache/cactus/util/log/LogAspect.java(1k):134)
>
>         at
>
org.apache.cactus.client.WebTestResultParser.dispatch29_parse(WebTestRes
ul
> tParser.java;org/apache/cactus/util/log/LogAspect.java(1k):101)
>
>         at
>
org.apache.cactus.client.WebTestResultParser.around29_parse(WebTestResul
tP
> arser.java;org/apache/cactus/util/log/LogAspect.java(1k):1221)
>
>         at
>
org.apache.cactus.client.WebTestResultParser.parse(WebTestResultParser.j
av
> a;org/apache/cactus/util/log/LogAspect.java(1k):96)
>
>         at
>
org.apache.cactus.client.AbstractHttpClient.callGetResult(AbstractHttpCl
ie
> nt.java;org/apache/cactus/util/log/LogAspect.java(1k):231)
>
>         at
>
org.apache.cactus.client.AbstractHttpClient.dispatch1_doTest(AbstractHtt
pC
> lient.java;org/apache/cactus/util/log/LogAspect.java(1k):123)
>         at
>
org.apache.cactus.client.AbstractHttpClient.around1_doTest(AbstractHttpC
li
> ent.java;org/apache/cactus/util/log/LogAspect.java(1k):1221)
>         at
>
org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient.ja
va
> ;org/apache/cactus/util/log/LogAspect.java(1k):115)
>         at
>
org.apache.cactus.AbstractTestCase.runGenericTest(AbstractTestCase.java:
45
> 7)
>         at
> org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:133)
>         at
> org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:400)
>
>         at
>
org.apache.cactus.sample.TestSampleServlet.main(TestSampleServlet.java:9
4)
>
> FAILURES!!!
> Tests run: 13,  Failures: 0,  Errors: 13   (SAME Error for all 13)
>
> Contents of my cactus.properties file reads as follows :  (It is in
the
> classpath)
>
>         # Configuration file for Cactus.
>
>         # Each project using Cactus need to have such a file put in
the
> client side
>         # CLASSPATH (Meaning the directory containgin this file should
be
> in the client
>         # side CLASSPATH, not the file itself of course ... :) )
>
>         # Defines the URLs that will be used by Cactus to call it's
> redirectors.
>         # You need to specify in these URLs the webapp context that
you
> use for your
>         # application. In the example below, the context is "test".
>
>         # Web app Context under which our application to test runs
>         cactus.contextURL = http://localhost/inst/SampleServlet
>
>         # Default Servlet Redirector Name. Used by ServletTestCase
test
> cases.
>         cactus.servletRedirectorName = ServletRedirector
>
>         # Default JSP Redirector Name. Used by JspTestCase test cases.
>         cactus.jspRedirectorName = JspRedirector
>
>         # NOTE: Some servlet 2.3 containers need to map the filter to
a
> valid
>         # resource (Orion 1.5.2 for example). Others, like Tomcat, are
> happy
>         # with just any mapping.
>         #
>         # For example, the following would work with Tomcat (and this
is
> what I would
>         # have expected !) :
>         # cactus.filterRedirectorName = FilterRedirector
>
>         cactus.filterRedirectorName = test/filterRedirector.jsp
>
>         # Enable Cactus internal logging
>         cactus.enableLogging = true
>
> Any Help Appreciated.
>
>
> Thanx & Rgds,
>
> Ravi Kiran Choppalli,
> I&CT Architecture - Framework Technologies,
> Phone : 480 293 0521
>
>
>
>
>       Thanx & Rgds,
>
>       Ravi Kiran Choppalli,
>       I&CT Architecture - Framework Technologies,
>       Phone : 480 293 0521
>











--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Stress Testing of a Servlet using Cactus !!!

Posted by Vincent Massol <vm...@octo.com>.
Ravi,

Cactus is *not* about stress test as it is; It is about unit testing
code (white box style). 

Extensions for using Cactus as stress test would be possible I guess. It
might even be very useful as it is nice to be able to stress test
portions of the site from the inside as opposed to stress testing from
the outside which doesn't help you understanding what is wrong inside.

I am open to suggestion and patches for that. Actually I would view that
as an extension. If someone wanted to start such a project, we could
certainly create a proposal/ directory in Cactus to work on that and see
how it works out.

Thanks
-Vincent

P.S.: Try JMeter for stress testing at the level of HTTP (not at the
level of Servlet code).

> -----Original Message-----
> From: Ravi K Choppalli [mailto:ravi.k.choppalli@aexp.com]
> Sent: 23 May 2002 19:25
> To: cactus-user@jakarta.apache.org
> Subject: Stress Testing of a Servlet using Cactus !!!
> 
> 
> Hello,
> 
> I was ableto run the cactus sample tests after carefully correcting
> mistakes
> related to cactus.properties file.
> But I'm struck at one place.
> 
> Can we use cactus for Stress Testing the Servlet.
> 
> I've written cactus test case to test a servlet.
> But for that I needed to write this SetUp() method where I had to call
>      servlet = new FrontServlet() ;
>      config.setInitiParameter("configFile","D:\frontservlet.xml") ;
>      servlet.init(config)
> 
> It works fine.
> 
> If I want to do a stress test on my FrontServlet,  ( I started using
> JUnitPerf)
> it is calling these test methods in different threads,
> but, since init() of the servlet is being called all the time and it
does
> not
> mean a good stress test.
> 
> Can anybody throw some light on this and advise,  how I can do a
stress
> testing
> on servlets using any open source software?
> 
> Thanks in advance.
> Ravi Kiran Choppalli.
> 
> 
> 
> 
> From: "Vincent Massol" <vm...@octo.com> on 05/23/2002 09:42 AM CET
> 
> To:   Ravi K Choppalli/NonAEXP/TRS/AEXP@AMEX
> cc:
> Subject:  RE: Help getting Apache Cactus Sample to RUN !!!
> 
> 
> Hi Ravi,
> 
> You should send Cactus related emails only to the cactus user mailing
> list where you'll get help from everyone.
> 
> Send an email there and I'll answer you ! :-)
> 
> P.S.: I have also added this to the Cactus FAQ.
> 
> 
> > -----Original Message-----
> > From: Ravi K Choppalli [mailto:ravi.k.choppalli@aexp.com]
> > Sent: 02 May 2002 20:44
> > To: vmassol@octo.com
> > Subject: Help getting Apache Cactus Sample to RUN !!!
> >
> > Hello Vincent,
> >
> > I've seen your name very actively associated with Cactus.
> > Could you please guide me to overcome the following problem.
> > I tried looking for some assistance all over the web, but could find
a
> > proper
> > source.
> >
> > Thanks,
> > - Ravi.
> >
> > ---------------------- Forwarded by Ravi K
Choppalli/NonAEXP/TRS/AEXP
> on
> > 05/02/2002 12:49 PM ---------------------------
> >
> > From: Ravi K Choppalli on 05/02/2002 12:17 PM
> >
> > To:   java@phxjug.org
> > cc:
> > Subject:  Help getting Apache Cactus Sample to RUN !!!
> >
> > Hi,
> >
> > I'm trying to run the sample which came with apache cactus (Testing
> > Framework
> > to test Servlets/Jsp's/ etc)
> > I'm running Websphere3.5 server on my windows 2000 machine and added
> the
> > SampleServlet & ServletRedirector to it.
> >
> > When I try to run the sample by saying :
> > E:\JAKART~1.3\SAMPLE~1\src\sample\org\apache\cactus\sample>java
> > org.apache.cactus.sample.TestSampleServlet
> >
> > I get the following errors :  13 Test cases are there in that and
all
> > fail.
> >
> > 13)
> >
>
testRequestDispatcherInclude(org.apache.cactus.sample.TestSampleServlet)
> or
> > g.apache.cactus.util.ChainedRuntimeException:
> >
> > Not a valid response
> >         at
> >
>
org.apache.cactus.client.WebTestResultParser.readRootElement(WebTestResu
> lt
> > Parser.java;org/apache/cactus/util/log/LogAspect.java(1k):134)
> >
> >         at
> >
>
org.apache.cactus.client.WebTestResultParser.dispatch29_parse(WebTestRes
> ul
> > tParser.java;org/apache/cactus/util/log/LogAspect.java(1k):101)
> >
> >         at
> >
>
org.apache.cactus.client.WebTestResultParser.around29_parse(WebTestResul
> tP
> > arser.java;org/apache/cactus/util/log/LogAspect.java(1k):1221)
> >
> >         at
> >
>
org.apache.cactus.client.WebTestResultParser.parse(WebTestResultParser.j
> av
> > a;org/apache/cactus/util/log/LogAspect.java(1k):96)
> >
> >         at
> >
>
org.apache.cactus.client.AbstractHttpClient.callGetResult(AbstractHttpCl
> ie
> > nt.java;org/apache/cactus/util/log/LogAspect.java(1k):231)
> >
> >         at
> >
>
org.apache.cactus.client.AbstractHttpClient.dispatch1_doTest(AbstractHtt
> pC
> > lient.java;org/apache/cactus/util/log/LogAspect.java(1k):123)
> >         at
> >
>
org.apache.cactus.client.AbstractHttpClient.around1_doTest(AbstractHttpC
> li
> > ent.java;org/apache/cactus/util/log/LogAspect.java(1k):1221)
> >         at
> >
>
org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient.ja
> va
> > ;org/apache/cactus/util/log/LogAspect.java(1k):115)
> >         at
> >
>
org.apache.cactus.AbstractTestCase.runGenericTest(AbstractTestCase.java:
> 45
> > 7)
> >         at
> > org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:133)
> >         at
> >
org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:400)
> >
> >         at
> >
>
org.apache.cactus.sample.TestSampleServlet.main(TestSampleServlet.java:9
> 4)
> >
> > FAILURES!!!
> > Tests run: 13,  Failures: 0,  Errors: 13   (SAME Error for all 13)
> >
> > Contents of my cactus.properties file reads as follows :  (It is in
> the
> > classpath)
> >
> >         # Configuration file for Cactus.
> >
> >         # Each project using Cactus need to have such a file put in
> the
> > client side
> >         # CLASSPATH (Meaning the directory containgin this file
should
> be
> > in the client
> >         # side CLASSPATH, not the file itself of course ... :) )
> >
> >         # Defines the URLs that will be used by Cactus to call it's
> > redirectors.
> >         # You need to specify in these URLs the webapp context that
> you
> > use for your
> >         # application. In the example below, the context is "test".
> >
> >         # Web app Context under which our application to test runs
> >         cactus.contextURL = http://localhost/inst/SampleServlet
> >
> >         # Default Servlet Redirector Name. Used by ServletTestCase
> test
> > cases.
> >         cactus.servletRedirectorName = ServletRedirector
> >
> >         # Default JSP Redirector Name. Used by JspTestCase test
cases.
> >         cactus.jspRedirectorName = JspRedirector
> >
> >         # NOTE: Some servlet 2.3 containers need to map the filter
to
> a
> > valid
> >         # resource (Orion 1.5.2 for example). Others, like Tomcat,
are
> > happy
> >         # with just any mapping.
> >         #
> >         # For example, the following would work with Tomcat (and
this
> is
> > what I would
> >         # have expected !) :
> >         # cactus.filterRedirectorName = FilterRedirector
> >
> >         cactus.filterRedirectorName = test/filterRedirector.jsp
> >
> >         # Enable Cactus internal logging
> >         cactus.enableLogging = true
> >
> > Any Help Appreciated.
> >
> >
> > Thanx & Rgds,
> >
> > Ravi Kiran Choppalli,
> > I&CT Architecture - Framework Technologies,
> > Phone : 480 293 0521
> >
> >
> >
> >
> >       Thanx & Rgds,
> >
> >       Ravi Kiran Choppalli,
> >       I&CT Architecture - Framework Technologies,
> >       Phone : 480 293 0521
> >
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:cactus-user-
> help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>