harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mackie Mathew" <mcclou...@gmail.com>
Subject [harmony-demo-1] Reasons for java.awt.ComponentTest failure
Date Mon, 28 Apr 2008 11:22:29 GMT
The testAction method that fails is due to:

public final void testAction() {
       int eventId = Event.ACTION_EVENT;
        myTestComp = new MyButton();
        createFrameAndWait();
        robot.setAutoDelay(700);
        Point screenLoc = myTestComp.getLocationOnScreen();
        int centerX = myTestComp.getWidth() / 2;
        int centerY = myTestComp.getHeight() / 2;
        screenLoc.translate(centerX, centerY);
        final Point absPos = screenLoc;

        waitForEvent(new Runnable() {
            public void run() {
                robot.mouseMove(absPos.x, absPos.y);
                robot.mousePress(InputEvent.BUTTON1_MASK |
InputEvent.BUTTON2_MASK);
                robot.mouseRelease(InputEvent.BUTTON1_MASK |
InputEvent.BUTTON2_MASK);
            }
        }, eventId, waitTime);
    *    assertNotNull(event);*
        Event actionEvt = new Event(myTestComp, eventId,
                ((Button) myTestComp).getLabel());
        actionEvt.modifiers = Event.ALT_MASK;
        checkOldEvent(actionEvt);
    }


The private variable event is declared to null at setUp() and it is not
changed and checked for not being null. I do not understand the logic behind
this. Shouldn't the test obviously fail as event is not assigned a not null
value.

-- 
Regards,

Tharindu

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message