我知道这是基本的 Java Eclipse 问题。但是,如果我从 Eclipse 创建 Junit 测试用例并能够在 Eclipse 中执行它们。
我也可以在 unix/linux 环境中运行相同的测试用例吗?我是否需要在 eclipse 中设置不同才能在 unix/linux 环境中运行它们?
谢谢。
The Java Virtual Machine (JVM) is fully platform-independent. Any JUnit tests that work on one OS, such as Windows, will work on another, such as Linux.
To run a JUnit test inside UNIX/Linux, you can:
java org.junit.runner.JUnitCore test class
in the terminal, where test
is the name of the test you want to run, and class
is the class that that test resides in.