public abstract class AbstractTestWrapper extends java.lang.Object implements TestWrapper
TestWrapper
interface so it can be called by another application.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
failed |
protected java.lang.Object |
test |
protected java.lang.Class<?> |
testClass |
protected java.lang.String |
testClassName |
protected TestListener |
testListener |
protected java.lang.String |
testMethod |
protected long |
testMethodStart |
| Constructor and Description |
|---|
AbstractTestWrapper(java.lang.Class<?> testClass)
Creates a wrapper instance for the specified test class.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getTestClass() |
protected void |
reportError(java.lang.Throwable error)
Called by generated wrappers to report an error.
|
protected void |
reportFailure(java.lang.AssertionError error)
Called by generated wrappers to report a failure.
|
protected void |
reportSkip(java.lang.String message)
Called by generated wrappers to report that a test was skipped.
|
protected void |
reportTestEnd() |
boolean |
run(TestListener listener) |
protected abstract void |
runAfterClassMethods()
To be implemented by generated subclasses, triggers the execution of methods tagged with
AfterClass |
protected abstract void |
runAfterMethods()
To be implemented by generated subclasses, triggers the execution of methods tagged with
After |
protected abstract void |
runBeforeClassMethods()
To be implemented by generated subclasses, triggers the execution of methods tagged with
BeforeClass |
protected abstract void |
runBeforeMethods()
To be implemented by generated subclasses, triggers the execution of methods tagged with
Before |
protected abstract void |
runTestMethods()
To be implemented by generated subclasses, triggers the execution of test methods tagged with
Test |
protected void |
testFinalize()
Called by generated subclasses to trigger test finalization.
|
protected boolean |
testInitialize(java.lang.String testMethodName)
Called by generated subclasses to trigger test initialization, by instantiating the test class and calling the
Before methods. |
protected final java.lang.Class<?> testClass
protected final java.lang.String testClassName
protected boolean failed
protected java.lang.String testMethod
protected long testMethodStart
protected java.lang.Object test
protected TestListener testListener
public AbstractTestWrapper(java.lang.Class<?> testClass)
Queries and store the class name, so clients of the wrappers can look them up by name if necessary.
testClass - the test class to instantiate.protected void reportError(java.lang.Throwable error)
If a listener has been passed to run(TestListener), then the
TestListener.onError(String, String, String) is called.
error - the Throwable that caused the error.run(TestListener)protected void reportFailure(java.lang.AssertionError error)
If a listener has been passed to run(TestListener), then the
TestListener.onFailure(String, String, String) is called.
error - the AssertionError that caused the failure.run(TestListener)protected void reportSkip(java.lang.String message)
If a listener has been passed to run(TestListener), then the TestListener.onSkip(String) is
called.
message - the message associated with the test skiprun(TestListener)protected void reportTestEnd()
protected abstract void runBeforeClassMethods()
throws java.lang.Exception
BeforeClassjava.lang.Exception - if one of the BeforeClass methods throws one.protected abstract void runAfterClassMethods()
throws java.lang.Exception
AfterClassjava.lang.Exception - if one of the AfterClass methods throws one.protected abstract void runBeforeMethods()
throws java.lang.Exception
Beforejava.lang.Exception - if one of the Before methods throws one.protected abstract void runAfterMethods()
throws java.lang.Exception
Afterjava.lang.Exception - if one of the BeforeClass methods throws one.protected abstract void runTestMethods()
Testprotected final boolean testInitialize(java.lang.String testMethodName)
Before methods.testMethodName - the name of the test method to initialize.protected final void testFinalize()
public java.lang.String getTestClass()
getTestClass in interface TestWrapperpublic boolean run(TestListener listener)
run in interface TestWrapper