zoukankan      html  css  js  c++  java
  • 解决reportNG中文乱码(转:http://www.it610.com/article/3626590.htm)

    1.下载reportng源码
         git clone  https://github.com/dwdyer/reportng.git
    2.修改AbstractReporter.java
         package org.uncommons.reportng;
         ...
         import java.io.OutputStream;
         ...
         protected void generateFile(File file,
                                    String templateName,
                                    VelocityContext context) throws Exception
        {
            //Writer writer = new BufferedWriter(new FileWriter(file));
            //encoding to utf-8
            OutputStream out = new FileOutputStream(file);
            Writer writer = new BufferedWriter(new OutputStreamWriter(out,"utf-8"));
            try
            {
                Velocity.mergeTemplate(classpathPrefix + templateName,
                                       ENCODING,
                                       context,
                                       writer);
                writer.flush();
            }
            finally
            {
                writer.close();
            }
        }
    3.编译源码
         cd reportng
         ant
     
    PS:ant环境配置
    1.下载ant源码包
          http://ant.apache.org/bindownload.cgi
    2.解压到安装位置
         unzip to D:apache-ant-1.9.6
    3.修改环境变量
         set ANT_HOME      D:apache-ant-1.9.6
         set Path                  %ANT_HOME%in
    4.验证ant
         cmd:ant -version

    解决reportNG中文乱码

  • 相关阅读:
    vue 相对其他热门 框架 优点 --- 待续
    vue router 只需要这么几步
    正则表达式
    MySQL数据库优化的八种方式
    Django REST Framework 最佳实践
    Node.js ZLIB
    Node.js 虚拟机
    Node.js 实用工具
    Node.js URL
    Node.js UDP/Datagram
  • 原文地址:https://www.cnblogs.com/dayiran1222/p/5923222.html
Copyright © 2011-2022 走看看