Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ScalaTest Run Configuration in Eclipse: cannot find Suite Class

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

Steps to reproduce:

  • 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.

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

Steps taken:

  • Using: Scala IDE for Eclipse version: 2.1.0.m3-2_09
  • Using SBT, assemble project, run eclipse command and then import project and dependencies into Eclipse
  • Project compiles. ScalaTest code compiles(scalatest_2.9.2-1.8.jar is in the 'Referenced Libraries' configuration)
like image 819
RAbraham Avatar asked Jan 12 '13 23:01

RAbraham


4 Answers

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.

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...

like image 158
Justin du Coeur Avatar answered Nov 22 '22 23:11

Justin du Coeur


This could be caused by a misalignment between the scalatest and the scala eclipse IDE version. Try scalatest_2.9.0-2.0.M5b.jar or scalatest_2.10-2.0.M5b.jar. The former jar definitely works with ide 2.0.9.x so maybe the new version needs the 2.10 jar. Pick your version carefully from here

like image 43
Willem Avatar answered Nov 22 '22 22:11

Willem


Willem's answer is what worked for me. Getting both plugins from the same update site (from the list on Scalatest's github site), seemed to work for me using Kepler.

like image 29
Pete Neisen Avatar answered Nov 22 '22 22:11

Pete Neisen


for my case, one click on 'Reimport All Maven Projects' icon, like 'Refresh' icon, solved the problem.

like image 35
sunday03 Avatar answered Nov 22 '22 23:11

sunday03