Package org.jclouds.openstack.swift.v1.domain

Examples of org.jclouds.openstack.swift.v1.domain.ExtractArchiveResponse


      }
   }

   public void extractArchive() throws Exception {
      for (String regionId : api.configuredRegions()) {
         ExtractArchiveResponse extractResponse = api.bulkApiInRegion(regionId).extractArchive(containerName,
               Payloads.newPayload(tarGz), "tar.gz");
         assertEquals(extractResponse.created(), OBJECT_COUNT);
         assertTrue(extractResponse.errors().isEmpty());
         assertEquals(api.containerApiInRegion(regionId).get(containerName).objectCount(), OBJECT_COUNT);

         // repeat the command
         extractResponse = api.bulkApiInRegion(regionId).extractArchive(containerName, Payloads.newPayload(tarGz),
               "tar.gz");
         assertEquals(extractResponse.created(), OBJECT_COUNT);
         assertTrue(extractResponse.errors().isEmpty());
      }
   }
View Full Code Here


      server.enqueue(new MockResponse().setBody(accessRackspace));
      server.enqueue(new MockResponse().setResponseCode(201).setBody("{\"Number Files Created\": 10, \"Errors\": []}"));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         ExtractArchiveResponse response = api.bulkApiInRegion("DFW").extractArchive("myContainer",
               newByteArrayPayload(tarGz), "tar.gz");
         assertEquals(response.created(), 10);
         assertTrue(response.errors().isEmpty());

         assertEquals(server.getRequestCount(), 2);
         assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
         RecordedRequest extractRequest = server.takeRequest();
         assertEquals(extractRequest.getRequestLine(),
View Full Code Here

      }
   }

   public void testExtractArchive() throws Exception {
      for (String regionId : regions) {
         ExtractArchiveResponse extractResponse = api.bulkApiInRegion(regionId).extractArchive(containerName,
               Payloads.newPayload(tarGz), "tar.gz");
         assertEquals(extractResponse.getCreated(), OBJECT_COUNT);
         assertTrue(extractResponse.getErrors().isEmpty());
         assertEquals(api.containerApiInRegion(regionId).get(containerName).getObjectCount(), OBJECT_COUNT);

         // repeat the command
         extractResponse = api.bulkApiInRegion(regionId).extractArchive(containerName, Payloads.newPayload(tarGz),
               "tar.gz");
         assertEquals(extractResponse.getCreated(), OBJECT_COUNT);
         assertTrue(extractResponse.getErrors().isEmpty());
      }
   }
