private void checkVirtualGuest(VirtualGuest vg) { if (vg.getActiveTransactionCount() == 0) { assertNotNull(vg.getDomain(), "domain must be not null"); assertNotNull(vg.getFullyQualifiedDomainName(), "fullyQualifiedDomainName must be not null"); assertNotNull(vg.getHostname(), "hostname must be not null"); assertTrue(vg.getId() > 0, "id must be greater than 0"); assertTrue(vg.getMaxCpu() > 0, "maxCpu must be greater than 0"); assertTrue(vg.getMaxMemory() > 0, "maxMemory must be greater than 0"); assertTrue(vg.getStatusId() > 0, "statusId must be greater than 0"); } }
private void checkVirtualGuest(VirtualGuest vg) { if (vg.getActiveTransactionCount() == 0) { assertNotNull(vg.getDomain(), "domain must be not null"); assertNotNull(vg.getFullyQualifiedDomainName(), "fullyQualifiedDomainName must be not null"); assertNotNull(vg.getHostname(), "hostname must be not null"); assertTrue(vg.getId() > 0, "id must be greater than 0"); assertTrue(vg.getMaxCpu() > 0, "maxCpu must be greater than 0"); assertNotNull(vg.getMaxCpuUnits(), "maxCpuUnits must be not null"); assertTrue(vg.getMaxMemory() > 0, "maxMemory must be greater than 0"); assertTrue(vg.getStartCpus() > 0, "startCpus must be greater than 0"); assertTrue(vg.getStatusId() > 0, "statusId must be greater than 0"); assertNotNull(vg.getUuid(), "uuid must be not null"); } }
@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); }
builder.ids(from.getId() + ""); builder.name(from.getHostname()); builder.hostname(from.getFullyQualifiedDomainName()); if (from.getDatacenter() != null) { builder.location(from(locations.get()).firstMatch(
builder.ids(from.getId() + ""); builder.name(from.getHostname()); builder.hostname(from.getFullyQualifiedDomainName()); if (from.getDatacenter() != null) { builder.location(from(locations.get()).firstMatch(
builder.ids(from.getId() + ""); builder.name(from.getHostname()); builder.hostname(from.getFullyQualifiedDomainName()); if (from.getDatacenter() != null) { builder.location(from(locations.get()).firstMatch(
private void checkVirtualGuest(VirtualGuest vg) { if (vg.getBillingItemId() == -1) return;// Quotes and shutting down guests assert vg.getAccountId() > 0 : vg; assert vg.getCreateDate() != null : vg; assert vg.getDomain() != null : vg; assert vg.getFullyQualifiedDomainName() != null : vg; assert vg.getHostname() != null : vg; assert vg.getId() > 0 : vg; assert vg.getMaxCpu() > 0 : vg; assert vg.getMaxCpuUnits() != null : vg; assert vg.getMaxMemory() > 0 : vg; assert vg.getMetricPollDate() != null : vg; assert vg.getModifyDate() != null : vg; assert vg.getStartCpus() > 0 : vg; assert vg.getStatusId() >= 0 : vg; assert vg.getUuid() != null : vg; assert vg.getPrimaryBackendIpAddress() != null : vg; assert vg.getPrimaryIpAddress() != null : vg; }
public T fromVirtualGuest(VirtualGuest in) { return this .accountId(in.getAccountId()) .createDate(in.getCreateDate()) .dedicatedAccountHostOnly(in.isDedicatedAccountHostOnly()) .domain(in.getDomain()) .fullyQualifiedDomainName(in.getFullyQualifiedDomainName()) .hostname(in.getHostname()) .id(in.getId()) .lastVerifiedDate(in.getLastVerifiedDate()) .maxCpu(in.getMaxCpu()) .maxCpuUnits(in.getMaxCpuUnits()) .maxMemory(in.getMaxMemory()) .metricPollDate(in.getMetricPollDate()) .modifyDate(in.getModifyDate()) .notes(in.getNotes()) .privateNetworkOnly(in.isPrivateNetworkOnly()) .startCpus(in.getStartCpus()) .statusId(in.getStatusId()) .uuid(in.getUuid()) .primaryBackendIpAddress(in.getPrimaryBackendIpAddress()) .primaryIpAddress(in.getPrimaryIpAddress()) .billingItemId(in.getBillingItemId()) .operatingSystem(in.getOperatingSystem()) .datacenter(in.getDatacenter()) .powerState(in.getPowerState()); } }
public T fromVirtualGuest(VirtualGuest in) { return this .accountId(in.getAccountId()) .createDate(in.getCreateDate()) .dedicatedAccountHostOnly(in.isDedicatedAccountHostOnly()) .domain(in.getDomain()) .fullyQualifiedDomainName(in.getFullyQualifiedDomainName()) .hostname(in.getHostname()) .id(in.getId()) .lastVerifiedDate(in.getLastVerifiedDate()) .maxCpu(in.getMaxCpu()) .maxCpuUnits(in.getMaxCpuUnits()) .maxMemory(in.getMaxMemory()) .metricPollDate(in.getMetricPollDate()) .modifyDate(in.getModifyDate()) .notes(in.getNotes()) .privateNetworkOnly(in.isPrivateNetworkOnly()) .startCpus(in.getStartCpus()) .statusId(in.getStatusId()) .uuid(in.getUuid()) .primaryBackendIpAddress(in.getPrimaryBackendIpAddress()) .primaryIpAddress(in.getPrimaryIpAddress()) .billingItemId(in.getBillingItemId()) .operatingSystem(in.getOperatingSystem()) .datacenter(in.getDatacenter()) .powerState(in.getPowerState()); } }
.dedicatedAccountHostOnly(in.isDedicatedAccountHostOnly()) .domain(in.getDomain()) .fullyQualifiedDomainName(in.getFullyQualifiedDomainName()) .hostname(in.getHostname()) .id(in.getId())
.dedicatedAccountHostOnly(in.isDedicatedAccountHostOnly()) .domain(in.getDomain()) .fullyQualifiedDomainName(in.getFullyQualifiedDomainName()) .hostname(in.getHostname()) .id(in.getId())
.dedicatedAccountHostOnly(in.isDedicatedAccountHostOnly()) .domain(in.getDomain()) .fullyQualifiedDomainName(in.getFullyQualifiedDomainName()) .hostname(in.getHostname()) .id(in.getId())
.dedicatedAccountHostOnly(in.isDedicatedAccountHostOnly()) .domain(in.getDomain()) .fullyQualifiedDomainName(in.getFullyQualifiedDomainName()) .hostname(in.getHostname()) .id(in.getId())