Crossfire JXClient, Trunk
|
Public Member Functions | |
String | getAndClearEvents () |
void | killScript () |
Public Member Functions inherited from com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess | |
void | addScriptProcessListener (@NotNull final ScriptProcessListener scriptProcessListener) |
void | commandSent (@NotNull final String cmd) |
int | compareTo (@NotNull final ScriptProcess o) |
boolean | equals (@Nullable final Object obj) |
String | getFilename () |
int | getScriptId () |
int | hashCode () |
void | run () |
String | toString () |
Static Public Member Functions | |
static TestScriptProcess | newTestScriptProcess (@NotNull final String scriptCommands) |
static TestScriptProcess | newTestScriptProcess (@NotNull final String scriptCommands, @NotNull final CrossfireServerConnection crossfireServerConnection) |
Protected Member Functions | |
String | readFromScript () throws IOException |
String | waitForTermination () |
void | writeToScript (@NotNull final String data) |
Protected Member Functions inherited from com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess | |
AbstractScriptProcess (final int scriptId, @NotNull final String filename, @NotNull final CommandQueue commandQueue, @NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final Stats stats, @NotNull final FloorView floorView, @NotNull final ItemSet itemSet, @NotNull final SpellsManager spellsManager, @NotNull final MapUpdaterState mapUpdaterState, @NotNull final SkillSet skillSet) | |
Private Member Functions | |
TestScriptProcess (final int scriptId, @NotNull final String filename, @NotNull final CommandQueue commandQueue, @NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final Stats stats, @NotNull final FloorView floorView, @NotNull final ItemSet itemSet, @NotNull final SpellsManager spellsManager, @NotNull final MapUpdaterState mapUpdaterState, @NotNull final SkillSet skillSet, @NotNull final String scriptCommands) | |
Private Attributes | |
final BufferedReader | br |
final MapUpdaterState | mapUpdaterState |
final StringBuilder | sb = new StringBuilder() |
final Semaphore | sem = new Semaphore(0) |
Static Private Attributes | |
static final Pattern | PATTERN_MAP_SCROLL = Pattern.compile("@map_scroll (-?[0-9]+) (-?[0-9]+)") |
A ScriptProcess for regression tests.
In addition to the normal script commands, this class also recognizes the following commands:
Definition at line 65 of file TestScriptProcess.java.
|
private |
Creates a new instance.
scriptId | the script ID identifying the new script |
filename | the command including arguments to execute |
commandQueue | the command queue for sending commands |
crossfireServerConnection | the server connection |
stats | the stats instance to watch |
floorView | the floor view to use |
itemSet | the item set instance to use |
spellsManager | the spells manager instance to use |
mapUpdaterState | the map updater state instance to use |
skillSet | the skill set for looking up skill names |
scriptCommands | the script commands to execute |
Definition at line 152 of file TestScriptProcess.java.
References com.realtime.crossfire.jxclient.scripts.TestScriptProcess.br, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.commandQueue, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.crossfireServerConnection, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.filename, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.floorView, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.itemSet, com.realtime.crossfire.jxclient.scripts.TestScriptProcess.mapUpdaterState, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.scriptId, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.skillSet, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.spellsManager, and com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.stats.
Referenced by com.realtime.crossfire.jxclient.scripts.TestScriptProcess.newTestScriptProcess().
String com.realtime.crossfire.jxclient.scripts.TestScriptProcess.getAndClearEvents | ( | ) |
Returns the collected events.
Definition at line 223 of file TestScriptProcess.java.
References com.realtime.crossfire.jxclient.scripts.TestScriptProcess.sb.
Referenced by com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_commands_returnsResults(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueApply_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueDropTag_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueDropTagCount_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueLock_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueMark_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueNcom_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueRawString_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueTakeTag_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueTakeTagCount_sendsCommand(), and com.realtime.crossfire.jxclient.scripts.PacketWatcherTest.test1().
void com.realtime.crossfire.jxclient.scripts.TestScriptProcess.killScript | ( | ) |
Kills the script process. Does nothing if the process is not running.
Implements com.realtime.crossfire.jxclient.scripts.ScriptProcess.
Definition at line 159 of file TestScriptProcess.java.
References com.realtime.crossfire.jxclient.scripts.TestScriptProcess.sb.
Referenced by com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_commands_returnsResults(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueApply_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueDropTag_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueDropTagCount_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueLock_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueMark_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueNcom_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueRawString_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueTakeTag_sendsCommand(), and com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueTakeTagCount_sendsCommand().
|
static |
Creates a new instance.
scriptCommands | the script commands to execute |
Definition at line 103 of file TestScriptProcess.java.
Referenced by com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_commands_returnsResults(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueApply_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueDropTag_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueDropTagCount_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueLock_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueMark_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueNcom_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueRawString_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueTakeTag_sendsCommand(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcessTest.requestMap_issueTakeTagCount_sendsCommand(), and com.realtime.crossfire.jxclient.scripts.PacketWatcherTest.test1().
|
static |
Creates a new instance.
scriptCommands | the script commands to execute |
crossfireServerConnection | the crossfire server connection to use |
Definition at line 114 of file TestScriptProcess.java.
References com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.commandQueue, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.crossfireServerConnection, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.floorView, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.itemSet, com.realtime.crossfire.jxclient.scripts.TestScriptProcess.mapUpdaterState, com.realtime.crossfire.jxclient.map.MapUpdaterState.newMap(), com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.skillSet, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.spellsManager, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.stats, and com.realtime.crossfire.jxclient.scripts.TestScriptProcess.TestScriptProcess().
|
protected |
Reads a line from the script process.
IOException | if reading failed |
Reimplemented from com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.
Definition at line 165 of file TestScriptProcess.java.
References com.realtime.crossfire.jxclient.scripts.TestScriptProcess.br, com.realtime.crossfire.jxclient.map.MapUpdaterState.mapBegin(), com.realtime.crossfire.jxclient.map.MapUpdaterState.mapEnd(), com.realtime.crossfire.jxclient.map.MapUpdaterState.mapScroll(), com.realtime.crossfire.jxclient.scripts.TestScriptProcess.mapUpdaterState, com.realtime.crossfire.jxclient.map.MapUpdaterState.newMap(), com.realtime.crossfire.jxclient.scripts.TestScriptProcess.PATTERN_MAP_SCROLL, com.realtime.crossfire.jxclient.scripts.TestScriptProcess.sb, and com.realtime.crossfire.jxclient.scripts.TestScriptProcess.sem.
|
protected |
Waits until the script has terminated.
Reimplemented from com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.
Definition at line 204 of file TestScriptProcess.java.
References com.realtime.crossfire.jxclient.scripts.TestScriptProcess.sem.
|
protected |
Sends some data to the script process.
data | the data |
IOException | if sending fails |
Reimplemented from com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.
Definition at line 214 of file TestScriptProcess.java.
References com.realtime.crossfire.jxclient.scripts.TestScriptProcess.sb.
|
private |
The script commands not yet executed.
Definition at line 89 of file TestScriptProcess.java.
Referenced by com.realtime.crossfire.jxclient.scripts.TestScriptProcess.readFromScript(), and com.realtime.crossfire.jxclient.scripts.TestScriptProcess.TestScriptProcess().
|
private |
The MapUpdaterState for updating the current map information.
Definition at line 83 of file TestScriptProcess.java.
Referenced by com.realtime.crossfire.jxclient.scripts.TestScriptProcess.newTestScriptProcess(), com.realtime.crossfire.jxclient.scripts.TestScriptProcess.readFromScript(), and com.realtime.crossfire.jxclient.scripts.TestScriptProcess.TestScriptProcess().
|
staticprivate |
Matches the "@map_scroll" command.
Definition at line 71 of file TestScriptProcess.java.
Referenced by com.realtime.crossfire.jxclient.scripts.TestScriptProcess.readFromScript().
|
private |
Records all events.
Definition at line 77 of file TestScriptProcess.java.
Referenced by com.realtime.crossfire.jxclient.scripts.TestScriptProcess.getAndClearEvents(), com.realtime.crossfire.jxclient.scripts.TestScriptProcess.killScript(), com.realtime.crossfire.jxclient.scripts.TestScriptProcess.readFromScript(), and com.realtime.crossfire.jxclient.scripts.TestScriptProcess.writeToScript().
|
private |
Signals the end of the simulated script process.
Definition at line 95 of file TestScriptProcess.java.
Referenced by com.realtime.crossfire.jxclient.scripts.TestScriptProcess.readFromScript(), and com.realtime.crossfire.jxclient.scripts.TestScriptProcess.waitForTermination().