public class ActionProducer extends java.lang.Thread implements Action, Waitable, Timeoutable
Modifier | Constructor and Description |
---|---|
protected |
ActionProducer()
Creates a producer.
|
|
ActionProducer(Action a)
Creates a producer for an action.
|
|
ActionProducer(Action a,
boolean nw)
Creates a producer for an action.
|
protected |
ActionProducer(boolean nw)
Creates a producer.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
actionProduced(java.lang.Object obj)
Inquire for a reference to the object returned by a launched action.
|
java.lang.String |
getDescription()
Returns the description value.
|
java.lang.Throwable |
getException()
Returns the exception value.
|
boolean |
getFinished()
Check if a launched action has finished.
|
java.lang.Object |
getResult()
Get the result of a launched action.
|
Timeouts |
getTimeouts()
Get all the time outs used by sleeps or waits used by the launched action.
|
java.lang.Object |
launch(java.lang.Object obj)
Does nothing; the method should be overridden by inheritors.
|
java.lang.Object |
produceAction(java.lang.Object obj)
Starts execution.
|
void |
run()
Launch an action in a separate thread of execution.
|
void |
setActionPriority(int newPriority)
Defines action priority in terms of thread priority.
|
void |
setOutput(TestOut out)
Identity of the streams or writers used for print output.
|
void |
setTimeouts(Timeouts ts)
Set all the time outs used by sleeps or waits used by the launched action.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public ActionProducer(Action a)
a
- Action implementation.public ActionProducer(Action a, boolean nw)
a
- Action implementation.nw
- Defines if produceAction
method should wait for the end of action.protected ActionProducer()
produceAction
must be overridden.protected ActionProducer(boolean nw)
produceAction
must be overridden.nw
- Defines if produceAction
method should wait for the end of action.public void setTimeouts(Timeouts ts)
setTimeouts
in interface Timeoutable
ts
- An object containing timeout information.Timeouts
,
Timeoutable
,
getTimeouts()
public Timeouts getTimeouts()
getTimeouts
in interface Timeoutable
Timeouts
,
Timeoutable
,
setTimeouts(org.netbeans.jemmy.Timeouts)
public void setOutput(TestOut out)
out
- An object containing print output assignments for
output and error streams.TestOut
,
Outputable
public java.lang.Throwable getException()
public void setActionPriority(int newPriority)
newPriority
- New thread priority.public java.lang.Object getResult()
getFinished()
getFinished()
public boolean getFinished()
true
if the launched action has completed,
either normally or with an exception; false
otherwise.public java.lang.Object launch(java.lang.Object obj)
public java.lang.String getDescription()
Action
getDescription
in interface Action
getDescription
in interface Waitable
ActionProducer
's description.Action
public java.lang.Object produceAction(java.lang.Object obj) throws java.lang.InterruptedException
obj
- Parameter to be passed into action's launch(Object)
method.
This parameter might be a java.lang.String[]
that lists a test's
command line arguments.launch(Object)
result.TimeoutExpiredException
java.lang.InterruptedException
public final void run()
getFinished()
and getResult
to answer questions about test
completion and return value, respectively.run
in interface java.lang.Runnable
run
in class java.lang.Thread
getFinished()
,
getResult()
,
Runnable
public final java.lang.Object actionProduced(java.lang.Object obj)
actionProduced
in interface Waitable
obj
- Not used.Waitable