Package org.jclouds.softlayer.domain

Examples of org.jclouds.softlayer.domain.ProductItem


   @Test
   public void testIdManyPrices() {
      ProductItemPrice price1 = ProductItemPrice.builder().id(1234).build();
      ProductItemPrice price2 = ProductItemPrice.builder().id(5678).build();
      ProductItem item = ProductItem.builder().prices(ImmutableSet.of(price1,price2)).build();
      assertEquals("1234",imageId().apply(item));
   }
View Full Code Here


      assertEquals("1234",imageId().apply(item));
   }

   @Test(expectedExceptions = NoSuchElementException.class)
   public void testIdMissingPrices() {
      ProductItem item = ProductItem.builder().build();
      imageId().apply(item);
   }
View Full Code Here

   }

   @Test
   public void testHardwareId() {
      ProductItem item1 = ProductItem.builder().prices(ProductItemPrice.builder().id(123).build()).build();
      ProductItem item2 = ProductItem.builder().prices(ProductItemPrice.builder().id(456).build()).build();
      ProductItem item3 = ProductItem.builder().prices(ProductItemPrice.builder().id(789).build()).build();

      String id = hardwareId().apply(ImmutableList.of(item1, item2, item3));
      assertEquals("123,456,789", id);
   }
View Full Code Here

     assertEquals(100F, volumes.get(0).getSize());
   }

   @Test
   public void testHardwareWithTwoDisks() {
      ProductItem localVolumeItem = ProductItem.builder().id(4).description("25 GB").capacity(25F).prices(
            ProductItemPrice.builder().id(987).build()).categories(
            ProductItemCategory.builder().categoryCode("guest_disk1").build()).build();

      Hardware hardware = toHardware.apply(ImmutableSet.of(cpuItem, ramItem, volumeItem,localVolumeItem));
View Full Code Here

      for (String hardwareId : hardwareIds) {
         int id = Integer.parseInt(hardwareId);
         result.add(ProductItemPrice.builder().id(id).build());
      }
      float portSpeed = 10f;
      ProductItem uplinkItem = find(productPackage.getItems(),
              and(capacity(portSpeed), categoryCode("port_speed")));
      result.add(get(uplinkItem.getPrices(), 0));
      result.addAll(defaultPrices);
      return result.build();
   }
View Full Code Here

      Iterable<String> hardwareIds = Splitter.on(",").split(template.getHardware().getId());
      for (String hardwareId : hardwareIds) {
         int id = Integer.parseInt(hardwareId);
         result.add(ProductItemPrice.builder().id(id).build());
      }
      ProductItem uplinkItem = find(productPackageSupplier.get().getItems(),
            and(capacity(portSpeed), categoryCode("port_speed")));
      result.add(get(uplinkItem.getPrices(), 0));
      result.addAll(prices);
      return result.build();
   }
View Full Code Here

   @Test
   public void testConversion() {
      for( String description : operatingSystems )
      {
         ProductItem item = ProductItem.builder()
                                       .description(description)
                                       .prices(ProductItemPrice.builder().id(1234).build())
                                       .build();
         Image i = new ProductItemToImage().apply(item);
         OperatingSystem os = i.getOperatingSystem();
View Full Code Here

      }
   }

   @Test
   public void testUbuntu() {
         ProductItem item = ProductItem.builder()
                                       .description("Ubuntu Linux 10.04 LTS Lucid Lynx - Minimal Install (64 bit)")
                                       .prices(ProductItemPrice.builder().id(1234).build())
                                       .build();
         Image i = new ProductItemToImage().apply(item);
         OperatingSystem os = i.getOperatingSystem();
View Full Code Here

         assertTrue(os.is64Bit());
   }

   @Test
   public void testUbuntuNoBitCount() {
      ProductItem item = ProductItem.builder()
            .description("Ubuntu Linux 10.04 LTS Lucid Lynx - Minimal Install")
            .prices(ProductItemPrice.builder().id(1234).build())
            .build();
      Image i = new ProductItemToImage().apply(item);
      OperatingSystem os = i.getOperatingSystem();
View Full Code Here

   }


   @Test
   public void testCompletelyUnknown() {
      ProductItem item = ProductItem.builder()
            .description("This fails to match anything!!!")
            .prices(ProductItemPrice.builder().id(1234).build())
            .build();
      Image i = new ProductItemToImage().apply(item);
      OperatingSystem os = i.getOperatingSystem();
View Full Code Here

TOP

Related Classes of org.jclouds.softlayer.domain.ProductItem

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.