Examples of StringMessage


Examples of org.springframework.integration.message.StringMessage

    @Test
    public void testSendingTwoWayMessage() throws Exception {

        MessageChannel requestChannel = (MessageChannel) applicationContext.getBean("channelB");
        Message message = new StringMessage(MESSAGE_BODY);
        //Need to subscribe the responseChannel first
        DirectChannel responseChannel = (DirectChannel) applicationContext.getBean("channelC");
        responseChannel.subscribe(new MessageHandler() {
            public void handleMessage(Message<?> message) {
                String result = (String) message.getPayload();
                assertEquals("Get the wrong result", MESSAGE_BODY + " is processed",  result);               
            }           
        });
        requestChannel.send(message);
    }
View Full Code Here

Examples of org.springframework.integration.message.StringMessage

    @Test
    public void testSendingOneWayMessage() throws Exception {
        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
        resultEndpoint.expectedBodiesReceived(MESSAGE_BODY);
        MessageChannel outputChannel = (MessageChannel) applicationContext.getBean("outputChannel");
        outputChannel.send(new StringMessage(MESSAGE_BODY));
        resultEndpoint.assertIsSatisfied();
    }
View Full Code Here

Examples of org.springframework.integration.message.StringMessage

    @Test
    public void testSendingOneWayMessage() throws Exception {
        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
        resultEndpoint.expectedBodiesReceived(MESSAGE_BODY);
        MessageChannel outputChannel = (MessageChannel) applicationContext.getBean("channelA");
        outputChannel.send(new StringMessage(MESSAGE_BODY));
        resultEndpoint.assertIsSatisfied();
    }
View Full Code Here

Examples of org.springframework.integration.message.StringMessage

    @Test
    public void testSendingTwoWayMessage() throws Exception {

        MessageChannel requestChannel = (MessageChannel) applicationContext.getBean("channelB");
        Message message = new StringMessage(MESSAGE_BODY);
        //Need to subscribe the responseChannel first
        DirectChannel responseChannel = (DirectChannel) applicationContext.getBean("channelC");
        responseChannel.subscribe(new MessageHandler() {
            public void handleMessage(Message<?> message) {
                String result = (String) message.getPayload();
                assertEquals("Get the wrong result", MESSAGE_BODY + " is processed",  result);               
            }           
        });
        requestChannel.send(message);
    }
View Full Code Here

Examples of org.springframework.integration.message.StringMessage

    public void testSendingOneWayMessage() throws Exception {
        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
        resultEndpoint.expectedBodiesReceived(MESSAGE_BODY);

        MessageChannel outputChannel = (MessageChannel) applicationContext.getBean("outputChannel");
        outputChannel.send(new StringMessage(MESSAGE_BODY));

        resultEndpoint.assertIsSatisfied();
    }
View Full Code Here

Examples of org.springframework.integration.message.StringMessage

    }

    public void testSendingTwoWayMessage() throws Exception {

        MessageChannel requestChannel = (MessageChannel) applicationContext.getBean("requestChannel");
        Message message = new StringMessage(MESSAGE_BODY);
        message.getHeader().setReturnAddress("responseChannel");
        requestChannel.send(message);

        MessageChannel responseChannel = (MessageChannel) applicationContext.getBean("responseChannel");
        Message responseMessage = responseChannel.receive();
        String result = (String) responseMessage.getPayload();
View Full Code Here

Examples of org.springframework.integration.message.StringMessage

    public void testSendingOneWayMessage() throws Exception {
        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
        resultEndpoint.expectedBodiesReceived(MESSAGE_BODY);
        MessageChannel outputChannel = (MessageChannel) applicationContext.getBean("outputChannel");
        outputChannel.send(new StringMessage(MESSAGE_BODY));
        resultEndpoint.assertIsSatisfied();
    }
View Full Code Here

Examples of org.springframework.integration.message.StringMessage

    public void testSendingOneWayMessage() throws Exception {
        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
        resultEndpoint.expectedBodiesReceived(MESSAGE_BODY);
        MessageChannel outputChannel = (MessageChannel) applicationContext.getBean("channelA");
        outputChannel.send(new StringMessage(MESSAGE_BODY));
        resultEndpoint.assertIsSatisfied();
    }
View Full Code Here

Examples of org.springframework.integration.message.StringMessage

    }

    public void testSendingTwoWayMessage() throws Exception {

        MessageChannel requestChannel = (MessageChannel) applicationContext.getBean("channelB");
        Message message = new StringMessage(MESSAGE_BODY);
        requestChannel.send(message);

        MessageChannel responseChannel = (MessageChannel) applicationContext.getBean("channelC");
        Message responseMessage = responseChannel.receive();
        String result = (String) responseMessage.getPayload();
View Full Code Here

Examples of org.zkoss.monitor.message.StringMessage

  @Test
  public void handleSimpleMessage() throws Exception{
    EventBusMessageHandler handler = new EventBusMessageHandler();
    handler.addMessageEventListener(new EvtListener1());
    handler.addMessageEventListener(new EvtListener2());
    handler.handle(new StringMessage("This is a String!"), true);
    handler.handle(new NewTimelineMessage(), false);
  }
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.