|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.core.AttributeAccessorSupport org.springframework.test.context.TestContext
public class TestContext
TestContext encapsulates the context in which a test is executed, agnostic of the actual testing framework in use.
Method Summary | |
---|---|
ApplicationContext |
getApplicationContext()
Get the application context for this test
context, possibly cached. |
Class<?> |
getTestClass()
Get the test class for this test context. |
Throwable |
getTestException()
Get the exception that was thrown during execution of
the test method . |
Object |
getTestInstance()
Get the current test instance for this test context. |
Method |
getTestMethod()
Get the current test method for this test context. |
void |
markApplicationContextDirty()
Call this method to signal that the application
context associated with this test context is dirty and should
be reloaded. |
String |
toString()
Provide a String representation of this test context's state. |
Methods inherited from class org.springframework.core.AttributeAccessorSupport |
---|
attributeNames, copyAttributesFrom, equals, getAttribute, hasAttribute, hashCode, removeAttribute, setAttribute |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public ApplicationContext getApplicationContext()
application context
for this test
context, possibly cached.
IllegalStateException
- if an error occurs while retrieving the
application contextpublic final Class<?> getTestClass()
test class
for this test context.
null
)public final Object getTestInstance()
test instance
for this test context.
Note: this is a mutable property.
null
)updateState(Object,Method,Throwable)
public final Method getTestMethod()
test method
for this test context.
Note: this is a mutable property.
null
)updateState(Object, Method, Throwable)
public final Throwable getTestException()
exception
that was thrown during execution of
the test method
.
Note: this is a mutable property.
null
if no
exception was thrownupdateState(Object, Method, Throwable)
public void markApplicationContextDirty()
application
context
associated with this test context is dirty and should
be reloaded. Do this if a test has modified the context (for example, by
replacing a bean definition).
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |