use of net.heartsome.cat.ts.test.basecase.menu.db.DBManagement in project translationstudio8 by heartsome.
the class ProjectSetting method setTBDB.
/**
* 设置术语库
* @param from
* 功能入口,请使用 TSUIConstants 类提供的常量;
* @param nextAction
* 下一步操作,请使用本类提供的常量;
*/
public void setTBDB(Entry from, NextAction nextAction) {
if (dlgPrjSetting == null) {
openPrjSettingDlg(from);
}
dlgPrjSetting.treiTbSetting().select();
if (!dlgPrjSetting.table().containsTextInColumn(tBDBName, dlgPrjSetting.tblColName())) {
if (isTBDBExist) {
dlgPrjSetting.btnAdd().click();
DBManagement dbMgmt = new DBManagement(row);
dbMgmt.selectDB(tBDBName);
} 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("未正确选择术语库:" + tBDBName, dlgPrjSetting.table().containsTextInColumn(tBDBName, dlgPrjSetting.tblColName()));
}
nextAction(nextAction);
}
use of net.heartsome.cat.ts.test.basecase.menu.db.DBManagement in project translationstudio8 by heartsome.
the class ProjectSetting method getDataPrjSetting.
/**
* 从 Excel 文件中读取测试数据并赋值给相应变量;
*/
private void getDataPrjSetting() {
name = data.getTextOrEmpty(ExcelData.colPrjName);
client = data.getTextOrEmpty(ExcelData.colClient);
company = data.getTextOrEmpty(ExcelData.colCompany);
eMail = data.getTextOrEmpty(ExcelData.colEMail);
remark = data.getTextOrEmpty(ExcelData.colRemark);
srcLang = TsUIConstants.getLang(data.getTextOrEmpty(ExcelData.colSrcLang));
tgtLangs = TsUIConstants.getLangs(data.getTextArray(ExcelData.colTgtLang));
// dbType = data.getDBType();
tMDBName = data.getTextOrEmpty(ExcelData.colTMDBName);
tBDBName = data.getTextOrEmpty(ExcelData.colTBDBName);
// address = data.getServer();
DBManagement dbMgmt = new DBManagement(row);
isTMDBExist = dbMgmt.isDBExist(tMDBName, false);
isTBDBExist = dbMgmt.isExist(tBDBName);
dbMgmt.closeDialog();
}
Aggregations