Search in sources :

Example 1 with DBManagement

use of net.heartsome.cat.ts.test.basecase.menu.db.DBManagement in project translationstudio8 by heartsome.

the class ProjectSetting method setTMDB.

/**
	 * 设置记忆库
	 * @param from
	 *            功能入口,请使用 TSUIConstants 类提供的常量;
	 * @param nextAction
	 *            下一步操作,请使用本类提供的常量;
	 */
public void setTMDB(Entry from, NextAction nextAction) {
    if (dlgPrjSetting == null) {
        openPrjSettingDlg(from);
    }
    dlgPrjSetting.treiTmSetting().select();
    if (!dlgPrjSetting.table().containsTextInColumn(tMDBName, dlgPrjSetting.tblColName())) {
        if (isTMDBExist) {
            dlgPrjSetting.btnAdd().click();
            DBManagement dbMgmt = new DBManagement(row);
            dbMgmt.selectDB(tMDBName);
        } else {
            dlgPrjSetting.btnCreate().click();
        // TODO 目前弹出的是数据库创建向导,而该向导有较大的改进余地,暂不实现
        }
        try {
            InformationDialog dlgInfo = new InformationDialog(InformationDialog.dlgTitleTips, InformationDialog.msgNoMatchInDB);
            dlgInfo.btnOK().click();
            Waits.shellClosed(dlgInfo);
        } catch (WidgetNotFoundException e) {
        // e.printStackTrace();
        }
        assertTrue("未正确选择记忆库:" + tMDBName, dlgPrjSetting.table().containsTextInColumn(tMDBName, dlgPrjSetting.tblColName()));
    }
    nextAction(nextAction);
}
Also used : WidgetNotFoundException(org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException) InformationDialog(net.heartsome.cat.ts.test.ui.msgdialogs.InformationDialog) DBManagement(net.heartsome.cat.ts.test.basecase.menu.db.DBManagement)

Example 2 with DBManagement

use of net.heartsome.cat.ts.test.basecase.menu.db.DBManagement in project translationstudio8 by heartsome.

the class DatabaseTest method tc3DeleteDB.

@Repeat(15)
@Test
public void tc3DeleteDB() {
    HsRow row = shDeleteDBData.new HsRow(deleteDBNum);
    DBManagement db = new DBManagement(row);
    db.deleteDB(TsUIConstants.Entry.MENU);
    deleteDBNum++;
}
Also used : HsRow(net.heartsome.test.utilities.poi.ExcelUtil.HsSheet.HsRow) DBManagement(net.heartsome.cat.ts.test.basecase.menu.db.DBManagement) Test(org.junit.Test) Repeat(net.heartsome.test.swtbot.junit.Repeat)

Example 3 with DBManagement

use of net.heartsome.cat.ts.test.basecase.menu.db.DBManagement in project translationstudio8 by heartsome.

the class DatabaseTest method tc2CreateDB.

@Repeat(25)
@Test
public void tc2CreateDB() {
    HsRow row = shCreateDBData.new HsRow(createDBNum);
    DBManagement db = new DBManagement(row);
    db.createDB(TsUIConstants.Entry.MENU);
    createDBNum++;
}
Also used : HsRow(net.heartsome.test.utilities.poi.ExcelUtil.HsSheet.HsRow) DBManagement(net.heartsome.cat.ts.test.basecase.menu.db.DBManagement) Test(org.junit.Test) Repeat(net.heartsome.test.swtbot.junit.Repeat)

Example 4 with DBManagement

use of net.heartsome.cat.ts.test.basecase.menu.db.DBManagement in project translationstudio8 by heartsome.

the class DatabaseTest method tc4DeleteConnection.

@Repeat(5)
@Test
public void tc4DeleteConnection() {
    HsRow row = shConnectServerData.new HsRow(deleteConnectionNum);
    DBManagement db = new DBManagement(row);
    db.deleteConnection(TsUIConstants.Entry.SHORTCUT);
    deleteConnectionNum++;
}
Also used : HsRow(net.heartsome.test.utilities.poi.ExcelUtil.HsSheet.HsRow) DBManagement(net.heartsome.cat.ts.test.basecase.menu.db.DBManagement) Test(org.junit.Test) Repeat(net.heartsome.test.swtbot.junit.Repeat)

Example 5 with DBManagement

use of net.heartsome.cat.ts.test.basecase.menu.db.DBManagement in project translationstudio8 by heartsome.

the class DatabaseTest method tc1ConnectServer.

@Repeat(23)
@Test
public void tc1ConnectServer() {
    HsRow row = shConnectServerData.new HsRow(connectServerNum);
    DBManagement db = new DBManagement(row);
    db.connectServer(TsUIConstants.Entry.SHORTCUT);
    connectServerNum++;
}
Also used : HsRow(net.heartsome.test.utilities.poi.ExcelUtil.HsSheet.HsRow) DBManagement(net.heartsome.cat.ts.test.basecase.menu.db.DBManagement) Test(org.junit.Test) Repeat(net.heartsome.test.swtbot.junit.Repeat)

Aggregations

DBManagement (net.heartsome.cat.ts.test.basecase.menu.db.DBManagement)7 Repeat (net.heartsome.test.swtbot.junit.Repeat)4 HsRow (net.heartsome.test.utilities.poi.ExcelUtil.HsSheet.HsRow)4 Test (org.junit.Test)4 InformationDialog (net.heartsome.cat.ts.test.ui.msgdialogs.InformationDialog)2 WidgetNotFoundException (org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)2