org.mactor.extensions.xml
Class XPathTemplateMessageBuilder

java.lang.Object
  extended by org.mactor.extensions.xml.XPathTemplateMessageBuilder
All Implemented Interfaces:
MessageBuilderCommand

public class XPathTemplateMessageBuilder
extends java.lang.Object
implements MessageBuilderCommand

Builds a message based on a XML file (the template), substituting the vales in the file with the values specied in the paramaters.
The syntax of a parameters are:
[XPath expression that selects the single attribute or element ]==[value that should be assigned to the field]
If the namespace prefixes are used in the template file, the same prefixes must be used in the XPath expression.
If the a default namespace is used in the template file, 'def' must by used a namespace prefix in the XPath expression

Author:
Lars Ivar Almli

Constructor Summary
XPathTemplateMessageBuilder()
           
 
Method Summary
 Message buildMessage(TestContext context, java.lang.String templatePath, java.util.List<java.lang.String> params)
          The method invoked by the testrunner to build the message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPathTemplateMessageBuilder

public XPathTemplateMessageBuilder()
Method Detail

buildMessage

public Message buildMessage(TestContext context,
                            java.lang.String templatePath,
                            java.util.List<java.lang.String> params)
                     throws MactorException
Description copied from interface: MessageBuilderCommand
The method invoked by the testrunner to build the message

Specified by:
buildMessage in interface MessageBuilderCommand
Parameters:
context - contains information about the context of the test that might be useful (such as all messages sent/received so far in the test)
params - the list of parameteres specifed for the given node in the test-spec xml (after the ##{...} substitution has been performed)
Returns:
the built message
Throws:
MactorException - to indicate some problem (this will cause the test to fail)


Copyright © 2008. All Rights Reserved.