ScalaTest Run Configuration in Eclipse: Cannot Find Suite Class

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

Steps to play:

  • Right-click on Scala Suite and select Run As β†’ Run Configurations.
  • The configuration template for ScalaTest is displayed on the left. I click "Create" and fill in the name , but can not find the class class.

Note: it is mentioned here that I should see Run as β†’ ScalaTest - Suite, but I do not see this parameter. I tried using the context menu in the editor and in the package explorer

Steps taken:

  • Usage: Scala IDE for Eclipse version: 2.1.0.m3-2_09
  • Using SBT, building the project, running the eclipse command, and then importing the project and dependencies into Eclipse
  • Project compiled. ScalaTest codes are compiled (scalatest_2.9.2-1.8.jar is in the "Linked Libraries" configuration)
+6
source share
6 answers

I have tried a similar problem in the last few days; Lily / Jimbo's answer didn't quite fit my situation, but it helped me find the right direction.

In my case, I used a third-party library to which I copied. The class and test package names were consistent, but there was no folder structure - all my tests were directly in Play "/ test", and not in the folders corresponding to the package names. This did not show errors, but was broken: packages must match folders. When I built the correct folder structure under the test and recompiled, the expected options "Run As β†’ ScalaTest - Suite" appeared.

I don’t know if your problem was the same, but you can check it if you have not found the problem ...

+7
source

This may be caused by an inconsistency between the scalatest version and the scala eclipse IDE. 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 perhaps the new version needs a 2.10 jar. Select your version from here.

+1
source

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

+1
source

for my case, at the touch of a button "Reimport the icon" All Maven projects ", for example, the icon" Update ", solved the problem.

+1
source

I'm not sure that you fixed the error, but I had a similar error yesterday, and I pulled my hair in to try to fix it (none of the suggestions I found in googling helped me). So, for me it turns out that it is as simple as the package hierarchy in my test suite.

I use the playback platform, so naturally my folders look like controllers.package1.package2.... , and this also applies to my test folders.

Now my test classes have the definition of the package package1.package2..... (there are no "controllers" as a prefix).

If I run tests on the sbt / play command line, this is not a problem. But running them through Eclipse would give me the problem you described.

One way or another ... I thought that I would share this, in case this helps.

0
source

this is a bit annoying when combined with the view template compilation issue in the game infrastructure. but my approach is to restore the eclipse project file and add the view template path to the class path

0
source

All Articles