Package net.sourceforge.marathon.util

Examples of net.sourceforge.marathon.util.Snooze


        grandParent.setTitle("grandparent");
        JDialog parent = new JDialog(grandParent, "parent");
        JDialog child = new JDialog(parent, "child");
        grandParent.show();
        parent.show();
        new Snooze(500);
        WindowMonitor windowMonitor = WindowMonitor.getInstance();
        WindowId parentId = WindowIdCreator.createWindowId(parent, windowMonitor);
        child.show();
        new Snooze(500);
        WindowId childId = WindowIdCreator.createWindowId(child, windowMonitor);
        WindowElement parentAction = new WindowElement(parentId);
        WindowElement childAction = new WindowElement(childId);
        Window w = windowMonitor.getWindow(parentId.getTitle());
        assertEquals("parent", windowMonitor.getNamingStrategy().getName(w));
View Full Code Here


        child.setName("child");
        grandParent.show();
        AWTSync.sync();
        parent.show();
        AWTSync.sync();
        new Snooze(500);
        WindowId parentId = WindowIdCreator.createWindowId(parent, WindowMonitor.getInstance());
        parent.dispose();
        AWTSync.sync();
        new Snooze(500);
        child.show();
        AWTSync.sync();
        new Snooze(500);
        WindowId childId = WindowIdCreator.createWindowId(child, WindowMonitor.getInstance());
        WindowElement parentAction = new WindowElement(parentId);
        WindowElement childAction = new WindowElement(childId);
        assertTrue("Parent does not own the child", !parentAction.owns(childAction));
        child.dispose();
View Full Code Here

        JTabbedPane pane = dialog.getTabbedPane();
        Rectangle tabBounds = pane.getUI().getTabBounds(pane, 1);
        Point p = new Point(tabBounds.x + 1, tabBounds.y + 1);
        FireableMouseClickEvent e = new FireableMouseClickEvent(pane);
        e.fire(p, 1);
        new Snooze(1000);
        assertEquals(i1 + "if window('tab1'):\n" + i2 + "select('TabPane', 'tab2')\n" + i1 + "close()\n", scriptListener.script);
    }
View Full Code Here

        }
    }

    private void assertState(State state) {
        if (state != display.getState()) {
            new Snooze(10);
            assertEquals("Display state", state, display.getState());
        }
    }
View Full Code Here

    public void play(AbstractMarathonAction action) {
        if(failMessage != null)
            failX(failMessage);
        if (getDelayInMS() != 0) {
            new Snooze(getDelayInMS());
            AWTSync.sync();
        }
        try {
            action.setDelay(getDelayInMS());
            action.playProtected(finder);
View Full Code Here

    public void assertContent(ComponentId id, String[][] content) {
        play(new AssertContent(id, content, scriptModel, windowMonitor));
    }

    public void sleep(long seconds) {
        new Snooze(seconds * 1000);
        AWTSync.sync();
    }
View Full Code Here

        postEvent(createMouseEvent(MouseEvent.MOUSE_ENTERED, 0, x, y, modifiers));
        postEvent(createMouseEvent(MouseEvent.MOUSE_MOVED, 0, x, y, modifiers));
        if (numberOfClicks > 0) {
            for (int i = 0; i < numberOfClicks; i++) {
                postEvent(createMouseEvent(MouseEvent.MOUSE_PRESSED, i + 1, x, y, modifiers));
                new Snooze(5);
                postEvent(createMouseEvent(MouseEvent.MOUSE_RELEASED, i + 1, x, y, modifiers));
                postEvent(createMouseEvent(MouseEvent.MOUSE_CLICKED, i + 1, x, y, modifiers));
                new Snooze(10);
            }
            postEvent(createMouseEvent(MouseEvent.MOUSE_MOVED, 0, x, y, modifiers));
            postEvent(createMouseEvent(MouseEvent.MOUSE_EXITED, 1, x, y, modifiers));
        } else {
            new Snooze(hoverDelay);
        }
    }
View Full Code Here

        postEvent(createMouseEvent(MouseEvent.MOUSE_ENTERED, 0, x, y, modifiers));
        postEvent(createMouseEvent(MouseEvent.MOUSE_MOVED, 0, x, y, modifiers));

        postEvent(createMouseEvent(MouseEvent.MOUSE_PRESSED, 1, x, y, modifiers));
        new Snooze(5);

    }
View Full Code Here

        final int x = point.x;
        final int y = point.y;

        modifiers = prepareFire(modifiers, x, y);

        new Snooze(5);
        postEvent(createMouseEvent(MouseEvent.MOUSE_RELEASED, 1, x, y, modifiers));

        postEvent(createMouseEvent(MouseEvent.MOUSE_MOVED, 0, x, y, modifiers));
        postEvent(createMouseEvent(MouseEvent.MOUSE_EXITED, 0, x, y, modifiers));
View Full Code Here

            // Send the shift when appropriate
            if (Character.isUpperCase(ch) && (modifiers & InputEvent.SHIFT_MASK) == 0) {
                pressModifiers(InputEvent.SHIFT_MASK);
            }
            fireSingleKey(keyCode, ch);
            new Snooze(1);
            // Release the shift.
            if (Character.isUpperCase(ch) && (modifiers & InputEvent.SHIFT_MASK) == 0) {
                releaseModifiers(InputEvent.SHIFT_MASK);
            }
        }
View Full Code Here

TOP

Related Classes of net.sourceforge.marathon.util.Snooze

Copyright © 2018 www.massapicom. 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.