Package org.jclouds.sqs

Examples of org.jclouds.sqs.SQSApi


            .payload(
                  payloadFromStringWithContentType(
                        "<GetQueueAttributesResponse><GetQueueAttributesResult><Attribute><Name>VisibilityTimeout</Name><Value>30</Value></Attribute></GetQueueAttributesResult></GetQueueAttributesResponse>",
                        "text/xml")).build();

      SQSApi apiWhenExist = requestSendsResponse(getQueueAttribute, getQueueAttributeResponse);

      assertEquals(apiWhenExist.getQueueApi().getAttribute(queue, "VisibilityTimeout"), "30");
   }
View Full Code Here


   public void testGetQueueAttributesWhenResponseIs2xx() throws Exception {
     
      HttpResponse getQueueAttributesResponse = HttpResponse.builder().statusCode(200)
            .payload(payloadFromResourceWithContentType("/attributes.xml", "text/xml")).build();

      SQSApi apiWhenExist = requestSendsResponse(getQueueAttributes, getQueueAttributesResponse);

      assertEquals(apiWhenExist.getQueueApi().getAttributes(queue).toString(), new MapToQueueAttributesTest()
            .expected().toString());
   }
View Full Code Here

   public void testGetQueueAttributesSubsetWhenResponseIs2xx() throws Exception {
     
      HttpResponse getQueueAttributesSubsetResponse = HttpResponse.builder().statusCode(200)
            .payload(payloadFromResourceWithContentType("/attributes.xml", "text/xml")).build();

      SQSApi apiWhenExist = requestSendsResponse(getQueueAttributesSubset, getQueueAttributesSubsetResponse);

      assertEquals(apiWhenExist.getQueueApi()
            .getAttributes(queue, ImmutableSet.of("VisibilityTimeout", "DelaySeconds")).toString(),
            new GetQueueAttributesResponseTest().expected().toString());
   }
View Full Code Here

            .payload(
                  payloadFromStringWithContentType(
                        "<SetQueueAttributesResponse><ResponseMetadata><RequestId>b5293cb5-d306-4a17-9048-b263635abe42</RequestId></ResponseMetadata></SetQueueAttributesResponse>",
                        "text/xml")).build();

      SQSApi apiWhenExist = requestSendsResponse(setQueueAttribute, setQueueAttributeResponse);

      apiWhenExist.getQueueApi().setAttribute(queue, "MaximumMessageSize", "1");
   }
View Full Code Here

   public void testSendMessageWhenResponseIs2xx() throws Exception {
     
      HttpResponse sendMessageResponse = HttpResponse.builder().statusCode(200)
            .payload(payloadFromResourceWithContentType("/send_message.xml", "text/xml")).build();

      SQSApi apiWhenExist = requestSendsResponse(sendMessage, sendMessageResponse);

      assertEquals(apiWhenExist.getMessageApiForQueue(queue).send("hardyharhar").toString(),
            new SendMessageResponseTest().expected().toString());
   }
View Full Code Here

      HttpResponse sendMessageResponse = HttpResponse.builder()
            .statusCode(200)
            .payload(payloadFromResourceWithContentType("/send_message_batch.xml", "text/xml")).build();

      SQSApi apiWhenExist = requestSendsResponse(sendMessageIterable, sendMessageResponse);

      assertEquals(apiWhenExist.getMessageApiForQueue(queue).send(ImmutableSet.of("payload1", "payload2"))
            .toString(), new SendMessageBatchResponseTest().expected().toString());
   }
View Full Code Here

      HttpResponse sendMessageResponse = HttpResponse.builder()
            .statusCode(200)
            .payload(payloadFromResourceWithContentType("/send_message_batch.xml", "text/xml")).build();

      SQSApi apiWhenExist = requestSendsResponse(sendMessageMap, sendMessageResponse);

      assertEquals(
            apiWhenExist.getMessageApiForQueue(queue)
                  .send(ImmutableMap.of("foo1", "payload1", "foo2", "payload2")).toString(),
            new SendMessageBatchResponseTest().expected().toString());
   }
View Full Code Here

      HttpResponse sendMessageResponse = HttpResponse.builder()
            .statusCode(200)
            .payload(payloadFromResourceWithContentType("/send_message_batch.xml", "text/xml")).build();

      SQSApi apiWhenExist = requestSendsResponse(sendMessageWithDelayMap, sendMessageResponse);

      assertEquals(apiWhenExist.getMessageApiForQueue(queue).sendWithDelay(ImmutableMap.<String, String>builder()
            .put("foo1", "payload1")
            .put("foo2", "payload2")
            .build(), 10)
            .toString(), new SendMessageBatchResponseTest().expected().toString());
   }
View Full Code Here

      HttpResponse sendMessageResponse = HttpResponse.builder()
            .statusCode(200)
            .payload(payloadFromResourceWithContentType("/send_message_batch.xml", "text/xml")).build();

      SQSApi apiWhenExist = requestSendsResponse(sendMessageWithDelayIterable, sendMessageResponse);

      assertEquals(
            apiWhenExist.getMessageApiForQueue(queue).sendWithDelay(ImmutableSet.of("payload1", "payload2"), 10)
                  .toString(), new SendMessageBatchResponseTest().expected().toString());
   }
View Full Code Here

      HttpResponse sendMessageResponse = HttpResponse.builder()
            .statusCode(200)
            .payload(payloadFromResourceWithContentType("/send_message_batch.xml", "text/xml")).build();

      SQSApi apiWhenExist = requestSendsResponse(sendMessageWithDelaysTable, sendMessageResponse);

      assertEquals(apiWhenExist.getMessageApiForQueue(queue).sendWithDelays(ImmutableTable.<String, String, Integer>builder()
            .put("foo1", "payload1", 1)
            .put("foo2", "payload2", 10)
            .build())
            .toString(), new SendMessageBatchResponseTest().expected().toString());
   }
View Full Code Here

TOP

Related Classes of org.jclouds.sqs.SQSApi

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.