|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController<BOT>
cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotLogicController<BOT>
cz.cuni.amis.pogamut.emohawk.bot.impl.EmohawkBotController<BOT>
cz.cuni.amis.pogamut.emohawk.bot.EmohawkBotTestController<BOT>
public class EmohawkBotTestController<BOT extends UT2004Bot>
Field Summary |
---|
Fields inherited from class cz.cuni.amis.pogamut.emohawk.bot.impl.EmohawkBotController |
---|
act, animations, comm, config, emohawkNavigation, emoticons, fwMap, game, getBackToNavGraph, info, inventory, listenerRegistrator, move, navigation, pathExecutor, pathPlanner, places, players, random, raycasting, runStraight, senses, stats, steering, world |
Fields inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotLogicController |
---|
logicModule |
Fields inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController |
---|
bot, log, USER_LOG_CATEGORY_ID |
Constructor Summary | |
---|---|
EmohawkBotTestController()
|
Method Summary | |
---|---|
Throwable |
getCause()
The exception that caused the bot to fail... |
cz.cuni.amis.utils.flag.ImmutableFlag<Boolean> |
getFailureFlag()
Returns a failure flag, may be used to attach listeners to it. |
protected LogicModule |
getLogicModule()
|
String |
getMessage()
Message why the bot has succeeded or failed... |
cz.cuni.amis.utils.flag.ImmutableFlag<Boolean> |
getSuccessFlag()
Success flag, may be used to attach listeners to it... |
CountDownLatch |
getTestLatch()
Returns a latch on which you may CountDownLatch.await() till the test finishes. |
void |
initializeController(BOT bot)
Additionally initializes UT2004BotTestController#latch field with
new BusAwareCountDownLatch(1, bot.getEventBus()) |
boolean |
isFailure()
Whether the test has failed (may be called after the latch has been risen). |
boolean |
isSuccess()
Whether the test has succeeded (may be called after the latch has been risen). |
void |
setFailure()
Declares "failure" - i.e., the test has ended in a wrong way. |
void |
setFailure(String message)
Declares "failure" - i.e., the test has ended in a wrong way. |
void |
setFailure(String message,
Throwable cause)
Declares "failure" - i.e., the test has ended in a wrong way. |
void |
setFailure(Throwable cause)
Declares "failure" - i.e., the test has ended in a wrong way. |
void |
setSuccess()
Declares "success" - i.e., the test has ended correctly, everything has passed. |
void |
setSuccess(String message)
Declares "success" - i.e., the test has ended correctly, everything has passed. |
void |
setTestLatch(CountDownLatch latch)
Sets different latch for the bot controller. |
void |
timeout()
Called from the outside by the test itself to notify the bot about the timeout. |
Methods inherited from class cz.cuni.amis.pogamut.emohawk.bot.impl.EmohawkBotController |
---|
finishControllerInitialization, getConfig, getFwMap, getGame, getInfo, getMove, getNavigation, getPathExecutor, getPathPlanner, getPlayers, getRandom, getRaycasting, getSenses, getStats, getWorld, initializeListeners, initializeModules, initializePathFinding |
Methods inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotLogicController |
---|
beforeFirstLogic, getLogicInitializeTime, getLogicShutdownTime, initializeLogic, logic, logicInitialize, logicShutdown |
Methods inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController |
---|
botFirstSpawn, botInitialized, botKilled, botShutdown, getAct, getBot, getInitializeCommand, getLog, getPassword, getWorldView, prepareBot |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cz.cuni.amis.pogamut.ut2004.bot.IUT2004BotController |
---|
botFirstSpawn, botInitialized, botKilled, botShutdown, getAct, getBot, getInitializeCommand, getLog, getPassword, getWorldView, prepareBot |
Constructor Detail |
---|
public EmohawkBotTestController()
Method Detail |
---|
public void initializeController(BOT bot)
UT2004BotTestController#latch
field with
new BusAwareCountDownLatch(1, bot.getEventBus())
initializeController
in interface IUT2004BotController<BOT extends UT2004Bot>
initializeController
in class EmohawkBotController<BOT extends UT2004Bot>
public String getMessage()
UT2004BotTestController#setFailure(String)
or UT2004BotTestController#setSuccess(String)
.
public Throwable getCause()
UT2004BotTestController#setFailure(Throwable)
.
public void setTestLatch(CountDownLatch latch)
latch
- public void setSuccess()
Also raises the UT2004BotTestController#latch
.
public void setSuccess(String message)
Also raises the UT2004BotTestController#latch
.
public void timeout()
Calls UT2004BotTestController#setFailure(String)
+ raises the test latch.
public void setFailure()
Also raises the UT2004BotTestController#latch
.
public void setFailure(String message)
Also raises the UT2004BotTestController#latch
.
public void setFailure(Throwable cause)
Also raises the UT2004BotTestController#latch
.
public void setFailure(String message, Throwable cause)
Also raises the UT2004BotTestController#latch
.
public boolean isFailure()
public cz.cuni.amis.utils.flag.ImmutableFlag<Boolean> getFailureFlag()
Note that the flag's value semantics is a bit different
from UT2004BotTestController#isFailure()
as it will switch itself to true only iff
the bot reports a failure via UT2004BotTestController#setFailure()
.
public boolean isSuccess()
public cz.cuni.amis.utils.flag.ImmutableFlag<Boolean> getSuccessFlag()
public CountDownLatch getTestLatch()
CountDownLatch.await()
till the test finishes.
protected LogicModule getLogicModule()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |