'Unable to load a Suite class' while running ScalaTest in IntelliJ










16















I'm having some issues today with running a simple TestKit test in Intellij. The tests are for Scala code (I have the Scala plug-in for Intellij) and are based on Ray Roestenburg's example.



The Intellij project was created using a "Maven Module" which I then added all the dependencies to and created my project. The tests are located in the following place:




ActorBlast/src/test/scala/basicTest.scala




I'm basically "right-clicking" on the test and selecting "Run". What I get is the following error:




"C:Program FilesJavajdk1.7.0_25binjava" -Didea.launcher.port=7540...
Testing started at 2:29 PM ...
Unable to load a Suite class. This could be due to an error in your runpath.



Missing class: BasicActorSpec java.lang.ClassNotFoundException:
BasicActorSpec at
java.net.URLClassLoader$1.run(URLClassLoader.java:366) at
java.net.URLClassLoader$1.run(URLClassLoader.java:355) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(URLClassLoader.java:354) at
java.lang.ClassLoader.loadClass(ClassLoader.java:424) at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at
java.lang.ClassLoader.loadClass(ClassLoader.java:357) at
org.scalatest.tools.Runner$$anonfun$35.apply(Runner.scala:2393) at
org.scalatest.tools.Runner$$anonfun$35.apply(Runner.scala:2391) at
scala.collection.TraversableLike$$anonfun$filter$1.apply(TraversableLike.scala:264)
at scala.collection.immutable.List.foreach(List.scala:318) at
scala.collection.TraversableLike$class.filter(TraversableLike.scala:263)
at scala.collection.AbstractTraversable.filter(Traversable.scala:105)
at
org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:2391)
at
org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1006)
at
org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1005)
at
org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:2659)
at
org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1005)
at org.scalatest.tools.Runner$.run(Runner.scala:845) at
org.scalatest.tools.Runner.run(Runner.scala) at
org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.runScalaTest2(ScalaTestRunner.java:144)
at
org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.main(ScalaTestRunner.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606) at
com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)



Process finished with exit code 0




I can't figure out what this means. I've done a lot of searching but can't seem to find an answer. Note that the class the runner is complaining about not finding is the class I'm trying to test/run. The basicTest.scala looks like this:



// Testing specific imports
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.ShouldMatchers, WordSpecLike, BeforeAndAfterAll
import akka.testkit.TestKit, DefaultTimeout, ImplicitSender
// Actor specific imports
import akka.actor.ActorRef, Actor, ActorSystem, Props
// Misc. needed imports
import scala.concurrent.duration._
import com.typesafe.config.ConfigFactory


// In order to run tests in this module you need to use JUnitRunner (as per scalatest.org)
@RunWith(classOf[JUnitRunner])
class BasicActorSpec extends TestKit(ActorSystem("BasicActorSpec", ConfigFactory.parseString(BasicActorSpec.config)))
with DefaultTimeout with ImplicitSender with WordSpecLike with ShouldMatchers with BeforeAndAfterAll

import BasicActorSpec._

val echoRef = system.actorOf(Props[EchoActor])
val forwardRef = system.actorOf(Props[ForwardActor])

override def afterAll
shutdown(system)



/**
* The actual tests...
*/
"An EchoActor" should
"Respond with the same message it receives" in
within(500 millis)
echoRef ! "test"
expectMsg("test")




"A Forwarding Actor" should
"Forward a message it receives" in
within(500 millis)
forwardRef ! "test"
expectMsg("test")






/**
* Companion object of test class
*/
object BasicActorSpec

