harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrey Pavlenko (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-3701) [classlib][awt] java.awt.ButtonRTest fails on build machine
Date Fri, 20 Apr 2007 16:48:15 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-3701?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrey Pavlenko updated HARMONY-3701:
-------------------------------------

    Attachment: HARMONY-3701-ButtonStateController.patch
                HARMONY-3701-ButtonRTest.patch

This test fails if it's run in the same VM more than once. The reason is in buttons locking.
If a button has been pressed it is marked in ButtonStateController as an active component
and after that no other buttons could be pressed until this button is released. This test
never releases the pressed button, so all newly created buttons could not be pressed.
The similar situation cold be reproduced manually using 2 windows with buttons.
This patch fixes the issue. It makes the following changes in the ButtonStateController:
 - moves the locking/unlocking to the lock()/unlock() methods
 - unlocks the controller if the focus is lost.

> [classlib][awt] java.awt.ButtonRTest fails on build machine
> -----------------------------------------------------------
>
>                 Key: HARMONY-3701
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3701
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Win XP, x86, running HUTs via Continuum
>            Reporter: Tim Ellison
>            Priority: Minor
>         Attachments: HARMONY-3701-ButtonRTest.patch, HARMONY-3701-ButtonStateController.patch
>
>
> The test java.awt.ButtonRTest fails for me on an unattended WinXP/x86 machine running
the HUTs via Continuum.  The test is reproduced below, and I've marked the failing assertion.
> If I modify the test to bail if the event is not heard (i.e. return if (li.e == null))
then subsequent AWT tests pass ok.
> Note that this test seems to have appeared as a regression test for HARMONY-2305
>     // Regression test for HARMONY-2305
>     // Currently fails on Linux version of RI
>     public void testHarmony2305() throws Exception {
>         final Frame f = new Frame();
>         final Button b1 = new Button("B1"); //$NON-NLS-1$
>         final Button b2 = new Button("B2"); //$NON-NLS-1$
>         final AL l1 = new AL();
>         final AL l2 = new AL();
>         final Robot r = new Robot();
>         try {
>             b1.addActionListener(l1);
>             b2.addActionListener(l2);
>             f.add(BorderLayout.WEST, b1);
>             f.add(BorderLayout.EAST, b2);
>             f.setSize(100, 100);
>             f.setVisible(true);
>             r.setAutoWaitForIdle(true);
>             r.setAutoDelay(500);
>             r.mouseMove(b1.getLocation().x + 3, b1.getLocation().y + 3);
>             r.mousePress(InputEvent.BUTTON1_MASK);
>             r.mouseRelease(InputEvent.BUTTON1_MASK);
>             assertNotNull(l1.e); <<<<<<<<<<---------
>             assertNull(l2.e);
>             r.keyPress(KeyEvent.VK_SPACE);
>             r.mouseMove(b2.getLocation().x + 3, b2.getLocation().y + 3);
>             r.mousePress(InputEvent.BUTTON1_MASK);
>             r.mouseRelease(InputEvent.BUTTON1_MASK);
>             assertNull(l2.e);
>         } finally {
>             f.dispose();
>         }
>     }

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