| org.apache.cactus.spi.client.connector.ProtocolHandler
All known Subclasses: org.apache.cactus.internal.client.connector.http.HttpProtocolHandler,
ProtocolHandler | public interface ProtocolHandler (Code) | | Any communication protocol (e.g HTTP) used to connect between
Cactus client side and Cactus server side must implement this lifecycle
interface. This interface is part of the connector SPI.
Here is the lifecycle followed by Cactus core:
-
Call
ProtocolHandler.createRequest to create a request object that will be
passed to the
begin() and beginXXX()
methods. They will in turn enrich it with values set by the user.
-
Call
begin() and beginXXX() methods.
-
Call
ProtocolHandler.runTest to execute the tests.
-
Call
ProtocolHandler.createResponseObjectFactory to create a factory that is
used to create a test response object that will be passed to the
endXXX() and end() methods.
-
Call
endXXX() and end() methods.
-
Call
ProtocolHandler.afterTest to let the connector implementor clean up after
the test. For example, the HTTP connector implementation closes the HTTP
connection if the user has not closed it himself.
version: $Id: ProtocolHandler.java 238991 2004-05-22 11:34:50Z vmassol $ since: 1.6 |
Method Summary | |
void | afterTest(ProtocolState theState) Let the connector implementor clean up after the test. | Request | createRequest() Create a request object that will be passed to the begin()
and beginXXX() methods. | ResponseObjectFactory | createResponseObjectFactory(ProtocolState theState) Create a factory that is used by the core to create test response object
that will be passed to the endXXX() and end()
methods.
Parameters: theState - any state information that has been preserved from theProtocolHandler.runTest method (e.g. | ProtocolState | runTest(Test theDelegatedTest, Test theWrappedTest, Request theRequest) Connect to the server side (to the redirector proxy), passing all
information to execute the test there, trigger the test execution and
gather the test results. |
afterTest | void afterTest(ProtocolState theState) throws Exception(Code) | | Let the connector implementor clean up after the test. For example, the
HTTP connector implementation closes the HTTP connection if the user has
not closed it himself.
Parameters: theState - any state information that has been preserved from theProtocolHandler.runTest method (e.g. the HTTP connection object) throws: Exception - on error |
createRequest | Request createRequest()(Code) | | Create a request object that will be passed to the begin()
and beginXXX() methods. They will in turn enrich it with
values set by the user.
the request object |
createResponseObjectFactory | ResponseObjectFactory createResponseObjectFactory(ProtocolState theState)(Code) | | Create a factory that is used by the core to create test response object
that will be passed to the endXXX() and end()
methods.
Parameters: theState - any state information that has been preserved from theProtocolHandler.runTest method (e.g. the HTTP connection object) the response object factory |
runTest | ProtocolState runTest(Test theDelegatedTest, Test theWrappedTest, Request theRequest) throws Throwable(Code) | | Connect to the server side (to the redirector proxy), passing all
information to execute the test there, trigger the test execution and
gather the test results.
Parameters: theDelegatedTest - the Cactus test to execute Parameters: theWrappedTest - optionally specify a pure JUnit test case that isbeing wrapped and will be executed on the server side Parameters: theRequest - the request containing data to connect to the redirector proxy an object holding state information that should be preserved andthat will be passed to ProtocolHandler.createResponseObjectFactory andProtocolHandler.afterTest later on exception: Throwable - any error that occurred when connecting to the server side, when executing the test or when gathering thetest result. |
|
|