#=========================

#!/usr/bin/env ruby -w#coding:gbk#=========================## author: leijm# date : 2012-07-24 22:57:28# file name: testrb.rb## 1 测试套自动注册# 2 多版本支持# 3 checkRetcode 支持报错返回错误码# 4 单用例执行# 5 前后台执行##=========================#Ruby的类库中最大限度灵活运用Template Method模式的部分,应该说是Enumerable模块和Comparable模块了。#  Enumerable模块中实现循环的each方法采用了Template Method模式。表4-2是Enumerable模块的方法一览。#  表4-2 Enumerable提供的方法#  方 法 名 功  能#  all? 是否所有元素都为真#  all?{|x|...} 块是否对所有元素都为真#  any? 是否至少有一个元素为真#  any?{|x|...} 块是否对至少有一个元素为真#  collect{|x|...} 对各元素进行块中的计算,返回结果的数组#  detect{|x|...} 返回使块为真的第1个元素#  each_with_index{|x,i|...} 对各元素和下标进行块中的计算#  entries 返回元素的数组#  find{|x|...} 返回使块为真的第1个元素#  find_all{|x|...} 返回使块为真的所有元素的数组#  grep(pattern) 返回匹配检索模式的所有元素的数组#  grep(pattern){|x|...} 对匹配检索模式的所有元素进行块中的计算#  include?(x) 是否有元素与x相等#  inject{|x,y|...} 返回对各元素进行块中的计算的结果#  inject(init){|x,y|...} 返回对各元素进行块中的计算的结果#  map{|x|...} 对各元素进行块中的计算,返回结果的数组#  max 返回最大的元素#  max{|a,b|...} 使用块中的比较方法,返回最大的元素#  #  max_by{|x|...} 对各元素进行块中的变换,返回结果最大的元素(Ruby 1.9)#  member?(x) 是否有元素与x相等#  min 返回最小的元素#  min{|a,b|...} 使用块中的比较方法,返回最小的元素#  min_by{|x|...} 对各元素进行块中的变换,返回结果最小的元素(Ruby 1.9)#  partition{|x|...} 把使块为真的元素和使块为假的元素分离开#  reject{|x|...} 返回使块为假的元素的数组#  select{|x|...} 返回使块为真的元素的数组#  sort 对元素排序#  sort{|a,b|...} 使用块中的比较方法,对元素排序#  sort_by{|x|...} 对各元素进行块中的变换,按照变换结果对元素进行排序#  to_a 返回元素的数组#  zip(a,...) 返回各集合串接后的数组#  zip(a,...){|arr|...} 对集合进行串接,然后进行块中的计算load 'public/Testhelper.rb'Testhelper::LoadHelper.loadpathrequire 'ITestRunner' require 'ITestcode'$VERSION= Testconst::VERSION_DEFAULTclass ITestRunner def help puts "testrb.rb -h" puts "testrb.rb -all" self end #getsendrunner=ITestRunner.instance #runner.run( )#Testconst::VERSION_BM200 Testconst::VERSION_DEFAULT#ITestRunnerTest.instance.run(:TestConfigHelper,:testCfg)#ITestRunnerSuite.instance.run( :TestProxy ) #:TestThread :TestBSInfo :TestProxy#ITestRunnerSuite.instance.run( :TestBSInfo ) #:TestThread :TestBSInfo :TestProxy#ITestRunnerSuite.instance.run( :TestBinlog_300 ,Testconst::VERSION_BM300 )ITestRunnerSuite.instance.run( :TestcaseSqlite )ITestRunnerSuite.instance.run( :TestThread )#bsinfo=BSTestInfo.new#puts cmd= bsinfo.cmdtype#附件:http://down.51cto.com/data/2361236