Package net.sourceforge.marathon.util

Examples of net.sourceforge.marathon.util.Retry


     * net.sourceforge.marathon.component.INamingStrategy#getComponent(java.
     * lang.String)
     */
    public Component getComponent(final String name, int retryCount, boolean isContainer) {
        final Component[] found = new Component[1];
        new Retry("Could not find component", ComponentFinder.RETRY_INTERVAL_MS, retryCount, new Retry.Attempt() {
            public void perform() {
                if ((found[0] = findComponent(name)) == null) {
                    retry();
                }
            }
View Full Code Here


            for (int i = 0; i < cols.length; i++)
                cells.add(new Cell(rows[0], cols[i]));
        } else {
        }
        final int maxRow = findMaxRow(cells);
        new Retry("Could not find row " + maxRow + " in table", ComponentFinder.RETRY_INTERVAL_MS,
                ComponentFinder.COMPONENT_SEARCH_RETRY_COUNT, new Attempt() {
                    @Override public void perform() {
                        int rowCount = eventQueueRunner.invokeInteger(table, "getRowCount");
                        if(maxRow >= rowCount)
                            retry();
View Full Code Here

        swingWait();
    }

    private int getTab(final String text) {
        try {
            new Retry("Search for cell component", ComponentFinder.getRetryInterval(), ComponentFinder.getRetryCount(),
                    new Retry.Attempt() {
                        public void perform() {
                            if (findTab(text) == -1)
                                retry();
                        }
View Full Code Here

            }
        }
        // Delay and recheck just to make sure the app is not messing with
        // focus itself
        try {
            new Retry(new ComponentNotFoundException("Cannot find the component with focus, to receive the key stroke!",
                    scriptModel, windowMonitor), 1000, 3, new Retry.Attempt() {
                public void perform() {
                    if (resolver.getWindow().getFocusOwner() == null) {
                        retry();
                    }
View Full Code Here

    }

    private Component getContainer(final String name, int retryCount, String message) {
        final ComponentNotFoundException err = new ComponentNotFoundException(message, null, null);
        final Object[] found = new Object[1];
        new Retry(err, ComponentFinder.RETRY_INTERVAL_MS, retryCount, new Retry.Attempt() {
            public void perform() {
                Component c = findContainerForName(name);
                if (c == null) {
                    retry();
                } else
View Full Code Here

        }
        String message = "More than one component matched for: " + name + " with properties: " + omapComponent;
        final ComponentNotFoundException err = new ComponentNotFoundException(message, null, null);
        final Object[] found = new Object[1];
        try {
            new Retry(err, ComponentFinder.RETRY_INTERVAL_MS, retryCount, new Retry.Attempt() {
                public void perform() {
                    List<Component> matchedComponents = findComponent(omapComponent);
                    found[0] = matchedComponents;
                    if (matchedComponents.size() != 1) {
                        if (matchedComponents.size() == 0) {
View Full Code Here

        this.property = property;
        this.value = value;
    }

    public void play(final ComponentFinder resolver) {
        new Retry("Wait for change in property timed out", 500, 120, new Attempt() {
            public void perform() {
                if (!isValueEqual(resolver))
                    retry();
            }
        });
View Full Code Here

     */
    public abstract String[][] getContent();

    public MComponent findMatchingComponent(final Properties props) {
        try {
            new Retry("Search for cell component", ComponentFinder.getRetryInterval(), ComponentFinder.getRetryCount(),
                    new Retry.Attempt() {
                        public void perform() {
                            if (findMatch(props) == null)
                                retry();
                        }
View Full Code Here

        dialog.addTextField("text.name", "");
        dialog.addComboBox("combo.name", new String[] { "choiceA", "choiceB", "choiceC" });
        dialog.show();
        waitForIt();
        try {
            new Retry("timed out while waiting for recordingEventListener to start picking up events", 50, 60, new Retry.Attempt() {
                public void perform() {
                    fireMouseEvent(dialog.getButton(), MouseEvent.MOUSE_PRESSED, 1);
                    if (events.toString().indexOf("mouse pressed on button.name") == -1) {
                        retry();
                    }
View Full Code Here

    private List<Component> getComponentsByProperties(final Properties nameProps, int retryCount, boolean isContainer) {
        String message = "More than one component matched for: " + nameProps;
        final ComponentNotFoundException err = new ComponentNotFoundException(message, null, null);
        final Object[] found = new Object[1];
        new Retry(err, ComponentFinder.RETRY_INTERVAL_MS, retryCount, new Retry.Attempt() {
            public void perform() {
                List<Component> matchedComponents = findMatchedComponents(nameProps);
                if (matchedComponents.size() != 1) {
                    if (matchedComponents.size() == 0)
                        err.setMessage("No components matched for: " + nameProps);
View Full Code Here

TOP

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

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.