使用 J2EE 和 STAF/STAX 实现全生命周期的自动化回归测试(4)

发表于:2012-03-16来源:IBM作者:杨锐 张冲 支雷点击数: 标签:自动化回归测试;J2EE
清单 6. 建立日志目录 !--*************************************************************************** MAKE A DIRECTORY ON TEST MACHINE FOR EVERY BUCKET LISTED IN THE VECTOR *********************

  清单 6. 建立日志目录

				
<!--*************************************************************************** 
    MAKE A DIRECTORY ON TEST MACHINE FOR EVERY BUCKET LISTED IN THE VECTOR 
    ************************************************************************--> 
<block name="'Making Directories for Server %s'%(server[1])"> 
  <script> 
    curBucketList = reg_type.BucketList 
    import time 
    now = time.strftime("%m%d%y") 
  </script> 
  <iterate var="myVector" in="curBucketList"> 
    <sequence> 
      <loop until="RC == 0"> 
        <sequence> 
          <timer duration="dirTimerDuration"> 
            <testcase name="'Making Directory %s'%(myVector[0])" mode="'strict'"> 
              <sequence> 
                <if expr="server[ 1 ] in myVector[ 1 ]"> 
                  <sequence> 
                    <call 
                      function="'sysExecAndVerify'">reg_type.clientMachine, 
                        'mkdir C:\\log\\t%s\\%s\\%s\\%s' 
                        %(driverType, now, server[ 1 ], myVector[0]), ['']</call> 
                  </sequence> 
                </if> 
              </sequence> 
            </testcase> 
          </timer> 
        </sequence> 
      </loop> 
    </sequence> 
  </iterate> 
</block>

  日志目录建立之后,STAX 引擎开始按顺序执行对应当前测试场景的每个 Bucket 中的每个测试用例(Test Case)。在执行之前,RegExec.xml 任务会根据

原文转自:http://www.ltesting.net