SAFS Init Files
There're many deployment files for configuration. We need to learn how SAFS read these depolyment files.
Let's use the IBT as the a small example for reading UseMultiThreadSearch parameter which determines if we use multi-thread algorithm for image comparing.
In the DefaultDriver.java, define a variable USE_MULTIPLE_THREADS to store client's choice about using multi-thread:
/**
* Set true if image searches using BitTolerance
* should attempt to use parallel threading.
* The current implementation of multi-threading is poor,
* and may actually be slower than NOT using multi-threading.
* Current default is 'false'.
* @see org.safs.image.SmallPieceComparator
* @see org.safs.image.ScreenXYBTComparator
*/
public static boolean USE_MULTIPLE_THREADS = false;
Then, in the DefaultDriver.java file, the initializeMiscConfigInfo() method will call configInfo's getNamedValue() method to read the configuration files. So in order to get client's choice of whether use multi-thread, we'll do:
String useMultiThread = configInfo.getNamedValue(DriverConstant.SECTION_SAFS_IBT, "UseMultiThreadSearch");
if(useMultiThread!=null) {
ImageUtils.USE_MULTIPLE_THREADS = StringUtilities.convertBool(useMultiThread);
Log.info("SAFS_IBT:UseMultiThreadSearch set to: "+ ImageUtils.USE_MULTIPLE_THREADS);
}
The corresponding test.ini file should be written like this:
[SAFS_IBT]
UseTwoDimensionMatch=true
Obviously the [SAFS_IBT] is determined by parameter DriverConstant.SECTION_SAFS_IBT in configInfo.getNamedValue() method.
In org.safs.tools.drivers.DriverConstant.java, one constant DEFAULT_PROJECT_DATAPOOL is used to store test tables and app maps. Generally, all inputs except benchmarks are placed here.
Then, in org.safs.tools.drivers.AbstractDriver.java, in AbstractDriver class, the variable datapoolSource will use the DEFAULT_PROJECT_DATAPOOL as default value. In the method validateRootConfigureParameters() of AbstractDriver class, it will call:
datapoolSource = getProjectDirectoryInfo (configInfo.getNamedValue (
DriverConstant.SECTION_SAFS_DIRECTORIES, "DataDir"),
DriverConstant.DEFAULT_PROJECT_DATAPOOL);
for setting.
In jsafs.validateRootConfigureParameters() using datapoolSource = getProjectDirectoryInfo() get the directory of MAP files.
SAFS Init Files的更多相关文章
- saltstack之(七)配置管理系统初始化init
saltstack的配置管理分环境管理:①.base为基础环境,一般会存放一些所有服务器都使用的配置管理信息.②.dev为开发测试环境,一般会存放一些开发测试服务器使用的配置管理信息.③.pro为线上 ...
- saltstack简单部署和实践
#Elaine:master;Dylan:minion#利用salt给minion安装包[root@elaine states]# vim /etc/salt/master default_inclu ...
- 使用Githua管理代码
原创博客:转载请标明出处:http://www.cnblogs.com/zxouxuewei/ 1.安装配置git服务器 a.安装ssh,因为git是基于ssh协议的,所以必须先装ssh: ...
- error: src refspec master does not match any. 错误处理办法
自从上次学了git之后,很少用.今天在使用 本地仓库使用如下命令初始化: $ git init 之后使用如下命令添加远程库: $ git remote add origin git@github.co ...
- web工作流
web工作流之Gulp学习 Gulp.js 是一个自动化构建工具,开发者可以使用它在项目开发过程中自动执行常见任务. Gulp.js 是基于 Node.js 构建的,利用 Node.js 流的威力,你 ...
- SaltStack项目实战(六)
SaltStack项目实战 系统架构图 一.初始化 1.salt环境配置,定义基础环境.生产环境(base.prod) vim /etc/salt/master 修改file_roots file_r ...
- gulp进阶构建项目由浅入深
gulp进阶构建项目由浅入深 阅读目录 gulp基本安装和使用 gulp API介绍 Gulp.src(globs[,options]) gulp.dest(path[,options]) gulp. ...
- SaltStack实战
SaltStack实战 #安装 安装注意几点 python-libs-2.6.6-64.el6.x86_64 conflicts with file from package python-2.6.6 ...
- linux hugepage
The intent of this file is to give a brief summary of hugetlbpage support inthe Linux kernel. This ...
随机推荐
- Codeforces Round #383 _python作死系列
A. Arpa's hard exam and Mehrdad's naive cheat 题意求1378的n次方的最后一位,懒的写循环节 瞎快速幂 py3 int和LL 合并为int了 def q_ ...
- iOS.ReactNative-4-react-native-command-line-tool
Command line tool: react-native 1. react-native 是一个命令行工具 1.1 react-native简介 运行以下命令: ls -lt `which re ...
- IOS线程的一些总结
主线程的作用 (在主线程中才能设置) 显示/刷新UI界面 处理UI事件(比如点击事件.滚动事件.拖拽事件): 主线程的使用注意 别将比较耗时的操作放到主线程中. 耗时操作会卡住主线程.影响体验. [N ...
- Windows上安装Maven
Maven的具体参考书可以看:<Maven实战> 下载maven可以到:http://maven.apache.org/ Maven的eclipse基本使用可以在这里看到:http://w ...
- iOS模拟各种网络状态
在iOS开发中我们有在各种不同网络状态下测试app运行状态的需求.苹果给我们提供了在模拟器和真机状态下,模拟各种网络状态的软件. 在模拟器中 苹果提供的模拟网络状态的工具官网地址下载该工具需要登录Ap ...
- java 字符串截取
截取指定长度的字符串,如果超出就用more的内容来替换 截取的字节数,截取的时候,有可能会少截取一位(当最后一位是1个双字节的话,会少截取一个) public class Test { publ ...
- HTML5的viewport使用
viewport 语法介绍: <!-- html document --> <meta name="viewport" content=" height ...
- andriod终端操作命令
1.卸载大厅安装包,如果卸载不掉的话,添加-r pm uninstall -r com.scigames.egm.lobby 2.查找包含"scigames"的安装包 3.卸载一个 ...
- C3P0连接池异常
解决方案: 将c3p0.jar包换成c3p0-0.9.0.2.jar,c3p0这个包应该有bug 引用如下: com.mchange.v2.log.MLog Determines which libr ...
- Linux下Tomcat重新启动
在Linux系统下,重启Tomcat使用命令操作的! 首先,进入Tomcat下的bin目录 cd /usr/local/tomcat/bin 使用Tomcat关闭命令 ./shutdown.sh 查看 ...