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 Venu Sunil Boyireddy <ve...@aztec.soft.net> on 2005/01/21 16:49:21 UTC

RE: Help bundling Servlet Test cases

Hi Vincent

Thanks for your help. 
We created a generic test case driven by XML file. It solves our purpose.

Thanks once again

Sunil


-----Original Message-----
From: Vincent Massol [mailto:vmassol@pivolis.com]
Sent: Saturday, December 18, 2004 3:49 AM
To: 'Cactus Users List'
Subject: RE: Help bundling Servlet Test cases


Hi Sunil,

Unfortunately Cactus does not currently support Data-driven testing because
of a limitation in our implementation. In short, for each test to execute on
the server side the cactus client side passes the name of the test
class/test method to execute to the cactus redirector on the server side.
The redirector then instantiates your test class inside the container using
introspection. It does this by calling either the default constructor or the
constructor accepting a string as parameter. It cannot currently call a
constructor that would accept input parameters. We've discussed this in the
past and we've agreed that one solution to support this would be to let the
client side instantiate the test and pass it as a serialized object to the
server side. But that remains to be implemented... I don't remember if
there's a JIRA issue for this so you may with to raise one if you're
interested.

All that said, here's the good news! You can probably make it work by doing
the following:

- pass the location of a properties file to the server side by adding it as
an HTTP parameter to the HTTP request (in your beginXXX() method).
Alternatively pass different HTTP parameters, one for each property you wish
to use in your generic test methid

- in your generic test method, read the properties file/paremeters (get them
from the request object)

- in order not to have all test methods named identically in your JUnit
report, ensure you override the JUnit getName() method.

Hope it helps,
-Vincent

> -----Original Message-----
> From: Venu Sunil Boyireddy [mailto:venub@aztec.soft.net]
> Sent: jeudi 16 décembre 2004 07:37
> To: cactus-user@jakarta.apache.org
> Subject: Help bundling Servlet Test cases
> 
> Hi,
> 
> I'm using Cactus to test servlets and JSPs. As of now I'm writing a
> separate
> test cases for each Servlet and bundling them in Suite.
> 
> 
> 
> Instead of writing a separate test case for each and every Servlet/JSP, I
> wanted to write a application which takes inputs(Servlet name, path,
> params
> etc.) from properties file and runs the test case.
> 
> 
> 
> Is there any way where I can write test application.
> 
> 
> 
> 
> 
> Any Help is very much grateful.
> 
> 
> 
> Thanks in advance.
> 
> 
> 
> Sunil



---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-user-help@jakarta.apache.org