Published: 05 Oct 2020 › Updated: 05 Oct 2020![[JAVA #23] [Troubleshooting #5] TestNG 运行结果在Eclipse显示乱码](https://i.ecency.com/p/5bEGgqZEHBMdvSSM3YPY82SEa7SJvsvpWtBM6Y7qtxHYyEZvHKDjJGrFQ9GRzoDsPrDhBuTkEUR9zZ5FUjx8hJjzCkfQZNJi?format=match&mode=fit&height=377)
[JAVA #23] [Troubleshooting #5] TestNG 运行结果在Eclipse显示乱码
pixabay
重新安装windows后一堆问题在困扰着我。其中最烦人的是,TestNG 运行结果在Eclipse显示乱码。控制台和主代码页面都没问题,为什么呢?
Code:
@Test(dataProvider = "normalList")
public void CASE_03_CheckList(List<Object> exp, List<Object> res) {
Assert.assertTrue(aa.isContains(exp, res), aa.message(exp, res));
Response response = given().get(mockApi_ListRes);
aa.AssertResBody(exp, response);
}
@DataProvider(name = "normalList")
public List<?>[][] normalList() {
return new List<?>[][]{
{Arrays.asList("포함 OR a", "list"), Arrays.asList("스트링 포함","list", "s")},
{Arrays.asList("eng OR sh", "list"), Arrays.asList("English", "list", "s")},
{Arrays.asList("e s", "list"), Arrays.asList("space space", "list", "s")},
{Arrays.asList("!@#$%^&*()", "list"), Arrays.asList("!@#$%^&*()", "list", "s")},
{Arrays.asList("23", "list"), Arrays.asList("123, 4444", "list", "s")},
{Arrays.asList("sp AND ce", "list"), Arrays.asList("space space", "list", "s")},
{Arrays.asList("sp AND ce", "list"), Arrays.asList("space space", "list", "s")},
{Arrays.asList(2, 1), Arrays.asList(1, 2, 3)},
{Arrays.asList(false, true), Arrays.asList(true, false, null)},
{Arrays.asList(false, null), Arrays.asList(null, false, true)},
};
}
Console:
[RemoteTestNG] detected TestNG version 7.3.0
PASSED: CASE_03_CheckList([포함 OR a, list], [스트링 포함, list, s])
PASSED: CASE_03_CheckList([eng OR sh, list], [English, list, s])
PASSED: CASE_03_CheckList([e s, list], [space space, list, s])
PASSED: CASE_03_CheckList([!@#$%^&*(), list], [!@#$%^&*(), list, s])
PASSED: CASE_03_CheckList([23, list], [123, 4444, list, s])
PASSED: CASE_03_CheckList([sp AND ce, list], [space space, list, s])
PASSED: CASE_03_CheckList([sp AND ce, list], [space space, list, s])
PASSED: CASE_03_CheckList([2, 1], [1, 2, 3])
PASSED: CASE_03_CheckList([false, true], [true, false, null])
PASSED: CASE_03_CheckList([false, null], [null, false, true])
记得几年前也发生过这个问题,并且好不容易解决了,但... 忘了怎么改了,哭笑不得~
数字时代无法相信记忆力,数字化并存到区块链才是正道。
解决方法很简单,在Eclipse安装目录下的eclipse.ini文件尾部加上-Dfile.encoding=UTF-8即可。
[Cookie 😅]
参考:
https://blog.csdn.net/sinat_28734889/article/details/52300070
Leave [JAVA #23] [Troubleshooting #5] TestNG 运行结果在Eclipse显示乱码 to:
Read more #cn posts
Best Posts From ETHAN
We have not curated any of june0620's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From ETHAN
- [Life] 献血 #7
- [Life] 산과 바다를 동시에 느끼려면!!! 통영!!! 클럽이에스 리조트!!! #1
- [Life] 韩国的驾照有意思~
- [Coin] 从NEXO发送coin到Bitfinex需要谨慎!
- [Coin] 好久不见!QTUM
- My Actifit Report Card: 4월 18 2021
- [Coin] 现在的市场太激烈,找个稳定币稳定稳定
- My Actifit Report Card: 4월 4 2021
- [Coin] ETH2 锁仓70日收益
- [Life] 韩国一部分女性要求男人坐小便,怎么想?
- [it] Chrome os 88 添加性能监控
- [Life] Happy 牛 Year
- [IT] Chromium取Web代App
- [IT] SAMSUNG Galaxy Chromebook #6 在 Chromebook Linux安装 Postman
- [JAVA #23] [Troubleshooting #5] TestNG 运行结果在Eclipse显示乱码
- [Life] blood donation #3
- [Python #19] [Django #12] 穿上CSS搜索功能
- [Python #19] [Django #12] 검색 기능 UI 다듬기
- [Python #18] [Django #11] form action 添加变量(副题:搜索他人搜索)
- [Python #18] [Django #11] form action 변수 적용 (부제: 타인 글 검색)