Package junit.extensions.abbot

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


        Frame frame = showFrame(new JLabel(getName()));
        robot.iconify(frame);
        // Give the WM time to put the window away
        Timer timer = new Timer();
        while (frame.getState() != Frame.ICONIFIED) {
            if (timer.elapsed() > EVENT_GENERATION_DELAY)
                fail("Frame not iconified, state " + frame.getState());
            robot.sleep();
        }
        robot.deiconify(frame);
        timer.reset();
View Full Code Here


            robot.sleep();
        }
        robot.deiconify(frame);
        timer.reset();
        while (frame.getState() != Frame.NORMAL) {
            if (timer.elapsed() > EVENT_GENERATION_DELAY)
                fail("Frame not restored, state " + frame.getState());
            robot.sleep();
        }
    }
View Full Code Here

        Frame frame = showFrame(new JLabel(getName()));
        Dimension size = frame.getSize();
        robot.maximize(frame);
        Timer timer = new Timer();
        while (frame.getSize().equals(size)) {
            if (timer.elapsed() > EVENT_GENERATION_DELAY)
                fail("Frame size not changed");
            robot.sleep();
        }
        robot.normalize(frame);
        // Don't bother testing normalize (it won't work on 1.3.1)
View Full Code Here

                flag.name = Thread.currentThread().getName();
            }
        }, 0);
        Timer t = new Timer();
        while (flag.name == null) {
            if (t.elapsed() > 5000)
                fail("Task never ran");
            try { Thread.sleep(50); } catch(InterruptedException e) { }
            Thread.yield();
        }
        assertEquals("Thread not properly named", getName(), flag.name);
View Full Code Here

            }
        };
        timer.schedule(task, 0);
        Timer t = new Timer();
        while (!flag.taskRan) {
            if (t.elapsed() > 5000)
                fail("Task never ran");
            Thread.yield();
        }
        // This will throw an exception if the Timer was canceled
        timer.schedule(new TimerTask() { public void run() { }}, 0);
View Full Code Here

        startRecording();
        tester.mouseMove(label, 0, 0);
        tester.mouseMove(label);
        Timer timer = new Timer();
        while (!tw.opened) {
            if (timer.elapsed() > 5000)
                throw new RuntimeException("No tooltip appeared");
        }
        assertNoStep();
    }
View Full Code Here

        Dialog dialog = pane.createDialog(frame, "Dialog");
        showWindow(dialog);
        dialog.setVisible(false);
        Timer timer = new Timer();
        while (dialog.isShowing()) {
            if (timer.elapsed() > 5000)
                throw new RuntimeException("Timed out waiting for dialog to hide");
            getRobot().sleep();
        }
        JOptionPane pane2 = new JOptionPane("A message", JOptionPane.
                                            INFORMATION_MESSAGE);
View Full Code Here

        getRobot().move(f1, 100, 100);
        getRobot().waitForIdle();

        Timer timer = new Timer();
        ComponentReference ref1 = resolver.addComponent(b1);
        long elapsed = timer.elapsed();
        assertTrue("Too long to create reference: " + elapsed + "ms",
                   elapsed < MAX_CREATION_TIME);

        JPanel p2 = new JPanel();
        JButton b2 = new JButton("Label");
View Full Code Here

        getRobot().move(f2, 101, 100);
        getRobot().waitForIdle();

        timer.reset();
        ComponentReference ref2 = resolver.addComponent(b2);
        elapsed = timer.elapsed();
        assertTrue("Too long to create reference (using ordering): "
                   + elapsed, elapsed < MAX_CREATION_TIME);
    }

    private static final int DEPTH = 10;
View Full Code Here

                break;
            }
            catch(ComponentNotFoundException e) {
                getRobot().waitForIdle();
            }
            if (timer.elapsed() > 10000)
                fail("Timed out waiting for transient dialog to show");
        }

        Frame fa = new MyFrame("A");
        Frame fb = new MyFrame("B");
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.