且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Eclipse中的ScalaTest运行配置:找不到套件类

更新时间:2022-03-11 05:36:28

过去几天,我一直在努力解决类似的问题; Lily / Jimbo的答案与我的情况不尽相同,但可以帮助我找到正确的方向。

I've been fighting a similar problem for the past few days; Lily / Jimbo's answer didn't quite match my situation, but helped me find the right direction.

在我的情况下,我使用的是第三方库d复制进来。类和测试的程序包名称匹配,但是文件夹结构 not -我的所有测试都直接位于Play的 / test文件夹中,而不是与软件包名称。它没有显示任何错误,但是被破坏了:程序包应该与文件夹匹配。当我在测试下构建正确的文件夹结构并重新编译时,出现了预期的运行方式-> ScalaTest-Suite选项。

In my case, I was using a third-party library that I'd copied in. The package names of the classes and tests matched, but the folder structure did not -- all of my tests were directly in Play's "/test" folder, rather than in folders that matched the package names. This didn't show any errors, but was broken: packages ought to match folders. When I built the right folder structure underneath test, and recompiled, the expected "Run As -> ScalaTest - Suite" options showed up.

不知道您的问题是一样的,但是如果您还没有发现问题,可以检查一下...

Don't know if your problem is the same, but you might check this if you haven't already found the issue...