@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.setEmrManagedSlaveSecurityGroup(emrClusterDefinition.getSlaveSecurityGroup());
jobFlowInstancesConfig.setEmrManagedSlaveSecurityGroup(emrClusterDefinition.getSlaveSecurityGroup());
if (emrClusterDefinitionOverride.getSlaveSecurityGroup() != null) emrClusterDefinition.setSlaveSecurityGroup(emrClusterDefinitionOverride.getSlaveSecurityGroup());
if (emrClusterDefinitionOverride.getSlaveSecurityGroup() != null) emrClusterDefinition.setSlaveSecurityGroup(emrClusterDefinitionOverride.getSlaveSecurityGroup());
lhsSlaveSecurityGroup = this.getSlaveSecurityGroup(); String rhsSlaveSecurityGroup; rhsSlaveSecurityGroup = that.getSlaveSecurityGroup(); if (!strategy.equals(LocatorUtils.property(thisLocator, "slaveSecurityGroup", lhsSlaveSecurityGroup), LocatorUtils.property(thatLocator, "slaveSecurityGroup", rhsSlaveSecurityGroup), lhsSlaveSecurityGroup, rhsSlaveSecurityGroup, (this.slaveSecurityGroup!= null), (that.slaveSecurityGroup!= null))) { return false;
lhsSlaveSecurityGroup = this.getSlaveSecurityGroup(); String rhsSlaveSecurityGroup; rhsSlaveSecurityGroup = that.getSlaveSecurityGroup(); if (!strategy.equals(LocatorUtils.property(thisLocator, "slaveSecurityGroup", lhsSlaveSecurityGroup), LocatorUtils.property(thatLocator, "slaveSecurityGroup", rhsSlaveSecurityGroup), lhsSlaveSecurityGroup, rhsSlaveSecurityGroup, (this.slaveSecurityGroup!= null), (that.slaveSecurityGroup!= null))) { return false;
lhsSlaveSecurityGroup = this.getSlaveSecurityGroup(); String rhsSlaveSecurityGroup; rhsSlaveSecurityGroup = that.getSlaveSecurityGroup(); if (!strategy.equals(LocatorUtils.property(thisLocator, "slaveSecurityGroup", lhsSlaveSecurityGroup), LocatorUtils.property(thatLocator, "slaveSecurityGroup", rhsSlaveSecurityGroup), lhsSlaveSecurityGroup, rhsSlaveSecurityGroup, (this.slaveSecurityGroup!= null), (that.slaveSecurityGroup!= null))) { return false;
theSlaveSecurityGroup = this.getSlaveSecurityGroup(); strategy.appendField(locator, this, "slaveSecurityGroup", buffer, theSlaveSecurityGroup, (this.slaveSecurityGroup!= null));
theSlaveSecurityGroup = this.getSlaveSecurityGroup(); strategy.appendField(locator, this, "slaveSecurityGroup", buffer, theSlaveSecurityGroup, (this.slaveSecurityGroup!= null));
theSlaveSecurityGroup = this.getSlaveSecurityGroup(); strategy.appendField(locator, this, "slaveSecurityGroup", buffer, theSlaveSecurityGroup, (this.slaveSecurityGroup!= null));
theSlaveSecurityGroup = this.getSlaveSecurityGroup(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "slaveSecurityGroup", theSlaveSecurityGroup), currentHashCode, theSlaveSecurityGroup, (this.slaveSecurityGroup!= null));
theSlaveSecurityGroup = this.getSlaveSecurityGroup(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "slaveSecurityGroup", theSlaveSecurityGroup), currentHashCode, theSlaveSecurityGroup, (this.slaveSecurityGroup!= null));
theSlaveSecurityGroup = this.getSlaveSecurityGroup(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "slaveSecurityGroup", theSlaveSecurityGroup), currentHashCode, theSlaveSecurityGroup, (this.slaveSecurityGroup!= null));
if (slaveSecurityGroupShouldBeCopiedAndSet == Boolean.TRUE) { String sourceSlaveSecurityGroup; sourceSlaveSecurityGroup = this.getSlaveSecurityGroup(); String copySlaveSecurityGroup = ((String) strategy.copy(LocatorUtils.property(locator, "slaveSecurityGroup", sourceSlaveSecurityGroup), sourceSlaveSecurityGroup, (this.slaveSecurityGroup!= null))); copy.setSlaveSecurityGroup(copySlaveSecurityGroup);
if (slaveSecurityGroupShouldBeCopiedAndSet == Boolean.TRUE) { String sourceSlaveSecurityGroup; sourceSlaveSecurityGroup = this.getSlaveSecurityGroup(); String copySlaveSecurityGroup = ((String) strategy.copy(LocatorUtils.property(locator, "slaveSecurityGroup", sourceSlaveSecurityGroup), sourceSlaveSecurityGroup, (this.slaveSecurityGroup!= null))); copy.setSlaveSecurityGroup(copySlaveSecurityGroup);
if (slaveSecurityGroupShouldBeCopiedAndSet == Boolean.TRUE) { String sourceSlaveSecurityGroup; sourceSlaveSecurityGroup = this.getSlaveSecurityGroup(); String copySlaveSecurityGroup = ((String) strategy.copy(LocatorUtils.property(locator, "slaveSecurityGroup", sourceSlaveSecurityGroup), sourceSlaveSecurityGroup, (this.slaveSecurityGroup!= null))); copy.setSlaveSecurityGroup(copySlaveSecurityGroup);