Package org.jclouds.sqs

Examples of org.jclouds.sqs.SQSApi


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

      SQSApi apiWhenExist = requestSendsResponse(changeMessageVisibilityIterableInt, sendMessageResponse);

      assertEquals(
            apiWhenExist.getMessageApiForQueue(queue).changeVisibility(ImmutableSet.of("aaaaaaaaa", "bbbbbbbbb"), 10)
                  .toString(), new ChangeMessageVisibilityBatchResponseTest().expected().toString());
   }
View Full Code Here


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

      SQSApi apiWhenExist = requestSendsResponse(addPermission, addPermissionResponse);

      apiWhenExist.getPermissionApiForQueue(queue).addPermissionToAccount("testLabel", Action.RECEIVE_MESSAGE, "125074342641");
   }
View Full Code Here

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

      SQSApi apiWhenExist = requestSendsResponse(removePermission, removePermissionResponse);

      apiWhenExist.getPermissionApiForQueue(queue).remove("testLabel");
   }
View Full Code Here

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


      SQSApi apiWhenExist = requestSendsResponse(getQueueUrl, getQueueUrlResponse);

      assertEquals(apiWhenExist.getQueueApi().get("queueName"), URI.create("http://sqs.us-east-1.amazonaws.com/123456789012/testQueue"));
   }
View Full Code Here

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


      SQSApi apiWhenExist = requestSendsResponse(getQueueUrlByOwner, getQueueUrlResponse);

      assertEquals(apiWhenExist.getQueueApi().getInAccount("queueName", "120908098979"), URI.create("http://sqs.us-east-1.amazonaws.com/123456789012/testQueue"));
   }
View Full Code Here

            .payload(
                  payloadFromStringWithContentType(
                        "<ErrorResponse><Error><Type>Sender</Type><Code>AWS.SimpleQueueService.NonExistentQueue</Code><Message>The specified queue does not exist or you do not have access to it.</Message><Detail/></Error><RequestId>194a169f-4483-5bb1-8cb6-5e4ac865909a</RequestId></ErrorResponse>",
                        "text/xml")).build();

      SQSApi apiWhenExist = requestSendsResponse(getQueueUrlByOwner, getQueueUrlResponse);

      assertNull(apiWhenExist.getQueueApi().getInAccount("queueName", "120908098979"));
   }
View Full Code Here

   public void testCreateQueueWhenResponseIs2xx() throws Exception {
     
      HttpResponse createQueueResponse = HttpResponse.builder().statusCode(200)
            .payload(payloadFromResourceWithContentType("/create_queue.xml", "text/xml")).build();

      SQSApi apiWhenExist = requestSendsResponse(createQueue, createQueueResponse);

      assertEquals(apiWhenExist.getQueueApi().create("queueName").toString(), new CreateQueueResponseTest().expected()
            .toString());
   }
View Full Code Here

            .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

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.