Program: 73185
Project: 73185
Buggy source:
/** 
 * @throws Exception
 */
public void testParser() throws Exception {
  openDesign(FILE_NAME);
  assertNotNull(designHandle);
  TabularCubeHandle cube=(TabularCubeHandle)designHandle.findCube("String_Node_Str");
  assertEquals(designHandle.findDataSet("String_Node_Str"),cube.getDataSet());
  Iterator iter=cube.filtersIterator();
  FilterConditionHandle filterConditionHandle=(FilterConditionHandle)iter.next();
  assertEquals("String_Node_Str",filterConditionHandle.getExpr());
  iter=cube.joinConditionsIterator();
  DimensionConditionHandle cubeJoinConditionHandle=(DimensionConditionHandle)iter.next();
  assertEquals(design.findOLAPElement("String_Node_Str"),cubeJoinConditionHandle.getHierarchy().getElement());
  MemberHandle conditionMemberHandle=cubeJoinConditionHandle.getJoinConditions();
  assertEquals(3,conditionMemberHandle.getListValue().size());
  DimensionJoinConditionHandle joinCondition=(DimensionJoinConditionHandle)conditionMemberHandle.getAt(0);
  assertEquals("String_Node_Str",joinCondition.getCubeKey());
  assertEquals("String_Node_Str",joinCondition.getHierarchyKey());
  assertEquals(designHandle.findLevel("String_Node_Str"),joinCondition.getLevel());
  joinCondition=(DimensionJoinConditionHandle)conditionMemberHandle.getAt(1);
  assertEquals("String_Node_Str",joinCondition.getCubeKey());
  assertEquals("String_Node_Str",joinCondition.getHierarchyKey());
  joinCondition=(DimensionJoinConditionHandle)conditionMemberHandle.getAt(2);
  assertEquals("String_Node_Str",joinCondition.getCubeKey());
  assertEquals("String_Node_Str",joinCondition.getHierarchyKey());
  cubeJoinConditionHandle=(DimensionConditionHandle)iter.next();
  assertNull(cubeJoinConditionHandle.getHierarchy());
  assertEquals("String_Node_Str",cubeJoinConditionHandle.getHierarchyName());
  conditionMemberHandle=cubeJoinConditionHandle.getJoinConditions();
  assertEquals(1,conditionMemberHandle.getListValue().size());
  Iterator iter1=cube.accessControlsIterator();
  AccessControlHandle accessControl=(AccessControlHandle)iter1.next();
  assertEquals("String_Node_Str",accessControl.getPropertyHandle(IAccessControlModel.USER_NAMES_PROP).getStringValue());
  assertEquals("String_Node_Str",accessControl.getPropertyHandle(IAccessControlModel.ROLES_PROP).getStringValue());
  assertEquals(DesignChoiceConstants.ACCESS_PERMISSION_DISALLOW,accessControl.getPermission());
  PropertyHandle propHandle=cube.getPropertyHandle(TabularCubeHandle.DIMENSIONS_PROP);
  assertEquals(1,propHandle.getContentCount());
  assertEquals(1,cube.getContentCount(TabularCubeHandle.DIMENSIONS_PROP));
  DimensionHandle dimension=(DimensionHandle)propHandle.getContent(0);
  assertEquals(dimension,cube.getContent(TabularCubeHandle.DIMENSIONS_PROP,0));
  assertEquals("String_Node_Str",dimension.getName());
  assertTrue(dimension.isTimeType());
  propHandle=dimension.getPropertyHandle(DimensionHandle.HIERARCHIES_PROP);
  assertEquals(1,propHandle.getContentCount());
  assertEquals(1,dimension.getContentCount(DimensionHandle.HIERARCHIES_PROP));
  TabularHierarchyHandle hierarchy=(TabularHierarchyHandle)propHandle.getContent(0);
  assertEquals(hierarchy,dimension.getContent(DimensionHandle.HIERARCHIES_PROP,0));
  assertEquals(hierarchy,dimension.getDefaultHierarchy());
  assertEquals("String_Node_Str",hierarchy.getName());
  assertEquals(designHandle.findDataSet("String_Node_Str"),hierarchy.getDataSet());
  iter1=hierarchy.accessControlsIterator();
  accessControl=(AccessControlHandle)iter1.next();
  assertEquals("String_Node_Str",accessControl.getPropertyHandle(IAccessControlModel.USER_NAMES_PROP).getStringValue());
  assertEquals("String_Node_Str",accessControl.getPropertyHandle(IAccessControlModel.ROLES_PROP).getStringValue());
  assertEquals(DesignChoiceConstants.ACCESS_PERMISSION_ALLOW,accessControl.getPermission());
  propHandle=cube.getPropertyHandle(TabularCubeHandle.DIMENSIONS_PROP);
  assertEquals(1,propHandle.getContentCount());
  assertEquals(1,cube.getContentCount(TabularCubeHandle.DIMENSIONS_PROP));
  iter=hierarchy.filtersIterator();
  filterConditionHandle=(FilterConditionHandle)iter.next();
  assertEquals("String_Node_Str",filterConditionHandle.getExpr());
  List primaryKeys=hierarchy.getPrimaryKeys();
  assertEquals(3,primaryKeys.size());
  assertEquals("String_Node_Str",primaryKeys.get(0));
  assertEquals("String_Node_Str",primaryKeys.get(1));
  assertEquals("String_Node_Str",primaryKeys.get(2));
  propHandle=hierarchy.getPropertyHandle(TabularHierarchyHandle.LEVELS_PROP);
  assertEquals(1,propHandle.getContentCount());
  assertEquals(1,hierarchy.getContentCount(TabularHierarchyHandle.LEVELS_PROP));
  TabularLevelHandle level=(TabularLevelHandle)propHandle.getContent(0);
  assertEquals(level,hierarchy.getContent(TabularHierarchyHandle.LEVELS_PROP,0));
  assertEquals("String_Node_Str",level.getName());
  assertEquals("String_Node_Str",level.getColumnName());
  assertEquals(DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER,level.getDataType());
  assertEquals("String_Node_Str",level.getInterval());
  assertEquals(DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_MONTH,level.getDateTimeLevelType());
  assertEquals("String_Node_Str",level.getDateTimeFormat());
  assertEquals(3.0,level.getIntervalRange(),0.00);
  assertEquals("String_Node_Str",level.getIntervalBase());
  assertEquals(DesignChoiceConstants.LEVEL_TYPE_DYNAMIC,level.getLevelType());
  iter=level.staticValuesIterator();
  RuleHandle rule=(RuleHandle)iter.next();
  assertEquals("String_Node_Str",rule.getRuleExpression());
  assertEquals("String_Node_Str",rule.getDisplayExpression());
  rule=(RuleHandle)iter.next();
  assertEquals("String_Node_Str",rule.getRuleExpression());
  assertEquals("String_Node_Str",rule.getDisplayExpression());
  iter=level.attributesIterator();
  LevelAttributeHandle attribute=(LevelAttributeHandle)iter.next();
  assertEquals("String_Node_Str",attribute.getName());
  assertEquals(DesignChoiceConstants.COLUMN_DATA_TYPE_STRING,attribute.getDataType());
  attribute=(LevelAttributeHandle)iter.next();
  assertEquals("String_Node_Str",attribute.getName());
  assertEquals(DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER,attribute.getDataType());
  iter1=level.valueAccessControlsIterator();
  ValueAccessControlHandle valueAccessControl=(ValueAccessControlHandle)iter1.next();
  assertEquals("String_Node_Str",valueAccessControl.getPropertyHandle(IAccessControlModel.USER_NAMES_PROP).getStringValue());
  assertEquals("String_Node_Str",valueAccessControl.getPropertyHandle(IAccessControlModel.ROLES_PROP).getStringValue());
  assertEquals("String_Node_Str",valueAccessControl.getPropertyHandle(IValueAccessControlModel.VALUES_PROP).getStringValue());
  assertEquals(DesignChoiceConstants.ACCESS_PERMISSION_DISALLOW,valueAccessControl.getPermission());
  propHandle=cube.getPropertyHandle(TabularCubeHandle.MEASURE_GROUPS_PROP);
  assertEquals(1,propHandle.getContentCount());
  assertEquals(1,cube.getContentCount(TabularCubeHandle.MEASURE_GROUPS_PROP));
  MeasureGroupHandle measureGroup=(MeasureGroupHandle)propHandle.getContent(0);
  assertEquals(measureGroup,cube.getContent(TabularCubeHandle.MEASURE_GROUPS_PROP,0));
  assertEquals("String_Node_Str",measureGroup.getName());
  assertEquals(measureGroup,cube.getDefaultMeasureGroup());
  propHandle=measureGroup.getPropertyHandle(MeasureGroupHandle.MEASURES_PROP);
  MeasureHandle measure=(MeasureHandle)propHandle.getContent(0);
  assertEquals("String_Node_Str",measure.getName());
  assertEquals("String_Node_Str",measure.getMeasureExpression());
  assertEquals(DesignChoiceConstants.MEASURE_FUNCTION_MIN,measure.getFunction());
  assertFalse(measure.isCalculated());
  assertEquals(DesignChoiceConstants.COLUMN_DATA_TYPE_STRING,measure.getDataType());
}

Fixed version (ground truth):
/** 
 * @throws Exception
 */
public void testParser() throws Exception {
  openDesign(FILE_NAME);
  assertNotNull(designHandle);
  TabularCubeHandle cube=(TabularCubeHandle)designHandle.findCube("String_Node_Str");
  assertEquals(designHandle.findDataSet("String_Node_Str"),cube.getDataSet());
  Iterator iter=cube.filtersIterator();
  FilterConditionHandle filterConditionHandle=(FilterConditionHandle)iter.next();
  assertEquals("String_Node_Str",filterConditionHandle.getExpr());
  iter=cube.joinConditionsIterator();
  DimensionConditionHandle cubeJoinConditionHandle=(DimensionConditionHandle)iter.next();
  assertEquals(design.findOLAPElement("String_Node_Str"),cubeJoinConditionHandle.getHierarchy().getElement());
  MemberHandle conditionMemberHandle=cubeJoinConditionHandle.getJoinConditions();
  assertEquals(3,conditionMemberHandle.getListValue().size());
  DimensionJoinConditionHandle joinCondition=(DimensionJoinConditionHandle)conditionMemberHandle.getAt(0);
  assertEquals("String_Node_Str",joinCondition.getCubeKey());
  assertEquals("String_Node_Str",joinCondition.getHierarchyKey());
  assertEquals(designHandle.findLevel("String_Node_Str"),joinCondition.getLevel());
  joinCondition=(DimensionJoinConditionHandle)conditionMemberHandle.getAt(1);
  assertEquals("String_Node_Str",joinCondition.getCubeKey());
  assertEquals("String_Node_Str",joinCondition.getHierarchyKey());
  joinCondition=(DimensionJoinConditionHandle)conditionMemberHandle.getAt(2);
  assertEquals("String_Node_Str",joinCondition.getCubeKey());
  assertEquals("String_Node_Str",joinCondition.getHierarchyKey());
  cubeJoinConditionHandle=(DimensionConditionHandle)iter.next();
  assertNull(cubeJoinConditionHandle.getHierarchy());
  assertEquals("String_Node_Str",cubeJoinConditionHandle.getHierarchyName());
  conditionMemberHandle=cubeJoinConditionHandle.getJoinConditions();
  assertEquals(1,conditionMemberHandle.getListValue().size());
  Iterator iter1=cube.accessControlsIterator();
  AccessControlHandle accessControl=(AccessControlHandle)iter1.next();
  assertEquals("String_Node_Str",accessControl.getPropertyHandle(IAccessControlModel.USER_NAMES_PROP).getStringValue());
  assertEquals("String_Node_Str",accessControl.getPropertyHandle(IAccessControlModel.ROLES_PROP).getStringValue());
  assertEquals(DesignChoiceConstants.ACCESS_PERMISSION_DISALLOW,accessControl.getPermission());
  PropertyHandle propHandle=cube.getPropertyHandle(TabularCubeHandle.DIMENSIONS_PROP);
  assertEquals(1,propHandle.getContentCount());
  assertEquals(1,cube.getContentCount(TabularCubeHandle.DIMENSIONS_PROP));
  DimensionHandle dimension=(DimensionHandle)propHandle.getContent(0);
  assertEquals(dimension,cube.getContent(TabularCubeHandle.DIMENSIONS_PROP,0));
  assertEquals("String_Node_Str",dimension.getName());
  assertTrue(dimension.isTimeType());
  propHandle=dimension.getPropertyHandle(DimensionHandle.HIERARCHIES_PROP);
  assertEquals(1,propHandle.getContentCount());
  assertEquals(1,dimension.getContentCount(DimensionHandle.HIERARCHIES_PROP));
  TabularHierarchyHandle hierarchy=(TabularHierarchyHandle)propHandle.getContent(0);
  assertEquals(hierarchy,dimension.getContent(DimensionHandle.HIERARCHIES_PROP,0));
  assertEquals(hierarchy,dimension.getDefaultHierarchy());
  assertEquals("String_Node_Str",hierarchy.getName());
  assertEquals(designHandle.findDataSet("String_Node_Str"),hierarchy.getDataSet());
  TabularLevelHandle level=(TabularLevelHandle)hierarchy.getLevel("String_Node_Str");
  assertNotNull(level);
  iter1=hierarchy.accessControlsIterator();
  accessControl=(AccessControlHandle)iter1.next();
  assertEquals("String_Node_Str",accessControl.getPropertyHandle(IAccessControlModel.USER_NAMES_PROP).getStringValue());
  assertEquals("String_Node_Str",accessControl.getPropertyHandle(IAccessControlModel.ROLES_PROP).getStringValue());
  assertEquals(DesignChoiceConstants.ACCESS_PERMISSION_ALLOW,accessControl.getPermission());
  propHandle=cube.getPropertyHandle(TabularCubeHandle.DIMENSIONS_PROP);
  assertEquals(1,propHandle.getContentCount());
  assertEquals(1,cube.getContentCount(TabularCubeHandle.DIMENSIONS_PROP));
  iter=hierarchy.filtersIterator();
  filterConditionHandle=(FilterConditionHandle)iter.next();
  assertEquals("String_Node_Str",filterConditionHandle.getExpr());
  List primaryKeys=hierarchy.getPrimaryKeys();
  assertEquals(3,primaryKeys.size());
  assertEquals("String_Node_Str",primaryKeys.get(0));
  assertEquals("String_Node_Str",primaryKeys.get(1));
  assertEquals("String_Node_Str",primaryKeys.get(2));
  propHandle=hierarchy.getPropertyHandle(TabularHierarchyHandle.LEVELS_PROP);
  assertEquals(1,propHandle.getContentCount());
  assertEquals(1,hierarchy.getContentCount(TabularHierarchyHandle.LEVELS_PROP));
  level=(TabularLevelHandle)propHandle.getContent(0);
  assertEquals(level,hierarchy.getContent(TabularHierarchyHandle.LEVELS_PROP,0));
  assertEquals("String_Node_Str",level.getName());
  assertEquals("String_Node_Str",level.getColumnName());
  assertEquals(DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER,level.getDataType());
  assertEquals("String_Node_Str",level.getInterval());
  assertEquals(DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_MONTH,level.getDateTimeLevelType());
  assertEquals("String_Node_Str",level.getDateTimeFormat());
  assertEquals(3.0,level.getIntervalRange(),0.00);
  assertEquals("String_Node_Str",level.getIntervalBase());
  assertEquals(DesignChoiceConstants.LEVEL_TYPE_DYNAMIC,level.getLevelType());
  iter=level.staticValuesIterator();
  RuleHandle rule=(RuleHandle)iter.next();
  assertEquals("String_Node_Str",rule.getRuleExpression());
  assertEquals("String_Node_Str",rule.getDisplayExpression());
  rule=(RuleHandle)iter.next();
  assertEquals("String_Node_Str",rule.getRuleExpression());
  assertEquals("String_Node_Str",rule.getDisplayExpression());
  iter=level.attributesIterator();
  LevelAttributeHandle attribute=(LevelAttributeHandle)iter.next();
  assertEquals("String_Node_Str",attribute.getName());
  assertEquals(DesignChoiceConstants.COLUMN_DATA_TYPE_STRING,attribute.getDataType());
  attribute=(LevelAttributeHandle)iter.next();
  assertEquals("String_Node_Str",attribute.getName());
  assertEquals(DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER,attribute.getDataType());
  iter1=level.valueAccessControlsIterator();
  ValueAccessControlHandle valueAccessControl=(ValueAccessControlHandle)iter1.next();
  assertEquals("String_Node_Str",valueAccessControl.getPropertyHandle(IAccessControlModel.USER_NAMES_PROP).getStringValue());
  assertEquals("String_Node_Str",valueAccessControl.getPropertyHandle(IAccessControlModel.ROLES_PROP).getStringValue());
  assertEquals("String_Node_Str",valueAccessControl.getPropertyHandle(IValueAccessControlModel.VALUES_PROP).getStringValue());
  assertEquals(DesignChoiceConstants.ACCESS_PERMISSION_DISALLOW,valueAccessControl.getPermission());
  propHandle=cube.getPropertyHandle(TabularCubeHandle.MEASURE_GROUPS_PROP);
  assertEquals(1,propHandle.getContentCount());
  assertEquals(1,cube.getContentCount(TabularCubeHandle.MEASURE_GROUPS_PROP));
  MeasureGroupHandle measureGroup=(MeasureGroupHandle)propHandle.getContent(0);
  assertEquals(measureGroup,cube.getContent(TabularCubeHandle.MEASURE_GROUPS_PROP,0));
  assertEquals("String_Node_Str",measureGroup.getName());
  assertEquals(measureGroup,cube.getDefaultMeasureGroup());
  propHandle=measureGroup.getPropertyHandle(MeasureGroupHandle.MEASURES_PROP);
  MeasureHandle measure=(MeasureHandle)propHandle.getContent(0);
  assertEquals("String_Node_Str",measure.getName());
  assertEquals("String_Node_Str",measure.getMeasureExpression());
  assertEquals(DesignChoiceConstants.MEASURE_FUNCTION_MIN,measure.getFunction());
  assertFalse(measure.isCalculated());
  assertEquals(DesignChoiceConstants.COLUMN_DATA_TYPE_STRING,measure.getDataType());
}