简体   繁体   English

在Eclipse中没有运行方式-> Scala测试?

[英]Don't have Run As -> Scala Test in Eclipse?

I recently re-installed my OS from scratch (Debian). 我最近从头开始重新安装了操作系统(Debian)。 Then did following: 然后执行以下操作:

  • Installed Scala from the repository 从存储库安装了Scala
  • Installed Eclipse Kepler from the repository 从存储库安装了Eclipse Kepler
  • Installed Scala IDE from inside Eclipse 从Eclipse内部安装了Scala IDE
  • created a Scala class 创建了一个Scala类
  • created a Scala test which makes a new instance of my class 创建了一个Scala测试,该测试创建了我的课程的新实例
  • copied the scalatest jar into the project and added it to the build path 将scalatest jar复制到项目中并将其添加到构建路径

Here, I noticed that I don't have "Run as -> Scala test" in the menu. 在这里,我注意到菜单中没有“ Run as-> Scala test”。 Looked at the versions and noticed that I have installed a Scala IDE which is made for Scala 2.10, but I have 2.10 installed. 查看了版本,发现我已经安装了针对Scala 2.10的Scala IDE,但是我已经安装了2.10。 The Eclipse version 3.8 was correct. Eclipse版本3.8是正确的。

So I uninstalled the repository scala, downloaded 2.10.4 and installed it manually, setting both $SCALA_HOME and $PATH. 因此,我卸载了存储库scala,下载了2.10.4并手动安装了它,同时设置了$ SCALA_HOME和$ PATH。 I restarted the computer in case Eclipse has loaded some dependencies to the old scala, and tried running the test again. 如果Eclipse已将某些依赖项加载到旧的scala,则重新启动计算机,然后尝试再次运行测试。 But to no avail; 但是无济于事; I have the choice to run a scala application, but not a scala test. 我可以选择运行一个scala应用程序,但不能运行scala测试。

我的跑步配置窗口

My mini-test is extremely simple and doesn't reference anything unusual: 我的迷你测试非常简单,没有引用任何异常:

import org.scalatest._
import Matchers._

class StudySpec extends FlatSpec {
  "It" should "be possible to create a new Study with the default constructor." in {
    val newStudy = new Study()
  }

What did I do wrong, and how can I get the test to run? 我做错了什么?如何运行测试?

Seems you haven't Install the ScalaTest plugin for Scala IDE . 似乎您尚未ScalaTest plugin for Scala IDE安装ScalaTest plugin for Scala IDE Just install it. 只需安装它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM