protected boolean writeRowTo( Object[] row ) throws KettleException {
    if ( meta.isServletOutput( ) ) {
      return writeRowToServlet( row );
    } else {
      return writeRowToFile( row );
    }
  }
@Test
  public void testWriteRowToFile_initFileStreamWriter() throws Exception {

    // SETUP
    textFileOutput =
      new TextFileOutputTestHandler( stepMockHelper.stepMeta, stepMockHelper.stepDataInterface, 0,
        stepMockHelper.transMeta,
        stepMockHelper.trans );

    TextFileOutputMeta mockTFOMeta = mock( TextFileOutputMeta.class );
    when( mockTFOMeta.isServletOutput() ).thenReturn( false );
    Path tempDirWithPrefix = Files.createTempDirectory( "pdi-textFileOutputTest" );
    when( mockTFOMeta.getFileName() ).thenReturn( tempDirWithPrefix.toString() + "/wtf.txt" );
    textFileOutput.meta = mockTFOMeta;

    TextFileOutputData data = new TextFileOutputData();
    data.binarySeparator = " ".getBytes();
    data.binaryEnclosure = "\"".getBytes();
    data.binaryNewline = "\n".getBytes();
    textFileOutput.data = data;

    data.outputRowMeta = new RowMeta();
    data.outputRowMeta.addValueMeta( new ValueMetaString( "name" ) );

    // variable not set
    textFileOutput.data.writer = null;

    // EXECUTE
    textFileOutput.writeRowTo( secondRow );

    // VERIFY
    assertNotNull( textFileOutput.data.writer );
  }