Program: 78520
Project: 78520
Buggy source:
/** 
 * test informations which should be contained by report document
 */
public void testReportDocument(){
  String path=getBaseFolder() + System.getProperty("String_Node_Str");
  String report_design=path + INPUT_FOLDER + System.getProperty("String_Node_Str")+ "String_Node_Str";
  String report_document=path + OUTPUT_FOLDER + System.getProperty("String_Node_Str")+ "String_Node_Str";
  try {
    createReportDocument1(report_design,report_document);
    IDocArchiveReader archive=new FileArchiveReader(report_document);
    IReportDocument reportDoc=engine.openReportDocument(report_document);
    TOCNode root, tableNode, headerNode, groupNode, detailNode, footerNode;
    root=reportDoc.findTOC("String_Node_Str");
    assertNotNull("String_Node_Str",root);
    assertNotNull("String_Node_Str",root.getChildren());
    tableNode=(TOCNode)root.getChildren().get(0);
    assertNotNull("String_Node_Str",tableNode);
    assertEquals("String_Node_Str","String_Node_Str",tableNode.getDisplayString());
    assertNotNull("String_Node_Str",tableNode.getChildren());
    assertEquals("String_Node_Str",6,tableNode.getChildren().size());
    headerNode=(TOCNode)tableNode.getChildren().get(0);
    groupNode=(TOCNode)((TOCNode)tableNode.getChildren().get(1)).getChildren().get(0);
    footerNode=(TOCNode)tableNode.getChildren().get(5);
    assertNotNull("String_Node_Str",headerNode);
    assertNotNull("String_Node_Str",groupNode);
    assertNotNull("String_Node_Str",footerNode);
    assertEquals("String_Node_Str","String_Node_Str",headerNode.getDisplayString());
    assertEquals("String_Node_Str","String_Node_Str",groupNode.getDisplayString());
    assertEquals("String_Node_Str","String_Node_Str",footerNode.getDisplayString());
    assertNotNull("String_Node_Str",groupNode.getChildren());
    detailNode=(TOCNode)((TOCNode)tableNode.getChildren().get(1)).getChildren().get(1);
    assertEquals("String_Node_Str","String_Node_Str",detailNode.getDisplayString());
    IDocArchiveReader arch=reportDoc.getArchive();
    assertNotNull("String_Node_Str",arch);
    assertEquals("String_Node_Str",archive.getName(),arch.getName());
    ArrayList bookmarks=(ArrayList)reportDoc.getBookmarks();
    String hMark="String_Node_Str", gMark="String_Node_Str", dMark="String_Node_Str";
    String fMark="String_Node_Str", pMark="String_Node_Str";
    assertNotNull("String_Node_Str",bookmarks);
    assertTrue("String_Node_Str" + hMark,bookmarks.contains(hMark));
    assertTrue("String_Node_Str" + gMark,bookmarks.contains(gMark));
    assertTrue("String_Node_Str" + dMark,bookmarks.contains(dMark));
    assertTrue("String_Node_Str" + fMark,bookmarks.contains(fMark));
    assertTrue("String_Node_Str" + pMark,bookmarks.contains(pMark));
    List root_children=reportDoc.getChildren("String_Node_Str");
    assertNotNull("String_Node_Str",root_children);
    assertNotNull("String_Node_Str",root_children.get(0));
    TOCNode table_toc=(TOCNode)root_children.get(0);
    List table_children=reportDoc.getChildren(table_toc.getNodeID());
    assertNotNull("String_Node_Str",table_children);
    assertEquals("String_Node_Str",6,table_children.size());
    InputStream designStream=reportDoc.getDesignStream();
    FileInputStream designFile=new FileInputStream(report_design);
    assertNotNull("String_Node_Str",designStream);
    int length=designStream.available();
    byte[] fBytes=new byte[length];
    designStream.read(fBytes,0,length);
    String tempFile=path + OUTPUT_FOLDER + "String_Node_Str";
    File tmp=new File(tempFile);
    FileOutputStream fos=new FileOutputStream(tmp);
    fos.write(fBytes);
    fos.close();
    designStream.close();
    designFile.close();
    assertEquals("String_Node_Str",-6,new File(report_design).compareTo(tmp));
    removeFile(tempFile);
    assertEquals("String_Node_Str",3,reportDoc.getPageCount());
    assertEquals("String_Node_Str",2,reportDoc.getPageNumber(pMark));
    HashMap params=(HashMap)reportDoc.getParameterValues();
    assertNotNull("String_Node_Str",params);
    assertEquals("String_Node_Str",2,params.size());
    assertNotNull("String_Node_Str",params.get(new String("String_Node_Str")));
    assertNotNull("String_Node_Str",params.get(new String("String_Node_Str")));
    assertEquals("String_Node_Str","String_Node_Str",params.get(new String("String_Node_Str")));
    assertEquals("String_Node_Str",new Integer(2),params.get(new String("String_Node_Str")));
    String name=report_document;
    name=name.replace('/','\\');
    assertEquals("String_Node_Str",name,reportDoc.getName());
    IReportRunnable report=reportDoc.getReportRunnable();
    assertNotNull("String_Node_Str",report);
    assertEquals("String_Node_Str",reportRunnable.getReportEngine(),report.getReportEngine());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * test informations which should be contained by report document
 */
public void testReportDocument(){
  String path=getBaseFolder() + System.getProperty("String_Node_Str");
  String report_design=path + INPUT_FOLDER + System.getProperty("String_Node_Str")+ "String_Node_Str";
  String report_document=path + OUTPUT_FOLDER + System.getProperty("String_Node_Str")+ "String_Node_Str";
  try {
    createReportDocument1(report_design,report_document);
    IDocArchiveReader archive=new FileArchiveReader(report_document);
    IReportDocument reportDoc=engine.openReportDocument(report_document);
    TOCNode root, tableNode, headerNode, groupNode, detailNode, footerNode;
    root=reportDoc.findTOC("String_Node_Str");
    assertNotNull("String_Node_Str",root);
    assertNotNull("String_Node_Str",root.getChildren());
    tableNode=(TOCNode)root.getChildren().get(0);
    assertNotNull("String_Node_Str",tableNode);
    assertEquals("String_Node_Str","String_Node_Str",tableNode.getDisplayString());
    assertNotNull("String_Node_Str",tableNode.getChildren());
    assertEquals("String_Node_Str",6,tableNode.getChildren().size());
    headerNode=(TOCNode)tableNode.getChildren().get(0);
    groupNode=(TOCNode)((TOCNode)tableNode.getChildren().get(1)).getChildren().get(0);
    footerNode=(TOCNode)tableNode.getChildren().get(5);
    assertNotNull("String_Node_Str",headerNode);
    assertNotNull("String_Node_Str",groupNode);
    assertNotNull("String_Node_Str",footerNode);
    assertEquals("String_Node_Str","String_Node_Str",headerNode.getDisplayString());
    assertEquals("String_Node_Str","String_Node_Str",groupNode.getDisplayString());
    assertEquals("String_Node_Str","String_Node_Str",footerNode.getDisplayString());
    assertNotNull("String_Node_Str",groupNode.getChildren());
    detailNode=(TOCNode)((TOCNode)tableNode.getChildren().get(1)).getChildren().get(1);
    assertEquals("String_Node_Str","String_Node_Str",detailNode.getDisplayString());
    IDocArchiveReader arch=reportDoc.getArchive();
    assertNotNull("String_Node_Str",arch);
    assertEquals("String_Node_Str",archive.getName(),arch.getName());
    ArrayList bookmarks=(ArrayList)reportDoc.getBookmarks();
    String hMark="String_Node_Str", gMark="String_Node_Str", dMark="String_Node_Str";
    String fMark="String_Node_Str", pMark="String_Node_Str";
    assertNotNull("String_Node_Str",bookmarks);
    assertTrue("String_Node_Str" + hMark,bookmarks.contains(hMark));
    assertTrue("String_Node_Str" + gMark,bookmarks.contains(gMark));
    assertTrue("String_Node_Str" + dMark,bookmarks.contains(dMark));
    assertTrue("String_Node_Str" + fMark,bookmarks.contains(fMark));
    assertTrue("String_Node_Str" + pMark,bookmarks.contains(pMark));
    List root_children=reportDoc.getChildren("String_Node_Str");
    assertNotNull("String_Node_Str",root_children);
    assertNotNull("String_Node_Str",root_children.get(0));
    TOCNode table_toc=(TOCNode)root_children.get(0);
    List table_children=reportDoc.getChildren(table_toc.getNodeID());
    assertNotNull("String_Node_Str",table_children);
    assertEquals("String_Node_Str",6,table_children.size());
    InputStream designStream=reportDoc.getDesignStream();
    FileInputStream designFile=new FileInputStream(report_design);
    assertNotNull("String_Node_Str",designStream);
    int length=designStream.available();
    byte[] fBytes=new byte[length];
    designStream.read(fBytes,0,length);
    String tempFile=path + OUTPUT_FOLDER + "String_Node_Str";
    File tmp=new File(tempFile);
    FileOutputStream fos=new FileOutputStream(tmp);
    fos.write(fBytes);
    fos.close();
    designStream.close();
    designFile.close();
    assertEquals("String_Node_Str",-6,new File(report_design).compareTo(tmp));
    removeFile(tempFile);
    assertEquals("String_Node_Str",2,reportDoc.getPageCount());
    assertEquals("String_Node_Str",2,reportDoc.getPageNumber(pMark));
    HashMap params=(HashMap)reportDoc.getParameterValues();
    assertNotNull("String_Node_Str",params);
    assertEquals("String_Node_Str",2,params.size());
    assertNotNull("String_Node_Str",params.get(new String("String_Node_Str")));
    assertNotNull("String_Node_Str",params.get(new String("String_Node_Str")));
    assertEquals("String_Node_Str","String_Node_Str",params.get(new String("String_Node_Str")));
    assertEquals("String_Node_Str",new Integer(2),params.get(new String("String_Node_Str")));
    String name=report_document;
    name=name.replace('/','\\');
    assertEquals("String_Node_Str",name,reportDoc.getName());
    IReportRunnable report=reportDoc.getReportRunnable();
    assertNotNull("String_Node_Str",report);
    assertEquals("String_Node_Str",reportRunnable.getReportEngine(),report.getReportEngine());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}