|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.qpid.junit.extensions.SetupTaskHandler
public class SetupTaskHandler
SetupTaskHandler implements a task stack. It can be used, by delegation, as a base implementation for tests that want to have configurable setup/teardown task stacks. Typically it is up to the test implementation to decide whether the stack is executed in the setup/teardown methods or in the threadSetup/threadTeaddown methods.
Responsibilities | Collaborations |
---|---|
Handle injection of set up tasks. | |
Handle injection of tear down tasks. | |
Run set up tasks in chain order. | |
Run tear down tasks in reverse chain order. |
Field Summary | |
---|---|
(package private) Queue<Runnable> |
setups
Holds the set up tasks. |
(package private) Queue<Runnable> |
teardowns
Holds the tear down tasks. |
Constructor Summary | |
---|---|
SetupTaskHandler()
|
Method Summary | |
---|---|
void |
chainSetupTask(Runnable task)
Adds the specified task to the tests setup. |
void |
chainTearDownTask(Runnable task)
Adds the specified task to the tests tear down. |
void |
runSetupTasks()
Runs the set up tasks in the order that they way chained. |
void |
runTearDownTasks()
Runs the tear down tasks in the reverse of the order in which they were chained. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
Queue<Runnable> setups
Queue<Runnable> teardowns
Constructor Detail |
---|
public SetupTaskHandler()
Method Detail |
---|
public void chainSetupTask(Runnable task)
chainSetupTask
in interface SetupTaskAware
task
- The task to add to the tests setup.public void chainTearDownTask(Runnable task)
chainTearDownTask
in interface SetupTaskAware
task
- The task to add to the tests tear down.public void runSetupTasks()
public void runTearDownTasks()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |