Package org.jclouds.compute.domain

Examples of org.jclouds.compute.domain.OperatingSystem$Builder


      ImageBuilder builder = new ImageBuilder().id("1").operatingSystem(osBuilder.build()).status(
               org.jclouds.compute.domain.Image.Status.AVAILABLE).description("test");
        OsFamily family = OsFamily.WINDOWS;

        rpi.reviseParsedImage(from, builder, family, osBuilder);
        OperatingSystem os = osBuilder.build();
        assertEquals(os.getFamily(), OsFamily.WINDOWS);
        assertEquals(os.getVersion(), "2008");
        assertEquals(builder.build().getVersion(), "2012.03.13");
    }
View Full Code Here


        ImageBuilder builder = new ImageBuilder().id("1").operatingSystem(osBuilder.build()).status(
                 org.jclouds.compute.domain.Image.Status.AVAILABLE).description("test");
        OsFamily family = OsFamily.WINDOWS;

        rpi.reviseParsedImage(from, builder, family, osBuilder);
        OperatingSystem os = osBuilder.build();
        assertEquals(os.getFamily(), OsFamily.WINDOWS);
        assertEquals(os.getVersion(), "2008");
        assertEquals(builder.build().getVersion(), "2012.01.12");
    }
View Full Code Here

      Provider<TemplateOptions> optionsProvider = createMock(Provider.class);
      Provider<TemplateBuilder> templateBuilderProvider = createMock(Provider.class);
      TemplateOptions defaultOptions = createMock(TemplateOptions.class);
      Image knownImage = createMock(Image.class);
      OperatingSystem os = createMock(OperatingSystem.class);

      expect(optionsProvider.get()).andReturn(defaultOptions);

      expect(knownImage.getId()).andReturn("us-east-1/ami").atLeastOnce();
      expect(knownImage.getLocation()).andReturn(region).atLeastOnce();
      expect(knownImage.getName()).andReturn(null).atLeastOnce();
      expect(knownImage.getDescription()).andReturn(null).atLeastOnce();
      expect(knownImage.getVersion()).andReturn(null).atLeastOnce();
      expect(knownImage.getProviderId()).andReturn("ami").atLeastOnce();

      expect(knownImage.getOperatingSystem()).andReturn(os).atLeastOnce();

      expect(os.getName()).andReturn(null).atLeastOnce();
      expect(os.getVersion()).andReturn(null).atLeastOnce();
      expect(os.getFamily()).andReturn(null).atLeastOnce();
      expect(os.getDescription()).andReturn(null).atLeastOnce();
      expect(os.getArch()).andReturn("paravirtual").atLeastOnce();
      expect(os.is64Bit()).andReturn(false).atLeastOnce();

      replay(knownImage);
      replay(os);
      replay(defaultOptions);
      replay(optionsProvider);
View Full Code Here

      builder.ids(from.getId());
      builder.name(from.getName());
      builder.description(from.getDescription());
      // in fgcp, if the image is listed it is available
      builder.status(Status.AVAILABLE);
      OperatingSystem os = diskImageToOperatingSystem.apply(from);
      builder.operatingSystem(os);
      String user = os.getFamily() == OsFamily.WINDOWS ? "Administrator" : "root";
      builder.defaultCredentials(LoginCredentials.builder().identity(user).noPassword().build());
      return builder.build();
   }
View Full Code Here

         builder.registrant("registrant");
         builder.description("description");
         builder.id("ABCDEFGH");
         DiskImage image = builder.build();

         OperatingSystem os = new DiskImageToOperatingSystem().apply(image);

         assertNotNull(os, description);
         assertNotNull(os.getFamily(), description);
         assertNotEquals(OsFamily.UNRECOGNIZED, os.getFamily(),
               "OsFamily not recognised: " + description);
         assertNotNull(os.getVersion(), "Version not recognised: "
               + description);
         assertEquals(os.getName(), description);
         assertEquals(os.getDescription(), description);
         assertNotNull(os.getArch(), description);
      }
   }
View Full Code Here

   @Test
   public void testOsFamilyUnrecognized() {
      DiskImage image = DiskImage.builder()
            .osName("not a known operating system").build();

      OperatingSystem os = new DiskImageToOperatingSystem().apply(image);

      assertNotNull(os);
      assertEquals(os.getFamily(), OsFamily.UNRECOGNIZED);
   }
View Full Code Here

   @Test
   public void test64BitsWithSpace() {
      DiskImage image = DiskImage.builder().osName("a (64 bit) os").build();

      OperatingSystem os = new DiskImageToOperatingSystem().apply(image);

      assertNotNull(os);
      assertTrue(os.is64Bit());
   }
View Full Code Here

   @Test
   public void test64BitsNoSpace() {
      DiskImage image = DiskImage.builder().osName("a (64bit) os").build();

      OperatingSystem os = new DiskImageToOperatingSystem().apply(image);

      assertNotNull(os);
      assertTrue(os.is64Bit());
   }
View Full Code Here

   @Test
   public void test32BitsNoSpace() {
      DiskImage image = DiskImage.builder().osName("a (32bit) os").build();

      OperatingSystem os = new DiskImageToOperatingSystem().apply(image);

      assertNotNull(os);
      assertFalse(os.is64Bit());
   }
View Full Code Here

   @Test
   public void testx64NoSpace() {
      DiskImage image = DiskImage.builder().osName("a (x64) os").build();

      OperatingSystem os = new DiskImageToOperatingSystem().apply(image);

      assertNotNull(os);
      assertTrue(os.is64Bit());
   }
View Full Code Here

TOP

Related Classes of org.jclouds.compute.domain.OperatingSystem$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.