fipaos.test.agent
Class AgentTestFramework

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--fipaos.test.agent.AgentTestFramework
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AMSAgentTest

public abstract class AgentTestFramework
extends junit.framework.TestCase

Test-framework for testing an Agent at the ACL level


Constructor Summary
AgentTestFramework(java.lang.String name)
          Creates new AgentTestFramework
 
Method Summary
static java.lang.String findAndReplace(java.lang.String str, java.lang.String find, java.lang.String replace)
          Replaces all occurences of a String with another String within a String
static AgentProfile getAgentProfile()
          Returns a bog-standard AgentProfile
protected  AgentID getAID()
          AID to use for testing
protected abstract  java.lang.String getAPName()
          Get the name of the AP
protected  Message getIncomingMessage()
          Get next message from the test Agent
static PlatformProfile getPlatformProfile()
          Returns a bog-standard PlatformProfile
protected abstract  java.lang.String getTestAgentName()
          Get the name of the test-agent
protected  boolean sendMessage(Message msg)
          Send message to the test Agent
protected  void setUp()
          Setup the tests
protected  boolean startAgent(java.lang.String name, java.lang.String class_name)
          Start the given Agent
protected  void tearDown()
          Clean-up the tests
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, name, run, run, runBare, runTest, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AgentTestFramework

public AgentTestFramework(java.lang.String name)
Creates new AgentTestFramework
Method Detail

setUp

protected void setUp()
Setup the tests
Overrides:
setUp in class junit.framework.TestCase

tearDown

protected void tearDown()
Clean-up the tests
Overrides:
tearDown in class junit.framework.TestCase

startAgent

protected boolean startAgent(java.lang.String name,
                             java.lang.String class_name)
Start the given Agent

sendMessage

protected boolean sendMessage(Message msg)
Send message to the test Agent

getIncomingMessage

protected Message getIncomingMessage()
Get next message from the test Agent

getAID

protected AgentID getAID()
AID to use for testing

getAPName

protected abstract java.lang.String getAPName()
Get the name of the AP

getTestAgentName

protected abstract java.lang.String getTestAgentName()
Get the name of the test-agent

findAndReplace

public static java.lang.String findAndReplace(java.lang.String str,
                                              java.lang.String find,
                                              java.lang.String replace)
Replaces all occurences of a String with another String within a String
Parameters:
str - String to modify
find - String to find
replace - String to replace found occurences with
Returns:
The modified String

getPlatformProfile

public static PlatformProfile getPlatformProfile()
Returns a bog-standard PlatformProfile

getAgentProfile

public static AgentProfile getAgentProfile()
Returns a bog-standard AgentProfile