Package org.jclouds.joyent.cloudapi.v6_5.compute.functions

Examples of org.jclouds.joyent.cloudapi.v6_5.compute.functions.MachineInDatacenterToNodeMetadata


   }

   public void testGetDatacentersWhenResponseIs404() {
      HttpResponse getDatacentersResponse = HttpResponse.builder().statusCode(404).build();

      JoyentCloudApi getDatacentersWhenNone = requestSendsResponse(getDatacenters, getDatacentersResponse);

      assertEquals(getDatacentersWhenNone.getDatacenterApi().getDatacenters(), ImmutableMap.of());
   }
View Full Code Here


      return createInjector(fn, module, props).getInstance(ComputeServiceContext.class);
   }
  
   @Override
   protected ApiMetadata createApiMetadata() {
      return new JoyentCloudApiMetadata();
   }
View Full Code Here

*/
@Test(groups = "unit", testName = "JoyentCloudProviderMetadataTest")
public class JoyentCloudProviderMetadataTest extends BaseProviderMetadataTest {

   public JoyentCloudProviderMetadataTest() {
      super(new JoyentCloudProviderMetadata(), new JoyentCloudApiMetadata());
   }
View Full Code Here

   public static class Builder extends BaseProviderMetadata.Builder {

      protected Builder() {
         id("joyentcloud")
         .name("JoyentCloud")
         .apiMetadata(new JoyentCloudApiMetadata())
         .homepage(URI.create("http://www.joyent.com/products/smartdatacenter/"))
         .console(URI.create("https://my.joyentcloud.com/login"))
         .iso3166Codes("US-VA", "US-CA", "US-NV", "NL-NH")
         .endpoint("https://api.joyentcloud.com")
         .defaultProperties(JoyentCloudProviderMetadata.defaultProperties());
View Full Code Here

@Test(groups = "unit", testName = "JoyentCloudProviderMetadataTest")
public class JoyentCloudProviderMetadataTest extends BaseProviderMetadataTest {

   public JoyentCloudProviderMetadataTest() {
      super(new JoyentCloudProviderMetadata(), new JoyentCloudApiMetadata());
   }
View Full Code Here

   public static class Builder extends BaseProviderMetadata.Builder {

      protected Builder() {
         id("joyentcloud")
         .name("JoyentCloud")
         .apiMetadata(new JoyentCloudApiMetadata())
         .homepage(URI.create("http://www.joyent.com/products/smartdatacenter/"))
         .console(URI.create("https://my.joyentcloud.com/login"))
         .iso3166Codes("US-VA", "US-CA", "US-NV", "NL-NH")
         .endpoint("https://api.joyentcloud.com")
         .defaultProperties(JoyentCloudProviderMetadata.defaultProperties());
View Full Code Here

      return createInjector(fn, module, props).getInstance(ComputeServiceContext.class);
   }
  
   @Override
   protected ApiMetadata createApiMetadata() {
      return new JoyentCloudApiMetadata();
   }
View Full Code Here

            .of(existingHardware);
      Machine machineToConvert = new ParseCreatedMachineTest().expected();

      MachineInDatacenter machineInDatacenterToConvert = new MachineInDatacenter(machineToConvert, "us-sw-1");

      MachineInDatacenterToNodeMetadata converter = new MachineInDatacenterToNodeMetadata(
            JoyentCloudComputeServiceContextModule.toPortableNodeStatus, locationIndex,
            Suppliers.<Set<? extends Image>> ofInstance(images),
            Suppliers.<Set<? extends Hardware>> ofInstance(hardwares), namingConvention);

      NodeMetadata convertedNodeMetadata = converter.apply(machineInDatacenterToConvert);

      assertEquals(machineInDatacenterToConvert.slashEncode(), convertedNodeMetadata.getId());
      assertEquals(machineToConvert.getId(), convertedNodeMetadata.getProviderId());

      assertEquals(convertedNodeMetadata.getLocation().getScope(), LocationScope.ZONE);
View Full Code Here

  
   @Test
   public void testWhenComputeServiceSaysAllNodesAreDeadBothGroupsAreReturned() {

     
      MachineInDatacenterToNodeMetadata converter = new MachineInDatacenterToNodeMetadata(
               JoyentCloudComputeServiceContextModule.toPortableNodeStatus, locationIndex, Suppliers
               .<Set<? extends Image>> ofInstance(ImmutableSet.<Image> of()), Suppliers
               .<Set<? extends Hardware>> ofInstance(ImmutableSet.<Hardware> of()), namingConvention);

      Set<? extends NodeMetadata> set = ImmutableSet.of(converter.apply(machine2), converter.apply(machine1));

      assertEquals(new OrphanedGroupsByDatacenterId(Predicates.<DatacenterAndName> alwaysTrue()).apply(set), ImmutableMultimap
               .<String, String> builder().putAll("us-east-1", "sample", "test").build());
   }
View Full Code Here

   public void testWhenComputeServiceSaysAllNodesAreDeadNoGroupsAreReturned() {

      MachineInDatacenter machine1 = new MachineInDatacenter(new ParseMachineTest().expected(), "us-east-1");
      MachineInDatacenter machine2 = new MachineInDatacenter(new ParseMachineTest().expected(), "us-east-1");

      MachineInDatacenterToNodeMetadata converter = new MachineInDatacenterToNodeMetadata(
               JoyentCloudComputeServiceContextModule.toPortableNodeStatus, locationIndex, Suppliers
                        .<Set<? extends Image>> ofInstance(ImmutableSet.<Image> of()), Suppliers
                        .<Set<? extends Hardware>> ofInstance(ImmutableSet.<Hardware> of()), namingConvention);

      Set<? extends NodeMetadata> set = ImmutableSet.of(converter.apply(machine2), converter.apply(machine1));

      assertEquals(new OrphanedGroupsByDatacenterId(Predicates.<DatacenterAndName> alwaysFalse()).apply(set), ImmutableMultimap
               .<String, String> of());

   }
View Full Code Here

TOP

Related Classes of org.jclouds.joyent.cloudapi.v6_5.compute.functions.MachineInDatacenterToNodeMetadata

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.