Package org.jclouds.softlayer.domain

Examples of org.jclouds.softlayer.domain.ProductItem


   }


   @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


      assertFalse(os.is64Bit());
   }
  
   @Test
   public void test64BitUnknown() {
      ProductItem item = ProductItem.builder()
            .description("This only has the bit-count (64 bit)")
            .prices(ProductItemPrice.builder().id(1234).build())
            .build();
      Image i = new ProductItemToImage().apply(item);
      OperatingSystem os = i.getOperatingSystem();
View Full Code Here

      new ProductItemToImage().apply(null);
   }
  
   @Test(expectedExceptions = NullPointerException.class)
   public void testNoDescription() {
      ProductItem item = ProductItem.builder()
            .prices(ProductItemPrice.builder().id(1234).build())
            .build();
      new ProductItemToImage().apply(item);
   }
View Full Code Here

   }
  
   @Test
   public void testId() {
      ProductItemPrice price = ProductItemPrice.builder().id(1234).build();
      ProductItem item = ProductItem.builder().prices(price).build();
      assertEquals("1234",imageId().apply(item));
   }
View Full Code Here

   @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

       assertEquals(capacity().apply(item), 2.0f);
   }

   @Test
   public void testCapacityMissing() {
       ProductItem item = ProductItem.builder().id(1).build();
       assertNull(capacity().apply(item));
   }
View Full Code Here

       assertEquals(description().apply(item),"an item");
   }

   @Test
   public void testDescriptionMissing() {
       ProductItem item = ProductItem.builder().id(1).build();
       assertNull(description().apply(item));
   }
View Full Code Here

   }

   @Test
   public void testPriceMultiplePrices() {
       ImmutableSet<ProductItemPrice> prices = ImmutableSet.of(price, ProductItemPrice.builder().id(2).build());
       ProductItem item2 = ProductItem.builder().prices(prices).build();
       assertEquals(price().apply(item2),price);
   }
View Full Code Here

       assertEquals(price().apply(item2),price);
   }

   @Test(expectedExceptions = NoSuchElementException.class)
   public void testPriceMissing() {
      ProductItem noPriceItem = ProductItem.builder().id(1).build();
      price().apply(noPriceItem);
   }
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.