|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.lxtreme.ols.test.Ensure
public class Ensure
Helper class to make sure that steps in a test happen in the correct order.
Instantiate this class and subsequently invoke step(nr)
with
steps starting at 1. You can also have threads wait until you arrive at a
certain step.
Taken from Apache Felix Dependency Manager. (C) Copyright 2010-11 Apache Felix Project.
Constructor Summary | |
---|---|
Ensure()
Creates a new Ensure object. |
|
Ensure(boolean aDebug)
Creates a new Ensure object. |
Method Summary | |
---|---|
static Runnable |
createRunnableStep(Ensure aEnsure,
int aNr)
Factory method to create a runnable step that steps to the given number. |
void |
setStream(PrintStream aOutput)
Sets the output stream for printing the results of steps to. |
void |
step()
Mark this point as the next step. |
void |
step(int aNr)
Mark this point as step nr . |
void |
waitForStep(int aNr,
int aTimeout)
Wait until we arrive at least at step nr in the process, or
fail if that takes more than timeout milliseconds. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Ensure()
public Ensure(boolean aDebug)
aDebug
- true
to output more information about the steps this
class enters/waits for, false
otherwise.Method Detail |
---|
public static Runnable createRunnableStep(Ensure aEnsure, int aNr)
aEnsure
- the ensure class to use for setting the step;aNr
- the number to set upon invoking the returned runnable.
public void setStream(PrintStream aOutput)
aOutput
- the print stream to set, cannot be null
.
IllegalArgumentException
- in case the given stream was null
.public void step()
public void step(int aNr)
nr
.
aNr
- the step we are in.public void waitForStep(int aNr, int aTimeout)
nr
in the process, or
fail if that takes more than timeout
milliseconds. If you
invoke wait on a thread, you are effectively assuming some other thread
will invoke the step(nr)
method.
aNr
- the step to wait foraTimeout
- the number of milliseconds to wait
IllegalStateException
- in case current step isn't the step we expected.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |