| java.lang.Object org.mortbay.jetty.testing.ServletTester
ServletTester | public class ServletTester (Code) | | Testing support for servlets and filters.
Allows a programatic setup of a context with servlets and filters for
testing. Raw HTTP requests may be sent to the context and responses received.
To avoid handling raw HTTP see
org.mortbay.jetty.testing.HttpTester .
ServletTester tester=new ServletTester();
tester.setContextPath("/context");
tester.addServlet(TestServlet.class, "/servlet/*");
tester.addServlet("org.mortbay.jetty.servlet.DefaultServlet", "/");
tester.start();
String response = tester.getResponses("GET /context/servlet/info HTTP/1.0\r\n\r\n");
See Also: org.mortbay.jetty.testing.HttpTester author: gregw |
connector | LocalConnector connector(Code) | | |
ServletTester | public ServletTester()(Code) | | |
addEventListener | public void addEventListener(EventListener listener)(Code) | | Parameters: listener - See Also: org.mortbay.jetty.handler.ContextHandler.addEventListener(java.util.EventListener) |
addFilter | public FilterHolder addFilter(Class filterClass, String pathSpec, int dispatches)(Code) | | Parameters: filterClass - Parameters: pathSpec - Parameters: dispatches - See Also: org.mortbay.jetty.servlet.Context.addFilter(java.lang.Classjava.lang.Stringint) |
addFilter | public FilterHolder addFilter(String filterClass, String pathSpec, int dispatches)(Code) | | Parameters: filterClass - Parameters: pathSpec - Parameters: dispatches - See Also: org.mortbay.jetty.servlet.Context.addFilter(java.lang.Stringjava.lang.Stringint) |
addServlet | public ServletHolder addServlet(Class servlet, String pathSpec)(Code) | | Parameters: servlet - Parameters: pathSpec - See Also: org.mortbay.jetty.servlet.Context.addServlet(java.lang.Classjava.lang.String) |
addServlet | public ServletHolder addServlet(String className, String pathSpec)(Code) | | Parameters: className - Parameters: pathSpec - See Also: org.mortbay.jetty.servlet.Context.addServlet(java.lang.Stringjava.lang.String) |
getAttribute | public Object getAttribute(String name)(Code) | | Parameters: name - See Also: org.mortbay.jetty.handler.ContextHandler.getAttribute(java.lang.String) |
getAttributeNames | public Enumeration getAttributeNames()(Code) | | See Also: org.mortbay.jetty.handler.ContextHandler.getAttributeNames |
getAttributes | public Attributes getAttributes()(Code) | | See Also: org.mortbay.jetty.handler.ContextHandler.getAttributes |
getResourceBase | public String getResourceBase()(Code) | | See Also: org.mortbay.jetty.handler.ContextHandler.getResourceBase |
getResponses | public String getResponses(String rawRequests) throws Exception(Code) | | Get raw HTTP responses from raw HTTP requests.
Multiple requests and responses may be handled, but only if
persistent connections conditions apply.
Parameters: rawRequests - String of raw HTTP requests String of raw HTTP responses throws: Exception - |
setAttribute | public void setAttribute(String name, Object value)(Code) | | Parameters: name - Parameters: value - See Also: org.mortbay.jetty.handler.ContextHandler.setAttribute(java.lang.Stringjava.lang.Object) |
setClassLoader | public void setClassLoader(ClassLoader classLoader)(Code) | | Parameters: classLoader - See Also: org.mortbay.jetty.handler.ContextHandler.setClassLoader(java.lang.ClassLoader) |
setContextPath | public void setContextPath(String contextPath)(Code) | | Parameters: contextPath - See Also: org.mortbay.jetty.handler.ContextHandler.setContextPath(java.lang.String) |
setEventListeners | public void setEventListeners(EventListener[] eventListeners)(Code) | | Parameters: eventListeners - See Also: org.mortbay.jetty.handler.ContextHandler.setEventListeners(java.util.EventListener[]) |
setResourceBase | public void setResourceBase(String resourceBase)(Code) | | Parameters: resourceBase - See Also: org.mortbay.jetty.handler.ContextHandler.setResourceBase(java.lang.String) |
|
|