From 276778e15776856cfc79d8987feb65504328875b Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Mon, 19 Jul 2021 13:10:48 +0200 Subject: [PATCH] Compile akka-actor-testkit with scala 3 (#30395) Interestingly the Java code in the tests now doesn't compile, so something around generics might still be wrong. --- .travis.yml | 2 +- .../main/scala/akka/actor/testkit/typed/TestKitSettings.scala | 2 +- .../akka/actor/testkit/typed/internal/BehaviorTestKitImpl.scala | 2 +- .../akka/actor/testkit/typed/internal/StubbedActorContext.scala | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index e615e59db8..5d28a20eb1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ jobs: - stage: scala3 name: scala3 # separate job since only a few modules compile with Scala 3 yet - script: jabba install adopt@1.11-0 && jabba use adopt@1.11-0 && sbt -Dakka.build.scalaVersion=3.0 "akka-actor-tests/test:compile" akka-actor-typed/compile akka-pki/test:compile akka-protobuf/test:compile akka-protobuf-v3/test:compile akka-slf4j/test:compile akka-stream/compile akka-stream-tests-tck/test + script: jabba install adopt@1.11-0 && jabba use adopt@1.11-0 && sbt -Dakka.build.scalaVersion=3.0 "akka-actor-tests/test:compile" akka-actor-testkit-typed/compile akka-actor-typed/compile akka-pki/test:compile akka-protobuf/test:compile akka-protobuf-v3/test:compile akka-slf4j/test:compile akka-stream/compile akka-stream-tests-tck/test stages: - name: whitesource diff --git a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/TestKitSettings.scala b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/TestKitSettings.scala index 762c078c8e..97ec2882f4 100644 --- a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/TestKitSettings.scala +++ b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/TestKitSettings.scala @@ -44,7 +44,7 @@ object TestKitSettings { private object Ext extends ExtensionId[Ext] { override def createExtension(system: ActorSystem[_]): Ext = new Ext(system) - def get(system: ActorSystem[_]): Ext = apply(system) + def get(system: ActorSystem[_]): Ext = Ext.apply(system) } private class Ext(system: ActorSystem[_]) extends Extension { diff --git a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/BehaviorTestKitImpl.scala b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/BehaviorTestKitImpl.scala index ddea7b83d6..c15cd294a5 100644 --- a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/BehaviorTestKitImpl.scala +++ b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/BehaviorTestKitImpl.scala @@ -30,7 +30,7 @@ private[akka] final class BehaviorTestKitImpl[T](_path: ActorPath, _initialBehav with akka.actor.testkit.typed.scaladsl.BehaviorTestKit[T] { // really this should be private, make so when we port out tests that need it - private[akka] val context = new EffectfulActorContext[T](_path, () => currentBehavior) + private[akka] val context: EffectfulActorContext[T] = new EffectfulActorContext[T](_path, () => currentBehavior) private[akka] def as[U]: BehaviorTestKitImpl[U] = this.asInstanceOf[BehaviorTestKitImpl[U]] diff --git a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/StubbedActorContext.scala b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/StubbedActorContext.scala index 04243875aa..ac57d5c30b 100644 --- a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/StubbedActorContext.scala +++ b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/StubbedActorContext.scala @@ -76,7 +76,7 @@ private[akka] final class FunctionRef[-T](override val path: ActorPath, send: (T @InternalApi private[akka] val selfInbox = new TestInboxImpl[T](path) override val self = selfInbox.ref - override val system = new ActorSystemStub("StubbedActorContext") + override val system: ActorSystemStub = new ActorSystemStub("StubbedActorContext") private var _children = TreeMap.empty[String, BehaviorTestKitImpl[_]] private val childName = Iterator.from(0).map(Helpers.base64(_)) private val substituteLoggerFactory = new SubstituteLoggerFactory