org.mactor.framework
Class TestContextImpl

java.lang.Object
  extended by org.mactor.framework.TestContextImpl
All Implemented Interfaces:
TestContext

public class TestContextImpl
extends java.lang.Object
implements TestContext

Maintains context information about the current executing test

Author:
Lars Ivar Almli

Constructor Summary
TestContextImpl(GlobalConfig globalConfig, TestSpec testSpec)
           
 
Method Summary
 void addOutgoingMessage(java.lang.String nodeName, Message message)
           
 void addReceivedMessage(java.lang.String nodeName, Message message)
           
 java.util.LinkedList<Message> getAllMessages()
           
 GlobalConfig getGlobalConfig()
           
 GlobalConfig.Group getGlobalConfigGroup(java.lang.String groupName)
           
 java.lang.String getGlobalConfigValue(java.lang.String valueName)
           
 java.util.List<Message> getIncomingMessageHistory(java.lang.String nodeName)
           
 java.util.List<Message> getIncomingMessageHistoryForCurrentNode()
           
 Message getLastIncomingMessage()
           
 Message getLastOutgoingMessage()
           
 java.util.List<Message> getOutgoingMessageHistory(java.lang.String nodeName)
           
 java.util.List<Message> getOutgoingMessageHistoryForCurrentNode()
           
 GlobalConfig.Group getRequieredGlobalConfigGroup(java.lang.String groupName)
           
 SpecNode getSpecNode(java.lang.String nodeName)
           
 TestSpec getTestSpec()
           
 java.lang.Object getValue(java.lang.String name)
           
 java.util.Map<java.lang.String,java.lang.String> getValues()
           
 void setValue(java.lang.String name, java.lang.String value)
           
 void setValues(java.util.Map<java.lang.String,java.lang.String> nameValueMap)
           
 java.util.List<java.lang.String> substitute(java.util.List<java.lang.String> candidates)
           
 java.lang.String substitute(java.lang.String candidate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestContextImpl

public TestContextImpl(GlobalConfig globalConfig,
                       TestSpec testSpec)
Method Detail

setValues

public void setValues(java.util.Map<java.lang.String,java.lang.String> nameValueMap)

setValue

public void setValue(java.lang.String name,
                     java.lang.String value)

getValue

public java.lang.Object getValue(java.lang.String name)

getValues

public java.util.Map<java.lang.String,java.lang.String> getValues()
Specified by:
getValues in interface TestContext

addReceivedMessage

public void addReceivedMessage(java.lang.String nodeName,
                               Message message)

addOutgoingMessage

public void addOutgoingMessage(java.lang.String nodeName,
                               Message message)

getLastIncomingMessage

public Message getLastIncomingMessage()
Specified by:
getLastIncomingMessage in interface TestContext

getLastOutgoingMessage

public Message getLastOutgoingMessage()
Specified by:
getLastOutgoingMessage in interface TestContext

getIncomingMessageHistory

public java.util.List<Message> getIncomingMessageHistory(java.lang.String nodeName)
Specified by:
getIncomingMessageHistory in interface TestContext

getOutgoingMessageHistory

public java.util.List<Message> getOutgoingMessageHistory(java.lang.String nodeName)
Specified by:
getOutgoingMessageHistory in interface TestContext

getIncomingMessageHistoryForCurrentNode

public java.util.List<Message> getIncomingMessageHistoryForCurrentNode()
Specified by:
getIncomingMessageHistoryForCurrentNode in interface TestContext

getOutgoingMessageHistoryForCurrentNode

public java.util.List<Message> getOutgoingMessageHistoryForCurrentNode()
Specified by:
getOutgoingMessageHistoryForCurrentNode in interface TestContext

substitute

public java.util.List<java.lang.String> substitute(java.util.List<java.lang.String> candidates)

getSpecNode

public SpecNode getSpecNode(java.lang.String nodeName)
Specified by:
getSpecNode in interface TestContext

substitute

public java.lang.String substitute(java.lang.String candidate)

getGlobalConfig

public GlobalConfig getGlobalConfig()
Specified by:
getGlobalConfig in interface TestContext

getGlobalConfigValue

public java.lang.String getGlobalConfigValue(java.lang.String valueName)
Specified by:
getGlobalConfigValue in interface TestContext

getGlobalConfigGroup

public GlobalConfig.Group getGlobalConfigGroup(java.lang.String groupName)

getRequieredGlobalConfigGroup

public GlobalConfig.Group getRequieredGlobalConfigGroup(java.lang.String groupName)
                                                 throws ConfigException
Throws:
ConfigException

getAllMessages

public java.util.LinkedList<Message> getAllMessages()
Specified by:
getAllMessages in interface TestContext

getTestSpec

public TestSpec getTestSpec()


Copyright © 2008. All Rights Reserved.