如图,一运行测试函数就报错Error running 'XXX': Command line is too long. Shorten command line for……。
后来查了一下,发现需要设置如下:点击Edit Configurations...
点击Modify options
选择Shorten command line
在出现的Shorten command line中选择JAR manifest
最后点击应用Apply就OK了。
再次进行test测试,可以正常进行。
如果不想每次进行不同的test时都要进行该设置,可以在Run/Debug Configurations中(也就是通过Edit Configurations...进入的配置页面)选择Templates
往下找,可以找到JUnit,按照之前说的对Shorten command line进行配置就行。
这样,进行新的test测试时,也不会报如上错误了。