|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert org.apache.cactus.internal.client.ClientTestCaseDelegate
Delegate class that provides useful methods for the Cactus
XXXTestCase
classes. All the methods provided are independent
of any communication protocol between client side and server side (HTTP,
JMS, etc). Subclasses will define additional behaviour that depends on the
protocol.
It provides the ability to run common code before each test on the client
side (note that calling common tear down code is delegated to child classes
as the method signature depends on the protocol used).
In addition it provides the ability to execute some one time (per-JVM)
initialisation code (a pity this is not provided in JUnit). It can be
useful to start an embedded server for example. Note: In the future this
should be refatored and provided using a custom JUnit TestSuite.
Field Summary | |
protected static java.lang.String |
BEGIN_METHOD_PREFIX
The prefix of a begin test method. |
protected static java.lang.String |
CLIENT_GLOBAL_BEGIN_METHOD
The name of the method that is called before each test on the client side (if it exists). |
protected static java.lang.String |
CLIENT_GLOBAL_END_METHOD
The name of the method that is called after each test on the client side (if it exists). |
protected static java.lang.String |
END_METHOD_PREFIX
The prefix of an end test method. |
protected static java.lang.String |
TEST_METHOD_PREFIX
The prefix of a test method. |
Constructor Summary | |
ClientTestCaseDelegate(junit.framework.Test theDelegatedTest,
junit.framework.Test theWrappedTest,
Configuration theConfiguration)
|
Method Summary | |
void |
callBeginMethod(Request theRequest)
Call the test case begin method. |
protected void |
callClientGlobalBegin(Request theRequest)
Call the global begin method. |
protected java.lang.String |
getBeginMethodName()
|
Configuration |
getConfiguration()
|
protected java.lang.String |
getCurrentTestMethod()
Deprecated. Use getCurrentTestName() instead |
protected java.lang.String |
getCurrentTestName()
|
junit.framework.Test |
getDelegatedTest()
|
protected java.lang.String |
getEndMethodName()
|
org.apache.commons.logging.Log |
getLogger()
|
junit.framework.Test |
getWrappedTest()
|
java.lang.String |
getWrappedTestName()
|
boolean |
isWrappingATest()
|
void |
runBareInit()
Perform client side initializations before each test, such as re-initializating the logger and printing some logging information. |
void |
setConfiguration(Configuration theConfiguration)
Sets the Cactus configuration * @param theConfiguration the Cactus configuration |
void |
setDelegatedTest(junit.framework.Test theDelegatedTest)
|
protected void |
setLogger(org.apache.commons.logging.Log theLogger)
|
void |
setWrappedTest(junit.framework.Test theWrappedTest)
|
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
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_METHOD_PREFIX
protected static final java.lang.String BEGIN_METHOD_PREFIX
protected static final java.lang.String END_METHOD_PREFIX
protected static final java.lang.String CLIENT_GLOBAL_BEGIN_METHOD
protected static final java.lang.String CLIENT_GLOBAL_END_METHOD
Constructor Detail |
public ClientTestCaseDelegate(junit.framework.Test theDelegatedTest, junit.framework.Test theWrappedTest, Configuration theConfiguration)
theDelegatedTest
- the test we are delegating fortheWrappedTest
- the test being wrapped by this delegate (or null
if none)theConfiguration
- the configuration to useMethod Detail |
public void setWrappedTest(junit.framework.Test theWrappedTest)
theWrappedTest
- the pure JUnit test that we need to wrappublic void setDelegatedTest(junit.framework.Test theDelegatedTest)
theDelegatedTest
- the test we are delegating forpublic junit.framework.Test getWrappedTest()
public junit.framework.Test getDelegatedTest()
public final org.apache.commons.logging.Log getLogger()
TestCase
class and
subclasses to perform logging.protected void setLogger(org.apache.commons.logging.Log theLogger)
theLogger
- the logger to usepublic Configuration getConfiguration()
public void setConfiguration(Configuration theConfiguration)
protected java.lang.String getBeginMethodName()
WebRequest
object
for the test case.protected java.lang.String getEndMethodName()
public void runBareInit()
protected void callClientGlobalBegin(Request theRequest) throws java.lang.Throwable
theRequest
- the request object which will contain data that will
be used to connect to the Cactus server side redirectors.
java.lang.Throwable
- any error that occurred when calling the methodpublic void callBeginMethod(Request theRequest) throws java.lang.Throwable
theRequest
- the request object to pass to the begin method.
java.lang.Throwable
- any error that occurred when calling the begin
method for the current test case.protected java.lang.String getCurrentTestMethod()
getCurrentTestName()
instead
getCurrentTestName()
protected java.lang.String getCurrentTestName()
public java.lang.String getWrappedTestName()
public boolean isWrappingATest()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |