|
|||||||||
Home >> All >> com >> meterware >> [ servletunit overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |
com.meterware.servletunit
Class ServletRunner

java.lang.Objectcom.meterware.servletunit.ServletRunner
- public class ServletRunner
- extends java.lang.Object
This class acts as a test environment for servlets.
Nested Class Summary | |
static class |
ServletRunner.JasperJSPServletDescriptor
|
Field Summary | |
private WebApplication |
_application
|
private ServletUnitClient |
_client
|
private ServletUnitContext |
_context
|
private InvocationContextFactory |
_factory
|
private static JSPServletDescriptor |
_jspServletDescriptor
|
static JSPServletDescriptor |
JASPER_DESCRIPTOR
|
Constructor Summary | |
ServletRunner()
Default constructor, which defines no servlets. |
|
ServletRunner(java.io.File webXml)
Constructor which expects a File object representing the web.xml for the application. |
|
ServletRunner(java.io.File webXml,
java.lang.String contextPath)
Constructor which expects a File object representing the web.xml for the application and a context path under which to mount it. |
|
ServletRunner(java.io.InputStream webXML)
Constructor which expects an input stream containing the web.xml for the application. |
|
ServletRunner(java.io.InputStream webXML,
java.lang.String contextPath)
Constructor which expects an input stream containing the web.xml for the application. |
|
ServletRunner(java.lang.String webXMLFileSpec)
Deprecated. as of 1.6, use ServletRunner(File) 55 |
|
ServletRunner(java.lang.String webXMLFileSpec,
java.lang.String contextPath)
Deprecated. as of 1.6, use ServletRunner(File,String) 55 |
Method Summary | |
private void |
completeInitialization(java.lang.String contextPath)
|
(package private) WebApplication |
getApplication()
|
private ServletUnitClient |
getClient()
|
(package private) ServletUnitContext |
getContext()
|
java.lang.String |
getContextParameter(java.lang.String name)
Returns the value of the named context parameter found in the application definition. |
com.meterware.httpunit.WebResponse |
getResponse(java.lang.String url)
Returns the response from the specified servlet using GET. |
com.meterware.httpunit.WebResponse |
getResponse(com.meterware.httpunit.WebRequest request)
Returns the response from the specified servlet. |
javax.servlet.http.HttpSession |
getSession(boolean create)
Returns the session to be used by the next request. |
ServletUnitClient |
newClient()
Creates and returns a new web client that communicates with this servlet runner. |
void |
registerServlet(java.lang.String resourceName,
java.lang.String servletClassName)
Registers a servlet class to be run. |
void |
registerServlet(java.lang.String resourceName,
java.lang.String servletClassName,
java.util.Hashtable initParameters)
Registers a servlet class to be run, specifying initialization parameters. |
void |
shutDown()
Shuts down the servlet container, returning any resources held by it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
JASPER_DESCRIPTOR
public static final JSPServletDescriptor JASPER_DESCRIPTOR
_jspServletDescriptor
private static JSPServletDescriptor _jspServletDescriptor
_application
private WebApplication _application
_client
private ServletUnitClient _client
_context
private ServletUnitContext _context
_factory
private InvocationContextFactory _factory
Constructor Detail |
ServletRunner
public ServletRunner()
- Default constructor, which defines no servlets.
ServletRunner
public ServletRunner(java.lang.String webXMLFileSpec) throws java.io.IOException, org.xml.sax.SAXException
- Deprecated. as of 1.6, use
ServletRunner(File)
55- Constructor which expects the full path to the web.xml for the application.
- Constructor which expects the full path to the web.xml for the application.
ServletRunner
public ServletRunner(java.lang.String webXMLFileSpec, java.lang.String contextPath) throws java.io.IOException, org.xml.sax.SAXException
- Deprecated. as of 1.6, use
ServletRunner(File,String)
55- Constructor which expects the full path to the web.xml for the application and a context path under which to mount it.
- Constructor which expects the full path to the web.xml for the application and a context path under which to mount it.
ServletRunner
public ServletRunner(java.io.File webXml) throws java.io.IOException, org.xml.sax.SAXException
- Constructor which expects a File object representing the web.xml for the
application.
- Since:
- 1.6
ServletRunner
public ServletRunner(java.io.File webXml, java.lang.String contextPath) throws java.io.IOException, org.xml.sax.SAXException
- Constructor which expects a File object representing the web.xml for the
application and a context path under which to mount it.
- Since:
- 1.6
ServletRunner
public ServletRunner(java.io.InputStream webXML) throws java.io.IOException, org.xml.sax.SAXException
- Constructor which expects an input stream containing the web.xml for the application.
ServletRunner
public ServletRunner(java.io.InputStream webXML, java.lang.String contextPath) throws java.io.IOException, org.xml.sax.SAXException
- Constructor which expects an input stream containing the web.xml for the application.
Method Detail |
registerServlet
public void registerServlet(java.lang.String resourceName, java.lang.String servletClassName)
- Registers a servlet class to be run.
completeInitialization
private void completeInitialization(java.lang.String contextPath)
registerServlet
public void registerServlet(java.lang.String resourceName, java.lang.String servletClassName, java.util.Hashtable initParameters)
- Registers a servlet class to be run, specifying initialization parameters.
getResponse
public com.meterware.httpunit.WebResponse getResponse(com.meterware.httpunit.WebRequest request) throws java.net.MalformedURLException, java.io.IOException, org.xml.sax.SAXException
- Returns the response from the specified servlet.
getResponse
public com.meterware.httpunit.WebResponse getResponse(java.lang.String url) throws java.net.MalformedURLException, java.io.IOException, org.xml.sax.SAXException
- Returns the response from the specified servlet using GET.
getSession
public javax.servlet.http.HttpSession getSession(boolean create)
- Returns the session to be used by the next request.
- Since:
- 1.6
getContextParameter
public java.lang.String getContextParameter(java.lang.String name)
- Returns the value of the named context parameter found in the application definition.
shutDown
public void shutDown()
- Shuts down the servlet container, returning any resources held by it.
Calls the destroy method of each active servlet, then notifies
ContextListeners of server shutdown.
newClient
public ServletUnitClient newClient()
- Creates and returns a new web client that communicates with this servlet runner.
getContext
ServletUnitContext getContext()
getApplication
WebApplication getApplication()
getClient
private ServletUnitClient getClient()
|
|||||||||
Home >> All >> com >> meterware >> [ servletunit overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |