Examples of receive()


Examples of org.nfctools.nfcip.NFCIPConnection.receive()

        byte[] data = null;
        int runs = 0;
        do {
          log.trace("Start of Run: " + runs);
          data = nfcipConnection.receive();
          log.info("Received: " + data.length + " Runs: " + runs);
          nfcipConnection.send(data);
          log.trace("End of Run: " + runs);
          runs++;
        } while (data != null && data.length > 0);

Examples of org.springframework.amqp.core.AmqpTemplate.receive()

    @Test
    public void testMessageItemType() {
        final AmqpTemplate amqpTemplate = mock(AmqpTemplate.class);
        final Message message = mock(Message.class);

        when(amqpTemplate.receive()).thenReturn(message);

        final AmqpItemReader<Message> amqpItemReader = new AmqpItemReader<Message>(amqpTemplate);
        amqpItemReader.setItemType(Message.class);

        assertEquals(message, amqpItemReader.read());

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate.receive()

        .setContentType("text/plain")
        .setContentEncoding("junk")
        .build();
    template.send("", testQueueName, message);

    Message rejected = template.receive(dlq.getName());
    int n = 0;
    while (n++ < 100 && rejected == null) {
      Thread.sleep(100);
      rejected = template.receive(dlq.getName());
    }

Examples of org.springframework.integration.channel.AbstractPollableChannel.receive()

        Message<String> message = new GenericMessage<String>(MESSAGE_BODY, maps);

        requestChannel.send(message);

        AbstractPollableChannel responseChannel = (AbstractPollableChannel) applicationContext.getBean("responseChannel");
        Message responseMessage = responseChannel.receive();
        String result = (String) responseMessage.getPayload();

        assertEquals("Get the wrong result", MESSAGE_BODY + " is processed",  result);
    }

Examples of org.springframework.integration.channel.MessageChannel.receive()

        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();

        assertEquals("Get the wrong result", MESSAGE_BODY + " is processed",  result);
    }

Examples of org.springframework.integration.channel.PollableChannel.receive()

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

        PollableChannel responseChannel = (PollableChannel) applicationContext.getBean("channelC");
        Message responseMessage = responseChannel.receive();
        String result = (String) responseMessage.getPayload();

        assertEquals("Get the wrong result", MESSAGE_BODY + " is processed",  result);
    }

Examples of org.springframework.integration.channel.QueueChannel.receive()

    stdinToJmsoutChannel.send(MessageBuilder.withPayload("jms test").build());

    final QueueChannel queueChannel = applicationContext.getBean("queueChannel", QueueChannel.class);

    @SuppressWarnings("unchecked")
    Message<String> reply = (Message<String>) queueChannel.receive(20000);
    Assert.assertNotNull(reply);
    String out = reply.getPayload();

    Assert.assertEquals("JMS response: JMS TEST", out);

Examples of org.springframework.integration.core.MessagingOperations.receive()

    StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class);
    MessagingOperations operations = mock(MessagingOperations.class);
    Message message = mock(Message.class);
    //when
    when(message.getPayload()).thenReturn(Collections.emptyList());
    when(operations.receive((PollableChannel) anyObject())).thenReturn(message);
    //set
    messageChannelPartitionHandler.setMessagingOperations(operations);
   
    //execute
    Collection<StepExecution> executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, masterStepExecution);

Examples of org.springframework.integration.core.MessagingTemplate.receive()

    //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
    Collection<StepExecution> executions = messageChannelPartitionHandler.handle(stepExecutionSplitter, masterStepExecution);

Examples of org.springframework.integration.core.PollableChannel.receive()

    Scrobble scrobble2 = new Scrobble(user1, track1, false);

    Message message1 = new GenericMessage<Scrobble>(scrobble1);
    Message message2 = new GenericMessage<Scrobble>(scrobble2);
    PollableChannel scrobbleChannel = mock(PollableChannel.class);
    when(scrobbleChannel.receive()).thenReturn(message1, message2, null);
   
    scrobbleService.setScrobbleChannel(scrobbleChannel);
    scrobbleService.receive();
   
    assertNotNull(scrobbleService.userScrobbles);
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.