public RowMetaInterface getErrorRowMeta( long nrErrors, String errorDescriptions, String fieldNames,
    String errorCodes ) {
    RowMetaInterface row = new RowMeta();

    String nrErr = variables.environmentSubstitute( getNrErrorsValuename() );
    if ( !Utils.isEmpty( nrErr ) ) {
      ValueMetaInterface v = new ValueMetaInteger( nrErr );
      v.setLength( 3 );
      row.addValueMeta( v );
    }
    String errDesc = variables.environmentSubstitute( getErrorDescriptionsValuename() );
    if ( !Utils.isEmpty( errDesc ) ) {
      ValueMetaInterface v = new ValueMetaString( errDesc );
      row.addValueMeta( v );
    }
    String errFields = variables.environmentSubstitute( getErrorFieldsValuename() );
    if ( !Utils.isEmpty( errFields ) ) {
      ValueMetaInterface v = new ValueMetaString( errFields );
      row.addValueMeta( v );
    }
    String errCodes = variables.environmentSubstitute( getErrorCodesValuename() );
    if ( !Utils.isEmpty( errCodes ) ) {
      ValueMetaInterface v = new ValueMetaString( errCodes );
      row.addValueMeta( v );
    }

    return row;
  }
@Test
  public void testGetErrorRowMeta() {
    VariableSpace vars = new Variables();
    vars.setVariable( "VarNumberErrors", "nbrErrors" );
    vars.setVariable( "VarErrorDescription", "errorDescription" );
    vars.setVariable( "VarErrorFields", "errorFields" );
    vars.setVariable( "VarErrorCodes", "errorCodes" );
    StepErrorMeta testObject = new StepErrorMeta( vars, new StepMeta(), new StepMeta(),
      "${VarNumberErrors}", "${VarErrorDescription}", "${VarErrorFields}", "${VarErrorCodes}" );
    RowMetaInterface result = testObject.getErrorRowMeta( 10, "some data was bad", "factId", "BAD131" );

    assertNotNull( result );
    assertEquals( 4, result.size() );
    assertEquals( ValueMetaInterface.TYPE_INTEGER, result.getValueMeta( 0 ).getType() );
    assertEquals( "nbrErrors", result.getValueMeta( 0 ).getName() );
    assertEquals( ValueMetaInterface.TYPE_STRING, result.getValueMeta( 1 ).getType() );
    assertEquals( "errorDescription", result.getValueMeta( 1 ).getName() );
    assertEquals( ValueMetaInterface.TYPE_STRING, result.getValueMeta( 2 ).getType() );
    assertEquals( "errorFields", result.getValueMeta( 2 ).getName() );
    assertEquals( ValueMetaInterface.TYPE_STRING, result.getValueMeta( 3 ).getType() );
    assertEquals( "errorCodes", result.getValueMeta( 3 ).getName() );
  }