當前位置: 首頁>>代碼示例>>Java>>正文


Java TimeoutExpiredException類代碼示例

本文整理匯總了Java中org.netbeans.jemmy.TimeoutExpiredException的典型用法代碼示例。如果您正苦於以下問題:Java TimeoutExpiredException類的具體用法?Java TimeoutExpiredException怎麽用?Java TimeoutExpiredException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TimeoutExpiredException類屬於org.netbeans.jemmy包,在下文中一共展示了TimeoutExpiredException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: waitText

import org.netbeans.jemmy.TimeoutExpiredException; //導入依賴的package包/類
public static boolean waitText(MessageHandler handler) {
    int i = 0;

    while (!handler.isFinished()) {
        i++;
        if (i > TIME_OUT) {
            throw new TimeoutExpiredException("Text [" + handler.message + "] hasn't been found in reasonable time!");
        }
        try {
            Thread.sleep(500);
        } catch (InterruptedException ex) {
            ex.printStackTrace();
        }
    }
    return true;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:17,代碼來源:TestKit.java

示例2: deleteNode

import org.netbeans.jemmy.TimeoutExpiredException; //導入依賴的package包/類
/**
 * Deletes a node (file, package)
 * using pop-up menu
 */
public static void deleteNode(String path) {
    try {
        Node pn = new ProjectsTabOperator().getProjectRootNode(
                Utilities.TEST_PROJECT_NAME);
        if(pn != null && pn.isPresent()) {
            pn.select();
            Node n = new Node(pn, path);
            n.select();
            JPopupMenuOperator jpmo = n.callPopup();
            jpmo.pushMenu("Delete");
            new NbDialogOperator(CONFIRM_OBJECT_DELETION).btOK().push(); //confirm
            takeANap(500);
        }
    } catch (TimeoutExpiredException e) {
        System.out.println("Node hasn't been found!!!");
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:22,代碼來源:Utilities.java

示例3: prepare

import org.netbeans.jemmy.TimeoutExpiredException; //導入依賴的package包/類
public void prepare() {
    String documentPath = CommonUtilities.SOURCE_PACKAGES + "|" + "allComponents" + "|" + midletName;
    long nodeTimeout = pto.getTimeouts().getTimeout("ComponentOperator.WaitStateTimeout");

    try {
        openNode = new Node(pto.getProjectRootNode(targetProject), documentPath);
    } catch (TimeoutExpiredException ex) {
        pto.getTimeouts().setTimeout("ComponentOperator.WaitStateTimeout", nodeTimeout);
        throw new Error("Cannot find expected node because of Timeout");
    }
    pto.getTimeouts().setTimeout("ComponentOperator.WaitStateTimeout", nodeTimeout);

    if (this.openNode == null) {
        throw new Error("Cannot find expected node ");
    }
    openNode.select();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:OpenMIDletEditorTest.java

示例4: testPerformMenuOnNode

import org.netbeans.jemmy.TimeoutExpiredException; //導入依賴的package包/類
/** Test to perform main menu action on node. */
public void testPerformMenuOnNode() {
    Node n = new Node(new SourcePackagesNode("SampleProject"), "sample1|SampleClass1.java");
    // "Tools"
    String toolsItem = Bundle.getStringTrimmed("org.openide.actions.Bundle", "CTL_Tools");
    // "Add to Favorites"
    String addToFavoritesItem = Bundle.getStringTrimmed("org.netbeans.modules.favorites.Bundle", "ACT_Add");
    // "Tools|Add To Favorites"
    try {
        new Action(toolsItem + "|" + addToFavoritesItem, null).perform(n);
    } catch (TimeoutExpiredException e) {
        // Try it once more because sometimes for an uknown reason is Tools menu not fully populated first time.
        // See http://www.netbeans.org/issues/show_bug.cgi?id=85853.
        // push Escape key to ensure there is no open menu
        MainWindowOperator.getDefault().pushKey(KeyEvent.VK_ESCAPE);
        new Action(toolsItem + "|" + addToFavoritesItem, null).perform(n);
    }
    new FavoritesOperator().close();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:20,代碼來源:ActionTest.java

示例5: testFontProperty

import org.netbeans.jemmy.TimeoutExpiredException; //導入依賴的package包/類
/** Test org.netbeans.jellytools.properties.FontProperty. */
public void testFontProperty() {
    PropertySheetOperator pso = new PropertySheetOperator(TestNode.NODE_NAME);
    FontProperty p = new FontProperty(pso, "Font");  // NOI18N
    try {
        p.setFontValue("Serif", FontProperty.STYLE_BOLDITALIC, "14");  // NOI18N
    } catch (TimeoutExpiredException e) {
        // sometimes it fails on Solaris
        log("jemmy.log", "ERROR: " + e.getMessage());
        JDialog fontDialog = JDialogOperator.findJDialog(p.getName(), false, false);
        if (fontDialog != null) {
            log("jemmy.log", "   Closing Font dialog.");
            new NbDialogOperator(fontDialog).close();
        }
        log("jemmy.log", "   Trying to set font once more");
        p.setFontValue("Serif", FontProperty.STYLE_BOLDITALIC, "14");  // NOI18N
    }
    // need to change selection because it gets editable otherwise
    pso.tblSheet().selectCell(0, 0);
    String s[] = p.getFontValue();
    // need to change selection because it gets editable otherwise
    pso.tblSheet().selectCell(0, 0);
    assertTrue(s[0].indexOf("Serif") >= 0);  // NOI18N
    assertEquals(FontProperty.STYLE_BOLDITALIC, s[1]);
    assertEquals("14", s[2]);  // NOI18N
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:27,代碼來源:CustomPropertiesTest.java

示例6: OptionsOperator

import org.netbeans.jemmy.TimeoutExpiredException; //導入依賴的package包/類
/**
 * Waits for the Options window opened
 */
public OptionsOperator() {
    super(waitJDialog(optionsSubchooser));
    // wait until settings are loaded
    // "Loading Settings ..."
    String loadingLabel = Bundle.getString("org.netbeans.modules.options.Bundle", "CTL_Loading_Options");
    long waitTimeout = this.getTimeouts().getTimeout("ComponentOperator.WaitComponentTimeout");
    try {
        this.getTimeouts().setTimeout("ComponentOperator.WaitComponentTimeout", 5000);
        new JLabelOperator(this, loadingLabel).waitComponentShowing(false);
    } catch (TimeoutExpiredException e) {
        // ignore - options already loaded
    } finally {
        // set previous timeout
        this.getTimeouts().setTimeout("ComponentOperator.WaitComponentTimeout", waitTimeout);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:20,代碼來源:OptionsOperator.java

示例7: waitText

import org.netbeans.jemmy.TimeoutExpiredException; //導入依賴的package包/類
public static boolean waitText(MessageHandler handler) {
	int i = 0;

	while (!handler.isFinished()) {
		i++;
		if (i > TIME_OUT) {
			throw new TimeoutExpiredException("Text [" + handler.message + "] hasn't been found in reasonable time!");
		}
		try {
			Thread.sleep(500);
		} catch (InterruptedException ex) {
			ex.printStackTrace();
		}
	}
	return true;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:17,代碼來源:TestKit.java

示例8: selectCategory

import org.netbeans.jemmy.TimeoutExpiredException; //導入依賴的package包/類
/** Selects given project category
 * @param category name of the category to select
 */
public void selectCategory(String category) {
    // we need to wait until some node is selected because 'please, wait' node
    // is shown before tree is initialized. Then we can change selection.
    try {
        new Waiter(new Waitable() {

            @Override
            public Object actionProduced(Object param) {
                return treeCategories().isSelectionEmpty() ? null : Boolean.TRUE;
            }

            @Override
            public String getDescription() {
                return ("Wait node is selected");
            }
        }).waitAction(null);
    } catch (InterruptedException e) {
        throw new JemmyException("Interrupted.", e);
    } catch (TimeoutExpiredException tee) {
        // ignore it because sometimes can happen that no category is selected by default
    }
    new Node(treeCategories(), category).select();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:27,代碼來源:NewProjectWizardOperator.java

示例9: openProject

import org.netbeans.jemmy.TimeoutExpiredException; //導入依賴的package包/類
/** Open project. Before opening the project is checked opened projects.
 * @param projectName is name of the project stored in .../editor/test/qa-functional/data/ directory.
 */
public void openProject(String projectName) {
    this.projectName = projectName;
    File projectPath = new File(this.getDataDir() + "/projects", projectName);
    log("data dir = "+this.getDataDir().toString());
    
    /* 1. check if project is open  */
    ProjectsTabOperator pto = new ProjectsTabOperator();
    pto.invoke();
    boolean isOpen = true;
    try {
        JemmyProperties.setCurrentTimeout("JTreeOperator.WaitNextNodeTimeout", OPENED_PROJECT_ACCESS_TIMEOUT);
        ProjectRootNode prn = pto.getProjectRootNode(projectName);
    } catch (TimeoutExpiredException ex) {
        // This excpeiton is ok, project is not open;
        //ex.printStackTrace();
        isOpen = false;
    }
    
    if ( isOpen ) {
        log("Project is open!");
        return;
    }
    
    
    /* 2. open project */
    //retouche:
    //        Object prj= ProjectSupport.openProject(projectPath);
    
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:33,代碼來源:EditorTestCase.java

示例10: closeFile

import org.netbeans.jemmy.TimeoutExpiredException; //導入依賴的package包/類
/** Close file in open project.
 */
public void closeFile() {
    try {
        new EditorOperator(fileName).close();
    } catch ( TimeoutExpiredException ex) {
        log(ex.getMessage());
        log("Can't close the file");
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:EditorTestCase.java

示例11: closeFileWithSave

import org.netbeans.jemmy.TimeoutExpiredException; //導入依賴的package包/類
/** Close file in open project.
 */
public void closeFileWithSave() {
    try {
        new EditorOperator(fileName).close(true);
    } catch ( TimeoutExpiredException ex) {
        log(ex.getMessage());
        log("Can't close the file");
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:EditorTestCase.java

示例12: closeFileWithDiscard

import org.netbeans.jemmy.TimeoutExpiredException; //導入依賴的package包/類
/** Close file in open project.
 */
public void closeFileWithDiscard() {
    try {
        new EditorOperator(fileName).closeDiscard();
    } catch ( TimeoutExpiredException ex) {
        log(ex.getMessage());
        log("Can't close the file");
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:EditorTestCase.java

示例13: waitThreadsNode

import org.netbeans.jemmy.TimeoutExpiredException; //導入依賴的package包/類
/**
 * Waits until given threads node shows up in Debugging view.
 * @param name Full display name of the required thread node to be found.
 */
private void waitThreadsNode(String name) {
    TopComponentOperator debuggingView = new TopComponentOperator("Debugging");
    JTreeOperator threads = new JTreeOperator(debuggingView);
    try {
        new Node(threads, name);
    } catch (TimeoutExpiredException tee) {
        // if fails try second time because sometimes it fails for unknown reason
        new Node(threads, name);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:15,代碼來源:AntSanityTest.java

示例14: actionOnProject

import org.netbeans.jemmy.TimeoutExpiredException; //導入依賴的package包/類
/**
 * Invoke action on project node from popup menu
 * @param project
 * @param pushAction
 */
public static void actionOnProject(String project, String pushAction) {
    ProjectRootNode prn;
    try {
        prn = ProjectsTabOperator.invoke().getProjectRootNode(project);
    } catch (TimeoutExpiredException e) {
        prn = new ProjectsTabOperator().getProjectRootNode(project);
    }
    prn.callPopup().pushMenuNoBlock(pushAction);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:15,代碼來源:CommonUtilities.java

示例15: waitScanFinished

import org.netbeans.jemmy.TimeoutExpiredException; //導入依賴的package包/類
/**
 * Wait finished scan - repeatedly
 */
public static void waitScanFinished(){
    try {
        new QueueTool().waitEmpty();
    } catch (TimeoutExpiredException tee) {            
        getLog().println("The following exception is ignored");
        tee.printStackTrace(getLog());
    }
 }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:CommonUtilities.java


注:本文中的org.netbeans.jemmy.TimeoutExpiredException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。