You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by Ben Groeneveld <bg...@ici-web.com> on 2000/11/13 18:28:54 UTC

servlet test harness

Being new to jsp and servlets I am looking for a servlet test harness
similar to junit.  The ideal tool would be something that I can
integrate into by makefile-based system build process that allows me to
run test suites as batches.  Is there such a tool or junit customization
out there?  Thanks, BenG.

--
Ben Groeneveld
Information Concepts, Inc., 115 N.W. Oregon, Suite 30, Bend, OR 97701
Mailto:BGroeneveld@ici-web.com, phone:541.388.3611, cell:208.520.6488



Re: servlet test harness

Posted by Stefan Bodewig <bo...@apache.org>.
Alex Muc <al...@utoronto.ca> wrote:

> Specifically any information on JUnit customization or how one could
> test servlets with JUnit.  Is there anything you know of designed
> for testing servlets similar to how JUnit is used for testing
> regular classes?

There are some pages dedicated to servlet testing on the WikiWikiWeb,
see <http://c2.com/cgi/wiki?ServletTesting> for a starter.

I haven't tried anything mentioned there but some things look very
promising.

Stefan

Re: servlet test harness

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Alex Muc wrote:

> Ben,
>
> I came across this message that you posted on the
> general@jakarta.apache.org mailing list a couple of months ago.  Did you
> ever get any response from it?  Specifically any information on JUnit
> customization or how one could test servlets with JUnit.  Is there
> anything you know of designed for testing servlets similar to how JUnit
> is used for testing regular classes?

Alex,

One option you might want to consider is a unit test harness that we use to test
Tomcat 4.0.  It's in the "tester" directory of the source distribution.

Basically, the unit test client is implemented as a custom Ant task, so it's
easy to create "test scripts" using Ant's normal facilities.  The "server" end
of the tests is configured as a webapp that would contain the servlets under
test.

It includes the following features so far:
* Can use either HttpURLConnection or low-level socket connections
* Can configure the properties of the submitted request via
  attributes:  server host, port number, request headers,
  request data, request method, request URI
* Can configure the properties of the returned response that
  should be checked for test success:  response status, response
  message text, response headers that must be present, response
  data (first line only is compared currently).

The set of tests already present are somewhat specific to Tomcat, but can be
used to give you a sense of how your own tests could be set up.  Suggested
improvements to this framework are also welcome, and can be submitted to the
TOMCAT-DEV mailing list.

>
> Thanks
> Alex.
>

Craig McClanahan


>
> Ben Groeneveld wrote:
>
> > Being new to jsp and servlets I am looking for a servlet test harness
> > similar to junit.  The ideal tool would be something that I can
> > integrate into by makefile-based system build process that allows me
> > to run test suites as batches.  Is there such a tool or junit
> > customization out there?  Thanks, BenG.
> >
> > --
> > Ben Groeneveld
> > Information Concepts, Inc., 115 N.W. Oregon, Suite 30, Bend, OR 97701
> > Mailto:BGroeneveld@ici-web.com, phone:541.388.3611, cell:208.520.6488
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: general-help@jakarta.apache.org


Re: servlet test harness

Posted by Ben Groeneveld <bg...@ici-web.com>.
Alex, I didn't find anything.  I searched a lot.  One response from an 
interested party like yourself.  I looked briefly at Jakarta Watchdog 
(where's the doc?) thinking this was what Craig just responded to you 
about.  I miss junit...so nice and simple!  I have found servlets are in 
great need of debugging and testing tools, especially when it goes 
beyound the simple into session, multi-user, and concurrency issues.  I 
cannot begin to imagine starting work on an EJB project w/o getting 
these tools in place first. Good luck, I'm using JRun these days.  If 
you do get lucky let me know.   Thanks, BenG.

Alex Muc wrote:

> Ben,
> 
> I came across this message that you posted on the 
> general@jakarta.apache.org mailing list a couple of months ago.  Did 
> you ever get any response from it?  Specifically any information on 
> JUnit customization or how one could test servlets with JUnit.  Is 
> there anything you know of designed for testing servlets similar to 
> how JUnit is used for testing regular classes?
> 
> Thanks
> Alex.
> 
> Ben Groeneveld wrote:
> 
>> Being new to jsp and servlets I am looking for a servlet test harness 
>> similar to junit.  The ideal tool would be something that I can 
>> integrate into by makefile-based system build process that allows me 
>> to run test suites as batches.  Is there such a tool or junit 
>> customization out there?  Thanks, BenG.
>> 
>> -- 
>> Ben Groeneveld Information Concepts, Inc., 115 N.W. Oregon, Suite 30, 
>> Bend, OR 97701
>> Mailto:BGroeneveld@ici-web.com, phone:541.388.3611, cell:208.520.6488
>>  
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: general-help@jakarta.apache.org
> 
> 
> 

-- 
Ben Groeneveld 
Information Concepts, Inc., 115 N.W. Oregon, Suite 30, Bend, OR 97701
Mailto:BGroeneveld@ici-web.com, phone:541.388.3611, cell:208.520.6488


Re: servlet test harness

Posted by Alex Muc <al...@utoronto.ca>.
Ben,

I came across this message that you posted on the 
general@jakarta.apache.org mailing list a couple of months ago.  Did you 
ever get any response from it?  Specifically any information on JUnit 
customization or how one could test servlets with JUnit.  Is there 
anything you know of designed for testing servlets similar to how JUnit 
is used for testing regular classes?

Thanks
Alex.

Ben Groeneveld wrote:

> Being new to jsp and servlets I am looking for a servlet test harness 
> similar to junit.  The ideal tool would be something that I can 
> integrate into by makefile-based system build process that allows me 
> to run test suites as batches.  Is there such a tool or junit 
> customization out there?  Thanks, BenG.
> 
> -- 
> Ben Groeneveld 
> Information Concepts, Inc., 115 N.W. Oregon, Suite 30, Bend, OR 97701
> Mailto:BGroeneveld@ici-web.com, phone:541.388.3611, cell:208.520.6488
>