【发布时间】:2012-12-18 06:53:54
【问题描述】:
我正在使用 AIX 机器运行一些 JUnit 测试。这些测试在 Eclipse 中使用适用于 Windows 和 Linux 平台的 JUnit 运行良好。我正在尝试使用 JUnit 命令行运行这些测试,但出现以下错误
# java org.junit.runner.JUnitCore testName
JUnit version 4.8.1
Could not find class: testName
Time: 0.012
OK (0 tests)
文件作为 testName.java 存在于该位置。我已经在 /etc/profile 文件中设置了我的环境变量。这些是我的环境变量。
导出 CLASSPATH=/usr/junit/junit-4.8.1.jar:/usr/junit/
导出 PATH=$PATH=$PATH:/usr/junit/junit-4.8.1.jar:/usr/junit/
在 AIX 机器上,当我尝试使用以下代码测试 JUnit 时,它给了我同样的失败。
# java org.junit.runner.JUnitCore org.junit.tests.AllTests
JUnit version 4.8.1
Could not find class: org.junit.tests.AllTests
Time: 0.012
OK (0 tests)
JUnit 网站 http://junit.sourceforge.net/doc/faq/faq.htm#tests_1 提供的默认位置中不存在 AllTests 类
# find / -name "*AllTests*"
/usr/junit/org/junit/runners/AllTests.class
可能出了什么问题?
【问题讨论】:
标签: java linux junit junit4 aix