2

I'm running my first round of ScalaTests, starting with a simple configuration:

  • brand new (empty) Intellij Scala project with latest SBT (1.2.8) and Scala 2.13.0
  • build.sbt amended to include:
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.8" % "test"

I created a simple scalatest class and no other code:

import org.scalatest.FunSuite

class mytests extends FunSuite {
  test("mytest.abc") {
    assert(1===1)
  }
}

This does not run. But if I change to Scala 2.12.8 it works fine.

This is reproduceable. Any thoughts?

Error message below:

Exception in thread "ScalaTest-dispatcher" java.lang.NoSuchMethodError: scala.collection.JavaConverters.seqAsJavaListConverter(Lscala/collection/Seq;)Lscala/collection/convert/Decorators$AsJava;
    at org.jetbrains.plugins.scala.testingSupport.scalaTest.treeBuilder.ParallelTreeBuilder.getOrdinalList(ParallelTreeBuilder.java:21)
    at org.jetbrains.plugins.scala.testingSupport.scalaTest.treeBuilder.ParallelTreeBuilder$SuiteTree.<init>(ParallelTreeBuilder.java:92)
    at org.jetbrains.plugins.scala.testingSupport.scalaTest.treeBuilder.ParallelTreeBuilder.initRun(ParallelTreeBuilder.java:261)
    at org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestReporterWithLocation.apply(ScalaTestReporterWithLocation.java:59)
    at org.scalatest.DispatchReporter$Propagator.$anonfun$run$10(DispatchReporter.scala:249)
    at org.scalatest.DispatchReporter$Propagator.$anonfun$run$10$adapted(DispatchReporter.scala:248)
    at scala.collection.immutable.List.foreach(List.scala:312)
    at org.scalatest.DispatchReporter$Propagator.run(DispatchReporter.scala:248)
    at java.base/java.lang.Thread.run(Thread.java:835)

mattgoss
  • 31
  • 2
  • 1
    Thanks Mario - that post helped solve it. I opened my test class file -> Run -> Edit Configurations and selected the two checkboxes (use sbt and use ui with sbt) I still get a compile error, but the test runs. Compile error: `error while loading String, class file '/modules/java.base/java/lang/String.class' is broken` – mattgoss Jun 23 '19 at 00:24
  • The 'broken' issue in the above comment is an open issue: https://github.com/scala/bug/issues/11381 – mattgoss Jun 23 '19 at 00:32
  • See also https://youtrack.jetbrains.com/issue/SCL-15558#focus=streamItem-27-3511377.0-0 for possible workaround. – Andrey Jun 23 '19 at 11:33

0 Answers0