use of org.finra.herd.model.api.xml.EmrShellStepAddRequest in project herd by FINRAOS.
the class EmrServiceTest method getNewEmrShellStepAddRequest.
/**
* This method creates a EMR Shell step add request. This is called from all the other test methods.
*/
private EmrShellStepAddRequest getNewEmrShellStepAddRequest(String clusterName) throws Exception {
// Create the request.
EmrShellStepAddRequest request = new EmrShellStepAddRequest();
// Fill in the parameters.
request.setNamespace(NAMESPACE);
request.setEmrClusterDefinitionName(EMR_CLUSTER_DEFINITION_NAME);
request.setEmrClusterName(clusterName);
request.setStepName("A_SHELL_STEP");
request.setScriptLocation("SCRIPT_LOCATION");
request.setContinueOnError(false);
List<String> arguments = new ArrayList<>();
arguments.add("one");
arguments.add("two");
request.setScriptArguments(arguments);
return request;
}
use of org.finra.herd.model.api.xml.EmrShellStepAddRequest in project herd by FINRAOS.
the class EmrServiceTest method testEmrAddStepsAmazonOtherException.
/**
* This method tests the Amazon exceptions
*/
@Test(expected = AmazonServiceException.class)
public void testEmrAddStepsAmazonOtherException() throws Exception {
// Create the namespace entity.
NamespaceEntity namespaceEntity = namespaceDaoTestHelper.createNamespaceEntity(NAMESPACE);
emrClusterDefinitionDaoTestHelper.createEmrClusterDefinitionEntity(namespaceEntity, EMR_CLUSTER_DEFINITION_NAME, IOUtils.toString(resourceLoader.getResource(EMR_CLUSTER_DEFINITION_XML_FILE_WITH_CLASSPATH).getInputStream()));
EmrClusterCreateRequest request = getNewEmrClusterCreateRequest();
emrService.createCluster(request);
// Create a new EMR cluster create request.
EmrShellStepAddRequest stepRequest = getNewEmrShellStepAddRequest(request.getEmrClusterName());
stepRequest.setStepName(MockAwsOperationsHelper.AMAZON_SERVICE_EXCEPTION);
emrService.addStepToCluster(stepRequest);
}
use of org.finra.herd.model.api.xml.EmrShellStepAddRequest in project herd by FINRAOS.
the class EmrShellStepHelper method validateAddStepRequest.
@Override
public void validateAddStepRequest(Object step) {
EmrShellStepAddRequest shellStep = (EmrShellStepAddRequest) step;
validateStepName(shellStep.getStepName());
validateScriptLocation(shellStep.getScriptLocation());
}
use of org.finra.herd.model.api.xml.EmrShellStepAddRequest in project herd by FINRAOS.
the class AddEmrShellStep method executeImpl.
@Override
public void executeImpl(DelegateExecution execution) throws Exception {
// Create the request.
EmrShellStepAddRequest request = new EmrShellStepAddRequest();
populateCommonParams(request, execution);
request.setScriptLocation(getScriptLocation(execution));
request.setScriptArguments(getScriptArguments(execution));
addEmrStepAndSetWorkflowVariables(request, execution);
}
Aggregations