harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "spark shen (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4578) [classlib][beans] o.a.h.b.editors.ColorEditor & FontEditor do not have correct behaviors
Date Tue, 31 Jul 2007 07:55:53 GMT
[classlib][beans] o.a.h.b.editors.ColorEditor & FontEditor do not have correct behaviors
----------------------------------------------------------------------------------------

                 Key: HARMONY-4578
                 URL: https://issues.apache.org/jira/browse/HARMONY-4578
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: spark shen


The behavior of o.a.h.b.editors.ColorEditor was not correctly implemented. Neither does FontEditor.
The following test case will give a hint.

public void testFontEditor() throws Exception{
        PropertyEditor e2 = PropertyEditorManager.findEditor(Font.class);
        Font font = new Font("Helvetica", Font.PLAIN, 12);
        e2.setValue(font);
        assertNull(e2.getAsText());
        assertNull(e2.getTags());
        assertSame(font, e2.getValue());
        assertTrue(e2.isPaintable());
        Component c = e2.getCustomEditor();
        assertSame(c, e2);
        e2.addPropertyChangeListener(new ExceptionPropertyChangeListener());

        try {
            e2.setValue(null);
            fail("Should throw an error");
        } catch (MockError e) {
            // expected
            assertNull(e2.getValue());
        }
        
        try {
            e2.setValue(new Font("Arial", Font.BOLD, 10));
            fail("Should throw an error");
        } catch (MockError e) {
            // expected
        }
    }

I will give a patch to amend the behavior of the 2 editors.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message