Examples of MessagingMessageListenerAdapter


Examples of org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter

    DefaultMessageHandlerMethodFactory customFactory = new DefaultMessageHandlerMethodFactory();
    customFactory.setValidator(testValidator("invalid value"));
    initializeFactory(customFactory);

    Method method = getListenerMethod(methodName, String.class);
    MessagingMessageListenerAdapter listener = createInstance(customFactory, method);
    Session session = mock(Session.class);
    listener.onMessage(createSimpleJmsTextMessage("test"), session); // test is a valid value
    assertListenerMethodInvocation(sample, methodName);
  }
View Full Code Here

Examples of org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter

  public void validatePayloadInvalid() throws JMSException {
    DefaultMessageHandlerMethodFactory customFactory = new DefaultMessageHandlerMethodFactory();
    customFactory.setValidator(testValidator("invalid value"));

    Method method = getListenerMethod("validatePayload", String.class);
    MessagingMessageListenerAdapter listener = createInstance(customFactory, method);
    Session session = mock(Session.class);

    thrown.expect(ListenerExecutionFailedException.class);
    listener.onMessage(createSimpleJmsTextMessage("invalid value"), session); // test is an invalid value

  }
View Full Code Here

Examples of org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter

  // failure scenario

  @Test
  public void invalidPayloadType() throws JMSException {
    MessagingMessageListenerAdapter listener = createDefaultInstance(Integer.class);
    Session session = mock(Session.class);

    thrown.expect(ListenerExecutionFailedException.class);
    thrown.expectCause(Matchers.isA(MessageConversionException.class));
    thrown.expectMessage(getDefaultListenerMethod(Integer.class).toGenericString()); // ref to method
    listener.onMessage(createSimpleJmsTextMessage("test"), session); // test is not a valid integer
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.