Examples of osNameMatches()


Examples of org.jclouds.compute.domain.TemplateBuilder.osNameMatches()

      TemplateBuilder templateBuilder = templateBuilderProvider.get();

      try {
         // First call searching for the image properties will fail, as the image is not in the cache
         templateBuilder.osNameMatches(image.getOperatingSystem().getName()).build();
         fail("Image should not exist in the cache");
      } catch (Exception ex) {
         // Expected path
      }
View Full Code Here

Examples of org.jclouds.compute.domain.TemplateBuilder.osNameMatches()

      // A second call using the imageId will fallback to the GetImageStrategy and populate the image in the cache.
      assertNotNull(templateBuilder.imageId(image.getId()).build());

      // The third call will succeed, as the previous one should have populated the image in the cache.
      templateBuilder.imageId(null); // Clear all criteria
      Template template = templateBuilder.osNameMatches(image.getOperatingSystem().getName()).build();
      assertEquals(template.getImage().getId(), image.getId());

      // Verify this is called only once, as the third call will already find the image in the cache
      verify(getImageStrategy);
   }
View Full Code Here

Examples of org.jclouds.compute.domain.TemplateBuilder.osNameMatches()

      TemplateBuilder templateBuilder = templateBuilderProvider.get();

      try {
         // First call searching for the image properties will fail, as the image is not in the cache
         templateBuilder.osNameMatches(image.getOperatingSystem().getName()).build();
         fail("Image should not exist in the cache");
      } catch (Exception ex) {
         // Expected path
      }
View Full Code Here

Examples of org.jclouds.compute.domain.TemplateBuilder.osNameMatches()

      // A second call using the imageId will fallback to the GetImageStrategy and populate the image in the cache.
      assertNotNull(templateBuilder.imageId(image.getId()).build());

      // The third call will succeed, as the previous one should have populated the image in the cache.
      templateBuilder.imageId(null); // Clear all criteria
      Template template = templateBuilder.osNameMatches(image.getOperatingSystem().getName()).build();
      assertEquals(template.getImage().getId(), image.getId());

      // Verify this is called only once, as the third call will already find the image in the cache
      verify(getImageStrategy);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.