Package com.baidu.qa.service.test.dto

Examples of com.baidu.qa.service.test.dto.CaseData


    try{
      // 获取case的路径
      searchFolders(folderpath, Constant.FILENAME_CASEINFO, resultpaths);
     
      for (int i = 0; i < resultpaths.size(); i++) {
        CaseData casedata = parsecase(resultpaths.get(i));
        // 当case不是stop的时候添加
        if (casedata != null && casedata.getStatus() != null
            && !casedata.getStatus().toUpperCase().equals(Constant.CASE_STATUS_STOP)) {
            cases.add(casedata);
          }
      }
     
      // 有debug类型的 只执行debug的case
      List<CaseData> debuglist = new ArrayList<CaseData>();
      for (CaseData casedata : cases) {
        if (casedata.getStatus().toUpperCase().equals(Constant.CASE_STATUS_DEBUG)) {
          {
            debuglist.add(casedata);
          }
        }
      }
View Full Code Here


   * @return 单个case信息
   * @throws Exception
   */
  private CaseData parsecase(String casepath) throws Exception {
   
    CaseData casedata = new CaseData();
    File caseinfo = new File(casepath + Constant.FILENAME_CASEINFO);
    File input = new File(casepath + Constant.FILENAME_INPUT);
    // 解析case基本信息
    InputStream in_caseinfo = new BufferedInputStream(new FileInputStream(
        casepath + Constant.FILENAME_CASEINFO));
    Properties Info_caseinfo = new Properties();
    try {
      Info_caseinfo.load(in_caseinfo);

      casedata.setCaseid(Info_caseinfo.getProperty("caseid"));
      casedata.setDesc(Info_caseinfo.getProperty("desc"));
      casedata.setAction(Info_caseinfo.getProperty("action"));
      casedata.setStatus(Info_caseinfo.getProperty("status"));
      if (Info_caseinfo.containsKey("requesttype")) {
        casedata.setRequesttype(Info_caseinfo.getProperty("requesttype"));
      }
      //判断是否存在var替换
      if (Info_caseinfo.containsKey("var")&&Info_caseinfo
          .getProperty("var").trim().length()!=0) {
        casedata.setHasVar(true);
      }
      in_caseinfo.close();

      // 设置替换case变量的vargen,在此不进行文件路径是否为空的判断
      casedata.setVarGen(VariableGenerator.getGenerator(casepath
          + Constant.FILENAME_CASEINFO));
     
      casedata = parseCaseinfo(casedata,casepath);
      return casedata;
    } catch (IOException e) {
View Full Code Here

    hasdebug = false;
    List<CaseSuite> casesuitelist = new ArrayList<CaseSuite>();
    for (String path : pathlist) {
      // 如果是case文件
      if (path.trim().endsWith(Constant.FILENAME_CASEINFO.substring(1))) {
        CaseData onecase = parsecase(new File(rootpath + "/"
            + path.trim()).getParent());
        if (onecase == null) {
          return null;
        }
        boolean isadded = false;
View Full Code Here

TOP

Related Classes of com.baidu.qa.service.test.dto.CaseData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.