Program: 6439
Project: 6439
Buggy source:
@Test public void testS3toTPFS() throws Exception {
  String testPath="String_Node_Str";
  String testData="String_Node_Str";
  S3NInMemoryFileSystem fs=new S3NInMemoryFileSystem();
  Configuration conf=new Configuration();
  conf.set("String_Node_Str",S3NInMemoryFileSystem.class.getName());
  fs.initialize(URI.create("String_Node_Str"),conf);
  fs.createNewFile(new Path(testPath));
  FSDataOutputStream writeData=fs.create(new Path(testPath));
  writeData.write(testData.getBytes());
  writeData.flush();
  writeData.close();
  Method method=FileSystem.class.getDeclaredMethod("String_Node_Str",new Class[]{URI.class,Configuration.class,FileSystem.class});
  method.setAccessible(true);
  method.invoke(FileSystem.class,URI.create("String_Node_Str"),conf,fs);
  ETLStage source=new ETLStage("String_Node_Str",ImmutableMap.<String,String>builder().put(Properties.S3.ACCESS_KEY,"String_Node_Str").put(Properties.S3.ACCESS_ID,"String_Node_Str").put(Properties.S3.PATH,testPath).build());
  ETLStage sink=new ETLStage("String_Node_Str",ImmutableMap.of(Properties.TimePartitionedFileSetDataset.SCHEMA,FileBatchSource.DEFAULT_SCHEMA.toString(),Properties.TimePartitionedFileSetDataset.TPFS_NAME,"String_Node_Str"));
  ETLBatchConfig etlConfig=new ETLBatchConfig("String_Node_Str",source,sink,Lists.<ETLStage>newArrayList());
  AppRequest<ETLBatchConfig> appRequest=new AppRequest<>(ETLBATCH_ARTIFACT,etlConfig);
  Id.Application appId=Id.Application.from(Id.Namespace.DEFAULT,"String_Node_Str");
  ApplicationManager appManager=deployApplication(appId,appRequest);
  MapReduceManager mrManager=appManager.getMapReduceManager(ETLMapReduce.NAME);
  mrManager.start();
  mrManager.waitForFinish(2,TimeUnit.MINUTES);
  DataSetManager<TimePartitionedFileSet> fileSetManager=getDataset("String_Node_Str");
  TimePartitionedFileSet fileSet=fileSetManager.get();
  List<GenericRecord> records=readOutput(fileSet,FileBatchSource.DEFAULT_SCHEMA);
  Assert.assertEquals(1,records.size());
  Assert.assertEquals(testData,records.get(0).get("String_Node_Str").toString());
  fileSet.close();
}

Fixed version (ground truth):
@Test public void testS3toTPFS() throws Exception {
  String testPath="String_Node_Str";
  String testFile1="String_Node_Str";
  String testData1="String_Node_Str";
  String testFile2="String_Node_Str";
  String testData2="String_Node_Str";
  S3NInMemoryFileSystem fs=new S3NInMemoryFileSystem();
  Configuration conf=new Configuration();
  conf.set("String_Node_Str",S3NInMemoryFileSystem.class.getName());
  fs.initialize(URI.create("String_Node_Str"),conf);
  fs.createNewFile(new Path(testPath));
  try (FSDataOutputStream fos1=fs.create(new Path(testPath + testFile1))){
    fos1.write(testData1.getBytes());
    fos1.flush();
  }
   try (FSDataOutputStream fos2=fs.create(new Path(testPath + testFile2))){
    fos2.write(testData2.getBytes());
    fos2.flush();
  }
   Method method=FileSystem.class.getDeclaredMethod("String_Node_Str",URI.class,Configuration.class,FileSystem.class);
  method.setAccessible(true);
  method.invoke(FileSystem.class,URI.create("String_Node_Str"),conf,fs);
  ETLStage source=new ETLStage("String_Node_Str",ImmutableMap.<String,String>builder().put(Properties.S3.ACCESS_KEY,"String_Node_Str").put(Properties.S3.ACCESS_ID,"String_Node_Str").put(Properties.S3.PATH,testPath).put(Properties.S3.FILE_REGEX,"String_Node_Str").build());
  ETLStage sink=new ETLStage("String_Node_Str",ImmutableMap.of(Properties.TimePartitionedFileSetDataset.SCHEMA,FileBatchSource.DEFAULT_SCHEMA.toString(),Properties.TimePartitionedFileSetDataset.TPFS_NAME,"String_Node_Str"));
  ETLBatchConfig etlConfig=new ETLBatchConfig("String_Node_Str",source,sink,Lists.<ETLStage>newArrayList());
  AppRequest<ETLBatchConfig> appRequest=new AppRequest<>(ETLBATCH_ARTIFACT,etlConfig);
  Id.Application appId=Id.Application.from(Id.Namespace.DEFAULT,"String_Node_Str");
  ApplicationManager appManager=deployApplication(appId,appRequest);
  MapReduceManager mrManager=appManager.getMapReduceManager(ETLMapReduce.NAME);
  mrManager.start();
  mrManager.waitForFinish(2,TimeUnit.MINUTES);
  DataSetManager<TimePartitionedFileSet> fileSetManager=getDataset("String_Node_Str");
  try (TimePartitionedFileSet fileSet=fileSetManager.get()){
    List<GenericRecord> records=readOutput(fileSet,FileBatchSource.DEFAULT_SCHEMA);
    Assert.assertEquals(1,records.size());
    Assert.assertEquals(testData1,records.get(0).get("String_Node_Str").toString());
  }
 }