harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject [classlib][awt] Failing test java.awt.ButtonRTest
Date Tue, 17 Apr 2007 12:11:06 GMT
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();
        }
    }

Mime
View raw message