public abstract class AbstractWebTestCaller
extends java.lang.Object
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.Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
AbstractWebTestCaller(WebImplicitObjects theObjects) |
Modifier and Type | Method and Description |
---|---|
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
|
protected static final java.lang.String TEST_RESULTS
application
scope that will
hold the results of the test.protected WebImplicitObjects webImplicitObjects
setTesCaseFields
method.public AbstractWebTestCaller(WebImplicitObjects theObjects)
theObjects
- the implicit objects coming from the redirectorprotected 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 setjava.lang.Exception
- if an errors occurs when setting the implicit
objectsprotected 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 writerpublic 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 occurredpublic void doGetResults() throws javax.servlet.ServletException
javax.servlet.ServletException
- if an unexpected error occurredpublic void doRunTest() throws javax.servlet.ServletException
javax.servlet.ServletException
- if an unexpected error occurredpublic void doGetVersion() throws javax.servlet.ServletException
javax.servlet.ServletException
- if an unexpected error occurredpublic void doCreateSession() throws javax.servlet.ServletException
javax.servlet.ServletException
- if an unexpected error occurredprotected java.lang.String getTestClassName() throws javax.servlet.ServletException
javax.servlet.ServletException
- if the class name of the test case is missing
from the HTTP requestprotected java.lang.String getWrappedTestClassName() throws javax.servlet.ServletException
javax.servlet.ServletException
- if the wrapped class name is missing from
the HTTP requestprotected 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 casejavax.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 classjavax.servlet.ServletException
- if the class of the current test case
cannot be loaded in memory (i.e. it is not in the
classpath)Copyright © 2000-2004 Apache Software Foundation. All Rights Reserved.