Package org.jclouds.softlayer.domain

Examples of org.jclouds.softlayer.domain.ProductItemPrice$Builder


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

   @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


      price().apply(noPriceItem);
   }
  
   @Test
   public void testItemCallGetsCategory() {
      ProductItemPrice price = ProductItemPrice.builder().id(1)
                                                         .categories(category)
                                                         .item(item)
                                                         .build();
      ProductItem newItem = item().apply(price);
      assertEquals(newItem.getCategories(), ImmutableSet.of(category));
View Full Code Here

   @Test
   public void testItemCallNoCategoryOnPrice() {

      ProductItem item1 = item.toBuilder().categories(ImmutableSet.of(category)).build();

      ProductItemPrice price = ProductItemPrice.builder().id(1)
                                                         .item(item1)
                                                         .build();
      ProductItem newItem = item().apply(price);
      assertEquals(newItem.getCategories(), ImmutableSet.of(category));
   }
View Full Code Here

            .categoryCode("new category")
            .build();

      ProductItem item1 = item.toBuilder().categories(ImmutableSet.of(category2)).build();

      ProductItemPrice price = ProductItemPrice.builder().id(1)
                                                         .categories(category)
                                                         .item(item1)
                                                         .build();
      ProductItem newItem = item().apply(price);
      assertEquals(newItem.getCategories(), ImmutableSet.of(category2));
View Full Code Here

   }

   @Test
   public void testCorrect() {

      ProductItemPrice price1 = ProductItemPrice.builder().id(100).build();
      ProductItemPrice price2 = ProductItemPrice.builder().id(101).build();

      VirtualGuest guest = VirtualGuest.builder().hostname("myhost")
                                                 .domain("mydomain")
                                                 .build();
View Full Code Here

   public static Function<ProductItem, String> imageId() {
      return new Function<ProductItem, String>() {
         @Override
         public String apply(ProductItem productItem) {
            checkNotNull(productItem, "productItem");
            ProductItemPrice price = ProductItems.price().apply(productItem);
            return "" + price.getId();
         }
      };
   }
View Full Code Here

   }

   @Test
   public void testCorrect() {

      ProductItemPrice price1 = ProductItemPrice.builder().id(100).build();
      ProductItemPrice price2 = ProductItemPrice.builder().id(101).build();

      VirtualGuest guest = VirtualGuest.builder().hostname("myhost")
                                                 .domain("mydomain")
                                                 .build();
View Full Code Here

            Predicates.and(categoryCode("ram"), capacity(1.0f)));

      // capacity is key in GB (1Gb = 1.0f)
      Map<Float, ProductItem> ramToProductItem = Maps.uniqueIndex(ramItems, ProductItems.capacity());

      ProductItemPrice price = ProductItems.price().apply(ramToProductItem.get(1.0f));
      assert Integer.valueOf(1644).equals(price.getId());
   }
View Full Code Here

            Predicates.and(units("PRIVATE_CORE"), capacity(2.0f)));

      // number of cores is the key
      Map<Float, ProductItem> coresToProductItem = Maps.uniqueIndex(cpuItems, ProductItems.capacity());

      ProductItemPrice price = ProductItems.price().apply(coresToProductItem.get(2.0f));
      assert Integer.valueOf(1963).equals(price.getId());
   }
View Full Code Here

      Iterable<ProductItem> operatingSystems = Iterables.filter(cloudServerProductPackage.getItems(),
            categoryCode("os"));

      Map<String, ProductItem> osToProductItem = Maps.uniqueIndex(operatingSystems, ProductItems.description());

      ProductItemPrice price = ProductItems.price().apply(
            osToProductItem.get("Ubuntu Linux 8 LTS Hardy Heron - Minimal Install (64 bit)"));
      assert Integer.valueOf(1693).equals(price.getId());
   }
View Full Code Here

TOP

Related Classes of org.jclouds.softlayer.domain.ProductItemPrice$Builder

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.