void prepareResultsRowsFields( RowMetaInterface row ) throws KettleStepException {
    for ( int i = 0; i < outputRowsField.length; i++ ) {
      addFieldToRow( row, outputRowsField[ i ], outputRowsType[ i ], outputRowsLength[ i ], outputRowsPrecision[ i ] );
    }
  }
@Test
  public void testPrepareResultsRowsFields() throws Exception {
    TransExecutorMeta meta = new TransExecutorMeta();
    String[] outputFieldNames = new String[]{ "one", "two" };
    int[] outputFieldTypes = new int[]{ 0, 1 };
    int[] outputFieldLength = new int[]{ 4, 8 };
    int[] outputFieldPrecision = new int[]{ 2, 4 };

    meta.setOutputRowsField( outputFieldNames );
    meta.setOutputRowsType( outputFieldTypes );
    meta.setOutputRowsLength( outputFieldLength );
    meta.setOutputRowsPrecision( outputFieldPrecision );
    meta = spy( meta );

    RowMetaInterface row = mock( RowMetaInterface.class );

    StepMeta parent = mock( StepMeta.class );
    doReturn( parent ).when( meta ).getParentStepMeta();
    when( parent.getName() ).thenReturn( "parent step" );

    meta.prepareResultsRowsFields( row );

    // make sure we get the name of the parent step meta... used for the origin step
    verify( parent, times( outputFieldNames.length ) ).getName();
    ArgumentCaptor<ValueMetaInterface> argumentCaptor = ArgumentCaptor.forClass( ValueMetaInterface.class );
    verify( row, times( outputFieldNames.length ) ).addValueMeta( argumentCaptor.capture() );
    assertEquals( "parent step", argumentCaptor.getValue().getOrigin() );
  }