MessagingTestConfigProperties.CONNECTION_NAME | The broker name in the initial context.
- Parameters:
messagingProps - Connection properties as defined in MessagingTestConfigProperties .
- Returns:
- A JMS conneciton.
createTestMessageOfSize
public static Message createTestMessageOfSize(Session session,
int size)
throws JMSException
- Creates a test message of the specified size, on the given JMS session.
- Parameters:
session - The JMS session.size - The size of the message in bytes.
- Returns:
- A bytes message, of the specified size, filled with dummy data.
- Throws:
JMSException - Any underlying JMSExceptions are allowed to fall through.
pause
public static void pause(long t)
- Pauses for the specified length of time. In the event of failing to pause for at least that length of time
due to interuption of the thread, a RutimeException is raised to indicate the failure. The interupted status
of the thread is restores in that case. This method should only be used when it is expected that the pause
will be succesfull, for example in test code that relies on inejecting a pause.
- Parameters:
t - The minimum time to pause for in milliseconds.
setPropertiesOnMessage
public static void setPropertiesOnMessage(Message message,
Map<Object,Object> properties)
throws JMSException
- Sets properties of different types on a JMS Message.
- Parameters:
message - The message to set properties on.properties - The property name/value pairs to set.
- Throws:
JMSException - All underlying JMSExceptions are allowed to fall through.- Todo:
- Move this helper method somewhere else. For example, TestUtils.
Licensed to the Apache Software Foundation
|