cz.cuni.amis.pogamut.ut2004.test
Class UT2004Test

Package class diagram package UT2004Test
java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.test.UT2004Test
Direct Known Subclasses:
UT2004BotTest, UT2004Test01_AgentJmxLogging, UT2004Test01_BotDeadState, UT2004Test01_MindlessBot, UT2004Test01_UT2004Analyzer, UT2004Test01_UT2004Observer, UT2004Test01_UT2004Server, UT2004Test02_MindlessBot_Repeated50, UT2004Test02_UT2004Observer, UT2004Test02_UT2004Server, UT2004Test03_MindlessLogicBot, UT2004Test03_UT2004Server, UT2004Test04_MindlessLogicBot_Repeated5, UT2004Test04_UT2004Server, UT2004Test05_MindlessBot_Pausing, UT2004Test06_MindlessLogicBot_Pausing, UT2004Test07_MultipleLogicBotsAtOnce, UT2004Test08_MultipleLogicBotsRepeatedAtOnce, UT2004Test09_LeakTestBot_Guice, UT2004Test09_UT2004Server_SetGameMap_AgentKeepAlive2, UT2004Test10_LeakTestBot_Direct, UT2004Test11_LeakModuleTestBot_Guice, UT2004Test12_ModuleCheckingBot, UT2004Test13_ModuleCheckingBot_Repeated50, UT2004Test14_ModuleCheckingBot_Repeated100_LongRun, UT2004Test15_ModuleCheckingBot_Repeated50_MultipleMaps_DM, UT2004Test16_ModuleCheckingBot_Repeated50_MultipleMaps_TG, UT2004Test17_ModuleCheckingBot_Repeated50_MultipleMaps_CTF, UT2004Test18_ModuleCheckingBot_Repeated50_MultipleMaps_AllGameTypes

public class UT2004Test
extends Object

Base class for tests that need a running UCC instance. If you inherit from this class then before the first @Test method will be called the UCC server will be executed. The ports where it is listening can be obtained by ucc.getGbPort() and ucc.getControlPort() calls. Don't forget to specify pogamut.unreal.home and pogamut.unreal.serverexec variables.

Author:
ik

Field Summary
static String[] CTF_MAPS
           
static String[] DM_MAPS
           
protected  LogCategory log
           
protected  IAgentId testId
           
protected  UCCWrapper ucc
           
protected  String unrealHome
          If not null will be used.
protected  boolean useInternalUcc
          TRUE == use ucc executed through uccwrapper FALSE == use externaly executed instance
 
Constructor Summary
UT2004Test()
           
 
Method Summary
 void afterTest()
          Kills the UCC server and closes PogamutPlatform.
protected  boolean awaitAgentDown(AbstractAgent agent)
          Waits till 'agent' changes its state to IAgentStateDown.
protected  boolean awaitAgentUp(AbstractAgent agent)
          Waits till 'agent' changes its state to IAgentStateUp.
 void beforeTest()
          Initialize UCC server.
 void endUcc()
           
protected
<T extends IUT2004BotController>
List<UT2004Bot>
startAllUTBots(Class<T> controller, UT2004BotParameters... params)
           
 void startUCC(UCCWrapperConf uccConf)
          Starts UCC server.
protected
<T extends IUT2004BotController>
UT2004Bot
startUTBot(Class<T> controller)
          Starts new bot in the environment.
protected
<T extends IUT2004BotController>
UT2004Bot
startUTBot(Class<T> controller, UT2004AgentParameters params)
          Starts new bot in the environment with specified 'params'.
protected  IUT2004Observer startUTObserver(IAgentFactory<IUT2004Observer,IRemoteAgentParameters> factory)
          Starts new UTServer.
protected  IUT2004Server startUTServer(IAgentFactory<IUT2004Server,IRemoteAgentParameters> factory)
          Starts new UTServer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CTF_MAPS

public static final String[] CTF_MAPS

DM_MAPS

public static String[] DM_MAPS

testId

protected IAgentId testId

log

protected LogCategory log

ucc

protected UCCWrapper ucc

useInternalUcc

protected boolean useInternalUcc
TRUE == use ucc executed through uccwrapper FALSE == use externaly executed instance


unrealHome

protected String unrealHome
If not null will be used.

Constructor Detail

UT2004Test

public UT2004Test()
Method Detail

startUCC

public void startUCC(UCCWrapperConf uccConf)
              throws UCCStartException
Starts UCC server.

Throws:
cz.cuni.amis.pogamut.ut2004.server.exceptions.UCCStartException
UCCStartException

endUcc

public void endUcc()

beforeTest

public void beforeTest()
                throws UCCStartException
Initialize UCC server.

Throws:
UCCStartException

afterTest

public void afterTest()
Kills the UCC server and closes PogamutPlatform.


awaitAgentUp

protected boolean awaitAgentUp(AbstractAgent agent)
Waits till 'agent' changes its state to IAgentStateUp.

60s timeout.

Parameters:
agent -
Returns:

awaitAgentDown

protected boolean awaitAgentDown(AbstractAgent agent)
Waits till 'agent' changes its state to IAgentStateDown.

60s timeout.

Parameters:
agent -
Returns:

startUTBot

protected <T extends IUT2004BotController> UT2004Bot startUTBot(Class<T> controller)
Starts new bot in the environment.

Type Parameters:
T -
Parameters:
controller - controller that will be used for newly created bot
Returns:
running bot with the given controller

startUTBot

protected <T extends IUT2004BotController> UT2004Bot startUTBot(Class<T> controller,
                                                                UT2004AgentParameters params)
Starts new bot in the environment with specified 'params'.

Type Parameters:
T -
Parameters:
controller - controller that will be used for newly created bot
Returns:
running bot with the given controller

startAllUTBots

protected <T extends IUT2004BotController> List<UT2004Bot> startAllUTBots(Class<T> controller,
                                                                          UT2004BotParameters... params)

startUTServer

protected IUT2004Server startUTServer(IAgentFactory<IUT2004Server,IRemoteAgentParameters> factory)
Starts new UTServer.

Type Parameters:
T -
Returns:
running server connected to UCC instance.

startUTObserver

protected IUT2004Observer startUTObserver(IAgentFactory<IUT2004Observer,IRemoteAgentParameters> factory)
Starts new UTServer.

Type Parameters:
T -
Returns:
running server connected to UCC instance.


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.