Package org.jclouds.digitalocean.domain

Examples of org.jclouds.digitalocean.domain.Image


      DigitalOceanApi api = api(server.getUrl("/"));
      ImageApi imageApi = api.getImageApi();

      try {
         Image image = imageApi.get(1);

         assertRequestHasCommonFields(server.takeRequest(), "/images/1");
         assertNotNull(image);
         assertEquals(image.getId(), 1);
         assertEquals(image.getOs().getDistribution(), Distribution.ARCHLINUX);
         assertEquals(image.getOs().getVersion(), "2013.05");
         assertEquals(image.getOs().getArch(), "x32");
         assertEquals(image.getName(), "Arch Linux 2013.05 x32");
         assertTrue(image.isPublicImage());

         image = imageApi.get(2);

         assertRequestHasCommonFields(server.takeRequest(), "/images/2");
         assertNotNull(image);
         assertEquals(image.getId(), 2);
         assertEquals(image.getOs().getDistribution(), Distribution.FEDORA);
         assertEquals(image.getOs().getVersion(), "17");
         assertEquals(image.getOs().getArch(), "x64");
         assertEquals(image.getName(), "Fedora 17 x64 Desktop");
         assertTrue(image.isPublicImage());

         image = imageApi.get(3);

         assertRequestHasCommonFields(server.takeRequest(), "/images/3");
         assertNotNull(image);
         assertEquals(image.getId(), 3);
         assertEquals(image.getOs().getDistribution(), Distribution.UBUNTU);
         assertEquals(image.getOs().getVersion(), "13.04");
         assertEquals(image.getOs().getArch(), "");
         assertEquals(image.getName(), "Dokku on Ubuntu 13.04 0.2.0rc3");
         assertTrue(image.isPublicImage());
      } finally {
         api.close();
         server.shutdown();
      }
   }
