title: 'Unable to load a Suite class' while running ScalaTest in IntelliJ
body: <p>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 <a href="http://doc.akka.io/docs/akka/snapshot/scala/testkit-example.html" rel="noreferrer">Ray Roestenburg's example</a>.</p>
  
  <p>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:</p>
  
  <blockquote>
    <p>ActorBlast/src/test/scala/basicTest.scala</p>
  </blockquote>
  
  <p>I'm basically "right-clicking" on the test and selecting "Run".  What I get is the following error:</p>
  
  <blockquote>
    <p>"C:\Program Files\Java\jdk1.7.0_25\bin\java" -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. </p>
    
    <p>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)</p>
    
    <p>Process finished with exit code 0</p>
  </blockquote>
  
  <p>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:</p>
  
  <pre><code>// 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 =
      """
        |akka {
        | loglevel = "Warning"
        |}
      """.stripMargin
  
    /**
     * Classes of Actors used in testing
     */
    class EchoActor extends Actor {
      def receive = {
        case msg =&gt; sender ! msg
      }
    }
  
    class ForwardActor(next: ActorRef) extends Actor {
      def receive = {
        case msg =&gt; next ! msg
      }
    }
  
  }
  </code></pre>
  
  <p>Any help as to why I am getting this error would be GREATLY appreciated.</p>