简体   繁体   English

如何在 Eclipse 中运行 scala 单元测试用例

[英]How to run scala unit test cases in Eclipse

I have created a scala-spark application in eclipse.我在 eclipse 中创建了一个 scala-spark 应用程序。 I am able to run Spark code but when I am trying to run scala MainTest.scala by right click-> Run As Their is no option to run test cases.我能够运行 Spark 代码,但是当我尝试通过右键单击运行 scala MainTest.scala- > 运行方式时,没有运行测试用例的选项。

This is my project structure.这是我的项目结构。

在此处输入图片说明

This is my Unit Test Case.这是我的单元测试用例。

在此处输入图片说明

No option is shown here.此处未显示任何选项。

在此处输入图片说明

There is no test tab is shown.没有显示测试选项卡。

在此处输入图片说明

Dependency for scalatest: Scalatest 的依赖:

<dependency>
    <groupId>org.scalatest</groupId>
    <artifactId>scalatest_sjs1_2.13</artifactId>
    <version>3.2.0-M4</version>
    <scope>test</scope>
</dependency>

We can run scala test cases by directly right click on the test folder.我们可以通过直接右键单击测试文件夹来运行 scala 测试用例。 It will run all test cases but cannot run a single file in my case.它将运行所有测试用例,但在我的情况下无法运行单个文件。

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

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