|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.cactus.server.AbstractWebTestCaller
Responsible for instanciating the TestCase class on the server
side, set up the implicit objects and call the test method. This class
provides a common abstraction for all test web requests.
| Field Summary | |
protected static java.lang.String |
TEST_RESULTS
Name of the attribute in the application scope that will
hold the results of the test. |
protected WebImplicitObjects |
webImplicitObjects
The implicit objects (which will be used to set the test case fields in the setTesCaseFields method. |
| Constructor Summary | |
AbstractWebTestCaller(WebImplicitObjects theObjects)
|
|
| Method Summary | |
void |
doCreateSession()
Create an HTTP Session and returns the response that contains the HTTP session as a cookie (unless URL rewriting is used in which case the jsesssionid cookie is not returned). |
void |
doGetResults()
Return the last test results in the HTTP response. |
void |
doGetVersion()
Return the cactus version. |
void |
doRunTest()
Run the connection test between client and server. |
void |
doTest()
Calls a test method. |
protected abstract java.io.Writer |
getResponseWriter()
|
protected java.lang.Class |
getTestClassClass(java.lang.String theClassName)
|
protected junit.framework.TestCase |
getTestClassInstance(java.lang.String theClassName,
java.lang.String theWrappedClassName,
java.lang.String theTestCaseName)
|
protected java.lang.String |
getTestClassName()
|
protected java.lang.String |
getTestMethodName()
|
protected java.lang.String |
getWrappedTestClassName()
|
protected boolean |
isAutoSession()
|
protected abstract void |
setTestCaseFields(junit.framework.TestCase theTestCase)
Sets the implicit object in the test case class |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final java.lang.String TEST_RESULTS
application scope that will
hold the results of the test.
protected WebImplicitObjects webImplicitObjects
setTesCaseFields method.
| Constructor Detail |
public AbstractWebTestCaller(WebImplicitObjects theObjects)
theObjects - the implicit objects coming from the redirector| Method Detail |
protected abstract void setTestCaseFields(junit.framework.TestCase theTestCase)
throws java.lang.Exception
theTestCase - the instance of the test case class on which the
class variable (implicit objects) should be set
java.lang.Exception - if an errors occurs when setting the implicit
objects
protected abstract java.io.Writer getResponseWriter()
throws java.io.IOException
Writer object that will be used to return the
test result to the client side.
java.io.IOException - if an error occurs when retrieving the writer
public void doTest()
throws javax.servlet.ServletException
application
scope so that the Get Test Result service can find them.
javax.servlet.ServletException - if an unexpected error occurred
public void doGetResults()
throws javax.servlet.ServletException
javax.servlet.ServletException - if an unexpected error occurred
public void doRunTest()
throws javax.servlet.ServletException
javax.servlet.ServletException - if an unexpected error occurred
public void doGetVersion()
throws javax.servlet.ServletException
javax.servlet.ServletException - if an unexpected error occurred
public void doCreateSession()
throws javax.servlet.ServletException
javax.servlet.ServletException - if an unexpected error occurred
protected java.lang.String getTestClassName()
throws javax.servlet.ServletException
javax.servlet.ServletException - if the class name of the test case is missing
from the HTTP request
protected java.lang.String getWrappedTestClassName()
throws javax.servlet.ServletException
javax.servlet.ServletException - if the wrapped class name is missing from
the HTTP request
protected java.lang.String getTestMethodName()
throws javax.servlet.ServletException
javax.servlet.ServletException - if the method name of the test case is
missing from the HTTP requestprotected boolean isAutoSession()
protected junit.framework.TestCase getTestClassInstance(java.lang.String theClassName,
java.lang.String theWrappedClassName,
java.lang.String theTestCaseName)
throws javax.servlet.ServletException
theClassName - the name of the test classtheWrappedClassName - the name of the wrapped test class. Can be
null if there is nonetheTestCaseName - the name of the current test case
javax.servlet.ServletException - if the test case instance for the current
test fails to be instanciated (for example if some
information is missing from the HTTP request)
protected java.lang.Class getTestClassClass(java.lang.String theClassName)
throws javax.servlet.ServletException
theClassName - the name of the test class
javax.servlet.ServletException - if the class of the current test case
cannot be loaded in memory (i.e. it is not in the
classpath)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||