harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tharindu Mathew (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-5873) Fixes a problem in JComboBox that fails JComboBox.testSetGetSelectedItem()
Date Mon, 25 Aug 2008 19:13:44 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-5873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625467#action_12625467
] 

Tharindu Mathew commented on HARMONY-5873:
------------------------------------------

I checked on the issue Sean. It seems that the JComboRTest and JComboTest are testing for
functionality that is opposite of each other.

The following JComboRTest tests for an event to occur when an already selected item is selected
again.

public void testSetSelectedItem() {
        // regression test HARMONY-1533
        String item = "item";
        JComboBox jcb = new JComboBox(new String[] { item });
        jcb.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                eventFired = true;
            }
        });
        jcb.setSelectedItem(item);
        assertTrue("action performed", eventFired);
    }

While the following code in JComboTest checks to make sure that an event is not fired when
an already selected item is selected.

 assertEquals("b", comboBox.getSelectedItem());
        comboBox.setSelectedItem("b");
        assertTrue(itemController.getEvents().isEmpty());
        if (isHarmony()) {
            assertNull(actionController.getEvent());
        } else {
            assertNotNull(actionController.getEvent());
        }

Which one should we support?

> Fixes a problem in JComboBox that fails JComboBox.testSetGetSelectedItem()
> --------------------------------------------------------------------------
>
>                 Key: HARMONY-5873
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5873
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Tharindu Mathew
>            Assignee: Mark Hindess
>         Attachments: testSetGetSelectedItemFix.patch
>
>


-- 
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