Index: PropertyEditorSupportTest.java =================================================================== --- PropertyEditorSupportTest.java (revision 430759) +++ PropertyEditorSupportTest.java (working copy) @@ -256,6 +256,50 @@ assertFalse(support.isPaintable()); } + public void test_setAsTextNull(){ + //Regression for HARMONY-1113 + + // if value object is null + PropertyEditorSupport undefPropertyEditorSupport = new PropertyEditorSupport(); + try { + undefPropertyEditorSupport.setAsText("string"); + fail("IllegalArgumentException expected, but nothing was thrown!"); + } catch (IllegalArgumentException e) { + // Expected IllegalArgumentException + } catch (Exception e) { + fail("IllegalArgumentException expected, but found: " + + e.getMessage()); + } + } + + public void test_setAsTextObject(){ + //Regression for HARMONY-1113 + + // if value object is instanse of Object + PropertyEditorSupport defPropertyEditorSupport = new PropertyEditorSupport(); + try { + defPropertyEditorSupport.setValue(new Object()); + defPropertyEditorSupport.setAsText("string"); + fail("IllegalArgumentException expected, but nothing was thrown!"); + } catch (IllegalArgumentException e) { + // Expected IllegalArgumentException + } catch (Exception e) { + fail("IllegalArgumentException expected, but found: " + + e.getMessage()); + } + } + + public void test_setAsTextString(){ + //Regression for HARMONY-1113 + + // if value object is instanse of String + + PropertyEditorSupport defPropertyEditorSupport = new PropertyEditorSupport(); + defPropertyEditorSupport.setValue(new String()); + defPropertyEditorSupport.setAsText("string"); + } + + public static class MockPropertyEditorSupport extends PropertyEditorSupport { public MockPropertyEditorSupport() {