From a340d3279a14c7b01e2e0d8934a7f818347a3233 Mon Sep 17 00:00:00 2001 From: Chua Chee Seng Date: Wed, 19 Jun 2024 21:29:06 +0800 Subject: [PATCH] Fixed compiler error in JUnitRunnerSuite for scala 3 build. --- .../junit/JUnitRunnerSuite.scala | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/test/scala/org/scalatestplus/junit/JUnitRunnerSuite.scala b/src/test/scala/org/scalatestplus/junit/JUnitRunnerSuite.scala index 74a8791..648949f 100644 --- a/src/test/scala/org/scalatestplus/junit/JUnitRunnerSuite.scala +++ b/src/test/scala/org/scalatestplus/junit/JUnitRunnerSuite.scala @@ -88,7 +88,7 @@ package org.scalatestplus.junit { // Suite to be filtered out by the name filter // @RunWith(classOf[JUnitRunner]) - class FilteredOutSuite extends FunSuite with BeforeAndAfterAll { + class FilteredOutSuite extends funsuite.AnyFunSuite with BeforeAndAfterAll { test("JUnit ran this OK!") { assert(1 === 1) } @@ -98,7 +98,7 @@ package org.scalatestplus.junit { // Suite not to be filtered by the name filter // @RunWith(classOf[JUnitRunner]) - class FilteredInSuite extends FunSuite with BeforeAndAfterAll { + class FilteredInSuite extends funsuite.AnyFunSuite with BeforeAndAfterAll { test("JUnit ran this OK!") { assert(1 === 1) } @@ -167,16 +167,14 @@ package org.scalatestplus.junit { assert(result.getIgnoreCount === kerblooeySuite.ignoreCount) } - test("Test a suite can be filtered by name" + - "as the runner implements filterable now") - { - val runNotifier = - new RunNotifier { - var ran: List[Description] = Nil - override def fireTestFinished(description: Description): Unit = { - ran = description :: ran - } + test("Test a suite can be filtered by name as the runner implements filterable now") { + class RanRunNotifier extends RunNotifier { + var ran: List[Description] = Nil + override def fireTestFinished(description: Description): Unit = { + ran = description :: ran } + } + val runNotifier = new RanRunNotifier() val runners = (new JUnitRunner(classOf[FilteredOutSuite])) :: (new JUnitRunner(classOf[FilteredInSuite])) :: Nil