Package junit.extensions.abbot

Examples of junit.extensions.abbot.Timer.elapsed()


        pane.add(tree);
        showFrame(pane);
        robot.drag(label, label.getWidth()/2, label.getHeight()/2);
        Timer timer = new Timer();
        while (!label.dragStarted) {
            if (timer.elapsed() > EVENT_GENERATION_DELAY) {
                fail("Drag gesture not recognized");
            }
            if (label.exception != null)
                throw label.exception;
            robot.sleep();
View Full Code Here


        Rectangle rect = tree.getRowBounds(2);
        robot.drop(tree, rect.x + rect.width/2, rect.y + rect.height/2);
        timer.reset();
        while (!label.dragExited || !tree.dragEntered
               || !tree.dropAccepted || !label.dragEnded) {
            if (timer.elapsed() > EVENT_GENERATION_DELAY) {
                assertTrue("Drag never left drag source", label.dragExited);
                assertTrue("Drag never entered drop target",
                           tree.dragEntered);
                assertTrue("Drag never ended", label.dragEnded);
                assertTrue("Drag not accepted", tree.dropAccepted);
View Full Code Here

        pane.add(table);
        showFrame(pane);
        robot.drag(label, label.getWidth()/2, label.getHeight()/2);
        Timer timer = new Timer();
        while (!label.dragStarted) {
            if (timer.elapsed() > EVENT_GENERATION_DELAY) {
                fail("Drag gesture not recognized");
            }
            if (label.exception != null)
                throw label.exception;
            robot.sleep();
View Full Code Here

        Rectangle rect = table.getCellRect(1, 1, false);
        robot.drop(table, rect.x + rect.width/2, rect.y + rect.height/2);
        timer.reset();
        while (!label.dragExited || !table.dragEntered
               || !table.dropAccepted || !label.dragEnded) {
            if (timer.elapsed() > EVENT_GENERATION_DELAY) {
                assertTrue("Drag never left drag source", label.dragExited);
                assertTrue("Drag never entered drop target",
                           table.dragEntered);
                assertTrue("Drag never ended", label.dragEnded);
                assertTrue("Drag not accepted", table.dropAccepted);
View Full Code Here

        showFrame(button);
        tester.actionClick(button);
        assertTrue("Button not pressed", bw.gotAction);
        Timer timer = new Timer();
        while (!isShowing("Input")) {
            if (timer.elapsed() > EVENT_GENERATION_DELAY)
                fail("Timed out waiting for input dialog");
            tester.sleep();
        }
        tester.actionClick(list);
        tester.reset();
View Full Code Here

        ButtonWatcher bw2 = new ButtonWatcher();
        ok.addActionListener(bw2);
        tester.actionClick(ok);
        timer.reset();
        while (isShowing("Input")) {
            if (timer.elapsed() > EVENT_GENERATION_DELAY)
                fail("Timed out waiting for dialog to close");
            tester.sleep();
        }
        assertTrue("OK button not pressed", bw2.gotAction);
    }
View Full Code Here

        robot.waitForIdle();
        if (!ml.gotPress) {
            Timer timer = new Timer();
            while (!ml.gotPress) {
                robot.delay(5);
                if (timer.elapsed() > 5000)
                    fail("Mouse press never registered");
            }
            long arrived = System.currentTimeMillis();
            fail("MOUSE_PRESSED event not yet generated, "
                 + "after " + Robot.getEventPostDelay()
View Full Code Here

                    pane.getWidth()/2,
                    pane.getHeight()/2,
                    InputEvent.BUTTON1_MASK, 2);
        Timer timer = new Timer();
        while (mw.clickCount < 2) {
            if (timer.elapsed() > EVENT_GENERATION_DELAY)
                fail("Never received a double click");
            robot.sleep();
        }
    }
View Full Code Here

        robot.focus(tf, true);
        robot.key(KeyEvent.VK_END);
        robot.waitForIdle();
        Timer timer = new Timer();
        while (!watcher.gotPress) {
            if (timer.elapsed() > EVENT_GENERATION_DELAY)
                fail("Never got key press");
            robot.sleep();
        }
        assertEquals("Wrong keycode was generated",
                     KeyEvent.VK_END, watcher.keyCode);
View Full Code Here

            robot.sleep();
        }
        assertEquals("Wrong keycode was generated",
                     KeyEvent.VK_END, watcher.keyCode);
        while (!watcher.gotRelease) {
            if (timer.elapsed() > EVENT_GENERATION_DELAY)
                fail("Never got key release");
            robot.sleep();
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.