Examples of MComponent


Examples of net.sourceforge.marathon.component.MComponent

    }

    @Test
    public void testAssertColumnCount() {
        JTable table = new JTable(1, 3);
        MComponent component = new MTable(table, "table", null, WindowMonitor.getInstance());
        ComponentFinder resolver = new DummyResolver(component);
        ActionTestCase.assertPasses(
                new AssertColumnCount(ID, 3, ScriptModelServerPart.getModelServerPart(), WindowMonitor.getInstance()), resolver);
        ActionTestCase.assertFails(
                new AssertColumnCount(ID, 4, ScriptModelServerPart.getModelServerPart(), WindowMonitor.getInstance()), resolver);
View Full Code Here

Examples of net.sourceforge.marathon.component.MComponent

        TreePath[] selectionPaths = assertionTree.getSelectionPaths();
        for (int i = 0; i < selectionPaths.length; i++) {
            TreePath path = selectionPaths[i];
            Object[] objects = path.getPath();
            final StringBuffer sb = new StringBuffer();
            MComponent forComponent = mcomponent;
            for (int j = 1; j < objects.length; j++) {
                final AssertionTreeNode node = (AssertionTreeNode) objects[j];
                if (node.getObject() instanceof MComponent) {
                    forComponent = (MComponent) node.getObject();
                    sb.setLength(0);
                    continue;
                }
                sb.append(node.getProperty());
                if (j < objects.length - 1) {
                    if (!((AssertionTreeNode) objects[j + 1]).getProperty().startsWith("["))
                        sb.append(".");
                } else {
                    IScriptElement enscript;
                    String property = sb.toString();
                    if (action == ASSERT_ACTION) {
                        if (property.equals("Content") && forComponent instanceof MCollectionComponent)
                            enscript = new AssertContent(forComponent.getComponentId(),
                                    ((MCollectionComponent) forComponent).getContent(), scriptModel, windowMonitor)
                                    .enscript(forComponent);
                        else {
                            String value;
                            if (property.equals("Text"))
                                value = forComponent.getComparableObject().toString();
                            else
                                value = forComponent.getProperty(property);
                            enscript = new AssertPropertyAction(forComponent.getComponentId(), property, value, scriptModel,
                                    windowMonitor).enscript(forComponent);
                        }
                    } else {
                        String value;
                        if (property.equals("Text"))
                            value = forComponent.getComparableObject().toString();
                        else
                            value = forComponent.getProperty(property);
                        enscript = new WaitPropertyAction(forComponent.getComponentId(), property, value, scriptModel,
                                windowMonitor).enscript(forComponent);
                    }
                    if (getFinder() != null)
                        getFinder().markUsed(forComponent);
                    getRecorder().record(enscript);
View Full Code Here

Examples of net.sourceforge.marathon.component.MComponent

        if (!finder.hasTopLevelWindow()) {
            pushed = true;
            Window window = WindowMonitor.getTopLevelWindowWithFocus();
            finder.push(window);
        }
        MComponent component = finder.getMContainerById(new ComponentId(windowTitle));
        if (pushed)
            finder.pop();
        finder.push(component.getComponent());
    }
View Full Code Here

Examples of net.sourceforge.marathon.component.MComponent

    }

    public String getProperty(ComponentId id, String property) {
        if(failMessage != null)
            failX(failMessage);
        MComponent component = finder.getMComponentById(id);
        return component.getProperty(property);
    }
View Full Code Here

Examples of net.sourceforge.marathon.component.MComponent

    }

    public Object getPropertyObject(ComponentId id, String property) {
        if(failMessage != null)
            failX(failMessage);
        MComponent component = finder.getMComponentById(id);
        return component.getPropertyObject(property);
    }
View Full Code Here

Examples of net.sourceforge.marathon.component.MComponent

    public void screenCapture(String imageName, String windowName) {
        play(new ScreenCaptureAction(imageName, windowName, scriptModel, windowMonitor));
    }

    public void screenCapture(String imageName, String windowName, ComponentId id) {
        MComponent component = finder.getMComponentById(id);
        play(new ScreenCaptureAction(imageName, windowName, component, scriptModel, windowMonitor));
    }
View Full Code Here

Examples of net.sourceforge.marathon.component.MComponent

        Iterator<IContextMenu> iterator = contextMenus.iterator();
        while (iterator.hasNext()) {
            IContextMenu menu = (IContextMenu) iterator.next();
            menu.setComponent(component, point, isTriggered);
        }
        MComponent mcomponent = finder.getMComponentByComponent(component, point);
        if (mcomponent == null) {
            return;
        }
        if (isTriggered) {
            overlayFrame = new TransparentFrame(mcomponent);
            overlayFrame.setVisible(true);
        }
        String info = mcomponent.getComponentInfo();
        titleLabel.setText("   " + mcomponent.getMComponentName() + (info == null ? "" : " (" + info + ")"));
        pack();
    }
View Full Code Here

Examples of net.sourceforge.marathon.component.MComponent

    public String getName() {
        return "Custom";
    }

    public void setComponent(final Component component, Point point, boolean isTriggered) {
        final MComponent mcomponent = getFinder().getMComponentByComponent(component);
        new Thread() {
            public void run() {
                String[][] customAssertions = runtime.getCustomAssertions(mcomponent);
                model.setData(customAssertions);
            }
View Full Code Here

Examples of net.sourceforge.marathon.component.MComponent

                            if (i > 0)
                                new Snooze(delayInMS);

                            ComponentId id = (ComponentId) ids.get(i);

                            MComponent mc = resolver.getMComponentById(id);
                            Component c = null;
                            if (mc != null) {
                                c = mc.getComponent();
                                if (c instanceof JMenu && (((JMenu) c).getPopupMenu().getComponentCount() == 0 || ((JMenu) c).getPopupMenu().isShowing())) {
                                    continue;
                                }
                            }
View Full Code Here

Examples of net.sourceforge.marathon.component.MComponent

        super(componentId, scriptModel, windowMonitor);
        this.content = content;
    }

    public void play(ComponentFinder resolver) {
        MComponent c = resolver.getMComponentById(getComponentId());
        assertTrue("Invoking assertContent on a non-collection component", c instanceof MCollectionComponent);
        MCollectionComponent component = (MCollectionComponent) c;
        assertEquals("Invalid Length", Integer.valueOf(content.length), Integer.valueOf(component.getContent().length));
        String[][] actualData = component.getContent();
        for (int i = 0; i < actualData.length; i++) {
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.