View Full Code Here

      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(201).setBody("{\"Number Files Created\": 10, \"Errors\": []}")));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         ExtractArchiveResponse response = api.bulkApiInRegion("DFW").extractArchive("myContainer",
               newByteArrayPayload(tarGz), "tar.gz");
         assertEquals(response.getCreated(), 10);
         assertTrue(response.getErrors().isEmpty());

         assertEquals(server.getRequestCount(), 2);
         assertAuthentication(server);
         RecordedRequest extractRequest = server.takeRequest();
         assertRequest(extractRequest, "PUT", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/myContainer?extract-archive=tar.gz");
View Full Code Here

   public void testExtractArchive() throws Exception {
      for (String regionId : regions) {
         Payload payload = new ByteSourcePayload(ByteSource.wrap(tarGz));

         ExtractArchiveResponse extractResponse = api.getBulkApiForRegion(regionId)
                                                     .extractArchive(containerName, payload, "tar.gz");
         assertEquals(extractResponse.getCreated(), OBJECT_COUNT);
         assertTrue(extractResponse.getErrors().isEmpty());
         assertEquals(api.getContainerApiForRegion(regionId).get(containerName).getObjectCount(), OBJECT_COUNT);

         // repeat the command
         extractResponse = api.getBulkApiForRegion(regionId).extractArchive(containerName, payload, "tar.gz");
         assertEquals(extractResponse.getCreated(), OBJECT_COUNT);
         assertTrue(extractResponse.getErrors().isEmpty());
      }
   }
View Full Code Here

      server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(201).setBody("{\"Number Files Created\": 10, \"Errors\": []}")));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         Payload payload = Payloads.newByteSourcePayload(ByteSource.wrap(tarGz));
         ExtractArchiveResponse response = api.getBulkApiForRegion("DFW").extractArchive("myContainer", payload, "tar.gz");

         assertEquals(response.getCreated(), 10);
         assertTrue(response.getErrors().isEmpty());

         assertEquals(server.getRequestCount(), 2);
         assertAuthentication(server);
         RecordedRequest extractRequest = server.takeRequest();
         assertRequest(extractRequest, "PUT", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/myContainer?extract-archive=tar.gz");
View Full Code Here

   public void testExtractArchive() throws Exception {
      for (String regionId : regions) {
         Payload payload = new ByteSourcePayload(ByteSource.wrap(tarGz));

         ExtractArchiveResponse extractResponse = api.getBulkApiForRegion(regionId)
                                                     .extractArchive(containerName, payload, "tar.gz");
         assertEquals(extractResponse.getCreated(), OBJECT_COUNT);
         assertTrue(extractResponse.getErrors().isEmpty());
         assertEquals(api.getContainerApiForRegion(regionId).get(containerName).getObjectCount(), OBJECT_COUNT);

         // repeat the command
         extractResponse = api.getBulkApiForRegion(regionId).extractArchive(containerName, payload, "tar.gz");
         assertEquals(extractResponse.getCreated(), OBJECT_COUNT);
         assertTrue(extractResponse.getErrors().isEmpty());
      }
   }
View Full Code Here

      server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(201).setBody("{\"Number Files Created\": 10, \"Errors\": []}")));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         Payload payload = Payloads.newByteSourcePayload(ByteSource.wrap(tarGz));
         ExtractArchiveResponse response = api.getBulkApiForRegion("DFW").extractArchive("myContainer", payload, "tar.gz");

         assertEquals(response.getCreated(), 10);
         assertTrue(response.getErrors().isEmpty());

         assertEquals(server.getRequestCount(), 2);
         assertAuthentication(server);
         RecordedRequest extractRequest = server.takeRequest();
         assertRequest(extractRequest, "PUT", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/myContainer?extract-archive=tar.gz");
View Full Code Here

   public void testExtractArchive() throws Exception {
      for (String regionId : regions) {
         Payload payload = new ByteSourcePayload(ByteSource.wrap(tarGz));

         ExtractArchiveResponse extractResponse = api.getBulkApi(regionId)
                                                     .extractArchive(containerName, payload, "tar.gz");
         assertEquals(extractResponse.getCreated(), OBJECT_COUNT);
         assertTrue(extractResponse.getErrors().isEmpty());
         assertEquals(api.getContainerApi(regionId).get(containerName).getObjectCount(), OBJECT_COUNT);

         // repeat the command
         extractResponse = api.getBulkApi(regionId).extractArchive(containerName, payload, "tar.gz");
         assertEquals(extractResponse.getCreated(), OBJECT_COUNT);
         assertTrue(extractResponse.getErrors().isEmpty());
      }
   }
View Full Code Here

      server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(201).setBody("{\"Number Files Created\": 10, \"Errors\": []}")));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         Payload payload = Payloads.newByteSourcePayload(ByteSource.wrap(tarGz));
         ExtractArchiveResponse response = api.getBulkApi("DFW").extractArchive("myContainer", payload, "tar.gz");

         assertEquals(response.getCreated(), 10);
         assertTrue(response.getErrors().isEmpty());

         assertEquals(server.getRequestCount(), 2);
         assertAuthentication(server);
         RecordedRequest extractRequest = server.takeRequest();
         assertRequest(extractRequest, "PUT", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/myContainer?extract-archive=tar.gz");
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.swift.v1.domain.ExtractArchiveResponse

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.