when( stepMockHelper.trans.addRowProducer( MAPPING_INPUT_STEP_NAME, 0 ) ).thenReturn( rProducerMock ); when( stepMockHelper.processRowsStepMetaInterface.getInputMapping() ).thenReturn( mpIODefMock );
@Test public void testStepShouldStopProcessingInput_IfUnderlyingTransitionIsStopped() throws Exception { MappingInput mappingInput = mock( MappingInput.class ); when( mappingInput.getStepname() ).thenReturn( MAPPING_INPUT_STEP_NAME ); stepMockHelper.processRowsStepDataInterface.mappingInput = mappingInput; RowProducer rowProducer = mock( RowProducer.class ); when( rowProducer.putRow( any( RowMetaInterface.class ), any( Object[].class ), anyBoolean() ) ) .thenReturn( true ); StepInterface stepInterface = mock( StepInterface.class ); Trans mappingTrans = mock( Trans.class ); when( mappingTrans.addRowProducer( anyString(), anyInt() ) ).thenReturn( rowProducer ); when( mappingTrans.findStepInterface( anyString(), anyInt() ) ).thenReturn( stepInterface ); when( mappingTrans.isFinishedOrStopped() ).thenReturn( Boolean.FALSE ).thenReturn( Boolean.TRUE ); stepMockHelper.processRowsStepDataInterface.mappingTrans = mappingTrans; MappingOutput mappingOutput = mock( MappingOutput.class ); when( mappingOutput.getStepname() ).thenReturn( MAPPING_OUTPUT_STEP_NAME ); stepMockHelper.processRowsStepDataInterface.mappingOutput = mappingOutput; smp = new SimpleMapping( stepMockHelper.stepMeta, stepMockHelper.stepDataInterface, 0, stepMockHelper.transMeta, stepMockHelper.trans ); smp.init( stepMockHelper.initStepMetaInterface, simpleMpData ); smp.addRowSetToInputRowSets( stepMockHelper.getMockInputRowSet( new Object[] { } ) ); smp.addRowSetToInputRowSets( stepMockHelper.getMockInputRowSet( new Object[] { } ) ); assertTrue( smp.processRow( stepMockHelper.processRowsStepMetaInterface, stepMockHelper.processRowsStepDataInterface ) ); assertFalse( smp.processRow( stepMockHelper.processRowsStepMetaInterface, stepMockHelper.processRowsStepDataInterface ) ); }
rowProducer = injectTrans.addRowProducer( data.streamingTargetStepname, 0 );
RowProducer rp = trans.addRowProducer( injectorStepname, 0 );
RowProducer rp = trans.addRowProducer( injectorStepname, 0 );
RowProducer rowProducer = simpleMappingData.mappingTrans.addRowProducer( mappingInputStepname, 0 ); simpleMappingData.rowDataInputMapper = new RowDataInputMapper( meta.getInputMapping(), rowProducer );
singleThreaderData.rowProducer = singleThreaderData.mappingTrans.addRowProducer( meta.getInjectStep(), 0 );
if ( inputStepName != null ) { rowProducer = trans.addRowProducer( inputStepName, 0 ); StepInterface inputStep = rowProducer.getStepInterface(); StepMetaInterface inputStepMeta = inputStep.getStepMeta().getStepMetaInterface();
if ( mapInputStepName != null ) { rowProducer = trans.addRowProducer( mapInputStepName, 0 ); StepInterface inputStep = rowProducer.getStepInterface(); StepMetaInterface inputStepMeta = inputStep.getStepMeta().getStepMetaInterface();