val config =
"""



Any help as to why I am getting this error would be GREATLY appreciated.










share|improve this question




























    16















    I'm having some issues today with running a simple TestKit test in Intellij. The tests are for Scala code (I have the Scala plug-in for Intellij) and are based on Ray Roestenburg's example.



    The Intellij project was created using a "Maven Module" which I then added all the dependencies to and created my project. The tests are located in the following place:




    ActorBlast/src/test/scala/basicTest.scala




    I'm basically "right-clicking" on the test and selecting "Run". What I get is the following error:




    "C:Program FilesJavajdk1.7.0_25binjava" -Didea.launcher.port=7540...
    Testing started at 2:29 PM ...
    Unable to load a Suite class. This could be due to an error in your runpath.



    Missing class: BasicActorSpec java.lang.ClassNotFoundException:
    BasicActorSpec at
    java.net.URLClassLoader$1.run(URLClassLoader.java:366) at
    java.net.URLClassLoader$1.run(URLClassLoader.java:355) at
    java.security.AccessController.doPrivileged(Native Method) at
    java.net.URLClassLoader.findClass(URLClassLoader.java:354) at
    java.lang.ClassLoader.loadClass(ClassLoader.java:424) at
    sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at
    java.lang.ClassLoader.loadClass(ClassLoader.java:357) at
    org.scalatest.tools.Runner$$anonfun$35.apply(Runner.scala:2393) at
    org.scalatest.tools.Runner$$anonfun$35.apply(Runner.scala:2391) at
    scala.collection.TraversableLike$$anonfun$filter$1.apply(TraversableLike.scala:264)
    at scala.collection.immutable.List.foreach(List.scala:318) at
    scala.collection.TraversableLike$class.filter(TraversableLike.scala:263)
    at scala.collection.AbstractTraversable.filter(Traversable.scala:105)
    at
    org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:2391)
    at
    org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1006)
    at
    org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1005)
    at
    org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:2659)
    at
    org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1005)
    at org.scalatest.tools.Runner$.run(Runner.scala:845) at
    org.scalatest.tools.Runner.run(Runner.scala) at
    org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.runScalaTest2(ScalaTestRunner.java:144)
    at
    org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.main(ScalaTestRunner.java:35)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606) at
    com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)



    Process finished with exit code 0




    I can't figure out what this means. I've done a lot of searching but can't seem to find an answer. Note that the class the runner is complaining about not finding is the class I'm trying to test/run. The basicTest.scala looks like this:



    // Testing specific imports
    import org.junit.runner.RunWith
    import org.scalatest.junit.JUnitRunner
    import org.scalatest.ShouldMatchers, WordSpecLike, BeforeAndAfterAll
    import akka.testkit.TestKit, DefaultTimeout, ImplicitSender
    // Actor specific imports
    import akka.actor.ActorRef, Actor, ActorSystem, Props
    // Misc. needed imports
    import scala.concurrent.duration._
    import com.typesafe.config.ConfigFactory


    // In order to run tests in this module you need to use JUnitRunner (as per scalatest.org)
    @RunWith(classOf[JUnitRunner])
    class BasicActorSpec extends TestKit(ActorSystem("BasicActorSpec", ConfigFactory.parseString(BasicActorSpec.config)))
    with DefaultTimeout with ImplicitSender with WordSpecLike with ShouldMatchers with BeforeAndAfterAll

    import BasicActorSpec._

    val echoRef = system.actorOf(Props[EchoActor])
    val forwardRef = system.actorOf(Props[ForwardActor])

    override def afterAll
    shutdown(system)



    /**
    * The actual tests...
    */
    "An EchoActor" should
    "Respond with the same message it receives" in
    within(500 millis)
    echoRef ! "test"
    expectMsg("test")




    "A Forwarding Actor" should
    "Forward a message it receives" in
    within(500 millis)
    forwardRef ! "test"
    expectMsg("test")






    /**
    * Companion object of test class
    */
    object BasicActorSpec

    val config =
    """



    Any help as to why I am getting this error would be GREATLY appreciated.










    share|improve this question


























      16












      16








      16


      1






      I'm having some issues today with running a simple TestKit test in Intellij. The tests are for Scala code (I have the Scala plug-in for Intellij) and are based on Ray Roestenburg's example.



      The Intellij project was created using a "Maven Module" which I then added all the dependencies to and created my project. The tests are located in the following place:




      ActorBlast/src/test/scala/basicTest.scala




      I'm basically "right-clicking" on the test and selecting "Run". What I get is the following error:




      "C:Program FilesJavajdk1.7.0_25binjava" -Didea.launcher.port=7540...
      Testing started at 2:29 PM ...
      Unable to load a Suite class. This could be due to an error in your runpath.



      Missing class: BasicActorSpec java.lang.ClassNotFoundException:
      BasicActorSpec at
      java.net.URLClassLoader$1.run(URLClassLoader.java:366) at
      java.net.URLClassLoader$1.run(URLClassLoader.java:355) at
      java.security.AccessController.doPrivileged(Native Method) at
      java.net.URLClassLoader.findClass(URLClassLoader.java:354) at
      java.lang.ClassLoader.loadClass(ClassLoader.java:424) at
      sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at
      java.lang.ClassLoader.loadClass(ClassLoader.java:357) at
      org.scalatest.tools.Runner$$anonfun$35.apply(Runner.scala:2393) at
      org.scalatest.tools.Runner$$anonfun$35.apply(Runner.scala:2391) at
      scala.collection.TraversableLike$$anonfun$filter$1.apply(TraversableLike.scala:264)
      at scala.collection.immutable.List.foreach(List.scala:318) at
      scala.collection.TraversableLike$class.filter(TraversableLike.scala:263)
      at scala.collection.AbstractTraversable.filter(Traversable.scala:105)
      at
      org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:2391)
      at
      org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1006)
      at
      org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1005)
      at
      org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:2659)
      at
      org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1005)
      at org.scalatest.tools.Runner$.run(Runner.scala:845) at
      org.scalatest.tools.Runner.run(Runner.scala) at
      org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.runScalaTest2(ScalaTestRunner.java:144)
      at
      org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.main(ScalaTestRunner.java:35)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606) at
      com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)



      Process finished with exit code 0




      I can't figure out what this means. I've done a lot of searching but can't seem to find an answer. Note that the class the runner is complaining about not finding is the class I'm trying to test/run. The basicTest.scala looks like this:



      // Testing specific imports
      import org.junit.runner.RunWith
      import org.scalatest.junit.JUnitRunner
      import org.scalatest.ShouldMatchers, WordSpecLike, BeforeAndAfterAll
      import akka.testkit.TestKit, DefaultTimeout, ImplicitSender
      // Actor specific imports
      import akka.actor.ActorRef, Actor, ActorSystem, Props
      // Misc. needed imports
      import scala.concurrent.duration._
      import com.typesafe.config.ConfigFactory


      // In order to run tests in this module you need to use JUnitRunner (as per scalatest.org)
      @RunWith(classOf[JUnitRunner])
      class BasicActorSpec extends TestKit(ActorSystem("BasicActorSpec", ConfigFactory.parseString(BasicActorSpec.config)))
      with DefaultTimeout with ImplicitSender with WordSpecLike with ShouldMatchers with BeforeAndAfterAll

      import BasicActorSpec._

      val echoRef = system.actorOf(Props[EchoActor])
      val forwardRef = system.actorOf(Props[ForwardActor])

      override def afterAll
      shutdown(system)



      /**
      * The actual tests...
      */
      "An EchoActor" should
      "Respond with the same message it receives" in
      within(500 millis)
      echoRef ! "test"
      expectMsg("test")




      "A Forwarding Actor" should
      "Forward a message it receives" in
      within(500 millis)
      forwardRef ! "test"
      expectMsg("test")






      /**
      * Companion object of test class
      */
      object BasicActorSpec

      val config =
      """



      Any help as to why I am getting this error would be GREATLY appreciated.










      share|improve this question
















      I'm having some issues today with running a simple TestKit test in Intellij. The tests are for Scala code (I have the Scala plug-in for Intellij) and are based on Ray Roestenburg's example.



      The Intellij project was created using a "Maven Module" which I then added all the dependencies to and created my project. The tests are located in the following place:




      ActorBlast/src/test/scala/basicTest.scala




      I'm basically "right-clicking" on the test and selecting "Run". What I get is the following error:




      "C:Program FilesJavajdk1.7.0_25binjava" -Didea.launcher.port=7540...
      Testing started at 2:29 PM ...
      Unable to load a Suite class. This could be due to an error in your runpath.



      Missing class: BasicActorSpec java.lang.ClassNotFoundException:
      BasicActorSpec at
      java.net.URLClassLoader$1.run(URLClassLoader.java:366) at
      java.net.URLClassLoader$1.run(URLClassLoader.java:355) at
      java.security.AccessController.doPrivileged(Native Method) at
      java.net.URLClassLoader.findClass(URLClassLoader.java:354) at
      java.lang.ClassLoader.loadClass(ClassLoader.java:424) at
      sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at
      java.lang.ClassLoader.loadClass(ClassLoader.java:357) at
      org.scalatest.tools.Runner$$anonfun$35.apply(Runner.scala:2393) at
      org.scalatest.tools.Runner$$anonfun$35.apply(Runner.scala:2391) at
      scala.collection.TraversableLike$$anonfun$filter$1.apply(TraversableLike.scala:264)
      at scala.collection.immutable.List.foreach(List.scala:318) at
      scala.collection.TraversableLike$class.filter(TraversableLike.scala:263)
      at scala.collection.AbstractTraversable.filter(Traversable.scala:105)
      at
      org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:2391)
      at
      org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1006)
      at
      org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1005)
      at
      org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:2659)
      at
      org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1005)
      at org.scalatest.tools.Runner$.run(Runner.scala:845) at
      org.scalatest.tools.Runner.run(Runner.scala) at
      org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.runScalaTest2(ScalaTestRunner.java:144)
      at
      org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.main(ScalaTestRunner.java:35)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606) at
      com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)



      Process finished with exit code 0




      I can't figure out what this means. I've done a lot of searching but can't seem to find an answer. Note that the class the runner is complaining about not finding is the class I'm trying to test/run. The basicTest.scala looks like this:



      // Testing specific imports
      import org.junit.runner.RunWith
      import org.scalatest.junit.JUnitRunner
      import org.scalatest.ShouldMatchers, WordSpecLike, BeforeAndAfterAll
      import akka.testkit.TestKit, DefaultTimeout, ImplicitSender
      // Actor specific imports
      import akka.actor.ActorRef, Actor, ActorSystem, Props
      // Misc. needed imports
      import scala.concurrent.duration._
      import com.typesafe.config.ConfigFactory


      // In order to run tests in this module you need to use JUnitRunner (as per scalatest.org)
      @RunWith(classOf[JUnitRunner])
      class BasicActorSpec extends TestKit(ActorSystem("BasicActorSpec", ConfigFactory.parseString(BasicActorSpec.config)))
      with DefaultTimeout with ImplicitSender with WordSpecLike with ShouldMatchers with BeforeAndAfterAll

      import BasicActorSpec._

      val echoRef = system.actorOf(Props[EchoActor])
      val forwardRef = system.actorOf(Props[ForwardActor])

      override def afterAll
      shutdown(system)



      /**
      * The actual tests...
      */
      "An EchoActor" should
      "Respond with the same message it receives" in
      within(500 millis)
      echoRef ! "test"
      expectMsg("test")




      "A Forwarding Actor" should
      "Forward a message it receives" in
      within(500 millis)
      forwardRef ! "test"
      expectMsg("test")






      /**
      * Companion object of test class
      */
      object BasicActorSpec

      val config =
      """



      Any help as to why I am getting this error would be GREATLY appreciated.







      scala intellij-idea akka






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 14 '17 at 17:38









      fglez

      6,64643972




      6,64643972










      asked Sep 16 '13 at 21:58









      MCPMCP

      2,206103050




      2,206103050






















          9 Answers
          9






          active

          oldest

          votes


















          3














          You need to set up the Scala SDK.
          1.) Usually, intelliJ will ask you by showing a message on right hand corner of your editor
          2.) You can do it by yourself as mentioned on the https://www.jetbrains.com/help/idea/discover-intellij-idea-for-scala.html






          share|improve this answer























          • Please, do not put external links. At least, copy the relevant part to your answer.

            – King Midas
            Feb 27 '18 at 11:57


















          3














          Run build the project - It helped me to resolved that issue that could have happened to me when I cleared Cache IDEA :) while trying to tackle another issue






          share|improve this answer






























            2














            If you are using IntelliJ to run scalatest make sure the class paths are correct. For example:



             /dummyApp 


            your build.sbt should look like, name := "dummyApp". If you name it name := "dummy App" you will get errors.






            share|improve this answer
































              2














              In my case, I was missing the Scala facet in my module.



              https://blog.jetbrains.com/scala/2010/09/02/project-configuration-explained/



              I got rid of the error once I configured module properly.






              share|improve this answer























              • This solved it for me. It seems even now, IntelliJ won't prompt you for this until after you close and reopen your project once after creation.

                – tunesmith
                Feb 2 '18 at 22:51


















              2














              This is how I solved same exception:



              --> Right click on your project folder in IDE:


              enter image description here



              --> Click Add Framework Support
              --> Then Check Scala
              --> Click OK





              share|improve this answer






























                1














                This issue happened to me recently when I was trying to run tests in an inherited Scala project using IntelliJ IDEA 2018 (Community Edition). Below steps helped me to fix it:



                1. File → Project Structure → Choose specific module → "Paths" tab → Select "Use module compile output path" → Modify "Test output path" to point to test-classes folder. For example:


                  Output path: /home/rustam/IdeaProjects/project/module/target/scala-2.12/classes
                  Test output path: /home/rustam/IdeaProjects/project/module/target/scala-2.12/test-classes




                2. IntelliJ does not like multiple Scala classes defined in one file, so make sure the test class is named the same as the test file and nest other helper classes, which you can refactor later as necessary.





                share|improve this answer






























                  0














                  In my case I had in Preferences -> Build, Execution, Deployment -> sbt



                  Use sbt shell for build and import checkbox enabled



                  And the test was not in the expected directory src/test but in src/it (integrated test).






                  share|improve this answer






























                    0














                    I met this issue when I used Gatling



                    I've replaced 'gatling-classes' to 'test-classes'



                    I fix it by replacing gatling-classes to test-classes on File -> Project Structure -> Modules -> Module Name -> Paths -> Test output path






                    share|improve this answer






























                      0














                      I encountered the error when the test class was not part of any package.






                      share|improve this answer






















                        Your Answer






                        StackExchange.ifUsing("editor", function ()
                        StackExchange.using("externalEditor", function ()
                        StackExchange.using("snippets", function ()
                        StackExchange.snippets.init();
                        );
                        );
                        , "code-snippets");

                        StackExchange.ready(function()
                        var channelOptions =
                        tags: "".split(" "),
                        id: "1"
                        ;
                        initTagRenderer("".split(" "), "".split(" "), channelOptions);

                        StackExchange.using("externalEditor", function()
                        // Have to fire editor after snippets, if snippets enabled
                        if (StackExchange.settings.snippets.snippetsEnabled)
                        StackExchange.using("snippets", function()
                        createEditor();
                        );

                        else
                        createEditor();

                        );

                        function createEditor()
                        StackExchange.prepareEditor(
                        heartbeatType: 'answer',
                        autoActivateHeartbeat: false,
                        convertImagesToLinks: true,
                        noModals: true,
                        showLowRepImageUploadWarning: true,
                        reputationToPostImages: 10,
                        bindNavPrevention: true,
                        postfix: "",
                        imageUploader:
                        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                        allowUrls: true
                        ,
                        onDemand: true,
                        discardSelector: ".discard-answer"
                        ,immediatelyShowMarkdownHelp:true
                        );



                        );













                        draft saved

                        draft discarded


















                        StackExchange.ready(
                        function ()
                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f18838012%2funable-to-load-a-suite-class-while-running-scalatest-in-intellij%23new-answer', 'question_page');

                        );

                        Post as a guest















                        Required, but never shown

























                        9 Answers
                        9






                        active

                        oldest

                        votes








                        9 Answers
                        9






                        active

                        oldest

                        votes









                        active

                        oldest

                        votes






                        active

                        oldest

                        votes









                        3














                        You need to set up the Scala SDK.
                        1.) Usually, intelliJ will ask you by showing a message on right hand corner of your editor
                        2.) You can do it by yourself as mentioned on the https://www.jetbrains.com/help/idea/discover-intellij-idea-for-scala.html






                        share|improve this answer























                        • Please, do not put external links. At least, copy the relevant part to your answer.

                          – King Midas
                          Feb 27 '18 at 11:57















                        3














                        You need to set up the Scala SDK.
                        1.) Usually, intelliJ will ask you by showing a message on right hand corner of your editor
                        2.) You can do it by yourself as mentioned on the https://www.jetbrains.com/help/idea/discover-intellij-idea-for-scala.html






                        share|improve this answer























                        • Please, do not put external links. At least, copy the relevant part to your answer.

                          – King Midas
                          Feb 27 '18 at 11:57













                        3












                        3








                        3







                        You need to set up the Scala SDK.
                        1.) Usually, intelliJ will ask you by showing a message on right hand corner of your editor
                        2.) You can do it by yourself as mentioned on the https://www.jetbrains.com/help/idea/discover-intellij-idea-for-scala.html






                        share|improve this answer













                        You need to set up the Scala SDK.
                        1.) Usually, intelliJ will ask you by showing a message on right hand corner of your editor
                        2.) You can do it by yourself as mentioned on the https://www.jetbrains.com/help/idea/discover-intellij-idea-for-scala.html







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Feb 27 '18 at 11:35









                        AMSAMS

                        7211




                        7211












                        • Please, do not put external links. At least, copy the relevant part to your answer.

                          – King Midas
                          Feb 27 '18 at 11:57

















                        • Please, do not put external links. At least, copy the relevant part to your answer.

                          – King Midas
                          Feb 27 '18 at 11:57
















                        Please, do not put external links. At least, copy the relevant part to your answer.

                        – King Midas
                        Feb 27 '18 at 11:57





                        Please, do not put external links. At least, copy the relevant part to your answer.

                        – King Midas
                        Feb 27 '18 at 11:57













                        3














                        Run build the project - It helped me to resolved that issue that could have happened to me when I cleared Cache IDEA :) while trying to tackle another issue






                        share|improve this answer



























                          3














                          Run build the project - It helped me to resolved that issue that could have happened to me when I cleared Cache IDEA :) while trying to tackle another issue






                          share|improve this answer

























                            3












                            3








                            3







                            Run build the project - It helped me to resolved that issue that could have happened to me when I cleared Cache IDEA :) while trying to tackle another issue






                            share|improve this answer













                            Run build the project - It helped me to resolved that issue that could have happened to me when I cleared Cache IDEA :) while trying to tackle another issue







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Aug 30 '18 at 10:43









                            AlexPesAlexPes

                            177210




                            177210





















                                2














                                If you are using IntelliJ to run scalatest make sure the class paths are correct. For example:



                                 /dummyApp 


                                your build.sbt should look like, name := "dummyApp". If you name it name := "dummy App" you will get errors.






                                share|improve this answer





























                                  2














                                  If you are using IntelliJ to run scalatest make sure the class paths are correct. For example:



                                   /dummyApp 


                                  your build.sbt should look like, name := "dummyApp". If you name it name := "dummy App" you will get errors.






                                  share|improve this answer



























                                    2












                                    2








                                    2







                                    If you are using IntelliJ to run scalatest make sure the class paths are correct. For example:



                                     /dummyApp 


                                    your build.sbt should look like, name := "dummyApp". If you name it name := "dummy App" you will get errors.






                                    share|improve this answer















                                    If you are using IntelliJ to run scalatest make sure the class paths are correct. For example:



                                     /dummyApp 


                                    your build.sbt should look like, name := "dummyApp". If you name it name := "dummy App" you will get errors.







                                    share|improve this answer














                                    share|improve this answer



                                    share|improve this answer








                                    edited Dec 21 '16 at 21:07









                                    nevets1219

                                    6,48942745




                                    6,48942745










                                    answered Sep 17 '13 at 15:44









                                    Ray GoodwinRay Goodwin

                                    103129




                                    103129





















                                        2














                                        In my case, I was missing the Scala facet in my module.



                                        https://blog.jetbrains.com/scala/2010/09/02/project-configuration-explained/



                                        I got rid of the error once I configured module properly.






                                        share|improve this answer























                                        • This solved it for me. It seems even now, IntelliJ won't prompt you for this until after you close and reopen your project once after creation.

                                          – tunesmith
                                          Feb 2 '18 at 22:51















                                        2














                                        In my case, I was missing the Scala facet in my module.



                                        https://blog.jetbrains.com/scala/2010/09/02/project-configuration-explained/



                                        I got rid of the error once I configured module properly.






                                        share|improve this answer























                                        • This solved it for me. It seems even now, IntelliJ won't prompt you for this until after you close and reopen your project once after creation.

                                          – tunesmith
                                          Feb 2 '18 at 22:51













                                        2












                                        2








                                        2







                                        In my case, I was missing the Scala facet in my module.



                                        https://blog.jetbrains.com/scala/2010/09/02/project-configuration-explained/



                                        I got rid of the error once I configured module properly.






                                        share|improve this answer













                                        In my case, I was missing the Scala facet in my module.



                                        https://blog.jetbrains.com/scala/2010/09/02/project-configuration-explained/



                                        I got rid of the error once I configured module properly.







                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered Aug 14 '17 at 17:35









                                        fglezfglez

                                        6,64643972




                                        6,64643972












                                        • This solved it for me. It seems even now, IntelliJ won't prompt you for this until after you close and reopen your project once after creation.

                                          – tunesmith
                                          Feb 2 '18 at 22:51

















                                        • This solved it for me. It seems even now, IntelliJ won't prompt you for this until after you close and reopen your project once after creation.

                                          – tunesmith
                                          Feb 2 '18 at 22:51
















                                        This solved it for me. It seems even now, IntelliJ won't prompt you for this until after you close and reopen your project once after creation.

                                        – tunesmith
                                        Feb 2 '18 at 22:51





                                        This solved it for me. It seems even now, IntelliJ won't prompt you for this until after you close and reopen your project once after creation.

                                        – tunesmith
                                        Feb 2 '18 at 22:51











                                        2














                                        This is how I solved same exception:



                                        --> Right click on your project folder in IDE:


                                        enter image description here



                                        --> Click Add Framework Support
                                        --> Then Check Scala
                                        --> Click OK





                                        share|improve this answer



























                                          2














                                          This is how I solved same exception:



                                          --> Right click on your project folder in IDE:


                                          enter image description here



                                          --> Click Add Framework Support
                                          --> Then Check Scala
                                          --> Click OK





                                          share|improve this answer

























                                            2












                                            2








                                            2







                                            This is how I solved same exception:



                                            --> Right click on your project folder in IDE:


                                            enter image description here



                                            --> Click Add Framework Support
                                            --> Then Check Scala
                                            --> Click OK





                                            share|improve this answer













                                            This is how I solved same exception:



                                            --> Right click on your project folder in IDE:


                                            enter image description here



                                            --> Click Add Framework Support
                                            --> Then Check Scala
                                            --> Click OK






                                            share|improve this answer












                                            share|improve this answer



                                            share|improve this answer










                                            answered May 4 '18 at 18:12









                                            yantaqyantaq

                                            2,57121927




                                            2,57121927





















                                                1














                                                This issue happened to me recently when I was trying to run tests in an inherited Scala project using IntelliJ IDEA 2018 (Community Edition). Below steps helped me to fix it:



                                                1. File → Project Structure → Choose specific module → "Paths" tab → Select "Use module compile output path" → Modify "Test output path" to point to test-classes folder. For example:


                                                  Output path: /home/rustam/IdeaProjects/project/module/target/scala-2.12/classes
                                                  Test output path: /home/rustam/IdeaProjects/project/module/target/scala-2.12/test-classes




                                                2. IntelliJ does not like multiple Scala classes defined in one file, so make sure the test class is named the same as the test file and nest other helper classes, which you can refactor later as necessary.





                                                share|improve this answer



























                                                  1














                                                  This issue happened to me recently when I was trying to run tests in an inherited Scala project using IntelliJ IDEA 2018 (Community Edition). Below steps helped me to fix it:



                                                  1. File → Project Structure → Choose specific module → "Paths" tab → Select "Use module compile output path" → Modify "Test output path" to point to test-classes folder. For example:


                                                    Output path: /home/rustam/IdeaProjects/project/module/target/scala-2.12/classes
                                                    Test output path: /home/rustam/IdeaProjects/project/module/target/scala-2.12/test-classes




                                                  2. IntelliJ does not like multiple Scala classes defined in one file, so make sure the test class is named the same as the test file and nest other helper classes, which you can refactor later as necessary.





                                                  share|improve this answer

























                                                    1












                                                    1








                                                    1







                                                    This issue happened to me recently when I was trying to run tests in an inherited Scala project using IntelliJ IDEA 2018 (Community Edition). Below steps helped me to fix it:



                                                    1. File → Project Structure → Choose specific module → "Paths" tab → Select "Use module compile output path" → Modify "Test output path" to point to test-classes folder. For example:


                                                      Output path: /home/rustam/IdeaProjects/project/module/target/scala-2.12/classes
                                                      Test output path: /home/rustam/IdeaProjects/project/module/target/scala-2.12/test-classes




                                                    2. IntelliJ does not like multiple Scala classes defined in one file, so make sure the test class is named the same as the test file and nest other helper classes, which you can refactor later as necessary.





                                                    share|improve this answer













                                                    This issue happened to me recently when I was trying to run tests in an inherited Scala project using IntelliJ IDEA 2018 (Community Edition). Below steps helped me to fix it:



                                                    1. File → Project Structure → Choose specific module → "Paths" tab → Select "Use module compile output path" → Modify "Test output path" to point to test-classes folder. For example:


                                                      Output path: /home/rustam/IdeaProjects/project/module/target/scala-2.12/classes
                                                      Test output path: /home/rustam/IdeaProjects/project/module/target/scala-2.12/test-classes




                                                    2. IntelliJ does not like multiple Scala classes defined in one file, so make sure the test class is named the same as the test file and nest other helper classes, which you can refactor later as necessary.






                                                    share|improve this answer












                                                    share|improve this answer



                                                    share|improve this answer










                                                    answered Oct 18 '18 at 10:01









                                                    Rustam AliyevRustam Aliyev

                                                    182414




                                                    182414





















                                                        0














                                                        In my case I had in Preferences -> Build, Execution, Deployment -> sbt



                                                        Use sbt shell for build and import checkbox enabled



                                                        And the test was not in the expected directory src/test but in src/it (integrated test).






                                                        share|improve this answer



























                                                          0














                                                          In my case I had in Preferences -> Build, Execution, Deployment -> sbt



                                                          Use sbt shell for build and import checkbox enabled



                                                          And the test was not in the expected directory src/test but in src/it (integrated test).






                                                          share|improve this answer

























                                                            0












                                                            0








                                                            0







                                                            In my case I had in Preferences -> Build, Execution, Deployment -> sbt



                                                            Use sbt shell for build and import checkbox enabled



                                                            And the test was not in the expected directory src/test but in src/it (integrated test).






                                                            share|improve this answer













                                                            In my case I had in Preferences -> Build, Execution, Deployment -> sbt



                                                            Use sbt shell for build and import checkbox enabled



                                                            And the test was not in the expected directory src/test but in src/it (integrated test).







                                                            share|improve this answer












                                                            share|improve this answer



                                                            share|improve this answer










                                                            answered Nov 14 '18 at 18:15









                                                            m3th0dmanm3th0dman

                                                            5,63343567




                                                            5,63343567





















                                                                0














                                                                I met this issue when I used Gatling



                                                                I've replaced 'gatling-classes' to 'test-classes'



                                                                I fix it by replacing gatling-classes to test-classes on File -> Project Structure -> Modules -> Module Name -> Paths -> Test output path






                                                                share|improve this answer



























                                                                  0














                                                                  I met this issue when I used Gatling



                                                                  I've replaced 'gatling-classes' to 'test-classes'



                                                                  I fix it by replacing gatling-classes to test-classes on File -> Project Structure -> Modules -> Module Name -> Paths -> Test output path






                                                                  share|improve this answer

























                                                                    0












                                                                    0








                                                                    0







                                                                    I met this issue when I used Gatling



                                                                    I've replaced 'gatling-classes' to 'test-classes'



                                                                    I fix it by replacing gatling-classes to test-classes on File -> Project Structure -> Modules -> Module Name -> Paths -> Test output path






                                                                    share|improve this answer













                                                                    I met this issue when I used Gatling



                                                                    I've replaced 'gatling-classes' to 'test-classes'



                                                                    I fix it by replacing gatling-classes to test-classes on File -> Project Structure -> Modules -> Module Name -> Paths -> Test output path







                                                                    share|improve this answer












                                                                    share|improve this answer



                                                                    share|improve this answer










                                                                    answered Nov 15 '18 at 14:01









                                                                    Alex ElkinAlex Elkin

                                                                    1108




                                                                    1108





















                                                                        0














                                                                        I encountered the error when the test class was not part of any package.






                                                                        share|improve this answer



























                                                                          0














                                                                          I encountered the error when the test class was not part of any package.






                                                                          share|improve this answer

























                                                                            0












                                                                            0








                                                                            0







                                                                            I encountered the error when the test class was not part of any package.






                                                                            share|improve this answer













                                                                            I encountered the error when the test class was not part of any package.







                                                                            share|improve this answer












                                                                            share|improve this answer



                                                                            share|improve this answer










                                                                            answered Feb 18 at 14:52









                                                                            Blitzkr1egBlitzkr1eg

                                                                            1,13672146




                                                                            1,13672146



























                                                                                draft saved

                                                                                draft discarded
















































                                                                                Thanks for contributing an answer to Stack Overflow!


                                                                                • Please be sure to answer the question. Provide details and share your research!

                                                                                But avoid


                                                                                • Asking for help, clarification, or responding to other answers.

                                                                                • Making statements based on opinion; back them up with references or personal experience.

                                                                                To learn more, see our tips on writing great answers.




                                                                                draft saved


                                                                                draft discarded














                                                                                StackExchange.ready(
                                                                                function ()
                                                                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f18838012%2funable-to-load-a-suite-class-while-running-scalatest-in-intellij%23new-answer', 'question_page');

                                                                                );

                                                                                Post as a guest















                                                                                Required, but never shown





















































                                                                                Required, but never shown














                                                                                Required, but never shown












                                                                                Required, but never shown







                                                                                Required, but never shown

































                                                                                Required, but never shown














                                                                                Required, but never shown












                                                                                Required, but never shown







                                                                                Required, but never shown







                                                                                這個網誌中的熱門文章

                                                                                Barbados

                                                                                How to read a connectionString WITH PROVIDER in .NET Core?

                                                                                Node.js Script on GitHub Pages or Amazon S3