| javax.servlet.http.HttpServlet org.apache.cactus.sample.servlet.SampleServlet
SampleServlet | public class SampleServlet extends HttpServlet (Code) | | Sample servlet that implement some very simple business logic. The goal is
to provide functional tests for Cactus, so we focus on providing as many
different test cases as possible rather than implementing a meaningful
business logic.
version: $Id: SampleServlet.java 238835 2004-03-06 20:59:41Z vmassol $ |
checkMethod | public String checkMethod(HttpServletRequest theRequest)(Code) | | Return the method used to send data from the client (POST or GET). This
will be used to verify that we can simulate POST or GET methods from
Cactus. This simulates a method which would test the method to
implement it's business logic.
Parameters: theRequest - the HTTP request the method used to post data |
doGet | public void doGet(HttpServletRequest theRequest, HttpServletResponse theResponse) throws IOException(Code) | | Entry point for the servlet when a GET request is received. This will
be used to verify that we can test for the servlet output stream in
Cactus test cases.
Parameters: theRequest - the HTTP request Parameters: theResponse - the HTTP response exception: IOException - on failure |
getRequestCookies | public Hashtable getRequestCookies(HttpServletRequest theRequest)(Code) | | the cookies sent in the HTTP request Parameters: theRequest - the HTTP request |
getRequestHeader | public String getRequestHeader(HttpServletRequest theRequest)(Code) | | Get a header from the request.
a test request header Parameters: theRequest - the HTTP request |
getRequestParameters | public Hashtable getRequestParameters(HttpServletRequest theRequest)(Code) | | Get some parameters from the HTTP request.
Parameters: theRequest - the HTTP request a hashtable containing some parameters |
setRequestAttribute | public void setRequestAttribute(HttpServletRequest theRequest)(Code) | | Set some attribute in the request.
Parameters: theRequest - the HTTP request |
setResponseCookie | public void setResponseCookie(HttpServletResponse theResponse)(Code) | | Set a cookie for sending back to the client. This is to verify that
it is possible with Cactus to assert the cookies returned to the client
Parameters: theResponse - the HTTP response |
setResponseHeader | public void setResponseHeader(HttpServletResponse theResponse)(Code) | | Set a header in the HTTP response. This is to verify that Cactus tests
can assert the returned headers.
Parameters: theResponse - the HTTP response |
setSessionVariable | public void setSessionVariable(HttpServletRequest theRequest)(Code) | | Set some variable in the HTTP session. It verifies that a session object
has automatically been created by Cactus prior to calling this method.
Parameters: theRequest - the HTTP request |
Methods inherited from javax.servlet.http.HttpServlet | protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doTrace(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected long getLastModified(HttpServletRequest req)(Code)(Java Doc) protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException(Code)(Java Doc)
|
|
|