@Test public void testCreateEmrClusterWithSecurityGroups() throws Exception { // Create the namespace entity. NamespaceEntity namespaceEntity = namespaceDaoTestHelper.createNamespaceEntity(NAMESPACE); // Retrieve the EMR cluster definition. String configXml = IOUtils.toString(resourceLoader.getResource(EMR_CLUSTER_DEFINITION_XML_FILE_WITH_CLASSPATH).getInputStream()); EmrClusterDefinition emrClusterDefinition = xmlHelper.unmarshallXmlToObject(EmrClusterDefinition.class, configXml); // Update the EMR cluster definition to use instance fleets instead of instance group definitions. emrClusterDefinition.setMasterSecurityGroup(EMR_MASTER_SECURITY_GROUP); emrClusterDefinition.setSlaveSecurityGroup(EMR_SLAVE_SECURITY_GROUP); // Create an entity for the the updated EMR cluster definition. configXml = xmlHelper.objectToXml(emrClusterDefinition); emrClusterDefinitionDaoTestHelper.createEmrClusterDefinitionEntity(namespaceEntity, EMR_CLUSTER_DEFINITION_NAME, configXml); // Create a new EMR cluster create request. EmrClusterCreateRequest request = getNewEmrClusterCreateRequest(); EmrCluster emrCluster = emrService.createCluster(request); // Validate the returned object against the input. assertNotNull(emrCluster); assertTrue(emrCluster.getNamespace().equals(request.getNamespace())); assertTrue(emrCluster.getEmrClusterDefinition().getMasterSecurityGroup().equals(EMR_MASTER_SECURITY_GROUP)); assertTrue(emrCluster.getEmrClusterDefinition().getSlaveSecurityGroup().equals(EMR_SLAVE_SECURITY_GROUP)); }
jobFlowInstancesConfig.setEmrManagedMasterSecurityGroup(emrClusterDefinition.getMasterSecurityGroup()); jobFlowInstancesConfig.setEmrManagedSlaveSecurityGroup(emrClusterDefinition.getSlaveSecurityGroup());
jobFlowInstancesConfig.setEmrManagedMasterSecurityGroup(emrClusterDefinition.getMasterSecurityGroup()); jobFlowInstancesConfig.setEmrManagedSlaveSecurityGroup(emrClusterDefinition.getSlaveSecurityGroup());
if (emrClusterDefinitionOverride.getMasterSecurityGroup() != null) emrClusterDefinition.setMasterSecurityGroup(emrClusterDefinitionOverride.getMasterSecurityGroup());
if (emrClusterDefinitionOverride.getMasterSecurityGroup() != null) emrClusterDefinition.setMasterSecurityGroup(emrClusterDefinitionOverride.getMasterSecurityGroup());
lhsMasterSecurityGroup = this.getMasterSecurityGroup(); String rhsMasterSecurityGroup; rhsMasterSecurityGroup = that.getMasterSecurityGroup(); if (!strategy.equals(LocatorUtils.property(thisLocator, "masterSecurityGroup", lhsMasterSecurityGroup), LocatorUtils.property(thatLocator, "masterSecurityGroup", rhsMasterSecurityGroup), lhsMasterSecurityGroup, rhsMasterSecurityGroup, (this.masterSecurityGroup!= null), (that.masterSecurityGroup!= null))) { return false;
lhsMasterSecurityGroup = this.getMasterSecurityGroup(); String rhsMasterSecurityGroup; rhsMasterSecurityGroup = that.getMasterSecurityGroup(); if (!strategy.equals(LocatorUtils.property(thisLocator, "masterSecurityGroup", lhsMasterSecurityGroup), LocatorUtils.property(thatLocator, "masterSecurityGroup", rhsMasterSecurityGroup), lhsMasterSecurityGroup, rhsMasterSecurityGroup, (this.masterSecurityGroup!= null), (that.masterSecurityGroup!= null))) { return false;
lhsMasterSecurityGroup = this.getMasterSecurityGroup(); String rhsMasterSecurityGroup; rhsMasterSecurityGroup = that.getMasterSecurityGroup(); if (!strategy.equals(LocatorUtils.property(thisLocator, "masterSecurityGroup", lhsMasterSecurityGroup), LocatorUtils.property(thatLocator, "masterSecurityGroup", rhsMasterSecurityGroup), lhsMasterSecurityGroup, rhsMasterSecurityGroup, (this.masterSecurityGroup!= null), (that.masterSecurityGroup!= null))) { return false;
theMasterSecurityGroup = this.getMasterSecurityGroup(); strategy.appendField(locator, this, "masterSecurityGroup", buffer, theMasterSecurityGroup, (this.masterSecurityGroup!= null));
theMasterSecurityGroup = this.getMasterSecurityGroup(); strategy.appendField(locator, this, "masterSecurityGroup", buffer, theMasterSecurityGroup, (this.masterSecurityGroup!= null));
theMasterSecurityGroup = this.getMasterSecurityGroup(); strategy.appendField(locator, this, "masterSecurityGroup", buffer, theMasterSecurityGroup, (this.masterSecurityGroup!= null));
theMasterSecurityGroup = this.getMasterSecurityGroup(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "masterSecurityGroup", theMasterSecurityGroup), currentHashCode, theMasterSecurityGroup, (this.masterSecurityGroup!= null));
theMasterSecurityGroup = this.getMasterSecurityGroup(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "masterSecurityGroup", theMasterSecurityGroup), currentHashCode, theMasterSecurityGroup, (this.masterSecurityGroup!= null));
theMasterSecurityGroup = this.getMasterSecurityGroup(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "masterSecurityGroup", theMasterSecurityGroup), currentHashCode, theMasterSecurityGroup, (this.masterSecurityGroup!= null));
if (masterSecurityGroupShouldBeCopiedAndSet == Boolean.TRUE) { String sourceMasterSecurityGroup; sourceMasterSecurityGroup = this.getMasterSecurityGroup(); String copyMasterSecurityGroup = ((String) strategy.copy(LocatorUtils.property(locator, "masterSecurityGroup", sourceMasterSecurityGroup), sourceMasterSecurityGroup, (this.masterSecurityGroup!= null))); copy.setMasterSecurityGroup(copyMasterSecurityGroup);
if (masterSecurityGroupShouldBeCopiedAndSet == Boolean.TRUE) { String sourceMasterSecurityGroup; sourceMasterSecurityGroup = this.getMasterSecurityGroup(); String copyMasterSecurityGroup = ((String) strategy.copy(LocatorUtils.property(locator, "masterSecurityGroup", sourceMasterSecurityGroup), sourceMasterSecurityGroup, (this.masterSecurityGroup!= null))); copy.setMasterSecurityGroup(copyMasterSecurityGroup);
if (masterSecurityGroupShouldBeCopiedAndSet == Boolean.TRUE) { String sourceMasterSecurityGroup; sourceMasterSecurityGroup = this.getMasterSecurityGroup(); String copyMasterSecurityGroup = ((String) strategy.copy(LocatorUtils.property(locator, "masterSecurityGroup", sourceMasterSecurityGroup), sourceMasterSecurityGroup, (this.masterSecurityGroup!= null))); copy.setMasterSecurityGroup(copyMasterSecurityGroup);