|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jbehave.core.ConfigurableEmbedder
org.jbehave.core.junit.JUnitStory
es.upm.dit.gsi.beast.story.BeastTestCase
public abstract class BeastTestCase
Project: beast File: es.upm.dit.gsi.beast.story.BeastTestCase.java Main class to translate plain text into code, following the Given-When-Then language In the GIVEN part it launches the platform In the WHEN part it configures the state of its agents In the THEN part it checks the correct behaviour The main purpose of it consists of knowing agents' state/properties without changing its code. Grupo de Sistemas Inteligentes Departamento de Ingeniería de Sistemas Telemáticos Universidad Politécnica de Madrid (UPM)
Field Summary | |
---|---|
protected AgentIntrospector |
introspector
|
Logger |
logger
|
static int |
SLEEP_TIME
|
Constructor Summary | |
---|---|
BeastTestCase()
|
Method Summary | |
---|---|
List<org.jbehave.core.steps.CandidateSteps> |
candidateSteps()
|
protected void |
checkAgentsBeliefEquealsTo(String agent_name,
String belief_name,
Object belief_value)
Checks the value of some agent's belief with the expected value. |
jadex.bdi.runtime.IGoal[] |
getAgentGoals(String agent_name)
This method prints goal information of an agent through its external access. |
jadex.bdi.runtime.IPlan[] |
getAgentPlans(String agent_name)
This method prints plan information of an agent through its external access. |
protected Object |
getBeliefValue(String agent_name,
String belief_name)
This method takes the value of an agent's belief through its external access |
Connector |
getConnector()
|
protected Object |
getGoals(String agent_name)
|
protected Object |
getPlans(String agent_name)
|
abstract void |
launch()
|
void |
sendMessageToAgent(String agent_name,
String msgtype,
Object message_content)
It sends one message of requested type to an agent |
void |
sendMessageToAgents(String[] agent_name,
String msgtype,
Object message_content)
The same as above, but this method sends the same message to many agents. |
void |
sendMessageToAgentsWithExtraProperties(String agent_name,
String msgtype,
Object message_content,
ArrayList<Object> properties)
It sends one message of requested type to an agent, including some extra parameters in the message event, such as ontology or language. |
void |
sendMessageToAgentWithExtraProperties(String agent_name,
String msgtype,
Object message_content,
ArrayList<Object> properties)
It sends one message of requested type to an agent, including some extra parameters in the message event, such as ontology or language. |
void |
setBeliefValue(String agent_name,
String belief_name,
Object new_value)
This method changes the value of an agent's belief through its external access |
void |
setExecutionTime(long millis)
This method set the execution time of the test. |
void |
setScenario()
Once given the scenario, child's setSetup() will be run |
abstract void |
setup()
|
void |
startAgent(String agent_name,
String path)
Creates a real agent in the platform |
void |
startAgent(String agent_name,
String path,
String containerName,
Object[] arguments)
Creates a real agent in the platform in a given container |
void |
startPlatform(String platform,
Logger logger)
Main constructor of the class, launches the platform |
abstract void |
verify()
|
Methods inherited from class org.jbehave.core.junit.JUnitStory |
---|
run |
Methods inherited from class org.jbehave.core.ConfigurableEmbedder |
---|
addSteps, addSteps, configuration, configuredEmbedder, stepsFactory, useConfiguration, useEmbedder, useStepsFactory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SLEEP_TIME
public Logger logger
protected AgentIntrospector introspector
Constructor Detail |
---|
public BeastTestCase()
Method Detail |
---|
public List<org.jbehave.core.steps.CandidateSteps> candidateSteps()
candidateSteps
in class org.jbehave.core.ConfigurableEmbedder
public abstract void setup()
public abstract void launch()
public abstract void verify()
public void startPlatform(String platform, Logger logger)
public Connector getConnector()
public void startAgent(String agent_name, String path)
agent_name
- The name that the agent is gonna have in the platformpath
- The path of the description of the agentpublic void startAgent(String agent_name, String path, String containerName, Object[] arguments)
agent_name
- The name of the agentpath
- The path of the AgentcontainerName
- The name of the container, if it does not exist, beast-tool
creates it.arguments
- For the agentpublic void sendMessageToAgent(String agent_name, String msgtype, Object message_content)
agent_name
- The name of the agent that receives the messagemsgtype
- The type of the message (SFipa.INFORM - SFipa.REQUEST)message_content
- The content of the messagepublic void sendMessageToAgents(String[] agent_name, String msgtype, Object message_content)
agent_name
- The name of the agent that receives the messagemsgtype
- The type of the message (SFipa.INFORM - SFipa.REQUEST)message_content
- The content of the messagepublic void sendMessageToAgentsWithExtraProperties(String agent_name, String msgtype, Object message_content, ArrayList<Object> properties)
agent_name
- The name of the agent that receives the messagemsgtype
- The type of the message (SFipa.INFORM - SFipa.REQUEST)message_content
- The content of the messageproperties
- to add to the messageprotected void checkAgentsBeliefEquealsTo(String agent_name, String belief_name, Object belief_value)
agent_name
- belief_name
- belief_value
- protected Object getBeliefValue(String agent_name, String belief_name)
agent_name
- belief_name
-
protected Object getGoals(String agent_name)
protected Object getPlans(String agent_name)
public void setScenario()
scenario
- public void setBeliefValue(String agent_name, String belief_name, Object new_value)
agent_name
- The name of the agent to change a beliefbelief_name
- The name of the belief to changenew_value
- The new value of the belief to be changedpublic jadex.bdi.runtime.IPlan[] getAgentPlans(String agent_name)
agent_name
- The name of the agent
public jadex.bdi.runtime.IGoal[] getAgentGoals(String agent_name)
agent_name
- The name of the agent
public void sendMessageToAgentWithExtraProperties(String agent_name, String msgtype, Object message_content, ArrayList<Object> properties)
agent_name
- The name of the agentmsgtype
- The type of the message (SFipa.INFORM - SFipa.REQUEST)message_content
- The content of the messageproperties
- to add to the messagepublic void setExecutionTime(long millis)
millis
- Time in milliseconds
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |