Program: 76326
Project: 76326
Buggy source:
public void testParserForSupportedProperties() throws Exception {
  assertNotNull(style1);
  assertNotNull(style2);
  assertNotNull(style3);
  assertEquals("String_Node_Str",style1.getProperty(IStyleModel.FONT_FAMILY_PROP));
  assertEquals("String_Node_Str",style2.getProperty(IStyleModel.FONT_FAMILY_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.FONT_SIZE_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.FONT_SIZE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.FONT_STYLE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.FONT_WEIGHT_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.FONT_VARIANT_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.COLOR_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.COLOR_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.TEXT_UNDERLINE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.TEXT_OVERLINE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.TEXT_LINE_THROUGH_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BACKGROUND_ATTACHMENT_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BACKGROUND_COLOR_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BACKGROUND_COLOR_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BACKGROUND_IMAGE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BACKGROUND_POSITION_X_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BACKGROUND_POSITION_Y_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BACKGROUND_POSITION_X_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BACKGROUND_POSITION_Y_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BACKGROUND_REPEAT_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.LETTER_SPACING_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.LETTER_SPACING_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.LINE_HEIGHT_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.LINE_HEIGHT_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.TEXT_ALIGN_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.TEXT_INDENT_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.TEXT_TRANSFORM_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.VERTICAL_ALIGN_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.VERTICAL_ALIGN_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.WHITE_SPACE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.WIDOWS_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.WIDOWS_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.ORPHANS_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.ORPHANS_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.WORD_SPACING_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.WORD_SPACING_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.DISPLAY_PROP));
  style1.setMasterPage("String_Node_Str");
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.MASTER_PAGE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.PAGE_BREAK_BEFORE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.PAGE_BREAK_AFTER_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.PAGE_BREAK_INSIDE_PROP));
  style1.setShowIfBlank(true);
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.SHOW_IF_BLANK_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_TOP_STYLE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_TOP_WIDTH_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BORDER_TOP_WIDTH_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_TOP_COLOR_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BORDER_TOP_COLOR_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_LEFT_STYLE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_LEFT_WIDTH_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BORDER_LEFT_WIDTH_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_LEFT_COLOR_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BORDER_LEFT_COLOR_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_BOTTOM_STYLE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_BOTTOM_WIDTH_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BORDER_BOTTOM_WIDTH_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_BOTTOM_COLOR_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BORDER_BOTTOM_COLOR_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_RIGHT_STYLE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_RIGHT_WIDTH_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BORDER_RIGHT_WIDTH_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_RIGHT_COLOR_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BORDER_RIGHT_COLOR_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.MARGIN_TOP_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.MARGIN_TOP_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.MARGIN_BOTTOM_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.MARGIN_BOTTOM_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.MARGIN_LEFT_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.MARGIN_LEFT_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.MARGIN_RIGHT_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.MARGIN_RIGHT_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.PADDING_TOP_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.PADDING_LEFT_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.PADDING_BOTTOM_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.PADDING_RIGHT_PROP));
  DateTimeFormatValue dtfValue=new DateTimeFormatValue();
  dtfValue.setCategory("String_Node_Str");
  dtfValue.setPattern("String_Node_Str");
  style1.setDateTimeFormatCategory(dtfValue.getCategory());
  style1.setDateTimeFormat(dtfValue.getPattern());
  assertEquals(dtfValue.getCategory(),((DateTimeFormatValue)style1.getProperty(IStyleModel.DATE_TIME_FORMAT_PROP)).getCategory());
  assertEquals(dtfValue.getPattern(),((DateTimeFormatValue)style1.getProperty(IStyleModel.DATE_TIME_FORMAT_PROP)).getPattern());
  NumberFormatValue nfValue=new NumberFormatValue();
  nfValue.setCategory("String_Node_Str");
  nfValue.setPattern("String_Node_Str");
  style1.setNumberFormatCategory(nfValue.getCategory());
  style1.setNumberFormat(nfValue.getPattern());
  assertEquals(nfValue.getCategory(),((NumberFormatValue)style1.getProperty(IStyleModel.NUMBER_FORMAT_PROP)).getCategory());
  assertEquals(nfValue.getPattern(),((NumberFormatValue)style1.getProperty(IStyleModel.NUMBER_FORMAT_PROP)).getPattern());
  style1.setProperty(IStyleModel.NUMBER_ALIGN_PROP,"String_Node_Str");
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.NUMBER_ALIGN_PROP));
  StringFormatValue sfValue=new StringFormatValue();
  sfValue.setCategory("String_Node_Str");
  sfValue.setPattern("String_Node_Str");
  style1.setStringFormatCategory(sfValue.getCategory());
  style1.setStringFormat(sfValue.getPattern());
  assertEquals(sfValue.getCategory(),((StringFormatValue)style1.getProperty(IStyleModel.STRING_FORMAT_PROP)).getCategory());
  assertEquals(sfValue.getPattern(),((StringFormatValue)style1.getProperty(IStyleModel.STRING_FORMAT_PROP)).getPattern());
  style1.setCanShrink(false);
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.CAN_SHRINK_PROP));
  MapRule mr=new MapRule();
  mr.setOperator("String_Node_Str");
  mr.setValue1("String_Node_Str");
  mr.setValue2("String_Node_Str");
  mr.setTestExpression("String_Node_Str");
  mr.setDisplay("String_Node_Str");
  List mapList=new ArrayList();
  mapList.add(mr);
  PropertyHandle mapRules=style1.getPropertyHandle(IStyleModel.MAP_RULES_PROP);
  mapRules.addItem(mr);
  assertEquals(mr.getOperator(),((MapRule)((List)style1.getProperty(IStyleModel.MAP_RULES_PROP)).get(0)).getOperator());
  assertEquals(mr.getValue1(),((MapRule)((List)style1.getProperty(IStyleModel.MAP_RULES_PROP)).get(0)).getValue1());
  assertEquals(mr.getValue2(),((MapRule)((List)style1.getProperty(IStyleModel.MAP_RULES_PROP)).get(0)).getValue2());
  assertEquals(mr.getTestExpression(),((MapRule)((List)style1.getProperty(IStyleModel.MAP_RULES_PROP)).get(0)).getTestExpression());
  assertEquals(mr.getDisplay(),((MapRule)((List)style1.getProperty(IStyleModel.MAP_RULES_PROP)).get(0)).getDisplay());
  HighlightRule hlr=new HighlightRule();
  hlr.setOperator("String_Node_Str");
  hlr.setValue1("String_Node_Str");
  hlr.setTestExpression("String_Node_Str");
  hlr.setProperty(IStyleModel.BACKGROUND_COLOR_PROP,"String_Node_Str");
  List highlight=new ArrayList();
  highlight.add(hlr);
  PropertyHandle highlightRules=style1.getPropertyHandle(IStyleModel.HIGHLIGHT_RULES_PROP);
  highlightRules.addItem(hlr);
  assertEquals(hlr.getOperator(),((HighlightRule)((List)style1.getProperty(IStyleModel.HIGHLIGHT_RULES_PROP)).get(0)).getOperator());
  assertEquals(hlr.getValue1(),((HighlightRule)((List)style1.getProperty(IStyleModel.HIGHLIGHT_RULES_PROP)).get(0)).getValue1());
  assertEquals(hlr.getTestExpression(),((HighlightRule)((List)style1.getProperty(IStyleModel.HIGHLIGHT_RULES_PROP)).get(0)).getTestExpression());
  assertEquals(hlr.getProperty(designHandle.getModule(),"String_Node_Str"),((HighlightRule)((List)style1.getProperty(IStyleModel.HIGHLIGHT_RULES_PROP)).get(0)).getProperty(designHandle.getModule(),"String_Node_Str"));
}

