Program: 78920
Project: 78920
Buggy source:
public void testContainElement() throws Throwable {
  showPerspective();
  openEditor();
  getView(DATA_EXPLORER_ID).setFocus();
  DataViewPage dataViewPage=(DataViewPage)((DataView)getView(DATA_EXPLORER_ID)).getCurrentPage();
  TreeViewer dataTreeViewer=(TreeViewer)PrivateAccessor.getField(dataViewPage,"String_Node_Str");
  ContentOutlinePage outlinePage=(ContentOutlinePage)PrivateAccessor.getField(UIUtil.getActiveReportEditor(),"String_Node_Str");
  TreeViewer outlineTreeViewer=(TreeViewer)PrivateAccessor.getField(outlinePage,"String_Node_Str");
  ReportDesignHandle reportHandle=(ReportDesignHandle)SessionHandleAdapter.getInstance().getReportDesignHandle();
  DataSourceHandle dataSource=reportHandle.getElementFactory().newOdaDataSource(null);
  DataSetHandle dataSet=reportHandle.getElementFactory().newScriptDataSet(null);
  ScalarParameterHandle param1=reportHandle.getElementFactory().newScalarParameter("String_Node_Str");
  ScalarParameterHandle param2=reportHandle.getElementFactory().newScalarParameter("String_Node_Str");
  ParameterGroupHandle paramGroup=reportHandle.getElementFactory().newParameterGroup(null);
  paramGroup.addElement(param2,ParameterGroupHandle.PARAMETERS_SLOT);
  reportHandle.getDataSources().add(dataSource);
  reportHandle.getDataSets().add(dataSet);
  reportHandle.getParameters().add(param1);
  reportHandle.getParameters().add(paramGroup);
  LabelHandle label1=reportHandle.getElementFactory().newLabel(null);
  LabelHandle label2=reportHandle.getElementFactory().newLabel(null);
  TextItemHandle text=reportHandle.getElementFactory().newTextItem(null);
  ListHandle list=reportHandle.getElementFactory().newList(null);
  ListGroupHandle listGroup=reportHandle.getElementFactory().newListGroup();
  listGroup.getHeader().add(label2);
  list.getDetail().add(text);
  list.getGroups().add(listGroup);
  reportHandle.getBody().add(label1);
  reportHandle.getBody().add(list);
  getView(DATA_EXPLORER_ID).setFocus();
  dataTreeViewer.refresh();
  getView(OUTLINE_ID).setFocus();
  outlineTreeViewer.refresh();
  try {
    assertTrue(UIUtil.containElement(outlineTreeViewer,label1));
    assertTrue(UIUtil.containElement(outlineTreeViewer,label2));
    assertTrue(UIUtil.containElement(outlineTreeViewer,text));
    assertTrue(UIUtil.containElement(outlineTreeViewer,list));
    assertTrue(UIUtil.containElement(outlineTreeViewer,listGroup));
    assertTrue(UIUtil.containElement(dataTreeViewer,dataSource));
    assertTrue(UIUtil.containElement(dataTreeViewer,dataSet));
    assertTrue(UIUtil.containElement(dataTreeViewer,param1));
    assertTrue(UIUtil.containElement(dataTreeViewer,paramGroup));
    assertTrue(UIUtil.containElement(dataTreeViewer,param2));
    assertFalse(UIUtil.containElement(outlineTreeViewer,dataSource));
    assertFalse(UIUtil.containElement(outlineTreeViewer,dataSet));
    assertFalse(UIUtil.containElement(outlineTreeViewer,param1));
    assertFalse(UIUtil.containElement(outlineTreeViewer,paramGroup));
    assertFalse(UIUtil.containElement(outlineTreeViewer,param2));
    assertFalse(UIUtil.containElement(dataTreeViewer,label1));
    assertFalse(UIUtil.containElement(dataTreeViewer,label2));
    assertFalse(UIUtil.containElement(dataTreeViewer,text));
    assertFalse(UIUtil.containElement(dataTreeViewer,list));
    assertFalse(UIUtil.containElement(dataTreeViewer,listGroup));
  }
 catch (  Throwable e) {
    throw e;
  }
 finally {
    closeEditor();
  }
}

Fixed version (ground truth):
public void testContainElement() throws Throwable {
  showPerspective();
  openEditor();
  getView(DATA_EXPLORER_ID).setFocus();
  DataViewPage dataViewPage=(DataViewPage)((DataView)getView(DATA_EXPLORER_ID)).getCurrentPage();
  TreeViewer dataTreeViewer=(TreeViewer)PrivateAccessor.getField(dataViewPage,"String_Node_Str");
  ContentOutlinePage outlinePage=(ContentOutlinePage)PrivateAccessor.getField(UIUtil.getActiveReportEditor(),"String_Node_Str");
  TreeViewer outlineTreeViewer=(TreeViewer)PrivateAccessor.getField(outlinePage,"String_Node_Str");
  ReportDesignHandle reportHandle=(ReportDesignHandle)SessionHandleAdapter.getInstance().getReportDesignHandle();
  DataSourceHandle dataSource=reportHandle.getElementFactory().newOdaDataSource(null,null);
  DataSetHandle dataSet=reportHandle.getElementFactory().newScriptDataSet(null);
  dataSet.setDataSource(dataSource.getName());
  ScalarParameterHandle param1=reportHandle.getElementFactory().newScalarParameter("String_Node_Str");
  ScalarParameterHandle param2=reportHandle.getElementFactory().newScalarParameter("String_Node_Str");
  ParameterGroupHandle paramGroup=reportHandle.getElementFactory().newParameterGroup(null);
  paramGroup.addElement(param2,ParameterGroupHandle.PARAMETERS_SLOT);
  reportHandle.getDataSources().add(dataSource);
  reportHandle.getDataSets().add(dataSet);
  reportHandle.getParameters().add(param1);
  reportHandle.getParameters().add(paramGroup);
  LabelHandle label1=reportHandle.getElementFactory().newLabel(null);
  LabelHandle label2=reportHandle.getElementFactory().newLabel(null);
  TextItemHandle text=reportHandle.getElementFactory().newTextItem(null);
  ListHandle list=reportHandle.getElementFactory().newList(null);
  ListGroupHandle listGroup=reportHandle.getElementFactory().newListGroup();
  listGroup.getHeader().add(label2);
  list.getDetail().add(text);
  list.getGroups().add(listGroup);
  reportHandle.getBody().add(label1);
  reportHandle.getBody().add(list);
  getView(DATA_EXPLORER_ID).setFocus();
  dataTreeViewer.refresh();
  getView(OUTLINE_ID).setFocus();
  outlineTreeViewer.refresh();
  try {
    assertTrue(UIUtil.containElement(outlineTreeViewer,label1));
    assertTrue(UIUtil.containElement(outlineTreeViewer,label2));
    assertTrue(UIUtil.containElement(outlineTreeViewer,text));
    assertTrue(UIUtil.containElement(outlineTreeViewer,list));
    assertTrue(UIUtil.containElement(outlineTreeViewer,listGroup));
    assertTrue(UIUtil.containElement(dataTreeViewer,dataSource));
    assertTrue(UIUtil.containElement(dataTreeViewer,dataSet));
    assertTrue(UIUtil.containElement(dataTreeViewer,param1));
    assertTrue(UIUtil.containElement(dataTreeViewer,paramGroup));
    assertTrue(UIUtil.containElement(dataTreeViewer,param2));
    assertFalse(UIUtil.containElement(outlineTreeViewer,dataSource));
    assertFalse(UIUtil.containElement(outlineTreeViewer,dataSet));
    assertFalse(UIUtil.containElement(outlineTreeViewer,param1));
    assertFalse(UIUtil.containElement(outlineTreeViewer,paramGroup));
    assertFalse(UIUtil.containElement(outlineTreeViewer,param2));
    assertFalse(UIUtil.containElement(dataTreeViewer,label1));
    assertFalse(UIUtil.containElement(dataTreeViewer,label2));
    assertFalse(UIUtil.containElement(dataTreeViewer,text));
    assertFalse(UIUtil.containElement(dataTreeViewer,list));
    assertFalse(UIUtil.containElement(dataTreeViewer,listGroup));
  }
 catch (  Throwable e) {
    throw e;
  }
 finally {
    closeEditor();
  }
}