Package org.jclouds.softlayer.domain

Examples of org.jclouds.softlayer.domain.Datacenter


   @Test
   public void testDatacenterToLocation() {
      Address address = Address.builder().country("US").state("TX").description("This is Texas!").build();

      Datacenter datacenter = Datacenter.builder().id(1).longName("Texas Datacenter").locationAddress(address).build();

      Location location = function.apply(datacenter);

      assertEquals(location.getId(), Long.toString(datacenter.getId()));
      Set<String> iso3166Codes = location.getIso3166Codes();
      assertEquals(iso3166Codes.size(), 1);
      assertTrue(iso3166Codes.contains("US-TX"));
   }
View Full Code Here


      assertTrue(iso3166Codes.contains("US-TX"));
   }

   @Test
   public void testGetIso3166CodeNoCountryAndState() {
      Datacenter datacenter = Datacenter.builder().id(1).longName("Nowhere").build();

      Location location = function.apply(datacenter);

      assertEquals(location.getId(), Long.toString(datacenter.getId()));
      Set<String> iso3166Codes = location.getIso3166Codes();
      assertEquals(iso3166Codes.size(), 0);
   }
View Full Code Here

   @Test
   public void testGetIso3166CodeCountryOnly() {
      Address address = Address.builder().country("US").description("This is North America!").build();

      Datacenter datacenter = Datacenter.builder().id(1).longName("Nowhere").locationAddress(address).build();

      Location location = function.apply(datacenter);

      assertEquals(location.getId(), Long.toString(datacenter.getId()));
      Set<String> iso3166Codes = location.getIso3166Codes();
      assertEquals(iso3166Codes.size(), 1);
      assertTrue(iso3166Codes.contains("US"));
   }
View Full Code Here

   @Test
   public void testGetIso3166CodeWhitespaceTrimmer() {
      Address address = Address.builder().country(" US ").state("  TX  ").description("This is spaced out Texas")
            .build();

      Datacenter datacenter = Datacenter.builder().id(1).longName("Nowhere").locationAddress(address).build();

      Location location = function.apply(datacenter);

      assertEquals(location.getId(), Long.toString(datacenter.getId()));
      Set<String> iso3166Codes = location.getIso3166Codes();
      assertEquals(iso3166Codes.size(), 1);
      assertTrue(iso3166Codes.contains("US-TX"));
   }
View Full Code Here

   public void testListDatacenters() {
      Set<Datacenter> response = api().listDatacenters();
      assert null != response;
      assertTrue(response.size() >= 0);
      for (Datacenter vg : response) {
         Datacenter newDetails = api().getDatacenter(vg.getId());
         assertEquals(vg.getId(), newDetails.getId());
         checkDatacenter(newDetails);
      }
   }
View Full Code Here

   public void testListDatacenters() {
      Set<Datacenter> response = api().listDatacenters();
      assert null != response;
      assertTrue(response.size() >= 0);
      for (Datacenter vg : response) {
         Datacenter newDetails = api().getDatacenter(vg.getId());
         assertEquals(vg.getId(), newDetails.getId());
         checkDatacenter(newDetails);
      }
   }
View Full Code Here

   public void testListDatacenters() {
      Set<Datacenter> response = api().listDatacenters();
      assert null != response;
      assertTrue(response.size() >= 0);
      for (Datacenter vg : response) {
         Datacenter newDetails = api().getDatacenter(vg.getId());
         assertEquals(vg.getId(), newDetails.getId());
         checkDatacenter(newDetails);
      }
   }
View Full Code Here

      SoftLayerTemplateOptions templateOptions = template.getOptions().as(SoftLayerTemplateOptions.class);
      String domainName = templateOptions.getDomainName();
      String diskType = templateOptions.getDiskType().or(DEFAULT_DISK_TYPE);
      int portSpeed = templateOptions.getPortSpeed().or(DEFAULT_PORT_SPEED);

      final Datacenter datacenter = Datacenter.builder().name(template.getLocation().getId()).build();
      final String imageId = template.getImage().getId();
      int cores = (int) template.getHardware().getProcessors().get(0).getCores();

      VirtualGuest.Builder virtualGuestBuilder = VirtualGuest.builder()
              .domain(domainName)
View Full Code Here

   public void testListDatacenters() {
      Set<Datacenter> response = api().listDatacenters();
      assert null != response;
      assertTrue(response.size() >= 0);
      for (Datacenter vg : response) {
         Datacenter newDetails = api().getDatacenter(vg.getId());
         assertEquals(vg.getId(), newDetails.getId());
         checkDatacenter(newDetails);
      }
   }
View Full Code Here

   @Test
   public void testDatacenterToLocation() {
      Address address = Address.builder().country("US").state("TX").description("This is Texas!").build();

      Datacenter datacenter = Datacenter.builder().id(1).longName("Texas Datacenter").locationAddress(address).build();

      Location location = function.apply(datacenter);

      assertEquals(location.getId(), Long.toString(datacenter.getId()));
      Set<String> iso3166Codes = location.getIso3166Codes();
      assertEquals(iso3166Codes.size(), 1);
      assertTrue(iso3166Codes.contains("US-TX"));
   }
View Full Code Here

TOP

Related Classes of org.jclouds.softlayer.domain.Datacenter

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.