/** * 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); }
cluster.setGlusterService(model.getEnableGlusterService().getEntity()); for (AdditionalFeature feature : model.getAdditionalClusterFeatures().getSelectedItem()) { cluster.getAddtionalFeaturesSupported().add(new SupportedAdditionalClusterFeature(cluster.getId(),
entity.setGlusterService(model.isGlusterService());