/** * Create an instance of {@link EmrHadoopJarStepAddRequest } * */ public EmrHadoopJarStepAddRequest createEmrHadoopJarStepAddRequest() { return new EmrHadoopJarStepAddRequest(); }
/** * Create an instance of {@link EmrHadoopJarStepAddRequest } * */ public EmrHadoopJarStepAddRequest createEmrHadoopJarStepAddRequest() { return new EmrHadoopJarStepAddRequest(); }
/** * Create an instance of {@link EmrHadoopJarStepAddRequest } * */ public EmrHadoopJarStepAddRequest createEmrHadoopJarStepAddRequest() { return new EmrHadoopJarStepAddRequest(); }
public Object createNewInstance() { return new EmrHadoopJarStepAddRequest(); }
public Object createNewInstance() { return new EmrHadoopJarStepAddRequest(); }
public Object createNewInstance() { return new EmrHadoopJarStepAddRequest(); }
@Override public void executeImpl(DelegateExecution execution) throws Exception { // Create the request. EmrHadoopJarStepAddRequest request = new EmrHadoopJarStepAddRequest(); populateCommonParams(request, execution); request.setJarLocation(getJarLocation(execution)); request.setMainClass(getMainClass(execution)); request.setScriptArguments(getScriptArguments(execution)); addEmrStepAndSetWorkflowVariables(request, execution); }
@Override public void executeImpl(DelegateExecution execution) throws Exception { // Create the request. EmrHadoopJarStepAddRequest request = new EmrHadoopJarStepAddRequest(); populateCommonParams(request, execution); request.setJarLocation(getJarLocation(execution)); request.setMainClass(getMainClass(execution)); request.setScriptArguments(getScriptArguments(execution)); addEmrStepAndSetWorkflowVariables(request, execution); }
@Test public void testAddHadoopJarStepToEmrCluster() throws Exception { // Create an add step request. EmrHadoopJarStepAddRequest emrHadoopJarStepAddRequest = new EmrHadoopJarStepAddRequest(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, EMR_CLUSTER_NAME, EMR_STEP_NAME, EMR_STEP_JAR_LOCATION, EMR_STEP_MAIN_CLASS, Arrays.asList(ATTRIBUTE_NAME_1_MIXED_CASE), CONTINUE_ON_ERROR, EMR_CLUSTER_ID, AWS_ACCOUNT_ID); // Create an add step response. EmrHadoopJarStep emrHadoopJarStep = new EmrHadoopJarStep(EMR_STEP_ID, NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, EMR_CLUSTER_NAME, EMR_STEP_NAME, EMR_STEP_JAR_LOCATION, EMR_STEP_MAIN_CLASS, Arrays.asList(ATTRIBUTE_NAME_1_MIXED_CASE), CONTINUE_ON_ERROR, EMR_CLUSTER_ID); // Mock the external calls. when(emrService.addStepToCluster(emrHadoopJarStepAddRequest)).thenReturn(emrHadoopJarStep); // Call the method under test. EmrHadoopJarStep result = emrRestController.addHadoopJarStepToEmrCluster(emrHadoopJarStepAddRequest); // Verify the external calls. verify(emrService).addStepToCluster(emrHadoopJarStepAddRequest); verifyNoMoreInteractionsHelper(); // Validate the results. assertEquals(emrHadoopJarStep, result); }
EmrHadoopJarStepAddRequest hadoopJarStepRequest = new EmrHadoopJarStepAddRequest(); List<String> scriptArgs2 = new ArrayList<>(); scriptArgs2.add("oozie_run");
EmrHadoopJarStepAddRequest hadoopJarStepRequest = new EmrHadoopJarStepAddRequest(); List<String> scriptArgs2 = new ArrayList<>(); scriptArgs2.add("oozie_run");
/** * This method tests the happy path scenario by testing all the step types */ @Test public void testEmrAddStepsHadoopNoMainClass() 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); // TODO: Why are we adding EMR steps to a list, but not doing anything with them once they're added? List<Serializable> emrSteps = new ArrayList<>(); EmrHadoopJarStepAddRequest hadoopJarStepRequest = new EmrHadoopJarStepAddRequest(); hadoopJarStepRequest.setNamespace(request.getNamespace()); hadoopJarStepRequest.setEmrClusterDefinitionName(request.getEmrClusterDefinitionName()); hadoopJarStepRequest.setEmrClusterName(request.getEmrClusterName()); hadoopJarStepRequest.setStepName("Hadoop Jar"); hadoopJarStepRequest.setJarLocation("s3://test-bucket-managed/app-a/test/hadoop-mapreduce-examples-2.4.0.jar"); emrSteps.add(hadoopJarStepRequest); EmrHadoopJarStep emrHadoopJarStep = (EmrHadoopJarStep) emrService.addStepToCluster(hadoopJarStepRequest); assertNotNull(emrHadoopJarStep); assertNotNull(emrHadoopJarStep.getId()); }