|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.mtp.pounder.Player
Plays a Pounder script. Has several options for controlling the playback.
WindowWatcher,
PounderPrefs| Field Summary | |
protected ClassLoader |
classLoader
ClassLoader used to instantiate test objects. |
protected boolean |
disposeWindows
Whether to dispose windows when playback has ended. |
protected boolean |
paused
Whether the playback is paused. |
protected PounderPrefs |
prefs
Preferences to determine how the playback operates. |
protected RecordingRecord |
record
Record of items to play. |
protected boolean |
stopRequested
Whether a stop has been requested. |
protected TestInstanceFactory |
testInstanceFactory
TestInstanceFactory used to manage test object. |
protected WindowWatcher |
windowWatcher
|
| Fields inherited from interface com.mtp.pounder.PounderConstants |
FILE_EXTENSION, FILE_FORMAT_VERSION, VERSION |
| Constructor Summary | |
Player(InputStream script,
ClassLoader cl)
Construct with data from script stored on given InputStream. |
|
Player(PounderModel pm)
Construct with given PounderModel. |
|
Player(PounderModel pm,
ClassLoader cl)
Construct with given PounderModel. |
|
Player(PounderPrefs prefs,
TestInstanceFactory tif,
RecordingRecord record,
ClassLoader cl)
Use given preferences to configure playback. |
|
Player(String script)
Construct with data from given script. |
|
Player(String scriptFile,
ClassLoader cl)
Construct with data from script stored in given File. |
|
Player(URL script)
Construct with data from given script. |
|
Player(URL script,
ClassLoader cl)
Construct with data from given script. |
|
| Method Summary | |
protected void |
addStopShortcutListener()
Add ourselves a keyboard listener for the stop shortcut. |
protected Object |
buildTestObject()
Build Object used for playback. |
protected WindowWatcher |
buildWindowWatcher()
Return a new WindowWatcher for playback. |
protected boolean |
checkStopRequested(BoundedRangeModel rm)
Return true if stop was requested. |
protected void |
clearEventQueue()
Make sure the system event queue is empty before returning. |
boolean |
dispatchKeyEvent(KeyEvent e)
Inherited from KeyEventDispatcher. |
protected void |
doDelayWhileCheckingForStop(long amount)
Delay for given amount, but do it fine grained; checking if stop is requested along the way. |
protected int |
getTotalDelay()
Return the total delay for our RecordingItem's. |
protected void |
init(PounderPrefs prefs,
TestInstanceFactory tif,
RecordingRecord record,
ClassLoader cl)
Initializer member varaiables. |
protected void |
initRangeModel(BoundedRangeModel rm)
|
boolean |
isPaused()
|
Object |
play()
Play and return created test object. |
Object |
play(BoundedRangeModel rm)
Playback the script and update the given range model. |
protected void |
playbackEnded(BoundedRangeModel rm)
Function called when playback has ended. |
protected void |
playItem(RecordingItem item)
Calls playback on the given item with the given WindowWatcher. |
protected void |
playItem(RecordingItem item,
int attempts)
Calls playback on the given item. |
protected void |
removeStopShortcutListener()
Remvoe ourselves a keyboard listener for the stop shortcut. |
void |
setDisposeWindows(boolean b)
Set whether to dispose of windows at end of playback. |
void |
setFailedPlaybackDelay(long d)
Shortcut that calls setFailedPlaybackDelay() on my PounderPrefs. |
void |
setItemDelayEnabled(boolean b)
Shortcut that calls setItemDelayEnabled() on my PounderPrefs. |
void |
setPaused(boolean b)
|
void |
setPlaybackAttempts(int count)
Shortcut that calls setPlaybackAttempts() on my PounderPrefs. |
void |
setStopRequested(boolean b)
If true, will stop as soon as possible. |
protected void |
sleepWhilePaused()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected PounderPrefs prefs
protected ClassLoader classLoader
protected TestInstanceFactory testInstanceFactory
protected RecordingRecord record
protected volatile boolean stopRequested
protected boolean disposeWindows
protected volatile boolean paused
protected WindowWatcher windowWatcher
| Constructor Detail |
public Player(PounderModel pm)
public Player(PounderModel pm,
ClassLoader cl)
public Player(String script)
throws Exception
public Player(URL script)
throws Exception
public Player(URL script,
ClassLoader cl)
throws Exception
public Player(String scriptFile,
ClassLoader cl)
throws Exception
public Player(InputStream script,
ClassLoader cl)
throws Exception
public Player(PounderPrefs prefs,
TestInstanceFactory tif,
RecordingRecord record,
ClassLoader cl)
| Method Detail |
protected void init(PounderPrefs prefs,
TestInstanceFactory tif,
RecordingRecord record,
ClassLoader cl)
public void setItemDelayEnabled(boolean b)
public void setPlaybackAttempts(int count)
public void setFailedPlaybackDelay(long d)
public void setDisposeWindows(boolean b)
public void setStopRequested(boolean b)
protected int getTotalDelay()
protected Object buildTestObject()
throws PlaybackException
PlaybackException
public Object play()
throws PlaybackException
PlaybackExceptionprotected void clearEventQueue()
protected void addStopShortcutListener()
protected void removeStopShortcutListener()
public boolean dispatchKeyEvent(KeyEvent e)
dispatchKeyEvent in interface KeyEventDispatcherprotected void doDelayWhileCheckingForStop(long amount)
protected WindowWatcher buildWindowWatcher()
protected void initRangeModel(BoundedRangeModel rm)
public void setPaused(boolean b)
public boolean isPaused()
public Object play(BoundedRangeModel rm)
throws PlaybackException
PlaybackExceptionprotected boolean checkStopRequested(BoundedRangeModel rm)
protected void playbackEnded(BoundedRangeModel rm)
protected void sleepWhilePaused()
protected void playItem(RecordingItem item)
throws Throwable
Throwable
protected void playItem(RecordingItem item,
int attempts)
throws Throwable
attempts - The number of times to attempt playback if failures occur.
Throwable
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||