Package com.baidu.qa.service.test.util

Examples of com.baidu.qa.service.test.util.FileCharsetDetector


   * @param config
   * @param vargen
   * @return
   */
  public Object requestHttpByHttpClient(File file, Config config, VariableGenerator vargen) {
    FileCharsetDetector det = new FileCharsetDetector();
    try {
      String oldcharset = det.guestFileEncoding(file);
      if (oldcharset.equalsIgnoreCase("UTF-8") == false)
        FileUtil.transferFile(file, oldcharset, "UTF-8");
    } catch (Exception ex) {
      log.error("[change expect file charset error]:" + ex);
    }
View Full Code Here


 
 
 
 
  public boolean setTestDataWithSql(File file,Config config) {
    FileCharsetDetector det = new FileCharsetDetector();
    try{
      String oldcharset = det.guestFileEncoding(file);
      if(oldcharset.equalsIgnoreCase("UTF-8") == false)
      FileUtil.transferFile(file, oldcharset, "UTF-8");
    }catch(Exception ex){
      log.error("[change expect file charset error]:"+ex);
    }
View Full Code Here

  }

 
 
  public boolean setTestDataWithCsvFile(File file,Config config){
    FileCharsetDetector det = new FileCharsetDetector();
    try{
      String oldcharset = det.guestFileEncoding(file);
      if(oldcharset.equalsIgnoreCase("UTF-8") == false)
      FileUtil.transferFile(file, oldcharset, "UTF-8");
    }catch(Exception ex){
      log.error("[change expect file charset error]:"+ex);
    }
View Full Code Here

   * @param file
   * @param config
   * @param vargen
   */
  public void selectVar(File file, Config config, VariableGenerator vargen) {
    FileCharsetDetector det = new FileCharsetDetector();
    try {
      String oldcharset = det.guestFileEncoding(file);
      if (oldcharset.equalsIgnoreCase("UTF-8") == false)
        FileUtil.transferFile(file, oldcharset, "UTF-8");
    } catch (Exception ex) {
      log.error("[change expect file charset error]:" + ex);
    }
View Full Code Here

 
 
  public void verifyResponseWithExpectString(File expectfile,String actual) {
   
   
    FileCharsetDetector det = new FileCharsetDetector();
    String expectedStr = FileUtil.readFileByLines(expectfile);
    try{
      String oldcharset = det.guestFileEncoding(expectfile);
      if(oldcharset.equalsIgnoreCase("UTF-8") == false)
      FileUtil.transferFile(expectfile, oldcharset, "UTF-8");
    }catch(Exception ex){
      log.error("[change expect file charset error]:"+ex);
    }
View Full Code Here

  private static Log log = LogFactory.getLog(VerifyMysqlDataImpl.class);

 

  public void verifyMysqlDataByCsvFile(File file,Config config) {
    FileCharsetDetector det = new FileCharsetDetector();
    try{
      String oldcharset = det.guestFileEncoding(file);
      if(oldcharset.equalsIgnoreCase("UTF-8") == false)
      FileUtil.transferFile(file, oldcharset, "UTF-8");
    }catch(Exception ex){
      log.error("[change expect file charset error]:"+ex);
    }
View Full Code Here




  public void verifyMysqlDataBySqlFile(File file, Config config) {
    FileCharsetDetector det = new FileCharsetDetector();
    try{
      String oldcharset = det.guestFileEncoding(file);
      if(oldcharset.equalsIgnoreCase("UTF-8") == false)
      FileUtil.transferFile(file, oldcharset, "UTF-8");
    }catch(Exception ex){
      log.error("[change expect file charset error]:"+ex);
    }
View Full Code Here

          inputfile = f;
        }
      }
     
      if (inputfile != null) {
        FileCharsetDetector det = new FileCharsetDetector();
        try {
          String oldcharset = det.guestFileEncoding(inputfile);
          if (oldcharset.equalsIgnoreCase("UTF-8") == false)
            FileUtil.transferFile(inputfile, oldcharset, "UTF-8");
        } catch (Exception ex) {
          log.error("[change expect file charset error]:" + ex);
          throw new RuntimeException("change expect file charset error", ex.getCause());
View Full Code Here

TOP

Related Classes of com.baidu.qa.service.test.util.FileCharsetDetector

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.