Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java CLI中的JUnit测试等价物_Java_Windows_Eclipse_Command Line_Junit - Fatal编程技术网

Java CLI中的JUnit测试等价物

Java CLI中的JUnit测试等价物,java,windows,eclipse,command-line,junit,Java,Windows,Eclipse,Command Line,Junit,我已经写了一些代码,但是没有一个main方法。但我想知道代码是否有任何问题。基本上,我可以在Eclipse中使用JUnit测试用例(我使用的是linux)。但我的情况是,我必须在目前没有Eclipse的Windows中测试它。因此,我可以选择在cmd中执行它(如果可能的话)。cmd中的JUnit测试(Eclipse)等价物是什么?请查看以下页面: 要运行JUnit测试,您需要在 您的类路径: JUnit类文件 类文件,包括JUnit测试类 类文件所依赖的库 如果尝试运行测试导致NoClas

我已经写了一些代码,但是没有一个main方法。但我想知道代码是否有任何问题。基本上,我可以在Eclipse中使用JUnit测试用例(我使用的是linux)。但我的情况是,我必须在目前没有Eclipse的Windows中测试它。因此,我可以选择在cmd中执行它(如果可能的话)。cmd中的JUnit测试(Eclipse)等价物是什么?

请查看以下页面:

要运行JUnit测试,您需要在 您的类路径:

  • JUnit类文件
  • 类文件,包括JUnit测试类
  • 类文件所依赖的库
如果尝试运行测试导致NoClassDefFoundError, 然后,类路径中缺少了一些内容

Windows示例:

set CLASSPATH=%JUNIT_HOME%\junit.jar;c:\myproject\classes;c:\myproject\lib\something.jar
调用运行程序:

java org.junit.runner.JUnitCore

注意:您肯定不想在MS-DOS中这样做,除非您有一些带有该操作系统的老式软盘。您所指的命令shell不是MS-DOS或DOS,即使它的命令行看起来非常类似。可能是