1、IDEA2020版中运行单元测试,报错:org.junit.ComparisonFailure: expected:<... Band by The Beatles[]]
2、参考https://yuwang.blog.csdn.net/article/details/102684967
3、调整后的代码如下
// assertEquals(
// "Playing Sgt. Pepper's Lonely Hearts Club Band by The Beatles\n",
// log.getLog());
assertEquals(
"Playing Sgt. Pepper's Lonely Hearts Club Band by The Beatles\r\n",
log.getLog());
4、修改gradle-wrapper.properties
#distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip
注释掉build.gradle中的部分内容
//task wrapper(type: Wrapper) {
// gradleVersion = '1.11'
//}
5、刷新Gradle
6、加入JUnit的Jar包
7、运行测试调试
参考:https://www.cnblogs.com/ws0316/p/11849316.html
9、配置服务器时报: Application server libraries not found,我的问题时IDEA2020使用了tomcat-10.0.6,下载tomcat-9.0.46,问题解决
10、使用Gradle:spittr.war,生成的路径为:http://localhost:8080/Gradle__spittr_war/, 使用spittr,生成的路径为http://localhost:8080/spittr/