本文介绍了Eclipse中的ScalaTest运行配置:找不到套件类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:我无法在我的项目中为 Scalatests运行运行配置以运行scalatest。

Problem: I cannot setup Run Configurations to run scalatest for the Scalatests in my project.

重现步骤:


  • 右键单击Scala Suite,然后单击运行方式->运行配置。

  • 在左侧,我看到了ScalaTest的配置模板。我单击新建并填写名称,但找不到套房类。

  • Right click on Scala Suite and click on Run as -> Run configurations..
  • On the left, I see a configuration template for ScalaTest. I click on New and fill the Name but it cannot find the suite-class.

注意:它在提到,我应该看到以-> ScalaTest-Suite运行,但没有看到该选项。我尝试在编辑器和程序包浏览器中使用上下文菜单

Note: It is mentioned here that I should see Run as -> ScalaTest - Suite but I do not see that option. I tried using context menu in the editor, and in the package explorer

已采取的步骤:


  • 使用:Scala IDE for Eclipse版本:2.1.0.m3-2_09

  • 使用SBT,组装项目,运行eclipse命令,然后将项目和依赖项导入Eclipse

  • 项目进行编译。 ScalaTest代码编译(scalatest_2.9.2-1.8.jar在参考库配置中)

推荐答案

过去几天,我一直在努力解决类似的问题; 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...

这篇关于Eclipse中的ScalaTest运行配置:找不到套件类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 14:21