Package org.jclouds.openstack.nova.v2_0.domain

Examples of org.jclouds.openstack.nova.v2_0.domain.Quota


            .<String, Location> of("az-1.region-a.geo-1", zone));
  
   @Test
   public void testConversionWhereLocationFound() {
      UUID id = UUID.randomUUID();
      Image novaImageToConvert = Image.builder().id(id.toString()).name("Test Image " + id).status(Image.Status.DELETED).build();
      OperatingSystem operatingSystem = new OperatingSystem(OsFamily.UBUNTU, "My Test OS", "My Test Version", "x86",
               "My Test OS", true);
      ImageInZoneToImage converter = new ImageInZoneToImage(NovaComputeServiceContextModule.toPortableImageStatus,
               constant(operatingSystem), locationIndex);

      ImageInZone novaImageInZoneToConvert = new ImageInZone(novaImageToConvert, "az-1.region-a.geo-1");

      org.jclouds.compute.domain.Image convertedImage = converter.apply(novaImageInZoneToConvert);

      assertEquals(convertedImage.getId(), novaImageInZoneToConvert.slashEncode());
      assertEquals(convertedImage.getProviderId(), novaImageToConvert.getId());
      assertEquals(convertedImage.getLocation(), locationIndex.get().get("az-1.region-a.geo-1"));

      assertEquals(convertedImage.getName(), novaImageToConvert.getName());
      assertEquals(convertedImage.getStatus(), org.jclouds.compute.domain.Image.Status.DELETED);
      assertEquals(convertedImage.getOperatingSystem(), operatingSystem);
   }
View Full Code Here


   }

   @Test(expectedExceptions = IllegalStateException.class)
   public void testConversionWhereLocationNotFound() {
      UUID id = UUID.randomUUID();
      Image novaImageToConvert = Image.builder().id(id.toString()).name("Test Image " + id).build();
      OperatingSystem operatingSystem = new OperatingSystem(OsFamily.UBUNTU, "My Test OS", "My Test Version", "x86",
               "My Test OS", true);
      ImageInZoneToImage converter = new ImageInZoneToImage(NovaComputeServiceContextModule.toPortableImageStatus,
               constant(operatingSystem), locationIndex);
View Full Code Here

      apiOption = api.getQuotaExtensionForZone(zone);
   }

   public void testGetQuotasForCurrentTenant() {
      if (apiOption.isPresent()) {
         Quota quota = apiOption.get().getByTenant(tenant);
         assertQuotasIsValid(quota);
      }
   }
View Full Code Here

      }
   }

   public void testGetDefaultQuotasForCurrentTenant() {
      if (apiOption.isPresent()) {
         Quota quota = apiOption.get().getDefaultsForTenant(tenant);
         assertQuotasIsValid(quota);
      }
   }
View Full Code Here

   }

   public void testUpdateQuotasOfCurrentTenantThenReset() {
      if (apiOption.isPresent()) {
         QuotaApi api = apiOption.get();
         Quota before = api.getByTenant(tenant);
         assertQuotasIsValid(before);

         Quota modified = before.toBuilder()
               .cores(before.getCores() - 1)
               .instances(before.getInstances() - 1)
               .metadataItems(before.getMetadatas() - 1)
               .ram(before.getRam() - 1)
               .volumes(before.getVolumes() - 1)
View Full Code Here

      apiOption = api.getQuotaExtensionForZone(zone);
   }

   public void testGetQuotasForCurrentTenant() {
      if (apiOption.isPresent()) {
         Quota quota = apiOption.get().getByTenant(tenant);
         assertQuotasIsValid(quota);
      }
   }
View Full Code Here

      }
   }

   public void testGetDefaultQuotasForCurrentTenant() {
      if (apiOption.isPresent()) {
         Quota quota = apiOption.get().getDefaultsForTenant(tenant);
         assertQuotasIsValid(quota);
      }
   }
View Full Code Here

   }

   public void testUpdateQuotasOfCurrentTenantThenReset() {
      if (apiOption.isPresent()) {
         QuotaApi api = apiOption.get();
         Quota before = api.getByTenant(tenant);
         assertQuotasIsValid(before);

         Quota modified = before.toBuilder()
               .cores(before.getCores() - 1)
               .instances(before.getInstances() - 1)
               .metadataItems(before.getMetadatas() - 1)
               .ram(before.getRam() - 1)
               .volumes(before.getVolumes() - 1)
View Full Code Here

      apiOption = api.getQuotaExtensionForZone(zone);
   }

   public void testGetQuotasForCurrentTenant() {
      if (apiOption.isPresent()) {
         Quota quota = apiOption.get().getByTenant(tenant);
         assertQuotasIsValid(quota);
      }
   }
View Full Code Here

      }
   }

   public void testGetDefaultQuotasForCurrentTenant() {
      if (apiOption.isPresent()) {
         Quota quota = apiOption.get().getDefaultsForTenant(tenant);
         assertQuotasIsValid(quota);
      }
   }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.nova.v2_0.domain.Quota

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.