Program: 75393
Project: 75393
Buggy source:
/** 
 * Tests set�aa� mthods. Test cases: <ul> <li>Case1:Get the default RGB and units value. <li>Case2:Set correct new value for RGB and units. <li>Case3:Set incorrect new default value for RGB and units. Exception expected. <li>Case4:Set correct default value for dimension type property.Get the value. <li>Case5:Set incorrect default value for it. Exception expected. </ul>
 * @throws PropertyValueException
 */
public void testSetValue() throws PropertyValueException {
  DesignSession session=new DesignSession(null);
  assertEquals(3,session.getColorFormat());
  session.setColorFormat(2);
  assertEquals(2,session.getColorFormat());
  try {
    session.setColorFormat(999999);
    fail();
  }
 catch (  PropertyValueException e) {
    assertEquals(PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE,e.getErrorCode());
  }
  assertEquals(2,session.getColorFormat());
  assertEquals("String_Node_Str",session.getUnits());
  session.setUnits("String_Node_Str");
  assertEquals("String_Node_Str",session.getUnits());
  try {
    session.setUnits("String_Node_Str");
    fail();
  }
 catch (  PropertyValueException e) {
    assertEquals(PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE,e.getErrorCode());
  }
  assertEquals("String_Node_Str",session.getUnits());
  assertNull(session.getDefaultValue(IStyleModel.FONT_SIZE_PROP));
  session.setDefaultValue(IStyleModel.FONT_SIZE_PROP,"String_Node_Str");
  assertEquals("String_Node_Str",((DimensionValue)session.getDefaultValue(IStyleModel.FONT_SIZE_PROP)).toString());
  try {
    session.setDefaultValue(IStyleModel.FONT_SIZE_PROP,"String_Node_Str");
    fail();
  }
 catch (  PropertyValueException pve) {
    assertEquals(PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE,pve.getErrorCode());
  }
  session.setDefaultValue(IStyleModel.FONT_SIZE_PROP,null);
}

Fixed version (ground truth):
/** 
 * Tests setValue methods. Test cases: <ul> <li>Case1:Get the default RGB and units value. <li>Case2:Set correct new value for RGB and units. <li>Case3:Set incorrect new default value for RGB and units. Exception expected. <li>Case4:Set correct default value for dimension type property.Get the value. <li>Case5:Set incorrect default value for it. Exception expected. </ul>
 * @throws PropertyValueException
 */
public void testSetValue() throws PropertyValueException {
  DesignSession session=new DesignSession(null);
  assertEquals(3,session.getColorFormat());
  session.setColorFormat(2);
  assertEquals(2,session.getColorFormat());
  try {
    session.setColorFormat(999999);
    fail();
  }
 catch (  PropertyValueException e) {
    assertEquals(PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE,e.getErrorCode());
  }
  assertEquals(2,session.getColorFormat());
  assertEquals("String_Node_Str",session.getUnits());
  session.setUnits("String_Node_Str");
  assertEquals("String_Node_Str",session.getUnits());
  try {
    session.setUnits("String_Node_Str");
    fail();
  }
 catch (  PropertyValueException e) {
    assertEquals(PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE,e.getErrorCode());
  }
  assertEquals("String_Node_Str",session.getUnits());
  assertNull(session.getDefaultValue(IStyleModel.FONT_SIZE_PROP));
  session.setDefaultValue(IStyleModel.FONT_SIZE_PROP,"String_Node_Str");
  assertEquals("String_Node_Str",((DimensionValue)session.getDefaultValue(IStyleModel.FONT_SIZE_PROP)).toString());
  try {
    session.setDefaultValue(IStyleModel.FONT_SIZE_PROP,"String_Node_Str");
    fail();
  }
 catch (  PropertyValueException pve) {
    assertEquals(PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE,pve.getErrorCode());
  }
  session.setDefaultValue(IStyleModel.FONT_SIZE_PROP,null);
}