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 ...
随机推荐
- nvidia 各种卡
cudnn是针对maxwell优化的啊, maxwell下的各种卡都是游戏卡,具体可以见: https://developer.nvidia.com/maxwell-compute-architect ...
- 使用GITHUB的体会
github的网页链接 https://github.com/zhangji123/test 学习总结 通过学习使用github软件使我掌握了其使用方法及其独特之处 1.github的网址: htt ...
- 应该了解的Python模块
Python很优雅.使用以下模块有助于保持你的代码整洁.易于维护.欢迎补充. Docopt.忘了optparse和argparse吧,使用docstring来构建优雅的.高可读性.复杂(如果你有这个需 ...
- java面试
1. 问一下服务器管理 2. 问一下流操作 3. 问一下多线程.struts是不是多线程的.或者说servlet的机制. 4. MySQL存储引擎 MyISAM 和 InnoDB 5 跨域问题. 6 ...
- win10下vs2015配置Opencv3.1.0过程详解
下载安装Opencv3.1.0 下载Opencv3.1.0,进入官网,点击opencv for windows即可下载. 点击运行下载好的文件.实际上,opencv的安装程序就是解压缩文件,个人因为 ...
- cocos2d-x 之 CCArray 源码分析(2)
cocos2d-x 自己实现了一个数组CCArray ,下面我们来分析一下CCArray的源码 CCArray继承CCObject,所以,CCArray也具有引用计数功能和内存自动管理功能. 数组的源 ...
- php openssl 增加密钥
生成私钥:openssl genrsa 1024 > private.key (注意,1024是密钥的长度,如果密钥较长,相应加密后的密文也会较长) 生成公钥:openssl rsa -in ...
- hdu 1086 You can Solve a Geometry Problem too
You can Solve a Geometry Problem too Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/3 ...
- ubuntu 14.04 键盘快捷键显示
安装完ubuntu14.04后 第一次登陆,会弹出键盘快捷键的一个大体预览, 也没有一个关闭按钮, 没看完就自动消失了. 让其重现的方法: 按住 super键 ,也就是键盘上的 win键 . 键盘 ...
- Titanium系列--安装Titanium Studio 中的Android SDK,JDK以及环境变量的配置(二)
Ubuntu安装配置JDK 1.先去 Oracle下载Linux下的JDK压缩包,我下载的是jdk-8u25-linux-x64.tar.gz文件,下好后直接解压 Step1:# 将解压好的jdk1. ...