0

我知道这是基本的 Java Eclipse 问题。但是,如果我从 Eclipse 创建 Junit 测试用例并能够在 Eclipse 中执行它们。

我也可以在 unix/linux 环境中运行相同的测试用例吗?我是否需要在 eclipse 中设置不同才能在 unix/linux 环境中运行它们?

谢谢。

4

1 回答 1

2

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:

  • Install and run it from Eclipse, just like you would on any other OS (Eclipse, being built in Java, is also platform-independent).
  • Run 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.
于 2012-08-03T23:51:23.127 回答