Example usage for javax.jms TextMessage getPropertyNames

List of usage examples for javax.jms TextMessage getPropertyNames

Introduction

In this page you can find the example usage for javax.jms TextMessage getPropertyNames.

Prototype


Enumeration getPropertyNames() throws JMSException;

Source Link

Document

Returns an Enumeration of all the property names.

Usage

From source file:org.mule.transport.jms.JmsMuleMessageFactoryTestCase.java

@Override
protected Object getValidTransportMessage() throws Exception {
    TextMessage textMessage = mock(TextMessage.class);
    when(textMessage.getText()).thenReturn(MESSAGE_TEXT);
    when(textMessage.getJMSCorrelationID()).thenReturn(null);
    when(textMessage.getJMSDeliveryMode()).thenReturn(Integer.valueOf(1));
    when(textMessage.getJMSDestination()).thenReturn(null);
    when(textMessage.getJMSExpiration()).thenReturn(Long.valueOf(0));
    when(textMessage.getJMSMessageID()).thenReturn("1234567890");
    when(textMessage.getJMSPriority()).thenReturn(Integer.valueOf(4));
    when(textMessage.getJMSRedelivered()).thenReturn(Boolean.FALSE);
    when(textMessage.getJMSReplyTo()).thenReturn(null);
    when(textMessage.getJMSTimestamp()).thenReturn(Long.valueOf(0));
    when(textMessage.getJMSType()).thenReturn(null);
    when(textMessage.getPropertyNames())
            .thenReturn(IteratorUtils.asEnumeration(IteratorUtils.arrayIterator(new Object[] { "foo" })));
    when(textMessage.getObjectProperty("foo")).thenReturn("bar");
    return textMessage;
}