cz.cuni.amis.pogamut.emohawk.test
Class EmohawkTest

Package class diagram package EmohawkTest
java.lang.Object
  extended by cz.cuni.amis.tests.BaseTest
      extended by cz.cuni.amis.pogamut.emohawk.test.EmohawkTest
Direct Known Subclasses:
EmohawkBotTest, EmohawkTest_UCCWrapper, EmohawkTest01_MindlessBot, UT2004Test01_UT2004Analyzer

public class EmohawkTest
extends cz.cuni.amis.tests.BaseTest

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 UCCWrapper.getBotPort(). Don't forget to specify pogamut.unreal.home and pogamut.unreal.serverexec variables.

Author:
ik

Field Summary
protected  String emohawkHome
          If this is NOT null, it will be used.
protected  LogCategory log
           
static String[] MAPS
           
protected  IAgentId testId
           
protected  UCCWrapper ucc
           
protected  boolean useInternalUcc
          TRUE == use ucc executed through uccwrapper FALSE == use externaly executed instance
 
Fields inherited from class cz.cuni.amis.tests.BaseTest
NEW_LINE
 
Constructor Summary
EmohawkTest()
           
 
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(UCCWrapperConfEmohawk 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 cz.cuni.amis.tests.BaseTest
assertFail, assertFalse, assertTrue, baseTestBeforeClass, getLogLevel, is32Bit, is64Bit, isLinux, isWindows, log, process, process, testFailed, testFailed, testOk
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAPS

public static String[] 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


emohawkHome

protected String emohawkHome
If this is NOT null, it will be used.

Constructor Detail

EmohawkTest

public EmohawkTest()
Method Detail

startUCC

public void startUCC(UCCWrapperConfEmohawk 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.

Overrides:
beforeTest in class cz.cuni.amis.tests.BaseTest
Throws:
UCCStartException

afterTest

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

Overrides:
afterTest in class cz.cuni.amis.tests.BaseTest

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 © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.