@Test public void getClusterName() { final Cluster g = new Cluster(); g.setName(NAME); b.setCluster(g); final String n = b.getClusterName(); assertEquals(NAME, n); }
public void setSelectedCluster(VDS host) { ArrayList<Cluster> clusters; if (getCluster().getItems() == null) { Cluster tempVar = new Cluster(); tempVar.setName(host.getClusterName()); tempVar.setId(host.getClusterId()); tempVar.setCompatibilityVersion(host.getClusterCompatibilityVersion()); getCluster() .setItems(new ArrayList<>(Arrays.asList(new Cluster[]{tempVar}))); } clusters = (ArrayList<Cluster>) getCluster().getItems(); updateModelClusterFromVds(clusters, host); if (getCluster().getSelectedItem() == null) { getCluster().setSelectedItem(Linq.firstOrNull(clusters)); } }
Cluster cluster = new Cluster(); cluster.setId(currentVm.getClusterId()); cluster.setName(currentVm.getClusterName()); cluster.setCompatibilityVersion(currentVm.getClusterCompatibilityVersion()); cluster.setStoragePoolId(currentVm.getStoragePoolId());
cluster.setName(clusterName); cluster.setDescription(clusterModel.getDescription().getEntity()); cluster.setStoragePoolId(enlistmentContext.getDataCenterId());
/** * Ensures that updating a group works as expected. */ @Test public void testUpdate() { String oldName = existingCluster.getName(); existingCluster.setName("This is the new name"); existingCluster.setVirtService(false); existingCluster.setGlusterService(true); existingCluster.setMigrationBandwidthLimitType(MigrationBandwidthLimitType.CUSTOM); existingCluster.setCustomMigrationNetworkBandwidth(20); dao.update(existingCluster); Cluster result = dao.get(existingCluster.getId()); assertCorrectCluster(result); result = dao.getByName(oldName); assertNull(result); }
@BeforeEach @Override public void setUp() throws Exception { super.setUp(); existingCluster = dao.get(FixturesTool.CLUSTER_RHEL6_ISCSI); groupWithNoRunningVms = dao.get(FixturesTool.CLUSTER_NO_RUNNING_VMS); newGroup = new Cluster(); newGroup.setName("New VDS Group"); newGroup.setCompatibilityVersion(Version.getLast()); newGroup.setVirtService(true); newGroup.setGlusterService(false); newGroup.setClusterPolicyId(existingCluster.getClusterPolicyId()); // set cluster policy name to allow equals method to succeed newGroup.setClusterPolicyName(clusterPolicyDao.get(existingCluster.getClusterPolicyId(), Collections.emptyMap()).getName()); newGroup.setClusterPolicyProperties(new LinkedHashMap<>()); newGroup.setDetectEmulatedMachine(true); newGroup.setEmulatedMachine("rhel6.4.0"); newGroup.setArchitecture(ArchitectureType.x86_64); newGroup.setGlusterCliBasedSchedulingOn(true); newGroup.setMigrationBandwidthLimitType(MigrationBandwidthLimitType.CUSTOM); newGroup.setCustomMigrationNetworkBandwidth(1000); newGroup.setMigrationPolicyId(Guid.newGuid()); newGroup.setMacPoolId(FixturesTool.DEFAULT_MAC_POOL_ID); newGroup.setFirewallType(FirewallType.FIREWALLD); newGroup.setLogMaxMemoryUsedThreshold(95); newGroup.setLogMaxMemoryUsedThresholdType(LogMaxMemoryUsedThresholdType.PERCENTAGE); newGroup.setVncEncryptionEnabled(true); }
@BeforeEach @Override public void setUp() { Cluster cluster = new Cluster(); cluster.setName("test-cluster"); cluster.setId(Guid.newGuid()); cluster.setCompatibilityVersion(Version.v4_3); cluster.setArchitecture(ArchitectureType.x86); cluster.setMacPoolId(FixturesTool.DEFAULT_MAC_POOL_ID); cluster.setFirewallType(FirewallType.IPTABLES); cluster.setLogMaxMemoryUsedThreshold(95); cluster.setLogMaxMemoryUsedThresholdType(LogMaxMemoryUsedThresholdType.PERCENTAGE); clusterDao.save(cluster); host = new VdsStatic(); host.setId(Guid.newGuid()); host.setName("test-host"); host.setHostName("host-ip"); host.setClusterId(cluster.getId()); vdsDao.save(host); }
private static Cluster cloneCluster(Cluster instance) { Cluster obj = new Cluster(); obj.setId(instance.getId()); obj.setName(instance.getName()); obj.setDescription(instance.getDescription()); obj.setComment(instance.getComment()); obj.setCpuName(instance.getCpuName()); obj.setClusterCompatibilityLevelUpgradeNeeded(instance.isClusterCompatibilityLevelUpgradeNeeded()); obj.setCompatibilityVersion(instance.getCompatibilityVersion()); obj.setMigrateOnError(instance.getMigrateOnError()); obj.setTransparentHugepages(instance.getTransparentHugepages()); obj.setStoragePoolId(instance.getStoragePoolId()); obj.setMaxVdsMemoryOverCommit(instance.getMaxVdsMemoryOverCommit()); obj.setCountThreadsAsCores(instance.getCountThreadsAsCores()); obj.setEmulatedMachine(instance.getEmulatedMachine()); obj.setDetectEmulatedMachine(instance.isDetectEmulatedMachine()); obj.setArchitecture(instance.getArchitecture()); obj.setSerialNumberPolicy(instance.getSerialNumberPolicy()); obj.setCustomSerialNumber(instance.getCustomSerialNumber()); obj.setFencingPolicy(new FencingPolicy(instance.getFencingPolicy())); obj.setAutoConverge(instance.getAutoConverge()); obj.setMigrateCompressed(instance.getMigrateCompressed()); return obj; }
cluster.setName(model.getName().getEntity()); cluster.setDescription(model.getDescription().getEntity()); cluster.setComment(model.getComment().getEntity());
entity.setName(model.getName());