Package org.springframework.messaging

Examples of org.springframework.messaging.Message


        this.messageMap = messageMap;
    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    public Collection<ConfigAttribute> getAttributes(Object object) throws IllegalArgumentException {
        final Message message = (Message) object;
        for (Map.Entry<MessageMatcher<?>, Collection<ConfigAttribute>> entry : messageMap.entrySet()) {
            if (entry.getKey().matches(message)) {
                return entry.getValue();
            }
        }
View Full Code Here


    private Message<?> messageContainingEvent(final StubDomainEvent event) {
        return argThat(new ArgumentMatcher<Message<?>>() {
            @Override
            public boolean matches(Object argument) {
                Message message = (Message) argument;
                return event.equals(message.getPayload());
            }
        });
    }
View Full Code Here

    messageChannelPartitionHandler = new MessageChannelPartitionHandler();
    //mock
    StepExecution masterStepExecution = mock(StepExecution.class);
    StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class);
    MessagingTemplate operations = mock(MessagingTemplate.class);
    Message message = mock(Message.class);
    //when
    HashSet<StepExecution> stepExecutions = new HashSet<StepExecution>();
    stepExecutions.add(new StepExecution("step1", new JobExecution(5l)));
    when(stepExecutionSplitter.split((StepExecution) anyObject(), eq(1))).thenReturn(stepExecutions);
    when(message.getPayload()).thenReturn(Collections.emptyList());
    when(operations.receive((PollableChannel) anyObject())).thenReturn(message);
    //set
    messageChannelPartitionHandler.setMessagingOperations(operations);

    //execute
View Full Code Here

    messageChannelPartitionHandler = new MessageChannelPartitionHandler();
    //mock
    StepExecution masterStepExecution = mock(StepExecution.class);
    StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class);
    MessagingTemplate operations = mock(MessagingTemplate.class);
    Message message = mock(Message.class);
    PollableChannel replyChannel = mock(PollableChannel.class);
    //when
    HashSet<StepExecution> stepExecutions = new HashSet<StepExecution>();
    stepExecutions.add(new StepExecution("step1", new JobExecution(5l)));
    when(stepExecutionSplitter.split((StepExecution) anyObject(), eq(1))).thenReturn(stepExecutions);
    when(message.getPayload()).thenReturn(Collections.emptyList());
    when(operations.receive(replyChannel)).thenReturn(message);
    //set
    messageChannelPartitionHandler.setMessagingOperations(operations);
    messageChannelPartitionHandler.setReplyChannel(replyChannel);
View Full Code Here

    messageChannelPartitionHandler = new MessageChannelPartitionHandler();
    //mock
    StepExecution masterStepExecution = mock(StepExecution.class);
    StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class);
    MessagingTemplate operations = mock(MessagingTemplate.class);
    Message message = mock(Message.class);
    //when
    HashSet<StepExecution> stepExecutions = new HashSet<StepExecution>();
    stepExecutions.add(new StepExecution("step1", new JobExecution(5l)));
    when(stepExecutionSplitter.split((StepExecution) anyObject(), eq(1))).thenReturn(stepExecutions);
    when(message.getPayload()).thenReturn(Collections.emptyList());
    //set
    messageChannelPartitionHandler.setMessagingOperations(operations);

    //execute
    Collection<StepExecution> executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, masterStepExecution);
View Full Code Here

TOP

Related Classes of org.springframework.messaging.Message

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.