@Test public void testVirtualGuestToNodeMetadata() { VirtualGuest virtualGuest = createVirtualGuest(); NodeMetadata nodeMetadata = new VirtualGuestToNodeMetadata(locationSupplier, namingConvention, virtualGuestToImage, virtualGuestToHardware).apply(virtualGuest); assertNotNull(nodeMetadata); assertEquals(nodeMetadata.getName(), virtualGuest.getHostname()); assertNotNull(nodeMetadata.getLocation()); assertEquals(nodeMetadata.getLocation().getId(), location.getId()); assertEquals(nodeMetadata.getHostname(), virtualGuest.getFullyQualifiedDomainName()); assertEquals(nodeMetadata.getHardware().getRam(), virtualGuest.getMaxMemory()); assertTrue(nodeMetadata.getHardware().getProcessors().size() == 1); assertEquals(Iterables.get(nodeMetadata.getHardware().getProcessors(), 0).getCores(), (double) virtualGuest.getStartCpus()); assertEquals(nodeMetadata.getOperatingSystem().getFamily(), OsFamily.UBUNTU); assertEquals(nodeMetadata.getOperatingSystem().getVersion(), "12.04"); assertEquals(nodeMetadata.getOperatingSystem().is64Bit(), true); }
@Inject VirtualGuestToNodeMetadata(@Memoized Supplier<Set<? extends Location>> locations, GroupNamingConvention.Factory namingConvention, VirtualGuestToImage virtualGuestToImage, VirtualGuestToHardware virtualGuestToHardware) { this.nodeNamingConvention = checkNotNull(namingConvention, "namingConvention").createWithoutPrefix(); this.locations = checkNotNull(locations, "locations"); this.virtualGuestToImage = checkNotNull(virtualGuestToImage, "virtualGuestToImage"); this.virtualGuestToHardware = checkNotNull(virtualGuestToHardware, "virtualGuestToHardware"); }
VirtualGuestToNodeMetadata implements Function<VirtualGuest, NodeMetadata> { @Inject VirtualGuestToNodeMetadata(@Memoized Supplier<Set<? extends Location>> locations, GroupNamingConvention.Factory namingConvention, VirtualGuestToImage virtualGuestToImage, VirtualGuestToHardware virtualGuestToHardware) { this.nodeNamingConvention = checkNotNull(namingConvention, "namingConvention").createWithoutPrefix(); this.locations = checkNotNull(locations, "locations"); this.virtualGuestToImage = checkNotNull(virtualGuestToImage, "virtualGuestToImage"); this.virtualGuestToHardware = checkNotNull(virtualGuestToHardware, "virtualGuestToHardware"); } }
VirtualGuestToNodeMetadata implements Function<VirtualGuest, NodeMetadata> { @Inject VirtualGuestToNodeMetadata(@Memoized Supplier<Set<? extends Location>> locations, GroupNamingConvention.Factory namingConvention, VirtualGuestToImage virtualGuestToImage, VirtualGuestToHardware virtualGuestToHardware) { this.nodeNamingConvention = checkNotNull(namingConvention, "namingConvention").createWithoutPrefix(); this.locations = checkNotNull(locations, "locations"); this.virtualGuestToImage = checkNotNull(virtualGuestToImage, "virtualGuestToImage"); this.virtualGuestToHardware = checkNotNull(virtualGuestToHardware, "virtualGuestToHardware"); } @Inject  VirtualGuestToNodeMetadata(@Memoized Supplier<Set<? extends Location>> locations,
         GroupNamingConvention.Factory namingConvention, VirtualGuestToImage virtualGuestToImage,
         VirtualGuestToHardware virtualGuestToHardware); }
VirtualGuestToNodeMetadata implements Function<VirtualGuest, NodeMetadata> { @Inject VirtualGuestToNodeMetadata(@Memoized Supplier<Set<? extends Location>> locations, GroupNamingConvention.Factory namingConvention, VirtualGuestToImage virtualGuestToImage, VirtualGuestToHardware virtualGuestToHardware) { this.nodeNamingConvention = checkNotNull(namingConvention, "namingConvention").createWithoutPrefix(); this.locations = checkNotNull(locations, "locations"); this.virtualGuestToImage = checkNotNull(virtualGuestToImage, "virtualGuestToImage"); this.virtualGuestToHardware = checkNotNull(virtualGuestToHardware, "virtualGuestToHardware"); } @Inject  VirtualGuestToNodeMetadata(@Memoized Supplier<Set<? extends Location>> locations,
         GroupNamingConvention.Factory namingConvention, VirtualGuestToImage virtualGuestToImage,
         VirtualGuestToHardware virtualGuestToHardware); @Override NodeMetadata apply(VirtualGuest from); }
VirtualGuestToNodeMetadata implements Function<VirtualGuest, NodeMetadata> { @Inject VirtualGuestToNodeMetadata(@Memoized Supplier<Set<? extends Location>> locations, GroupNamingConvention.Factory namingConvention, VirtualGuestToImage virtualGuestToImage, VirtualGuestToHardware virtualGuestToHardware) { this.nodeNamingConvention = checkNotNull(namingConvention, "namingConvention").createWithoutPrefix(); this.locations = checkNotNull(locations, "locations"); this.virtualGuestToImage = checkNotNull(virtualGuestToImage, "virtualGuestToImage"); this.virtualGuestToHardware = checkNotNull(virtualGuestToHardware, "virtualGuestToHardware"); } @Inject  VirtualGuestToNodeMetadata(@Memoized Supplier<Set<? extends Location>> locations,
         GroupNamingConvention.Factory namingConvention, VirtualGuestToImage virtualGuestToImage,
         VirtualGuestToHardware virtualGuestToHardware); @Override NodeMetadata apply(VirtualGuest from); static final Map<VirtualGuest.State, Status> serverStateToNodeStatus; }