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

Examples of org.jclouds.joyent.cloudapi.v6_5.compute.functions.MachineInDatacenterToNodeMetadata.apply()


            "My Test OS", true);
      DatasetInDatacenterToImage converter = new DatasetInDatacenterToImage(constant(operatingSystem), locationIndex);

      DatasetInDatacenter datasetInZoneToConvert = new DatasetInDatacenter(datasetToConvert, "us-sw-1");

      org.jclouds.compute.domain.Image convertedImage = converter.apply(datasetInZoneToConvert);

      assertEquals(convertedImage.getId(), "us-sw-1/" + datasetToConvert.getUrn());
      assertEquals(convertedImage.getProviderId(), datasetToConvert.getUrn());
      assertEquals(convertedImage.getLocation(), locationIndex.get().get("us-sw-1"));
View Full Code Here


            "My Test OS", true);
      DatasetInDatacenterToImage converter = new DatasetInDatacenterToImage(constant(operatingSystem), locationIndex);

      DatasetInDatacenter datasetInZoneToConvert = new DatasetInDatacenter(datasetToConvert, "South");

      converter.apply(datasetInZoneToConvert);
   }

   @SuppressWarnings("unchecked")
   private static Function<Dataset, OperatingSystem> constant(OperatingSystem operatingSystem) {
      return Function.class.cast(Functions.constant(operatingSystem));
View Full Code Here

      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

      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

      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

      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

      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
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.