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