Examples of DialogForTesting


Examples of net.sourceforge.marathon.DialogForTesting

    @Before public void setUp() throws Exception {
        disableRetries();
        System.setProperty(Constants.PROP_COMPONENT_RESOLVERS, "");
        System.setProperty(Constants.PROP_PROJECT_SCRIPT_MODEL, "net.sourceforge.marathon.mocks.MockScriptModel");
        _dialog = new DialogForTesting(getName());
        _dialog.addButton("button.name", "button.name");
        _dialog.addTextField("field.name", "field1");
        _dialog.addComboBox("box.name", new String[] { "field1", "field2" });
        _dialog.addCheckBox("checkbox.name", "checkbox.name");
        _dialog.addMenu("menu.name", "menu.name", "menuItem.name", "menuItem.name");
View Full Code Here

Examples of net.sourceforge.marathon.DialogForTesting

        button.setVisible(true);
        _finder.getComponent_test("button.name");
    }

    @Test public void testPushPopWindows() {
        _dialog2 = new DialogForTesting(getName() + ".2");
        _dialog2.addButton("other.name", "other.name");
        _dialog2.show();
        ComponentFinder resolver = new ComponentFinder(Boolean.FALSE, WindowMonitor.getInstance().getNamingStrategy(),
                new ResolversProvider(), ScriptModelServerPart.getModelServerPart(), WindowMonitor.getInstance());
        assertNull(resolver.getWindow());
View Full Code Here

Examples of net.sourceforge.marathon.DialogForTesting

        assertNotNull(component);
    }

    @Test public void testTabbedPaneWhenInScrollTabLayout() throws Exception {
        _dialog.dispose();
        _dialog = new DialogForTesting(getName());
        _dialog.addTabbedPane("tabbed.name", "tab1", "tab2");
        final JTabbedPane pane = _dialog.getTabbedPane();
        pane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
        _dialog.show();
        pane.addMouseListener(new TabbedPaneMouseListener());
View Full Code Here

Examples of net.sourceforge.marathon.DialogForTesting

    public void tearDown() throws Exception {
    }

    @Test
    public void testWaitForSwing() throws Throwable {
        DialogForTesting dialog1 = new DialogForTesting(this.getClass().getName());
        dialog1.addButton("foo", "bar");
        DialogForTesting dialog2 = new DialogForTesting(this.getClass().getName() + ".2");
        final HashSet<Window> hashWindows = new HashSet<Window>();
        ITopLevelWindowListener listener = new ITopLevelWindowListener() {
            public void topLevelWindowCreated(Window window) {
                hashWindows.add(window);
            }

            public void topLevelWindowDestroyed(Window window) {
                hashWindows.remove(window);
            }
        };
        try {
            WindowMonitor.getInstance().addTopLevelWindowListener(listener);
            assertEquals("should be nothing up", toSet(new Object[] {}), hashWindows);
            dialog1.show();
            assertEquals("dialog1 should have been shown", toSet(new Object[] { dialog1 }), hashWindows);
            dialog2.show();
            // new Snooze(500);
            assertEquals("dialog2 should have been shown", toSet(new Object[] { dialog1, dialog2 }), hashWindows);
            dialog1.dispose();
            dialog2.dispose();
            AWTSync.sync();
            assertNull("windows 1 should be closed", WindowMonitor.getInstance().getWindow(dialog1.getTitle()));
            assertNull("windows 2 should be closed", WindowMonitor.getInstance().getWindow(dialog2.getTitle()));
            if (hashWindows.size() != 0) {
                Thread.sleep(100); // doesn't matter, we know this is a race
                                   // condition, but who cares
                assertEquals("should have disposed both", toSet(new Object[] {}), hashWindows);
            }
        } finally {
            dialog1.dispose();
            dialog2.dispose();
            WindowMonitor.getInstance().removeTopLevelWindowListener(listener);
        }
    }
View Full Code Here

Examples of net.sourceforge.marathon.DialogForTesting

        System.setProperties(properties);
    }

    @Before
    public void setUp() throws Exception {
        dialog = new DialogForTesting(getName());
        dialog.addButton("button.name", "I dare you");
        listData = new String[] { "item0", "item1", "item2", "item3" };
        dialog.addList("list", listData);
        list = dialog.getList();
        dialog.pack();
View Full Code Here

Examples of net.sourceforge.marathon.DialogForTesting

        System.setProperties(properties);
    }

    @Before
    public void setUp() throws Exception {
        dialog = new DialogForTesting(this.getClass().getName());
        dialog.setBounds(300, 200, 100, 100);
        dialog.addCheckBox("CheckBox", "We need focus on this");
        dialog.addTextField("name", "the text");
        dialog.addSpinner();
        dialog.show();
View Full Code Here

Examples of net.sourceforge.marathon.DialogForTesting

        System.setProperties(properties);
    }

    @Before
    public void setUp() throws Exception {
        dialog = new DialogForTesting(this.getClass().getName());
        dialog.addTable();
        table = dialog.getTable();
        mTable = new MTable(dialog.getTable(), "foo", null, WindowMonitor.getInstance());
        dialog.show();
    }
View Full Code Here

Examples of net.sourceforge.marathon.DialogForTesting

    private static DialogForTesting dialog;

    @BeforeClass public static void setupOnce() {
        System.setProperty(Constants.PROP_PROJECT_SCRIPT_MODEL, "net.sourceforge.marathon.mocks.MockScriptModel");
        dialog = new DialogForTesting(TestPropertyWrapper.class.getName());
        dialog.addTable("table", true, new String[][] { { "a", "b", "c" }, { "d", "e", "f" } }, new String[] { "col1", "col2",
                "col3" });
        dialog.addTabbedPane("tabbedPane", "charles", "brilly");
        dialog.addButton(null, "Press Me", Icons.RUN);
        dialog.addTextField("textField", "some text");
View Full Code Here

Examples of net.sourceforge.marathon.DialogForTesting

        System.setProperties(properties);
    }

    @Before
    public void setUp() throws Exception {
        dialog = new DialogForTesting(this.getClass().getName());
        DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode("root");
        DefaultMutableTreeNode level1child1 = new DefaultMutableTreeNode("level1 - 1");
        rootNode.add(level1child1);
        DefaultMutableTreeNode level1child2 = new DefaultMutableTreeNode("level1 - 2");
        rootNode.add(level1child2);
View Full Code Here

Examples of net.sourceforge.marathon.DialogForTesting

        System.setProperties(properties);
    }

    @Before
    public void setUp() throws Exception {
        dialog = new DialogForTesting(this.getClass().getName());
        dialog.addButton("button.name", "I dare you");
        tableData = new Object[][] { { "Value1A", "Value1B", "Value1C", Boolean.FALSE },
                { "Value2A", "Value2B", "Value2C", Boolean.TRUE }, };
        String[] columnNames = new String[] { "Column1", "Col,two,2", "Column3", "Column4" };
        dialog.addTable("table", true, tableData, columnNames);
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.