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

编程入门 行业动态 更新时间:2024-10-25 16:25:43
本文介绍了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运行配置:找不到套件类

本文发布于:2023-11-25 05:50:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1628570.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:找不到   套件   Eclipse   ScalaTest

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!