Package org.springframework.jms

Examples of org.springframework.jms.StubTextMessage


  @Test
  public void userDefinedPropertyMappedFromHeader() throws JMSException {
    Message<String> message = initBuilder()
        .setHeader("foo", 123)
        .build();
    javax.jms.Message jmsMessage = new StubTextMessage();
    mapper.fromHeaders(message.getHeaders(), jmsMessage);
    Object value = jmsMessage.getObjectProperty("foo");
    assertNotNull(value);
    assertEquals(Integer.class, value.getClass());
    assertEquals(123, ((Integer) value).intValue());
  }
View Full Code Here


  public void userDefinedPropertyMappedFromHeaderWithCustomPrefix() throws JMSException {
    Message<String> message = initBuilder()
        .setHeader("foo", 123)
        .build();
    mapper.setOutboundPrefix("custom_");
    javax.jms.Message jmsMessage = new StubTextMessage();
    mapper.fromHeaders(message.getHeaders(), jmsMessage);
    Object value = jmsMessage.getObjectProperty("custom_foo");
    assertNotNull(value);
    assertEquals(Integer.class, value.getClass());
    assertEquals(123, ((Integer) value).intValue());
  }
View Full Code Here

  public void userDefinedPropertyWithUnsupportedType() throws JMSException {
    Destination destination = new Destination() {};
    Message<String> message = initBuilder()
        .setHeader("destination", destination)
        .build();
    javax.jms.Message jmsMessage = new StubTextMessage();
    mapper.fromHeaders(message.getHeaders(), jmsMessage);
    Object value = jmsMessage.getObjectProperty("destination");
    assertNull(value);
  }
View Full Code Here

    assertNull(value);
  }

  @Test
  public void attemptToReadDisallowedCorrelationIdPropertyIsNotFatal() throws JMSException {
    javax.jms.Message jmsMessage = new StubTextMessage() {
      @Override
      public String getJMSCorrelationID() throws JMSException {
        throw new JMSException("illegal property");
      }
    };
View Full Code Here

    assertAttemptReadDisallowedPropertyIsNotFatal(jmsMessage, JmsHeaders.CORRELATION_ID);
  }

  @Test
  public void attemptToReadDisallowedDestinationPropertyIsNotFatal() throws JMSException {
    javax.jms.Message jmsMessage = new StubTextMessage() {
      @Override
      public Destination getJMSDestination() throws JMSException {
        throw new JMSException("illegal property");
      }
    };
View Full Code Here

    assertAttemptReadDisallowedPropertyIsNotFatal(jmsMessage, JmsHeaders.DESTINATION);
  }

  @Test
  public void attemptToReadDisallowedDeliveryModePropertyIsNotFatal() throws JMSException {
    javax.jms.Message jmsMessage = new StubTextMessage() {
      @Override
      public int getJMSDeliveryMode() throws JMSException {
        throw new JMSException("illegal property");
      }
    };
View Full Code Here

    assertAttemptReadDisallowedPropertyIsNotFatal(jmsMessage, JmsHeaders.DELIVERY_MODE);
  }

  @Test
  public void attemptToReadDisallowedExpirationPropertyIsNotFatal() throws JMSException {
    javax.jms.Message jmsMessage = new StubTextMessage() {
      @Override
      public long getJMSExpiration() throws JMSException {
        throw new JMSException("illegal property");
      }
    };
View Full Code Here

    assertAttemptReadDisallowedPropertyIsNotFatal(jmsMessage, JmsHeaders.EXPIRATION);
  }

  @Test
  public void attemptToReadDisallowedMessageIdPropertyIsNotFatal() throws JMSException {
    javax.jms.Message jmsMessage = new StubTextMessage() {
      @Override
      public String getJMSMessageID() throws JMSException {
        throw new JMSException("illegal property");
      }
    };
View Full Code Here

    assertAttemptReadDisallowedPropertyIsNotFatal(jmsMessage, JmsHeaders.MESSAGE_ID);
  }

  @Test
  public void attemptToReadDisallowedPriorityPropertyIsNotFatal() throws JMSException {
    javax.jms.Message jmsMessage = new StubTextMessage() {
      @Override
      public int getJMSPriority() throws JMSException {
        throw new JMSException("illegal property");
      }
    };
View Full Code Here

    assertAttemptReadDisallowedPropertyIsNotFatal(jmsMessage, JmsHeaders.PRIORITY);
  }

  @Test
  public void attemptToReadDisallowedReplyToPropertyIsNotFatal() throws JMSException {
    javax.jms.Message jmsMessage = new StubTextMessage() {
      @Override
      public Destination getJMSReplyTo() throws JMSException {
        throw new JMSException("illegal property");
      }
    };
View Full Code Here

TOP

Related Classes of org.springframework.jms.StubTextMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.