public Object[] getRowImpl() throws KettleException { return super.getRow(); }
@Test public void getRowWithRowHandler() throws KettleException { BaseStep baseStep = new BaseStep( mockHelper.stepMeta, mockHelper.stepDataInterface, 0, mockHelper.transMeta, mockHelper.trans ); baseStep.setRowHandler( rowHandler ); baseStep.getRow(); verify( rowHandler, times( 1 ) ).getRow(); }
@Test public void testGetRowSafeModeEnabled() throws KettleException { Trans transMock = mock( Trans.class ); when( transMock.isSafeModeEnabled() ).thenReturn( true ); BaseStep baseStepSpy = spy( new BaseStep( mockHelper.stepMeta, mockHelper.stepDataInterface, 0, mockHelper.transMeta, transMock ) ); doNothing().when( baseStepSpy ).waitUntilTransformationIsStarted(); doNothing().when( baseStepSpy ).openRemoteInputStepSocketsOnce(); BlockingRowSet rowSet = new BlockingRowSet( 1 ); List<ValueMetaInterface> valueMetaList = Arrays.asList( new ValueMetaInteger( "x" ), new ValueMetaString( "a" ) ); RowMeta rowMeta = new RowMeta(); rowMeta.setValueMetaList( valueMetaList ); final Object[] row = new Object[] {}; rowSet.putRow( rowMeta, row ); baseStepSpy.setInputRowSets( Arrays.asList( rowSet ) ); doReturn( rowSet ).when( baseStepSpy ).currentInputStream(); baseStepSpy.getRow(); verify( mockHelper.transMeta, times( 1 ) ).checkRowMixingStatically( any( StepMeta.class ), anyObject() ); } }
public IRubyObject read() throws KettleException { Object r[] = step.getRow(); // signal that there's no more rows coming if (r == null) { return data.runtime.getNil(); } IRubyObject rubyRow = model.createRubyInputRow(data.inputRowMeta, r); return rubyRow; }