You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Tim Ellison <t....@gmail.com> on 2007/04/17 14:11:06 UTC

[classlib][awt] Failing test java.awt.ButtonRTest

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.

Can any AWT expert help?  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.

Regards,
Tim


    // 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();
        }
    }

Re: [classlib][awt] Failing test java.awt.ButtonRTest

Posted by Alexey Petrenko <al...@gmail.com>.
Thanks.

SY, Alexey

2007/4/18, Tim Ellison <t....@gmail.com>:
> Alexey Petrenko wrote:
> > Tim, thanks for the investigation.
> > Have you filed this issue to JIRA?
>
> I just created HARMONY-3701.
>
> Regards,
> Tim
>

Re: [classlib][awt] Failing test java.awt.ButtonRTest

Posted by Tim Ellison <t....@gmail.com>.
Alexey Petrenko wrote:
> Tim, thanks for the investigation.
> Have you filed this issue to JIRA?

I just created HARMONY-3701.

Regards,
Tim

Re: [classlib][awt] Failing test java.awt.ButtonRTest

Posted by Alexey Petrenko <al...@gmail.com>.
Tim, thanks for the investigation.
Have you filed this issue to JIRA?

SY, Alexey

2007/4/17, Tim Ellison <t....@gmail.com>:
> 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.
>
> Can any AWT expert help?  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.
>
> Regards,
> Tim
>
>
>    // 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();
>        }
>    }
>