Package junit.extensions.abbot

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


        showFrame(list);
        tester.actionSelectRow(list, new JListLocation(data[0]));
        assertEquals("Wrong item selected", 0, list.getSelectedIndex());
        Timer timer = new Timer();
        while (mw.clickCount == 0) {
            if (timer.elapsed() > EVENT_GENERATION_DELAY)
                throw new RuntimeException("Timed out waiting for clicks");
            tester.sleep();
        }
        assertEquals("Too many clicks", 1, mw.clickCount);
    }
View Full Code Here


        showFrame(list);
        tester.actionSelectIndex(list, 0);
        assertEquals("Wrong item selected", 0, list.getSelectedIndex());
        Timer timer = new Timer();
        while (mw.clickCount == 0) {
            if (timer.elapsed() > EVENT_GENERATION_DELAY)
                throw new RuntimeException("Timed out waiting for clicks");
            tester.sleep();
        }
        assertEquals("Too many clicks", 1, mw.clickCount);
    }
View Full Code Here

        thread.start();

        WindowTracker tracker = getWindowTracker();
        Timer timer = new Timer();
        while (appletStartCount < appletCount) {
            if (timer.elapsed() > 60000) {
                fail("AppletViewer failed to launch");
            }
            robot.sleep();
        }
    }
View Full Code Here

        FocusWatcher fw = new FocusWatcher();
        red.text.addFocusListener(fw);
        robot.focus(red.text, true);
        Timer timer = new Timer();
        while (!fw.gotFocus) {
            if (timer.elapsed() > EVENT_GENERATION_DELAY) {
                Log.log("Failing applet focus");
                fail("Red applet text field never received focus");
            }
            robot.sleep();
        }
View Full Code Here

        fw = new FocusWatcher();
        green.text.addFocusListener(fw);
        robot.focus(green.text, true);
        timer.reset();
        while (!fw.gotFocus) {
            if (timer.elapsed() > EVENT_GENERATION_DELAY) {
                Log.log("Failing text field focus");
                fail("Green applet text field never received focus");
            }
            robot.sleep();
        }
View Full Code Here

    private WindowTracker tracker;

    private void wait(Window w, boolean state, String msg) {
        Timer timer = new Timer();
        while (tracker.isWindowReady(w) != state) {
            if (timer.elapsed() > 5000)
                fail(msg);
            try { Thread.sleep(10); } catch(InterruptedException e) { }
        }
    }
View Full Code Here

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

        }

        robot.drop(c, 1, 1);
        timer.reset();
        while (!c.dropAccepted || !c.dragEnded) {
            if (timer.elapsed() > EVENT_GENERATION_DELAY) {
                assertTrue("Drag never ended", c.dragEnded);
                assertTrue("Drag not accepted", c.dropAccepted);
            }
            robot.sleep();
        }
View Full Code Here

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

        }
        robot.drop(c2, c2.getWidth()/2, c2.getHeight()/2);
        timer.reset();
        while (!c1.dragExited || !c2.dragEntered
               || !c2.dropAccepted || !c1.dragEnded) {
            if (timer.elapsed() > EVENT_GENERATION_DELAY) {
                assertTrue("Drag never left drag source", c1.dragExited);
                assertTrue("Drag never entered drop target",
                           c2.dragEntered);
                assertTrue("Drag never ended", c1.dragEnded);
                assertTrue("Drag not accepted", c2.dropAccepted);
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.