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

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


      provider = "rackspace-cloudfiles";
   }

   public void testUrlKeyExists() throws Exception {
      for (String regionId : regions) {
         Account account = api.accountApiInRegion(regionId).get();
         assertTrue(account.getTemporaryUrlKey().isPresent());
      }
   }
View Full Code Here


public class AccountApiLiveTest extends BaseSwiftApiLiveTest<SwiftApi> {

   public void testGet() throws Exception {
      for (String regionId : regions) {
         AccountApi accountApi = api.accountApiInRegion(regionId);
         Account account = accountApi.get();

         assertNotNull(account);
         assertTrue(account.getContainerCount() >= 0);
         assertTrue(account.getObjectCount() >= 0);
         assertTrue(account.getBytesUsed() >= 0);
      }
   }
View Full Code Here

         assertTrue(accountApi.updateMetadata(meta));
         accountHasMetadata(accountApi, meta);

         assertTrue(accountApi.deleteMetadata(meta));
         Account account = accountApi.get();
         for (Entry<String, String> entry : meta.entrySet()) {
            // note keys are returned in lower-case!
            assertFalse(account.getMetadata().containsKey(entry.getKey().toLowerCase()));
         }
      }
   }
View Full Code Here

         }
      }
   }

   static void accountHasMetadata(AccountApi accountApi, Map<String, String> meta) {
      Account account = accountApi.get();
      for (Entry<String, String> entry : meta.entrySet()) {
         // note keys are returned in lower-case!
         assertEquals(account.getMetadata().get(entry.getKey().toLowerCase()), entry.getValue(),
               account + " didn't have metadata: " + entry);
      }
   }
View Full Code Here

      provider = "rackspace-cloudfiles";
   }

   public void testUrlKeyExists() throws Exception {
      for (String regionId : regions) {
         Account account = api.getAccountApiForRegion(regionId).get();
         assertTrue(account.getTemporaryUrlKey().isPresent());
      }
   }
View Full Code Here

public class AccountApiLiveTest extends BaseSwiftApiLiveTest<SwiftApi> {

   public void testGet() throws Exception {
      for (String regionId : regions) {
         AccountApi accountApi = api.getAccountApiForRegion(regionId);
         Account account = accountApi.get();

         assertNotNull(account);
         assertTrue(account.getContainerCount() >= 0);
         assertTrue(account.getObjectCount() >= 0);
         assertTrue(account.getBytesUsed() >= 0);
      }
   }
View Full Code Here

         assertTrue(accountApi.updateMetadata(meta));
         accountHasMetadata(accountApi, meta);

         assertTrue(accountApi.deleteMetadata(meta));
         Account account = accountApi.get();
         for (Entry<String, String> entry : meta.entrySet()) {
            // note keys are returned in lower-case!
            assertFalse(account.getMetadata().containsKey(entry.getKey().toLowerCase()));
         }
      }
   }
View Full Code Here

         }
      }
   }

   static void accountHasMetadata(AccountApi accountApi, Map<String, String> meta) {
      Account account = accountApi.get();
      for (Entry<String, String> entry : meta.entrySet()) {
         // note keys are returned in lower-case!
         assertEquals(account.getMetadata().get(entry.getKey().toLowerCase()), entry.getValue(),
               account + " didn't have metadata: " + entry);
      }
   }
View Full Code Here

            .addHeader(ACCOUNT_METADATA_PREFIX + "Apiname", "swift")
            .addHeader(ACCOUNT_METADATA_PREFIX + "Apiversion", "v1.1")));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         Account account = api.getAccountApiForRegion("DFW").get();
         assertEquals(account.getContainerCount(), 3l);
         assertEquals(account.getObjectCount(), 42l);
         assertEquals(account.getBytesUsed(), 323479l);
         for (Entry<String, String> entry : metadata.entrySet()) {
            assertEquals(account.getMetadata().get(entry.getKey().toLowerCase()), entry.getValue());
         }

         assertEquals(server.getRequestCount(), 2);
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "HEAD", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/");
View Full Code Here

            .addHeader(ACCOUNT_METADATA_PREFIX + "Apiname", "swift")
            .addHeader(ACCOUNT_METADATA_PREFIX + "Apiversion", "v1.1")));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         Account account = api.getAccountApiForRegion("DFW").get();
         assertEquals(account.getContainerCount(), 3l);
         assertEquals(account.getObjectCount(), 42l);
         assertEquals(account.getBytesUsed(), 323479l);
         for (Entry<String, String> entry : metadata.entrySet()) {
            assertEquals(account.getMetadata().get(entry.getKey().toLowerCase()), entry.getValue());
         }

         assertEquals(server.getRequestCount(), 2);
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "HEAD", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/");
View Full Code Here

TOP

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

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.