我已经在我的 Windows 机器上创建了 Junit 测试。我想在 linux 服务器上部署这些测试。我已将代码放在正确的目录中,并将必要的 jar 文件放在服务器的类路径中。在本地,junit 测试运行良好,但是当我想在 linux 服务器上编译时,例如我得到的测试 initiateDeliverProcess1FileTest:
InitiateDeliveryProcess1FileTest.java:1029: cannot find symbol
symbol : method fail(java.lang.String)
location: class com.hp.bes.junit.systest.InitiateDeliveryProcess1FileTest
fail("test fail - There should be " + numberOfFiles
^
我该怎么做才能让它通过编译?
更新 1:
- 我在类路径中有 junit-4.11.jar
最佳答案
我遇到了类似的问题。我能够通过添加
来让它工作Assert.fail("My Message");
不仅仅是
fail("My Message");
希望对您有所帮助。
关于java - 在 Junit 测试中找不到符号失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22376838/