Program: 137958
Project: 137958
Buggy source:
@Test public void testExecuteSqlQuery_delimetd() throws Exception {
  String empty="String_Node_Str";
  Analysis analysis=mock(Analysis.class);
  DelimitedFileIndicatorEvaluator delFileIndiEvaluator=new DelimitedFileIndicatorEvaluator(analysis);
  stub(method(DelimitedFileIndicatorEvaluator.class,"String_Node_Str"));
  stub(method(DelimitedFileIndicatorEvaluator.class,"String_Node_Str",Indicator.class,EMap.class));
  AnalysisContext context=mock(AnalysisContext.class);
  when(analysis.getContext()).thenReturn(context);
  DelimitedFileConnection deliFileConn=mock(DelimitedFileConnection.class);
  when(context.getConnection()).thenReturn(deliFileConn);
  when(deliFileConn.isContextMode()).thenReturn(false);
  String path="String_Node_Str";
  when(deliFileConn.getFilePath()).thenReturn(path);
  IPath iPath=mock(IPath.class);
  File file=new File(path);
  BufferedWriter output=new BufferedWriter(new FileWriter(file));
  String str="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  output.write(str);
  output.close();
  when(iPath.toFile()).thenReturn(file);
  when(deliFileConn.getFieldSeparatorValue()).thenReturn("String_Node_Str");
  when(deliFileConn.getEncoding()).thenReturn("String_Node_Str");
  AnalysisResult results=mock(AnalysisResult.class);
  when(analysis.getResults()).thenReturn(results);
  EMap<Indicator,AnalyzedDataSet> indicToRowMap=mock(EMap.class);
  when(results.getIndicToRowMap()).thenReturn(indicToRowMap);
  List<ModelElement> columnElementList=new BasicEList<ModelElement>();
  List<MetadataColumn> columnElementList2=new BasicEList<MetadataColumn>();
  MetadataColumn mc0=mock(MetadataColumn.class);
  MetadataColumn mc1=mock(MetadataColumn.class);
  MetadataColumn mc2=mock(MetadataColumn.class);
  columnElementList.add(mc0);
  columnElementList.add(mc1);
  columnElementList.add(mc2);
  columnElementList2.add(mc0);
  columnElementList2.add(mc1);
  columnElementList2.add(mc2);
  EList<ModelElement> eLs=(EList<ModelElement>)columnElementList;
  when(context.getAnalysedElements()).thenReturn(eLs);
  PowerMockito.mockStatic(ColumnHelper.class);
  MetadataTable mTable=mock(MetadataTable.class);
  when(mTable.getColumns()).thenReturn((EList<MetadataColumn>)columnElementList2);
  when(ColumnHelper.getColumnOwnerAsMetadataTable(mc0)).thenReturn(mTable);
  when(ColumnHelper.getColumnOwnerAsMetadataTable(mc1)).thenReturn(mTable);
  when(deliFileConn.getHeaderValue()).thenReturn(empty);
  when(deliFileConn.getFooterValue()).thenReturn(empty);
  when(deliFileConn.getLimitValue()).thenReturn(empty);
  when(deliFileConn.getEscapeType()).thenReturn(Escape.DELIMITED);
  when(deliFileConn.getRowSeparatorValue()).thenReturn("String_Node_Str");
  when(deliFileConn.isRemoveEmptyRow()).thenReturn(false);
  when(deliFileConn.isSplitRecord()).thenReturn(false);
  PowerMockito.mockStatic(LanguageManager.class);
  when(LanguageManager.getCurrentLanguage()).thenReturn(ECodeLanguage.JAVA);
  delFileIndiEvaluator.executeSqlQuery(empty);
}

Fixed version (ground truth):
@Test public void testExecuteSqlQuery_delimetd() throws Exception {
  String empty="String_Node_Str";
  Analysis analysis=mock(Analysis.class);
  DelimitedFileIndicatorEvaluator delFileIndiEvaluator=new DelimitedFileIndicatorEvaluator(analysis);
  DelimitedFileIndicatorEvaluator spyEvaluator=Mockito.spy(delFileIndiEvaluator);
  stub(method(DelimitedFileIndicatorEvaluator.class,"String_Node_Str"));
  stub(method(DelimitedFileIndicatorEvaluator.class,"String_Node_Str",Indicator.class,EMap.class));
  AnalysisContext context=mock(AnalysisContext.class);
  when(analysis.getContext()).thenReturn(context);
  DelimitedFileConnection deliFileConn=mock(DelimitedFileConnection.class);
  when(context.getConnection()).thenReturn(deliFileConn);
  when(deliFileConn.isContextMode()).thenReturn(false);
  String path="String_Node_Str";
  when(deliFileConn.getFilePath()).thenReturn(path);
  IPath iPath=mock(IPath.class);
  File file=new File(path);
  BufferedWriter output=new BufferedWriter(new FileWriter(file));
  String str="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  output.write(str);
  output.close();
  when(iPath.toFile()).thenReturn(file);
  when(deliFileConn.getFieldSeparatorValue()).thenReturn("String_Node_Str");
  when(deliFileConn.getEncoding()).thenReturn("String_Node_Str");
  AnalysisResult results=mock(AnalysisResult.class);
  when(analysis.getResults()).thenReturn(results);
  EMap<Indicator,AnalyzedDataSet> indicToRowMap=mock(EMap.class);
  when(results.getIndicToRowMap()).thenReturn(indicToRowMap);
  List<ModelElement> columnElementList=new BasicEList<ModelElement>();
  List<MetadataColumn> columnElementList2=new BasicEList<MetadataColumn>();
  MetadataColumn mc0=mock(MetadataColumn.class);
  MetadataColumn mc1=mock(MetadataColumn.class);
  MetadataColumn mc2=mock(MetadataColumn.class);
  columnElementList.add(mc0);
  columnElementList.add(mc1);
  columnElementList.add(mc2);
  columnElementList2.add(mc0);
  columnElementList2.add(mc1);
  columnElementList2.add(mc2);
  EList<ModelElement> eLs=(EList<ModelElement>)columnElementList;
  when(context.getAnalysedElements()).thenReturn(eLs);
  PowerMockito.mockStatic(ColumnHelper.class);
  MetadataTable mTable=mock(MetadataTable.class);
  when(mTable.getColumns()).thenReturn((EList<MetadataColumn>)columnElementList2);
  when(ColumnHelper.getColumnOwnerAsMetadataTable(mc0)).thenReturn(mTable);
  when(ColumnHelper.getColumnOwnerAsMetadataTable(mc1)).thenReturn(mTable);
  when(deliFileConn.getHeaderValue()).thenReturn(empty);
  when(deliFileConn.getFooterValue()).thenReturn(empty);
  when(deliFileConn.getLimitValue()).thenReturn(empty);
  when(deliFileConn.getEscapeType()).thenReturn(Escape.DELIMITED);
  when(deliFileConn.getRowSeparatorValue()).thenReturn("String_Node_Str");
  when(deliFileConn.isRemoveEmptyRow()).thenReturn(false);
  when(deliFileConn.isSplitRecord()).thenReturn(false);
  PowerMockito.mockStatic(LanguageManager.class);
  when(LanguageManager.getCurrentLanguage()).thenReturn(ECodeLanguage.JAVA);
  Mockito.doReturn(true).when(spyEvaluator).continueRun();
  spyEvaluator.executeSqlQuery(empty);
}