Package net.sourceforge.marathon.component

Examples of net.sourceforge.marathon.component.WindowIdMock


        events = null;
    }

    @Test
    public void testOwnsItsChildren() {
        WindowIdMock parentId = new WindowIdMock("parent");
        WindowIdMock childId = new WindowIdMock("child", "parent");
        WindowElement parentAction = new WindowElement(parentId);
        WindowElement childAction = new WindowElement(childId);
        assertTrue("Parent owns the child", parentAction.owns(childAction));
    }
View Full Code Here


        listener.mousePressed(mComponentMock, e);
        builder.assertNext(createClick(1));
    }

    private MockRecordedClick createClick(int clicks) {
        return new MockRecordedClick(mComponentMock.getComponentId(), new WindowIdMock("foo window"), clicks);
    }
View Full Code Here

    private MockRecordedSelect createSelect(String text) {
        return createSelect(mComponentMock, text);
    }

    private MockRecordedSelect createSelect(MComponent component, String text) {
        return new MockRecordedSelect(component.getComponentId(), new WindowIdMock("foo window"), text);
    }
View Full Code Here

public class WindowActionMock extends WindowElement {
    private static final long serialVersionUID = 1L;

    public WindowActionMock(String title) {
        super(new WindowIdMock(title));
    }
View Full Code Here

        assertScriptEquals(i1 + "if window('dialog1'):\n" + i2 + "click('button1')\n" + i2 + "doubleclick('button1')\n" + i1
                + "close()\n");
    }

    private MockRecordedClick click(MButton button, int clicks) {
        return new MockRecordedClick(button.getComponentId(), new WindowIdMock("dialog1"), clicks);
    }
View Full Code Here

            public ComponentId getComponentId() {
                return new ComponentId(component);
            }

            public WindowId getWindowId() {
                return new WindowIdMock(windowTitle);
            }

            public boolean isUndo() {
                return false;
            }
View Full Code Here

    }

    @Test
    public void testRecordWindowTagOnSelect() {
        MButton button = new MButton(new JButton("text"), "button1", null, WindowMonitor.getInstance());
        WindowId windowId = new WindowIdMock("dialog1");
        button.setWindowId(windowId);
        recorder.record(new MockRecordedSelect(button.getComponentId(), windowId, "text"));
        AWTSync.sync();
        assertScriptEquals(i1 + "if window('dialog1'):\n" + i2 + "select('button1', 'text')\n" + i1 + "close()\n");
    }
View Full Code Here

        assertScriptEquals(i1 + "if window('dialog1'):\n" + i2 + "keystroke('Ctrl+Shift+B')\n" + i1 + "close()\n");
    }

    @Test
    public void testSimpleSwitchBetweenWindows() {
        recorder.record(new MockRecordedClick(new ComponentId("button1"), new WindowIdMock("dialog1"), 1));
        recorder.record(new MockRecordedClick(new ComponentId("button2"), new WindowIdMock("dialog2"), 1));
        AWTSync.sync();
        assertScriptEquals(i1 + "if window('dialog1'):\n" + i2 + "click('button1')\n" + i1 + "close()\n" + "\n" + i1
                + "if window('dialog2'):\n" + i2 + "click('button2')\n" + i1 + "close()\n");
    }
View Full Code Here

        assertEquals(script, listener.script);
    }

    private MButton getMButton(String dialogTitle, String name) {
        MButton button = new MButton(null, name, null, WindowMonitor.getInstance());
        button.setWindowId(new WindowIdMock(dialogTitle));
        return button;
    }
View Full Code Here

        inserter.add(w2 = window("window5", "window1"), mock());
        assertSame(w2, w1.getChildren().get(2));
    }

    private WindowElement window(String title) {
        return new WindowElement(new WindowIdMock(title));
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.marathon.component.WindowIdMock

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.