Package com.meterware.servletunit
package com.meterware.servletunit
Classes for unit testing servlets, providing internal access to running servlets using a simulated servlet container.
Each test session should begin by creating a
ServletRunner
which will act as a servlet application context.
The definition of application context may be supplied in one of two ways.
The registerServlet
method allows the
association of a servlet with a url path. Alternately, an entire servlet application may be defined by passing the
name of the desired web.xml file.
The newClient
method will return a
ServletUnitClient
object which can be
used to invoke the defined servlets, just as any subclass of
WebClient
. In addition, this client object defines methods which allow
access to the fully initializated servlet itself, as well as the request, response, and servlet session.
A tutorial is available.
Please direct any questions to Russell Gold.-
ClassDescriptionAn interface which represents the invocation of a servlet.An interface for an object which acts as a factory of InvocationContextsDescribes a servlet used to handle JSPs.A servlet which can run unit tests inside a servlet context.This class acts as a test environment for servlets.A base class for test cases to be run via
JUnitServlet
.A client for use with the servlet runner class, allowing the testing of servlets without an actual servlet container.This class is a private implementation of the ServletContext class.