Fixed version (ground truth):
public void testParserForSupportedProperties() throws Exception {
  assertNotNull(style1);
  assertNotNull(style2);
  assertNotNull(style3);
  assertEquals("String_Node_Str",style1.getProperty(IStyleModel.FONT_FAMILY_PROP));
  assertEquals("String_Node_Str",style2.getProperty(IStyleModel.FONT_FAMILY_PROP).toString());
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.FONT_SIZE_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.FONT_SIZE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.FONT_STYLE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.FONT_WEIGHT_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.FONT_VARIANT_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.COLOR_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.COLOR_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.TEXT_UNDERLINE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.TEXT_OVERLINE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.TEXT_LINE_THROUGH_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BACKGROUND_ATTACHMENT_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BACKGROUND_COLOR_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BACKGROUND_COLOR_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BACKGROUND_IMAGE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BACKGROUND_POSITION_X_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BACKGROUND_POSITION_Y_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BACKGROUND_POSITION_X_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BACKGROUND_POSITION_Y_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BACKGROUND_REPEAT_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.LETTER_SPACING_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.LETTER_SPACING_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.LINE_HEIGHT_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.LINE_HEIGHT_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.TEXT_ALIGN_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.TEXT_INDENT_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.TEXT_TRANSFORM_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.VERTICAL_ALIGN_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.VERTICAL_ALIGN_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.WHITE_SPACE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.WIDOWS_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.WIDOWS_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.ORPHANS_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.ORPHANS_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.WORD_SPACING_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.WORD_SPACING_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_TOP_STYLE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_TOP_WIDTH_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BORDER_TOP_WIDTH_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_TOP_COLOR_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BORDER_TOP_COLOR_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_LEFT_STYLE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_LEFT_WIDTH_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BORDER_LEFT_WIDTH_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_LEFT_COLOR_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BORDER_LEFT_COLOR_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_BOTTOM_STYLE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_BOTTOM_WIDTH_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BORDER_BOTTOM_WIDTH_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_BOTTOM_COLOR_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BORDER_BOTTOM_COLOR_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_RIGHT_STYLE_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_RIGHT_WIDTH_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BORDER_RIGHT_WIDTH_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.BORDER_RIGHT_COLOR_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.BORDER_RIGHT_COLOR_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.MARGIN_TOP_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.MARGIN_TOP_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.MARGIN_BOTTOM_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.MARGIN_BOTTOM_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.MARGIN_LEFT_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.MARGIN_LEFT_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.MARGIN_RIGHT_PROP));
  assertEquals("String_Node_Str",style2.getStringProperty(IStyleModel.MARGIN_RIGHT_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.PADDING_TOP_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.PADDING_LEFT_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.PADDING_BOTTOM_PROP));
  assertEquals("String_Node_Str",style1.getStringProperty(IStyleModel.PADDING_RIGHT_PROP));
}