简体   繁体   中英

How to run scala unit test cases in Eclipse

I have created a scala-spark application in eclipse. 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.

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:

<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. It will run all test cases but cannot run a single file in my case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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