Program: 75583
Project: 75583
Buggy source:
public void testCube1AggregationWithColPara() throws IOException, DataException, BirtException {
  CubeQueryExecutorHelper cubeQueryExcutorHelper=new CubeQueryExecutorHelper(CubeQueryExecutorHelper.loadCube("String_Node_Str",documentManager,new StopSign()));
  ISelection[][] filter=new ISelection[1][1];
  filter[0][0]=SelectionFactory.createRangeSelection(new Object[]{"String_Node_Str"},new Object[]{"String_Node_Str"},true,false);
  cubeQueryExcutorHelper.addFilter(new LevelFilter(dimLevel21,filter[0]));
  AggregationDefinition[] aggregations=new AggregationDefinition[1];
  int[] sortType=new int[1];
  sortType[0]=IDimensionSortDefn.SORT_ASC;
  AggregationFunctionDefinition[] funcitons=new AggregationFunctionDefinition[1];
  funcitons[0]=new AggregationFunctionDefinition("String_Node_Str",IBuildInAggregation.TOTAL_SUM_FUNC);
  AggregationFunctionDefinition[] funcitonsWithParameterCol=new AggregationFunctionDefinition[1];
  funcitonsWithParameterCol[0]=new AggregationFunctionDefinition("String_Node_Str",IBuildInAggregation.TOTAL_SUM_FUNC);
  funcitonsWithParameterCol[0]=new AggregationFunctionDefinition(null,"String_Node_Str","String_Node_Str",IBuildInAggregation.TOTAL_WEIGHTEDAVE_FUNC);
  aggregations[0]=new AggregationDefinition(null,null,funcitonsWithParameterCol);
  IAggregationResultSet[] resultSet=cubeQueryExcutorHelper.execute(aggregations,new StopSign());
  assertEquals(resultSet[0].length(),1);
  assertEquals(resultSet[0].getAggregationDataType(0),DataType.DOUBLE_TYPE);
  assertEquals(resultSet[0].getLevelIndex(dimLevel31),-1);
  resultSet[0].seek(0);
  assertEquals(resultSet[0].getLevelKeyValue(0),null);
  assertEquals(resultSet[0].getAggregationValue(0),new Double(3.8333333333333335));
  for (int i=0; i < resultSet.length; i++) {
    resultSet[i].close();
  }
}

Fixed version (ground truth):
public void testCube1AggregationWithColPara() throws IOException, DataException, BirtException {
  CubeQueryExecutorHelper cubeQueryExcutorHelper=new CubeQueryExecutorHelper(CubeQueryExecutorHelper.loadCube("String_Node_Str",documentManager,new StopSign()));
  ISelection[][] filter=new ISelection[1][1];
  filter[0][0]=SelectionFactory.createRangeSelection(new Object[]{"String_Node_Str"},new Object[]{"String_Node_Str"},true,false);
  cubeQueryExcutorHelper.addFilter(new LevelFilter(dimLevel21,filter[0]));
  AggregationDefinition[] aggregations=new AggregationDefinition[1];
  int[] sortType=new int[1];
  sortType[0]=IDimensionSortDefn.SORT_ASC;
  AggregationFunctionDefinition[] funcitons=new AggregationFunctionDefinition[1];
  funcitons[0]=new AggregationFunctionDefinition("String_Node_Str",IBuildInAggregation.TOTAL_SUM_FUNC);
  AggregationFunctionDefinition[] funcitonsWithParameterCol=new AggregationFunctionDefinition[1];
  funcitonsWithParameterCol[0]=new AggregationFunctionDefinition("String_Node_Str",IBuildInAggregation.TOTAL_SUM_FUNC);
  funcitonsWithParameterCol[0]=new AggregationFunctionDefinition(null,"String_Node_Str",new DimLevel("String_Node_Str","String_Node_Str"),"String_Node_Str",IBuildInAggregation.TOTAL_WEIGHTEDAVE_FUNC);
  aggregations[0]=new AggregationDefinition(null,null,funcitonsWithParameterCol);
  IAggregationResultSet[] resultSet=cubeQueryExcutorHelper.execute(aggregations,new StopSign());
  assertEquals(resultSet[0].length(),1);
  assertEquals(resultSet[0].getAggregationDataType(0),DataType.DOUBLE_TYPE);
  assertEquals(resultSet[0].getLevelIndex(dimLevel31),-1);
  resultSet[0].seek(0);
  assertEquals(resultSet[0].getLevelKeyValue(0),null);
  assertEquals(resultSet[0].getAggregationValue(0),new Double(3.8333333333333335));
  for (int i=0; i < resultSet.length; i++) {
    resultSet[i].close();
  }
}