View Full Code Here


      DigitalOceanApi api = api(server.getUrl("/"));
      ImageApi imageApi = api.getImageApi();

      try {
         Image image = imageApi.get(15);

         assertRequestHasCommonFields(server.takeRequest(), "/images/15");
         assertNull(image);
      } finally {
         api.close();
View Full Code Here

@Test(groups = "unit", testName = "ImageToImageTest")
public class ImageToImageTest {

   @Test
   public void testConvertImage() {
      Image image = new Image(1, "Ubuntu 14.04 x64", "Ubuntu 14.04 x64", true, "ubuntu-1404-x86");
      org.jclouds.compute.domain.Image expected = new ImageBuilder()
            .id("ubuntu-1404-x86")
            .providerId("1")
            .name("Ubuntu 14.04 x64")
            .status(AVAILABLE)
View Full Code Here

      DigitalOceanApi api = api(server.getUrl("/"));
      ImageApi imageApi = api.getImageApi();

      try {
         Image image = imageApi.get(1);

         assertRequestHasCommonFields(server.takeRequest(), "/images/1");
         assertNotNull(image);
         assertEquals(image.getId(), 1);
         assertEquals(image.getOs().getDistribution(), Distribution.ARCHLINUX);
         assertEquals(image.getOs().getVersion(), "2013.05");
         assertEquals(image.getOs().getArch(), "x32");
         assertEquals(image.getName(), "Arch Linux 2013.05 x32");
         assertTrue(image.isPublicImage());
         assertEquals(image.getSlug(), "arch-linux-x32");

         image = imageApi.get(2);

         assertRequestHasCommonFields(server.takeRequest(), "/images/2");
         assertNotNull(image);
         assertEquals(image.getId(), 2);
         assertEquals(image.getOs().getDistribution(), Distribution.FEDORA);
         assertEquals(image.getOs().getVersion(), "17");
         assertEquals(image.getOs().getArch(), "x64");
         assertEquals(image.getName(), "Fedora 17 x64 Desktop");
         assertTrue(image.isPublicImage());
         assertEquals(image.getSlug(), "fedora-17-x64");

         image = imageApi.get(3);

         assertRequestHasCommonFields(server.takeRequest(), "/images/3");
         assertNotNull(image);
         assertNull(image.getSlug());
         assertEquals(image.getId(), 3);
         assertEquals(image.getOs().getDistribution(), Distribution.UBUNTU);
         assertEquals(image.getOs().getVersion(), "13.04");
         assertEquals(image.getOs().getArch(), "");
         assertEquals(image.getName(), "Dokku on Ubuntu 13.04 0.2.0rc3");
         assertTrue(image.isPublicImage());
         assertNull(image.getSlug());

         image = imageApi.get("fedora-17-x64");

         assertRequestHasCommonFields(server.takeRequest(), "/images/fedora-17-x64");
         assertNotNull(image);
         assertEquals(image.getId(), 2);
         assertEquals(image.getOs().getDistribution(), Distribution.FEDORA);
         assertEquals(image.getOs().getVersion(), "17");
         assertEquals(image.getOs().getArch(), "x64");
         assertEquals(image.getName(), "Fedora 17 x64 Desktop");
         assertTrue(image.isPublicImage());
         assertEquals(image.getSlug(), "fedora-17-x64");
      } finally {
         api.close();
         server.shutdown();
      }
   }
View Full Code Here

      DigitalOceanApi api = api(server.getUrl("/"));
      ImageApi imageApi = api.getImageApi();

      try {
         Image image = imageApi.get(15);

         assertRequestHasCommonFields(server.takeRequest(), "/images/15");
         assertNull(image);
      } finally {
         api.close();
View Full Code Here

@Test(groups = "unit", testName = "ImageToImageTest")
public class ImageToImageTest {

   @Test
   public void testConvertImage() {
      Image image = new Image(1, "Ubuntu 14.04 x64", "Ubuntu 14.04 x64", true, "ubuntu-1404-x86");
      org.jclouds.compute.domain.Image expected = new ImageBuilder()
            .id("ubuntu-1404-x86")
            .providerId("1")
            .name("Ubuntu 14.04 x64")
            .status(AVAILABLE)
View Full Code Here

      DigitalOceanApi api = api(server.getUrl("/"));
      ImageApi imageApi = api.getImageApi();

      try {
         Image image = imageApi.get(1);

         assertRequestHasCommonFields(server.takeRequest(), "/images/1");
         assertNotNull(image);
         assertEquals(image.getId(), 1);
         assertEquals(image.getOs().getDistribution(), Distribution.ARCHLINUX);
         assertEquals(image.getOs().getVersion(), "2013.05");
         assertEquals(image.getOs().getArch(), "x32");
         assertEquals(image.getName(), "Arch Linux 2013.05 x32");
         assertTrue(image.isPublicImage());
         assertEquals(image.getSlug(), "arch-linux-x32");

         image = imageApi.get(2);

         assertRequestHasCommonFields(server.takeRequest(), "/images/2");
         assertNotNull(image);
         assertEquals(image.getId(), 2);
         assertEquals(image.getOs().getDistribution(), Distribution.FEDORA);
         assertEquals(image.getOs().getVersion(), "17");
         assertEquals(image.getOs().getArch(), "x64");
         assertEquals(image.getName(), "Fedora 17 x64 Desktop");
         assertTrue(image.isPublicImage());
         assertEquals(image.getSlug(), "fedora-17-x64");

         image = imageApi.get(3);

         assertRequestHasCommonFields(server.takeRequest(), "/images/3");
         assertNotNull(image);
         assertNull(image.getSlug());
         assertEquals(image.getId(), 3);
         assertEquals(image.getOs().getDistribution(), Distribution.UBUNTU);
         assertEquals(image.getOs().getVersion(), "13.04");
         assertEquals(image.getOs().getArch(), "");
         assertEquals(image.getName(), "Dokku on Ubuntu 13.04 0.2.0rc3");
         assertTrue(image.isPublicImage());
         assertNull(image.getSlug());

         image = imageApi.get("fedora-17-x64");

         assertRequestHasCommonFields(server.takeRequest(), "/images/fedora-17-x64");
         assertNotNull(image);
         assertEquals(image.getId(), 2);
         assertEquals(image.getOs().getDistribution(), Distribution.FEDORA);
         assertEquals(image.getOs().getVersion(), "17");
         assertEquals(image.getOs().getArch(), "x64");
         assertEquals(image.getName(), "Fedora 17 x64 Desktop");
         assertTrue(image.isPublicImage());
         assertEquals(image.getSlug(), "fedora-17-x64");
      } finally {
         api.close();
         server.shutdown();
      }
   }
View Full Code Here

      DigitalOceanApi api = api(server.getUrl("/"));
      ImageApi imageApi = api.getImageApi();

      try {
         Image image = imageApi.get(15);

         assertRequestHasCommonFields(server.takeRequest(), "/images/15");
         assertNull(image);
      } finally {
         api.close();
View Full Code Here

TOP

Related Classes of org.jclouds.digitalocean.domain.Image

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.