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 ...
随机推荐
- swift 定制自己的Button样式
swift的UIButton类中有些公开方法可以重写,所以,如果想写出自己的UIButton,只要继承UIButton类,并重写相应的方法即可. 系统的UIButton可以添加图片,也可以添加标题,但 ...
- 屏蔽input导致的回车提交事件
onkeypress="if(event.keyCode == 13) return false;"
- 树形菜单的json字符串的拼接
最近在学习权限管理, 要用到树形按钮, 但是字符串的拼接是一个难理解的问题, 然后从网上找了一个从前台用js来遍历组成这个json字符串, 很好! 但是没看懂... var data = [ {&qu ...
- c#输出、输入练习
//输出 Console.WriteLine("这是一行文字"); 自动回车的. Console.Write("Hello world"); 不带回车的. ...
- CardView的简单介绍
CardView是Android5.0中的一个全新控件,本质上而言,CardView是一个增加了圆角和阴影效果的FrameLayout,没错它就是一个FrameLayout,一个布局.CardView ...
- [转]MySQL中存储过程权限问题
MySQL中以用户执行存储过程的权限为EXECUTE 比如我们在名为configdb的数据库下创建了如下存储过程,存储过程的定义者为user_admin use configdb; drop proc ...
- [转]Oracle数据泵的使用
使用数据泵导出数据 1.连接Oracle数据库SQL> conn / as sysdba已连接. 2.创建一个操作目录SQL> create directory dump_dir as ' ...
- Postman-简单使用
Postman-简单使用 Postman-进阶使用 Postman-CI集成Jenkins Postman功能(https://www.getpostman.com/features) 主要用于模拟网 ...
- JavaWeb学习总结(三)——Tomcat服务器学习和使用(二)
一.打包JavaWeb应用 在Java中,使用"jar"命令来对将JavaWeb应用打包成一个War包,jar命令的用法如下:
- Sql语句,先查询再插入一条语句完成。
if ( (select COUNT(*) from Hr where 考勤号码 = '149' and 日期时间 = '2015/7/3 12:00:26') = 0 )INSERT INTO [ ...