eu.semaine.jms.message
Class SEMAINEMessageTestUtils

java.lang.Object
  extended by eu.semaine.jms.message.SEMAINEMessageTestUtils

public class SEMAINEMessageTestUtils
extends java.lang.Object

This class provides test utility methods for writing readable unit tests.

Author:
marc

Constructor Summary
SEMAINEMessageTestUtils()
           
 
Method Summary
static TextMessage createActiveMQTextMessage()
           
static SEMAINEEmmaMessage createEMMAMessage(java.lang.String... xpathValuePairs)
          Create an EMMA message from the XPath string/value pairs given as parameters
static SEMAINEStateMessage createStateMessage(StateInfo.Type type, java.lang.String... shortnamesAndValues)
           
static SEMAINEStateMessage createStateMessage(StateInfo info)
           
static SEMAINEXMLMessage createXMLMessage(java.lang.String... xpathValuePairs)
          Create an XML message from the XPath string/value pairs given as parameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SEMAINEMessageTestUtils

public SEMAINEMessageTestUtils()
Method Detail

createActiveMQTextMessage

public static TextMessage createActiveMQTextMessage()
                                             throws JMSException
Throws:
JMSException

createEMMAMessage

public static SEMAINEEmmaMessage createEMMAMessage(java.lang.String... xpathValuePairs)
                                            throws JMSException
Create an EMMA message from the XPath string/value pairs given as parameters

Parameters:
xpathValuePairs - an even number of Strings, representing pairs of xpath strings used for generating the document and the values to store at the given location.
Returns:
an EMMA message containing an EMMA document with the given data.
Throws:
JMSException - if the underlying message object cannot be created
java.lang.IllegalArgumentException - if the number of strings provided as parameters is not an even number, or if they cannot be interpreted
See Also:
XMLTool#xpath2doc(String, String, javax.xml.namespace.NamespaceContext, Document)}

createXMLMessage

public static SEMAINEXMLMessage createXMLMessage(java.lang.String... xpathValuePairs)
                                          throws JMSException
Create an XML message from the XPath string/value pairs given as parameters

Parameters:
xpathValuePairs - an even number of Strings, representing pairs of xpath strings used for generating the document and the values to store at the given location.
Returns:
an XML message containing a document with the given data.
Throws:
JMSException - if the underlying message object cannot be created
java.lang.IllegalArgumentException - if the number of strings provided as parameters is not an even number, or if they cannot be interpreted
See Also:
XMLTool#xpath2doc(String, String, javax.xml.namespace.NamespaceContext, Document)}

createStateMessage

public static SEMAINEStateMessage createStateMessage(StateInfo.Type type,
                                                     java.lang.String... shortnamesAndValues)
                                              throws JMSException
Throws:
JMSException

createStateMessage

public static SEMAINEStateMessage createStateMessage(StateInfo info)
                                              throws JMSException
Throws:
JMSException