Package org.jclouds.sqs.features

Examples of org.jclouds.sqs.features.MessageApi


    * Tests {@link SQS#receiveAllAtRate} where a single response returns all
    * results.
    */
   @Test
   public void testSinglePageResult() throws Exception {
      MessageApi messageClient = createMock(MessageApi.class);
      ReceiveMessageOptions options = new ReceiveMessageOptions();
      FluentIterable<Message> aMessage = FluentIterable.from(ImmutableSet.of(createMock(Message.class)));
      FluentIterable<Message> noMessages = FluentIterable.from(ImmutableSet.<Message>of());

      expect(messageClient.receive(1, options))
            .andReturn(aMessage)
            .once();
     
      expect(messageClient.receive(1, options))
            .andReturn(noMessages)
            .once();
           
      EasyMock.replay(messageClient);

View Full Code Here


   /**
    * Tests {@link SQS#receiveAllAtRate} where retrieving all results requires multiple requests.
    */
   @Test
   public void testMultiPageResult() throws Exception {
      MessageApi messageClient = createMock(MessageApi.class);
      ReceiveMessageOptions options = new ReceiveMessageOptions();
      FluentIterable<Message> aMessage = FluentIterable.from(ImmutableSet.of(createMock(Message.class)));
      FluentIterable<Message> noMessages = FluentIterable.from(ImmutableSet.<Message>of());
     
      expect(messageClient.receive(1, options))
            .andReturn(aMessage)
            .times(2);
      expect(messageClient.receive(1, options))
            .andReturn(noMessages)
            .once();

      EasyMock.replay(messageClient);

View Full Code Here

    * Tests {@link SQS#receiveAllAtRate} where a single response returns all
    * results.
    */
   @Test
   public void testSinglePageResult() throws Exception {
      MessageApi messageClient = createMock(MessageApi.class);
      ReceiveMessageOptions options = new ReceiveMessageOptions();
      FluentIterable<Message> aMessage = FluentIterable.from(ImmutableSet.of(createMock(Message.class)));
      FluentIterable<Message> noMessages = FluentIterable.from(ImmutableSet.<Message>of());

      expect(messageClient.receive(1, options))
            .andReturn(aMessage)
            .once();
     
      expect(messageClient.receive(1, options))
            .andReturn(noMessages)
            .once();
           
      EasyMock.replay(messageClient);

View Full Code Here

   /**
    * Tests {@link SQS#receiveAllAtRate} where retrieving all results requires multiple requests.
    */
   @Test
   public void testMultiPageResult() throws Exception {
      MessageApi messageClient = createMock(MessageApi.class);
      ReceiveMessageOptions options = new ReceiveMessageOptions();
      FluentIterable<Message> aMessage = FluentIterable.from(ImmutableSet.of(createMock(Message.class)));
      FluentIterable<Message> noMessages = FluentIterable.from(ImmutableSet.<Message>of());
     
      expect(messageClient.receive(1, options))
            .andReturn(aMessage)
            .times(2);
      expect(messageClient.receive(1, options))
            .andReturn(noMessages)
            .once();

      EasyMock.replay(messageClient);

View Full Code Here

    * Tests {@link SQS#receiveAllAtRate} where a single response returns all
    * results.
    */
   @Test
   public void testSinglePageResult() throws Exception {
      MessageApi messageClient = createMock(MessageApi.class);
      ReceiveMessageOptions options = new ReceiveMessageOptions();
      FluentIterable<Message> aMessage = FluentIterable.from(ImmutableSet.of(createMock(Message.class)));
      FluentIterable<Message> noMessages = FluentIterable.from(ImmutableSet.<Message>of());

      expect(messageClient.receive(1, options))
            .andReturn(aMessage)
            .once();
     
      expect(messageClient.receive(1, options))
            .andReturn(noMessages)
            .once();
           
      EasyMock.replay(messageClient);

View Full Code Here

   /**
    * Tests {@link SQS#receiveAllAtRate} where retrieving all results requires multiple requests.
    */
   @Test
   public void testMultiPageResult() throws Exception {
      MessageApi messageClient = createMock(MessageApi.class);
      ReceiveMessageOptions options = new ReceiveMessageOptions();
      FluentIterable<Message> aMessage = FluentIterable.from(ImmutableSet.of(createMock(Message.class)));
      FluentIterable<Message> noMessages = FluentIterable.from(ImmutableSet.<Message>of());
     
      expect(messageClient.receive(1, options))
            .andReturn(aMessage)
            .times(2);
      expect(messageClient.receive(1, options))
            .andReturn(noMessages)
            .once();

      EasyMock.replay(messageClient);

View Full Code Here

TOP

Related Classes of org.jclouds.sqs.features.MessageApi

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.