Search in sources :

Example 1 with SWTBotTreeItem

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project translationstudio8 by heartsome.

the class DBManagement method selectDBType.

/**
	 * 在库管理对话框左边的树上选择并展开指定类型的数据库
	 * @param dbType
	 *            数据库类型;
	 * @return 指定数据库类型的树节点;
	 */
public SWTBotTreeItem selectDBType(DB dbType) {
    SWTBotTreeItem treei = null;
    assertTrue("库管理对话框为 null。", dialog != null);
    switch(dbType) {
        case INTERNAL:
            {
                treei = dialog.treiDBInternal().expand().select();
                verifyInternalDBWidgets();
                break;
            }
        case MYSQL:
            {
                treei = dialog.treiDBMySQL().expand().select();
                verifyExternalDBWidgets(dbType);
                break;
            }
        case ORACLE:
            {
                treei = dialog.treiDBOracle().expand().select();
                verifyExternalDBWidgets(dbType);
                break;
            }
        case POSTGRESQL:
            {
                treei = dialog.treiDBPostgreSQL().expand().select();
                verifyExternalDBWidgets(dbType);
                break;
            }
        case MSSQL:
            {
                treei = dialog.treiDBMSSQL().expand().select();
                verifyExternalDBWidgets(dbType);
                break;
            }
        default:
            {
                assertTrue("无此数据库类型" + dbType, false);
            }
    }
    return treei;
}
Also used : SWTBotTreeItem(org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)

Example 2 with SWTBotTreeItem

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project translationstudio8 by heartsome.

the class MemoryDBManagement method deleteConnection.

/**
	 * 完整步骤:根据从 Excel 中读取的数据删除已保存的连接信息
	 * @param from
	 *            功能入口,请使用 TSUIConstants 类的枚举;
	 */
public void deleteConnection(Entry from) {
    mode = MemoryDatabaseManagementDialog.MANAGEMENT;
    openDBMgmgDialog(from);
    getDataConnect(mode);
    assertTrue("未在已保存的连接信息中找到该连接:" + connectionName, isConnectionSaved());
    SWTBotTreeItem curDb = selectDBType();
    int countBefore = curDb.getItems().length;
    curDb.expandNode(connectionName).select();
    dialog.btnRemoveConn().click();
    int countRemove = curDb.getItems().length;
    assertTrue("仍可在已保存的连接信息中找到该连接:" + connectionName, countBefore == countRemove + 1);
    dialog.btnClose().click();
}
Also used : SWTBotTreeItem(org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)

Example 3 with SWTBotTreeItem

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project translationstudio8 by heartsome.

the class MemoryDBManagement method selectDBType.

/**
	 * 在库管理对话框左边的树上选择并展开指定类型的数据库
	 * @param dbType
	 *            数据库类型;
	 * @return 指定数据库类型的树节点;
	 */
public SWTBotTreeItem selectDBType(DB dbType) {
    SWTBotTreeItem treei = null;
    assertTrue("库管理对话框为 null。", dialog != null);
    switch(dbType) {
        case INTERNAL:
            {
                treei = dialog.treiDBInternal().expand().select();
                verifyInternalDBWidgets();
                break;
            }
        case MYSQL:
            {
                treei = dialog.treiDBMySQL().expand().select();
                verifyExternalDBWidgets(dbType);
                break;
            }
        case ORACLE:
            {
                treei = dialog.treiDBOracle().expand().select();
                verifyExternalDBWidgets(dbType);
                break;
            }
        case POSTGRESQL:
            {
                treei = dialog.treiDBPostgreSQL().expand().select();
                verifyExternalDBWidgets(dbType);
                break;
            }
        case MSSQL:
            {
                treei = dialog.treiDBMSSQL().expand().select();
                verifyExternalDBWidgets(dbType);
                break;
            }
        default:
            {
                assertTrue("无此数据库类型" + dbType, false);
            }
    }
    return treei;
}
Also used : SWTBotTreeItem(org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)

Example 4 with SWTBotTreeItem

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project translationstudio8 by heartsome.

the class IsProjectExist method test.

/**
	 * (non-Javadoc)
	 * @see org.eclipse.swtbot.swt.finder.waits.ICondition#test()
	 */
public boolean test() throws Exception {
    boolean result = false;
    SWTBotTreeItem[] items = ProjectTreeView.getTree().getAllItems();
    for (SWTBotTreeItem item : items) {
        if (projectName.equals(item.getText())) {
            result = true;
            break;
        }
    }
    return result;
}
Also used : SWTBotTreeItem(org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)

Example 5 with SWTBotTreeItem

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project gfm_viewer by satyagraha.

the class ProjectBot method newFile.

public ProjectFileBot newFile(String fileName) {
    projectTree.setFocus();
    projectTree.contextMenu("New").menu("File").click();
    SWTBotShell shell = bot.shell("New File");
    shell.activate();
    bot.textWithLabel("File name:").setText(fileName);
    bot.button("Finish").click();
    SWTUtils.sleep(2000);
    SWTBotTreeItem treeItem = projectTree.getNode(fileName);
    return new ProjectFileBot(treeItem);
}
Also used : SWTBotTreeItem(org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)

Aggregations

SWTBotTreeItem (org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)63 Test (org.junit.Test)38 DockerConnection (org.eclipse.linuxtools.internal.docker.core.DockerConnection)20 DockerClient (com.spotify.docker.client.DockerClient)19 IDockerConnection (org.eclipse.linuxtools.docker.core.IDockerConnection)9 Path (org.eclipse.core.runtime.Path)7 SWTBotTree (org.eclipse.swtbot.swt.finder.widgets.SWTBotTree)7 IDockerConnectionStorageManager (org.eclipse.linuxtools.docker.core.IDockerConnectionStorageManager)6 SWTBotEclipseEditor (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor)6 ByteArrayInputStream (java.io.ByteArrayInputStream)5 SWTBotEditor (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor)5 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)5 IEditorReference (org.eclipse.ui.IEditorReference)5 Ignore (org.junit.Ignore)5 IResource (org.eclipse.core.resources.IResource)4 File (java.io.File)3 IFile (org.eclipse.core.resources.IFile)3 ProjectExplorerTreeItemAppearsCondition (org.eclipse.linuxtools.changelog.ui.tests.utils.ProjectExplorerTreeItemAppearsCondition)3 TCPConnectionSettings (org.eclipse.linuxtools.internal.docker.core.TCPConnectionSettings)3 UnixSocketConnectionSettings (org.eclipse.linuxtools.internal.docker.core.UnixSocketConnectionSettings)2