title: Run JUnit tests with SBT
body: <p>I have a 0.13.7 SBT project, with several sub-projects.</p>
  
  <p>One of them is called <code>webapp</code>, and it has many <code>JUnit</code> tests in <code>webapp/src/test/java</code>.</p>
  
  <p>When running:</p>
  
  <pre><code>sbt webapp/test
  </code></pre>
  
  <p>only the <code>ScalaTest</code> tests are run, but no JUnit tests.</p>
  
  <p>Snippet of my <code>build.sbt</code> file:</p>
  
  <pre><code>libraryDependencies ++= Seq(
      "com.novocode" % "junit-interface" % "0.11" % Test
  )
  
  lazy val webapp = project
      settings(
          Seq(
              projectDependencies ++= Seq(
                  ....
                  "org.scalatest" %% "scalatest" % "2.2.2" % Test,
                  "junit" % "junit" % "4.11" % Test,
                  "com.novocode" % "junit-interface" % "0.11" % Test
              )
          ): _*
      )
  </code></pre>
  
  <p>Example JUnit test:</p>
  
  <pre><code>import org.junit.Test;
  
  public class CodificadorBase64Test {
      @Test
      public void testPlain() {
          byte b[] = {64, 127, 72, 36, 100, 1, 5, 9, 123};
          assertEquals("QH9IJGQBBQl7", CodificadorBase64.encode(b));
      }
  }
  </code></pre>
  
  <p><strong>UPDATE</strong> (some more research):</p>
  
  <pre><code>&gt; webapp/testFrameworks
  [info] List(TestFramework(WrappedArray(org.scalacheck.ScalaCheckFramework)), TestFramework(WrappedArray(org.specs2.runner.Specs2Framework, org.specs2.runner.SpecsFramework)), TestFramework(WrappedArray(org.specs.runner.SpecsFramework)), TestFramework(WrappedArray(org.scalatest.tools.Framework, org.scalatest.tools.ScalaTestFramework)), TestFramework(WrappedArray(com.novocode.junit.JUnitFramework))
  
  show webapp/loadedTestFrameworks
  [info] Map(TestFramework(WrappedArray(
    org.scalatest.tools.Framework, 
    org.scalatest.tools.ScalaTestFramework)
  ) -&gt; org.scalatest.tools.Framework@65767aeb)
  </code></pre>
  
  <p>So <code>JUnit</code> support is known by SBT but not loaded.</p>
  
  <p>Debug output:</p>
  
  <pre><code>[debug] Framework implementation 'org.scalacheck.ScalaCheckFramework' not present.
  [debug] Framework implementation 'org.scalacheck.ScalaCheckFramework' not present.
  [debug] Framework implementation 'org.scalacheck.ScalaCheckFramework' not present.
  [debug] Framework implementation 'org.scalacheck.ScalaCheckFramework' not present.
  [debug] Framework implementation 'org.specs2.runner.Specs2Framework' not present.
  [debug] Framework implementation 'org.specs2.runner.Specs2Framework' not present.
  [debug] Framework implementation 'org.specs2.runner.Specs2Framework' not present.
  [debug] Framework implementation 'org.specs2.runner.Specs2Framework' not present.
  [debug] Framework implementation 'org.specs2.runner.SpecsFramework' not present.
  [debug] Framework implementation 'org.specs2.runner.SpecsFramework' not present.
  [debug] Framework implementation 'org.specs2.runner.SpecsFramework' not present.
  [debug] Framework implementation 'org.specs2.runner.SpecsFramework' not present.
  [debug] Framework implementation 'org.specs.runner.SpecsFramework' not present.
  [debug] Framework implementation 'org.specs.runner.SpecsFramework' not present.
  [debug] Framework implementation 'org.specs.runner.SpecsFramework' not present.
  [debug] Framework implementation 'org.specs.runner.SpecsFramework' not present.
  [debug] Framework implementation 'com.novocode.junit.JUnitFramework' not present.
  [debug] Framework implementation 'com.novocode.junit.JUnitFramework' not present.
  [debug] Framework implementation 'com.novocode.junit.JUnitFramework' not present.
  [debug] Framework implementation 'com.novocode.junit.JUnitFramework' not present.
  [debug] Subclass fingerprints: List((org.scalatest.Suite,false,org.scalatest.tools.Framework$$anon$1@3ad42aff))
  [debug] Subclass fingerprints: List((org.scalatest.Suite,false,org.scalatest.tools.Framework$$anon$1@97f54b))
  [debug] Annotation fingerprints: List((org.scalatest.WrapWith,false,org.scalatest.tools.Framework$$anon$2@6a589982))
  [debug] Annotation fingerprints: List((org.scalatest.WrapWith,false,org.scalatest.tools.Framework$$anon$2@1b95d5e6))
  [debug] Subclass fingerprints: List((org.scalatest.Suite,false,org.scalatest.tools.Framework$$anon$1@5c997dac))
  [debug] Subclass fingerprints: List((org.scalatest.Suite,false,org.scalatest.tools.Framework$$anon$1@406c43ef))
  [debug] Annotation fingerprints: List((org.scalatest.WrapWith,false,org.scalatest.tools.Framework$$anon$2@282ddefc))
  [debug] Annotation fingerprints: List((org.scalatest.WrapWith,false,org.scalatest.tools.Framework$$anon$2@4400c80))
  </code></pre>
  
  <p>Working with:</p>
  
  <ul>
  <li>SBT 0.13.9, and </li>
  <li>JUnit 4.x.</li>
  </ul>
  
  <p>Related information:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/23974840/why-dont-junit-tests-get-executed-with-sbt-test">Why don&#39;t junit tests get executed with &quot;sbt test&quot;?</a></li>
  <li><a href="http://www.scala-sbt.org/0.13/docs/Testing.html" rel="noreferrer">SBT documentation</a></li>
  </ul>