testng-result中文乱码问题

简介: 背景 执行完用例查看报告,发现testng-result.xml文件中关于中文的都是乱码   解决方法 eclipse已设置了utf-8去编译,所以直接运行run as testng ,在console栏输出中文是没有问题的 通过mvn去执行的时候用的是maven-surefire-plugin插件,所以需要修改这里新增 -Dfile.

背景

执行完用例查看报告,发现testng-result.xml文件中关于中文的都是乱码

 

解决方法

eclipse已设置了utf-8去编译,所以直接运行run as testng ,在console栏输出中文是没有问题的

通过mvn去执行的时候用的是maven-surefire-plugin插件,所以需要修改这里新增

<argLine>-Dfile.encoding=UTF-8</argLine> 

 

<plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <version> 2.19 . 1 </version>
                 <configuration>
                     <suiteXmlFiles>
                         <suiteXmlFile>testng.xml</suiteXmlFile>
                     </suiteXmlFiles>
                     <testFailureIgnore> false </testFailureIgnore>
                     <argLine>
                         -javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar -Dcucumber.options= "--plugin ru.yandex.qatools.allure.cucumberjvm.AllureReporter"
                     </argLine>
                     <argLine>-Dfile.encoding=UTF- 8 </argLine>   
                 </configuration>
                 <dependencies>
                     <dependency>
                         <groupId>org.aspectj</groupId>
                         <artifactId>aspectjweaver</artifactId>
                         <version>${aspectj.version}</version>
                     </dependency>
                 </dependencies>
             </plugin>
虽千万人,吾往矣!
目录
相关文章
|
2月前
|
SQL Java 数据库连接
mybatis报错 resultMapException
mybatis报错 resultMapException
25 0
mybatis报错 resultMapException
|
6月前
|
Java Spring
【Java用法】Spring之@Nullable和@NotNull注释的使用
【Java用法】Spring之@Nullable和@NotNull注释的使用
85 0
|
SQL Java 数据库连接
hibernate.exception.GenericJDBCException: could not extract ResultSet 解决办法
这句话翻译过来就是无法提取ResultSet 我在联查表的视图的时候发现的问题,明明之前好好的 那么你就得想想了 你再把错误信息往上翻翻,能不能看到 no viable alternative at input‘XXXX’ 是不是在关联表里更改了字段名视图里没改,字段名都不匹配它找个屁啊(笑)
|
6月前
|
Java 测试技术 Spring
在进行SSM单元测试时出现的Could not load TestContextBootstrapper [null]. Specify @BootstrapW错误
在进行SSM单元测试时出现的Could not load TestContextBootstrapper [null]. Specify @BootstrapW错误
|
10月前
|
网络协议 Java 数据库连接
Springboot 通用返回类Result
Springboot 通用返回类Result
310 0
|
SQL XML Java
Mybatis开发要点-resultType和resultMap的区别?
Mybatis开发要点-resultType和resultMap的区别?
88 0
|
前端开发
springboot05、封装返回结果集{state:““msg:““result:null}
springboot05、封装返回结果集{state:““msg:““result:null}
119 0
springboot05、封装返回结果集{state:““msg:““result:null}
|
Java Android开发
使用ant运行testng的testng.xml并且使用testng-results.xsl美化结果
使用ant运行testng的testng.xml并且使用testng-results.xsl美化结果
|
SQL Java 关系型数据库
记录:springboot使用resultType空指针java.lang.NullPointerException: null...【亲测有效】
记录:springboot使用resultType空指针java.lang.NullPointerException: null...【亲测有效】
386 0

热门文章

最新文章