diff --git a/.scalafix.conf b/.scalafix.conf index 37456749c4..50c6e050c2 100644 --- a/.scalafix.conf +++ b/.scalafix.conf @@ -2,6 +2,7 @@ rules = [ RemoveUnused ExplicitResultTypes + "github:ohze/scalafix-rules/ExplicitNonNullaryApply" "github:ohze/scalafix-rules/ConstructorProcedureSyntax" "github:ohze/scalafix-rules/FinalObject" "github:ohze/scalafix-rules/Any2StringAdd" diff --git a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/ActorSystemStub.scala b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/ActorSystemStub.scala index 7c493f8bdf..a430472f1c 100644 --- a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/ActorSystemStub.scala +++ b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/internal/ActorSystemStub.scala @@ -90,7 +90,7 @@ import org.slf4j.LoggerFactory override def scheduler: Scheduler = throw new UnsupportedOperationException("no scheduler") - private val terminationPromise = Promise[Done] + private val terminationPromise = Promise[Done]() override def terminate(): Unit = terminationPromise.trySuccess(Done) override def whenTerminated: Future[Done] = terminationPromise.future override def getWhenTerminated: CompletionStage[Done] = FutureConverters.toJava(whenTerminated) 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 d1c8e4e0ba..45dc04c406 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 @@ -128,7 +128,7 @@ private[akka] final class BehaviorTestKitImpl[T](_path: ActorPath, _initialBehav } catch handleException } - override def runOne(): Unit = run(selfInbox.receiveMessage()) + override def runOne(): Unit = run(selfInbox().receiveMessage()) override def signal(signal: Signal): Unit = { try { 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 1c13b9e0f0..18f4f3b6fb 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 @@ -147,7 +147,7 @@ private[akka] final class FunctionRef[-T](override val path: ActorPath, send: (T new FunctionRef[U](p, (message, _) => { val m = f(message); if (m != null) { - selfInbox.ref ! m; i.selfInbox.ref ! message + selfInbox.ref ! m; i.selfInbox().ref ! message } }) } diff --git a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/javadsl/BehaviorTestKit.scala b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/javadsl/BehaviorTestKit.scala index 40c1263a63..090e39bf37 100644 --- a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/javadsl/BehaviorTestKit.scala +++ b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/javadsl/BehaviorTestKit.scala @@ -75,7 +75,7 @@ abstract class BehaviorTestKit[T] { /** * The self reference of the actor living inside this testkit. */ - def getRef(): ActorRef[T] = selfInbox.getRef() + def getRef(): ActorRef[T] = selfInbox().getRef() /** * Requests all the effects. The effects are consumed, subsequent calls will only diff --git a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/scaladsl/BehaviorTestKit.scala b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/scaladsl/BehaviorTestKit.scala index 44e41fdd27..36159d38a0 100644 --- a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/scaladsl/BehaviorTestKit.scala +++ b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/scaladsl/BehaviorTestKit.scala @@ -72,7 +72,7 @@ trait BehaviorTestKit[T] { /** * The self reference of the actor living inside this testkit. */ - def ref: ActorRef[T] = selfInbox.ref + def ref: ActorRef[T] = selfInbox().ref /** * Requests all the effects. The effects are consumed, subsequent calls will only diff --git a/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/TestProbeSpec.scala b/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/TestProbeSpec.scala index 681fc4c2a3..7a64e74062 100644 --- a/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/TestProbeSpec.scala +++ b/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/TestProbeSpec.scala @@ -148,7 +148,7 @@ class TestProbeSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with val probe = createTestProbe[EventT]() eventsT(10).forall { e => probe.ref ! e - probe.receiveMessage == e + probe.receiveMessage() == e } should ===(true) probe.expectNoMessage() diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorConfigurationVerificationSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorConfigurationVerificationSpec.scala index 0f9bbeef43..d9988adcc0 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorConfigurationVerificationSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorConfigurationVerificationSpec.scala @@ -47,22 +47,22 @@ class ActorConfigurationVerificationSpec "An Actor configured with a BalancingDispatcher" must { "fail verification with a ConfigurationException if also configured with a RoundRobinPool" in { intercept[ConfigurationException] { - system.actorOf(RoundRobinPool(2).withDispatcher("balancing-dispatcher").props(Props[TestActor])) + system.actorOf(RoundRobinPool(2).withDispatcher("balancing-dispatcher").props(Props[TestActor]())) } } "fail verification with a ConfigurationException if also configured with a BroadcastPool" in { intercept[ConfigurationException] { - system.actorOf(BroadcastPool(2).withDispatcher("balancing-dispatcher").props(Props[TestActor])) + system.actorOf(BroadcastPool(2).withDispatcher("balancing-dispatcher").props(Props[TestActor]())) } } "fail verification with a ConfigurationException if also configured with a RandomPool" in { intercept[ConfigurationException] { - system.actorOf(RandomPool(2).withDispatcher("balancing-dispatcher").props(Props[TestActor])) + system.actorOf(RandomPool(2).withDispatcher("balancing-dispatcher").props(Props[TestActor]())) } } "fail verification with a ConfigurationException if also configured with a SmallestMailboxPool" in { intercept[ConfigurationException] { - system.actorOf(SmallestMailboxPool(2).withDispatcher("balancing-dispatcher").props(Props[TestActor])) + system.actorOf(SmallestMailboxPool(2).withDispatcher("balancing-dispatcher").props(Props[TestActor]())) } } "fail verification with a ConfigurationException if also configured with a ScatterGatherFirstCompletedPool" in { @@ -70,33 +70,33 @@ class ActorConfigurationVerificationSpec system.actorOf( ScatterGatherFirstCompletedPool(nrOfInstances = 2, within = 2 seconds) .withDispatcher("balancing-dispatcher") - .props(Props[TestActor])) + .props(Props[TestActor]())) } } "not fail verification with a ConfigurationException also not configured with a Router" in { - system.actorOf(Props[TestActor].withDispatcher("balancing-dispatcher")) + system.actorOf(Props[TestActor]().withDispatcher("balancing-dispatcher")) } } "An Actor configured with a non-balancing dispatcher" must { "not fail verification with a ConfigurationException if also configured with a Router" in { - system.actorOf(RoundRobinPool(2).props(Props[TestActor].withDispatcher("pinned-dispatcher"))) + system.actorOf(RoundRobinPool(2).props(Props[TestActor]().withDispatcher("pinned-dispatcher"))) } "fail verification if the dispatcher cannot be found" in { intercept[ConfigurationException] { - system.actorOf(Props[TestActor].withDispatcher("does not exist")) + system.actorOf(Props[TestActor]().withDispatcher("does not exist")) } } "fail verification if the dispatcher cannot be found for the head of a router" in { intercept[ConfigurationException] { - system.actorOf(RoundRobinPool(1, routerDispatcher = "does not exist").props(Props[TestActor])) + system.actorOf(RoundRobinPool(1, routerDispatcher = "does not exist").props(Props[TestActor]())) } } "fail verification if the dispatcher cannot be found for the routees of a router" in { intercept[ConfigurationException] { - system.actorOf(RoundRobinPool(1).props(Props[TestActor].withDispatcher("does not exist"))) + system.actorOf(RoundRobinPool(1).props(Props[TestActor]().withDispatcher("does not exist"))) } } } diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorCreationPerfSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorCreationPerfSpec.scala index 7011b73aca..112d923e93 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorCreationPerfSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorCreationPerfSpec.scala @@ -218,9 +218,9 @@ class ActorCreationPerfSpec "Actor creation with actorOf" must { - registerTests("Props[EmptyActor] with new Props", () => Props[EmptyActor]) + registerTests("Props[EmptyActor] with new Props", () => Props[EmptyActor]()) - val props1 = Props[EmptyActor] + val props1 = Props[EmptyActor]() registerTests("Props[EmptyActor] with same Props", () => props1) registerTests("Props(new EmptyActor) new", () => { Props(new EmptyActor) }) diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorMailboxSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorMailboxSpec.scala index 0e3b2f6db3..6cedc04a78 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorMailboxSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorMailboxSpec.scala @@ -242,22 +242,22 @@ class ActorMailboxSpec(conf: Config) extends AkkaSpec(conf) with DefaultTimeout "An Actor" must { "get an unbounded message queue by default" in { - checkMailboxQueue(Props[QueueReportingActor], "default-default", UnboundedMailboxTypes) + checkMailboxQueue(Props[QueueReportingActor](), "default-default", UnboundedMailboxTypes) } "get an unbounded deque message queue when it is only configured on the props" in { checkMailboxQueue( - Props[QueueReportingActor].withMailbox("akka.actor.mailbox.unbounded-deque-based"), + Props[QueueReportingActor]().withMailbox("akka.actor.mailbox.unbounded-deque-based"), "default-override-from-props", UnboundedDeqMailboxTypes) } "get an bounded message queue when it's only configured with RequiresMailbox" in { - checkMailboxQueue(Props[BoundedQueueReportingActor], "default-override-from-trait", BoundedMailboxTypes) + checkMailboxQueue(Props[BoundedQueueReportingActor](), "default-override-from-trait", BoundedMailboxTypes) } "get an unbounded deque message queue when it's only mixed with Stash" in { - checkMailboxQueue(Props[StashQueueReportingActor], "default-override-from-stash", UnboundedDeqMailboxTypes) + checkMailboxQueue(Props[StashQueueReportingActor](), "default-override-from-stash", UnboundedDeqMailboxTypes) checkMailboxQueue(Props(new StashQueueReportingActor), "default-override-from-stash2", UnboundedDeqMailboxTypes) checkMailboxQueue( Props(classOf[StashQueueReportingActorWithParams], 17, "hello"), @@ -270,99 +270,99 @@ class ActorMailboxSpec(conf: Config) extends AkkaSpec(conf) with DefaultTimeout } "get a bounded message queue when it's configured as mailbox" in { - checkMailboxQueue(Props[QueueReportingActor], "default-bounded", BoundedMailboxTypes) + checkMailboxQueue(Props[QueueReportingActor](), "default-bounded", BoundedMailboxTypes) } "get an unbounded deque message queue when it's configured as mailbox" in { - checkMailboxQueue(Props[QueueReportingActor], "default-unbounded-deque", UnboundedDeqMailboxTypes) + checkMailboxQueue(Props[QueueReportingActor](), "default-unbounded-deque", UnboundedDeqMailboxTypes) } "get a bounded control aware message queue when it's configured as mailbox" in { - checkMailboxQueue(Props[QueueReportingActor], "default-bounded-control-aware", BoundedControlAwareMailboxTypes) + checkMailboxQueue(Props[QueueReportingActor](), "default-bounded-control-aware", BoundedControlAwareMailboxTypes) } "get an unbounded control aware message queue when it's configured as mailbox" in { checkMailboxQueue( - Props[QueueReportingActor], + Props[QueueReportingActor](), "default-unbounded-control-aware", UnboundedControlAwareMailboxTypes) } "get an bounded control aware message queue when it's only configured with RequiresMailbox" in { checkMailboxQueue( - Props[BoundedControlAwareQueueReportingActor], + Props[BoundedControlAwareQueueReportingActor](), "default-override-from-trait-bounded-control-aware", BoundedControlAwareMailboxTypes) } "get an unbounded control aware message queue when it's only configured with RequiresMailbox" in { checkMailboxQueue( - Props[UnboundedControlAwareQueueReportingActor], + Props[UnboundedControlAwareQueueReportingActor](), "default-override-from-trait-unbounded-control-aware", UnboundedControlAwareMailboxTypes) } "fail to create actor when an unbounded dequeu message queue is configured as mailbox overriding RequestMailbox" in { intercept[ConfigurationException]( - system.actorOf(Props[BoundedQueueReportingActor], "default-unbounded-deque-override-trait")) + system.actorOf(Props[BoundedQueueReportingActor](), "default-unbounded-deque-override-trait")) } "get an unbounded message queue when defined in dispatcher" in { - checkMailboxQueue(Props[QueueReportingActor], "unbounded-default", UnboundedMailboxTypes) + checkMailboxQueue(Props[QueueReportingActor](), "unbounded-default", UnboundedMailboxTypes) } "fail to create actor when an unbounded message queue is defined in dispatcher overriding RequestMailbox" in { intercept[ConfigurationException]( - system.actorOf(Props[BoundedQueueReportingActor], "unbounded-default-override-trait")) + system.actorOf(Props[BoundedQueueReportingActor](), "unbounded-default-override-trait")) } "get a bounded message queue when it's configured as mailbox overriding unbounded in dispatcher" in { - checkMailboxQueue(Props[QueueReportingActor], "unbounded-bounded", BoundedMailboxTypes) + checkMailboxQueue(Props[QueueReportingActor](), "unbounded-bounded", BoundedMailboxTypes) } "get a bounded message queue when defined in dispatcher" in { - checkMailboxQueue(Props[QueueReportingActor], "bounded-default", BoundedMailboxTypes) + checkMailboxQueue(Props[QueueReportingActor](), "bounded-default", BoundedMailboxTypes) } "get a bounded message queue with 0 push timeout when defined in dispatcher" in { val q = checkMailboxQueue( - Props[QueueReportingActor], + Props[QueueReportingActor](), "default-bounded-mailbox-with-zero-pushtimeout", BoundedMailboxTypes) q.asInstanceOf[BoundedMessageQueueSemantics].pushTimeOut should ===(Duration.Zero) } "get an unbounded message queue when it's configured as mailbox overriding bounded in dispatcher" in { - checkMailboxQueue(Props[QueueReportingActor], "bounded-unbounded", UnboundedMailboxTypes) + checkMailboxQueue(Props[QueueReportingActor](), "bounded-unbounded", UnboundedMailboxTypes) } "get an unbounded message queue overriding configuration on the props" in { checkMailboxQueue( - Props[QueueReportingActor].withMailbox("akka.actor.mailbox.unbounded-deque-based"), + Props[QueueReportingActor]().withMailbox("akka.actor.mailbox.unbounded-deque-based"), "bounded-unbounded-override-props", UnboundedMailboxTypes) } "get a bounded deque-based message queue if configured and required" in { checkMailboxQueue( - Props[StashQueueReportingActor], + Props[StashQueueReportingActor](), "bounded-deque-requirements-configured", BoundedDeqMailboxTypes) } "fail with a unbounded deque-based message queue if configured and required" in { intercept[ConfigurationException]( - system.actorOf(Props[StashQueueReportingActor], "bounded-deque-require-unbounded-configured")) + system.actorOf(Props[StashQueueReportingActor](), "bounded-deque-require-unbounded-configured")) } "fail with a bounded deque-based message queue if not configured" in { intercept[ConfigurationException]( - system.actorOf(Props[StashQueueReportingActor], "bounded-deque-require-unbounded-unconfigured")) + system.actorOf(Props[StashQueueReportingActor](), "bounded-deque-require-unbounded-unconfigured")) } "get a bounded deque-based message queue if configured and required with Props" in { checkMailboxQueue( - Props[StashQueueReportingActor] + Props[StashQueueReportingActor]() .withDispatcher("requiring-bounded-dispatcher") .withMailbox("akka.actor.mailbox.bounded-deque-based"), "bounded-deque-requirements-configured-props", @@ -372,7 +372,7 @@ class ActorMailboxSpec(conf: Config) extends AkkaSpec(conf) with DefaultTimeout "fail with a unbounded deque-based message queue if configured and required with Props" in { intercept[ConfigurationException]( system.actorOf( - Props[StashQueueReportingActor] + Props[StashQueueReportingActor]() .withDispatcher("requiring-bounded-dispatcher") .withMailbox("akka.actor.mailbox.unbounded-deque-based"), "bounded-deque-require-unbounded-configured-props")) @@ -381,13 +381,13 @@ class ActorMailboxSpec(conf: Config) extends AkkaSpec(conf) with DefaultTimeout "fail with a bounded deque-based message queue if not configured with Props" in { intercept[ConfigurationException]( system.actorOf( - Props[StashQueueReportingActor].withDispatcher("requiring-bounded-dispatcher"), + Props[StashQueueReportingActor]().withDispatcher("requiring-bounded-dispatcher"), "bounded-deque-require-unbounded-unconfigured-props")) } "get a bounded deque-based message queue if configured and required with Props (dispatcher)" in { checkMailboxQueue( - Props[StashQueueReportingActor].withDispatcher("requiring-bounded-dispatcher"), + Props[StashQueueReportingActor]().withDispatcher("requiring-bounded-dispatcher"), "bounded-deque-requirements-configured-props-disp", BoundedDeqMailboxTypes) } @@ -395,20 +395,20 @@ class ActorMailboxSpec(conf: Config) extends AkkaSpec(conf) with DefaultTimeout "fail with a unbounded deque-based message queue if configured and required with Props (dispatcher)" in { intercept[ConfigurationException]( system.actorOf( - Props[StashQueueReportingActor].withDispatcher("requiring-bounded-dispatcher"), + Props[StashQueueReportingActor]().withDispatcher("requiring-bounded-dispatcher"), "bounded-deque-require-unbounded-configured-props-disp")) } "fail with a bounded deque-based message queue if not configured with Props (dispatcher)" in { intercept[ConfigurationException]( system.actorOf( - Props[StashQueueReportingActor].withDispatcher("requiring-bounded-dispatcher"), + Props[StashQueueReportingActor]().withDispatcher("requiring-bounded-dispatcher"), "bounded-deque-require-unbounded-unconfigured-props-disp")) } "get a bounded deque-based message queue if configured and required with Props (mailbox)" in { checkMailboxQueue( - Props[StashQueueReportingActor].withMailbox("akka.actor.mailbox.bounded-deque-based"), + Props[StashQueueReportingActor]().withMailbox("akka.actor.mailbox.bounded-deque-based"), "bounded-deque-requirements-configured-props-mail", BoundedDeqMailboxTypes) } @@ -416,32 +416,32 @@ class ActorMailboxSpec(conf: Config) extends AkkaSpec(conf) with DefaultTimeout "fail with a unbounded deque-based message queue if configured and required with Props (mailbox)" in { intercept[ConfigurationException]( system.actorOf( - Props[StashQueueReportingActor].withMailbox("akka.actor.mailbox.unbounded-deque-based"), + Props[StashQueueReportingActor]().withMailbox("akka.actor.mailbox.unbounded-deque-based"), "bounded-deque-require-unbounded-configured-props-mail")) } "fail with a bounded deque-based message queue if not configured with Props (mailbox)" in { intercept[ConfigurationException]( - system.actorOf(Props[StashQueueReportingActor], "bounded-deque-require-unbounded-unconfigured-props-mail")) + system.actorOf(Props[StashQueueReportingActor](), "bounded-deque-require-unbounded-unconfigured-props-mail")) } "get an unbounded message queue with a balancing dispatcher" in { checkMailboxQueue( - Props[QueueReportingActor].withDispatcher("balancing-dispatcher"), + Props[QueueReportingActor]().withDispatcher("balancing-dispatcher"), "unbounded-balancing", UnboundedMailboxTypes) } "get a bounded message queue with a balancing bounded dispatcher" in { checkMailboxQueue( - Props[QueueReportingActor].withDispatcher("balancing-bounded-dispatcher"), + Props[QueueReportingActor]().withDispatcher("balancing-bounded-dispatcher"), "bounded-balancing", BoundedMailboxTypes) } "get a bounded message queue with a requiring balancing bounded dispatcher" in { checkMailboxQueue( - Props[QueueReportingActor].withDispatcher("requiring-balancing-bounded-dispatcher"), + Props[QueueReportingActor]().withDispatcher("requiring-balancing-bounded-dispatcher"), "requiring-bounded-balancing", BoundedMailboxTypes) } diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala index fddfdb645f..d1346370b8 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala @@ -25,11 +25,11 @@ object ActorRefSpec { def receive = { case "complexRequest" => { replyTo = sender() - val worker = context.actorOf(Props[WorkerActor]) + val worker = context.actorOf(Props[WorkerActor]()) worker ! "work" } case "complexRequest2" => - val worker = context.actorOf(Props[WorkerActor]) + val worker = context.actorOf(Props[WorkerActor]()) worker ! ReplyTo(sender()) case "workDone" => replyTo ! "complexReply" case "simpleRequest" => sender() ! "simpleReply" @@ -278,7 +278,7 @@ class ActorRefSpec extends AkkaSpec(""" } "be serializable using Java Serialization on local node" in { - val a = system.actorOf(Props[InnerActor]) + val a = system.actorOf(Props[InnerActor]()) val esys = system.asInstanceOf[ExtendedActorSystem] import java.io._ @@ -309,7 +309,7 @@ class ActorRefSpec extends AkkaSpec(""" } "throw an exception on deserialize if no system in scope" in { - val a = system.actorOf(Props[InnerActor]) + val a = system.actorOf(Props[InnerActor]()) import java.io._ @@ -337,7 +337,7 @@ class ActorRefSpec extends AkkaSpec(""" val out = new ObjectOutputStream(baos) val sysImpl = system.asInstanceOf[ActorSystemImpl] - val ref = system.actorOf(Props[ReplyActor], "non-existing") + val ref = system.actorOf(Props[ReplyActor](), "non-existing") val serialized = SerializedActorRef(ref) out.writeObject(serialized) @@ -381,7 +381,7 @@ class ActorRefSpec extends AkkaSpec(""" "support reply via sender" in { val latch = new TestLatch(4) - val serverRef = system.actorOf(Props[ReplyActor]) + val serverRef = system.actorOf(Props[ReplyActor]()) val clientRef = system.actorOf(Props(new SenderActor(serverRef, latch))) clientRef ! "complex" @@ -391,7 +391,7 @@ class ActorRefSpec extends AkkaSpec(""" Await.ready(latch, timeout.duration) - latch.reset + latch.reset() clientRef ! "complex2" clientRef ! "simple" diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorSelectionSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorSelectionSpec.scala index 1bc0777780..46ba83709a 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorSelectionSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorSelectionSpec.scala @@ -19,7 +19,7 @@ object ActorSelectionSpec { final case class GetSender(to: ActorRef) extends Query final case class Forward(path: String, msg: Any) extends Query - val p = Props[Node] + val p = Props[Node]() class Node extends Actor { def receive = { diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorSystemSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorSystemSpec.scala index 4c72b51ea5..c93feb3ebc 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorSystemSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorSystemSpec.scala @@ -31,7 +31,7 @@ object ActorSystemSpec { case n: Int => master = sender() terminaters = Set() ++ (for (_ <- 1 to n) yield { - val man = context.watch(context.system.actorOf(Props[Terminater])) + val man = context.watch(context.system.actorOf(Props[Terminater]())) man ! "run" man }) @@ -142,7 +142,7 @@ class ActorSystemSpec extends AkkaSpec(ActorSystemSpec.config) with ImplicitSend ActorSystem("LogDeadLetters", ConfigFactory.parseString("akka.loglevel=INFO").withFallback(AkkaSpec.testConf)) try { val probe = TestProbe()(sys) - val a = sys.actorOf(Props[ActorSystemSpec.Terminater]) + val a = sys.actorOf(Props[ActorSystemSpec.Terminater]()) probe.watch(a) a.tell("run", probe.ref) probe.expectTerminated(a) @@ -166,7 +166,7 @@ class ActorSystemSpec extends AkkaSpec(ActorSystemSpec.config) with ImplicitSend ActorSystem("LogDeadLetters", ConfigFactory.parseString("akka.loglevel=INFO").withFallback(AkkaSpec.testConf)) try { val probe = TestProbe()(sys) - val a = sys.actorOf(Props[ActorSystemSpec.Terminater]) + val a = sys.actorOf(Props[ActorSystemSpec.Terminater]()) probe.watch(a) a.tell("run", probe.ref) probe.expectTerminated(a) @@ -264,7 +264,7 @@ class ActorSystemSpec extends AkkaSpec(ActorSystemSpec.config) with ImplicitSend "reliably create waves of actors" in { import system.dispatcher implicit val timeout: Timeout = Timeout((20 seconds).dilated) - val waves = for (_ <- 1 to 3) yield system.actorOf(Props[ActorSystemSpec.Waves]) ? 50000 + val waves = for (_ <- 1 to 3) yield system.actorOf(Props[ActorSystemSpec.Waves]()) ? 50000 Await.result(Future.sequence(waves), timeout.duration + 5.seconds) should ===(Vector("done", "done", "done")) } @@ -281,7 +281,7 @@ class ActorSystemSpec extends AkkaSpec(ActorSystemSpec.config) with ImplicitSend var created = Vector.empty[ActorRef] while (!system.whenTerminated.isCompleted) { try { - val t = system.actorOf(Props[ActorSystemSpec.Terminater]) + val t = system.actorOf(Props[ActorSystemSpec.Terminater]()) failing should not be true // because once failing => always failing (it’s due to shutdown) created :+= t if (created.size % 1000 == 0) Thread.sleep(50) // in case of unfair thread scheduling diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorWithBoundedStashSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorWithBoundedStashSpec.scala index 883ad4a351..ae0070a51c 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorWithBoundedStashSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorWithBoundedStashSpec.scala @@ -135,22 +135,22 @@ class ActorWithBoundedStashSpec "An Actor with Stash" must { "end up in DeadLetters in case of a capacity violation when configured via dispatcher" in { - val stasher = system.actorOf(Props[StashingActor].withDispatcher(dispatcherId1)) + val stasher = system.actorOf(Props[StashingActor]().withDispatcher(dispatcherId1)) testDeadLetters(stasher) } "end up in DeadLetters in case of a capacity violation when configured via mailbox" in { - val stasher = system.actorOf(Props[StashingActor].withMailbox(mailboxId1)) + val stasher = system.actorOf(Props[StashingActor]().withMailbox(mailboxId1)) testDeadLetters(stasher) } "throw a StashOverflowException in case of a stash capacity violation when configured via dispatcher" in { - val stasher = system.actorOf(Props[StashingActorWithOverflow].withDispatcher(dispatcherId2)) + val stasher = system.actorOf(Props[StashingActorWithOverflow]().withDispatcher(dispatcherId2)) testStashOverflowException(stasher) } "throw a StashOverflowException in case of a stash capacity violation when configured via mailbox" in { - val stasher = system.actorOf(Props[StashingActorWithOverflow].withMailbox(mailboxId2)) + val stasher = system.actorOf(Props[StashingActorWithOverflow]().withMailbox(mailboxId2)) testStashOverflowException(stasher) } } diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorWithStashSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorWithStashSpec.scala index ee3686e2fa..af413e5a74 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorWithStashSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorWithStashSpec.scala @@ -24,7 +24,7 @@ object ActorWithStashSpec { def greeted: Receive = { case "bye" => state.s = "bye" - state.finished.await + state.finished.await() case _ => // do nothing } @@ -63,7 +63,7 @@ object ActorWithStashSpec { context.unbecome() case _ => stash() } - case "done" => state.finished.await + case "done" => state.finished.await() case _ => stash() } } @@ -73,7 +73,7 @@ object ActorWithStashSpec { } class TerminatedMessageStashingActor(probe: ActorRef) extends Actor with Stash { - val watched = context.watch(context.actorOf(Props[WatchedActor])) + val watched = context.watch(context.actorOf(Props[WatchedActor]())) var stashed = false context.stop(watched) @@ -109,7 +109,7 @@ class ActorWithStashSpec extends AkkaSpec with DefaultTimeout with BeforeAndAfte system.eventStream.publish(Mute(EventFilter[Exception]("Crashing..."))) } - override def beforeEach() = state.finished.reset + override def beforeEach() = state.finished.reset() "An Actor with Stash" must { @@ -117,12 +117,12 @@ class ActorWithStashSpec extends AkkaSpec with DefaultTimeout with BeforeAndAfte val stasher = system.actorOf(Props(new StashingActor)) stasher ! "bye" stasher ! "hello" - state.finished.await + state.finished.await() state.s should ===("bye") } "support protocols" in { - val protoActor = system.actorOf(Props[ActorWithProtocol]) + val protoActor = system.actorOf(Props[ActorWithProtocol]()) protoActor ! "open" protoActor ! "write" protoActor ! "open" @@ -130,12 +130,12 @@ class ActorWithStashSpec extends AkkaSpec with DefaultTimeout with BeforeAndAfte protoActor ! "write" protoActor ! "close" protoActor ! "done" - state.finished.await + state.finished.await() } "throw an IllegalStateException if the same messages is stashed twice" in { state.expectedException = new TestLatch - val stasher = system.actorOf(Props[StashingTwiceActor]) + val stasher = system.actorOf(Props[StashingTwiceActor]()) stasher ! "hello" stasher ! "hello" Await.ready(state.expectedException, 10 seconds) diff --git a/akka-actor-tests/src/test/scala/akka/actor/ConsistencySpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ConsistencySpec.scala index 0a878c87c2..6de4762033 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ConsistencySpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ConsistencySpec.scala @@ -60,7 +60,7 @@ class ConsistencySpec extends AkkaSpec(ConsistencySpec.config) { "The Akka actor model implementation" must { "provide memory consistency" in { val noOfActors = threads + 1 - val props = Props[ConsistencyCheckingActor].withDispatcher("consistency-dispatcher") + val props = Props[ConsistencyCheckingActor]().withDispatcher("consistency-dispatcher") val actors = Vector.fill(noOfActors)(system.actorOf(props)) for (i <- 0L until 10000L) { diff --git a/akka-actor-tests/src/test/scala/akka/actor/DeathWatchSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/DeathWatchSpec.scala index 1ed59028f9..ee60730f83 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/DeathWatchSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/DeathWatchSpec.scala @@ -44,7 +44,7 @@ object DeathWatchSpec { context.become { case Terminated(`currentKid`) => testActor ! "GREEN" - context unbecome + context.unbecome() } } } @@ -217,7 +217,7 @@ trait DeathWatchSpec { this: AkkaSpec with ImplicitSender with DefaultTimeout => .sendSystemMessage(DeathWatchNotification(subject, existenceConfirmed = true, addressTerminated = false)) // the testActor is not watching subject and will not receive a Terminated msg - expectNoMessage + expectNoMessage() } "discard Terminated when unwatched between sysmsg and processing" in { diff --git a/akka-actor-tests/src/test/scala/akka/actor/FSMActorSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/FSMActorSpec.scala index 48de463243..1c66a7f289 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/FSMActorSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/FSMActorSpec.scala @@ -43,17 +43,17 @@ object FSMActorSpec { case Event(digit: Char, CodeState(soFar, code)) => { soFar + digit match { case incomplete if incomplete.length < code.length => - stay.using(CodeState(incomplete, code)) + stay().using(CodeState(incomplete, code)) case codeTry if (codeTry == code) => { doUnlock() goto(Open).using(CodeState("", code)).forMax(timeout) } case _ => { - stay.using(CodeState("", code)) + stay().using(CodeState("", code)) } } } - case Event("hello", _) => stay.replying("world") + case Event("hello", _) => stay().replying("world") case Event("bye", _) => stop(FSM.Shutdown) } @@ -67,13 +67,13 @@ object FSMActorSpec { whenUnhandled { case Event(msg, _) => { log.warning("unhandled event " + msg + " in state " + stateName + " with data " + stateData) - unhandledLatch.open - stay + unhandledLatch.open() + stay() } } onTransition { - case Locked -> Open => transitionLatch.open + case Locked -> Open => transitionLatch.open() } // verify that old-style does still compile @@ -119,8 +119,8 @@ class FSMActorSpec extends AkkaSpec(Map("akka.actor.debug.fsm" -> true)) with Im val transitionTester = system.actorOf(Props(new Actor { def receive = { - case Transition(_, _, _) => transitionCallBackLatch.open - case CurrentState(_, s: LockState) if s eq Locked => initialStateLatch.open // SI-5900 workaround + case Transition(_, _, _) => transitionCallBackLatch.open() + case CurrentState(_, s: LockState) if s eq Locked => initialStateLatch.open() // SI-5900 workaround } })) @@ -147,7 +147,7 @@ class FSMActorSpec extends AkkaSpec(Map("akka.actor.debug.fsm" -> true)) with Im val tester = system.actorOf(Props(new Actor { def receive = { case Hello => lock ! "hello" - case "world" => answerLatch.open + case "world" => answerLatch.open() case Bye => lock ! "bye" } })) @@ -183,7 +183,7 @@ class FSMActorSpec extends AkkaSpec(Map("akka.actor.debug.fsm" -> true)) with Im * It is necessary here because of the path-dependent type fsm.StopEvent. */ lazy val fsm = new Actor with FSM[Int, Null] { - override def preStart = { started.countDown } + override def preStart = { started.countDown() } startWith(1, null) when(1) { FSM.NullFunction } onTermination { @@ -269,7 +269,7 @@ class FSMActorSpec extends AkkaSpec(Map("akka.actor.debug.fsm" -> true)) with Im when(2) { case Event("stop", _) => cancelTimer("t") - stop + stop() } onTermination { case StopEvent(r, _, _) => testActor ! r @@ -307,8 +307,8 @@ class FSMActorSpec extends AkkaSpec(Map("akka.actor.debug.fsm" -> true)) with Im override def logDepth = 3 startWith(1, 0) when(1) { - case Event("count", c) => stay.using(c + 1) - case Event("log", _) => stay.replying(getLog) + case Event("count", c) => stay().using(c + 1) + case Event("log", _) => stay().replying(getLog) } }) fsmref ! "log" @@ -327,12 +327,12 @@ class FSMActorSpec extends AkkaSpec(Map("akka.actor.debug.fsm" -> true)) with Im val fsmref = system.actorOf(Props(new Actor with FSM[Int, Int] { startWith(0, 0) when(0)(transform { - case Event("go", _) => stay + case Event("go", _) => stay() }.using { case _ => goto(1) }) when(1) { - case _ => stay + case _ => stay() } })) fsmref ! SubscribeTransitionCallBack(testActor) diff --git a/akka-actor-tests/src/test/scala/akka/actor/FSMTimingSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/FSMTimingSpec.scala index 3abaeb63bb..850c88cd15 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/FSMTimingSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/FSMTimingSpec.scala @@ -44,7 +44,7 @@ class FSMTimingSpec extends AkkaSpec with ImplicitSender { } "cancel a StateTimeout when actor is stopped" taggedAs TimingTest in { - val stoppingActor = system.actorOf(Props[StoppingActor]) + val stoppingActor = system.actorOf(Props[StoppingActor]()) system.eventStream.subscribe(testActor, classOf[DeadLetter]) stoppingActor ! TestStoppingActorStateTimeout within(400 millis) { @@ -56,7 +56,7 @@ class FSMTimingSpec extends AkkaSpec with ImplicitSender { // the timeout in state TestStateTimeout is 800 ms, then it will change to Initial within(400 millis) { fsm ! TestStateTimeoutOverride - expectNoMessage + expectNoMessage() } within(1 second) { fsm ! Cancel @@ -72,7 +72,7 @@ class FSMTimingSpec extends AkkaSpec with ImplicitSender { expectMsg(Tick) expectMsg(Transition(fsm, TestSingleTimer, Initial)) } - expectNoMessage + expectNoMessage() } } @@ -86,7 +86,7 @@ class FSMTimingSpec extends AkkaSpec with ImplicitSender { expectMsg(Tock) expectMsg(Transition(fsm, TestSingleTimerResubmit, Initial)) } - expectNoMessage + expectNoMessage() } } @@ -232,10 +232,10 @@ object FSMTimingSpec { cancelTimer("hallo") sender() ! Tick startSingleTimer("hallo", Tock, 500.millis.dilated) - stay + stay() case Event(Tock, _) => tester ! Tock - stay + stay() case Event(Cancel, _) => cancelTimer("hallo") goto(Initial) @@ -247,7 +247,7 @@ object FSMTimingSpec { cancelTimer("tester") goto(Initial) } else { - stay.using(remaining - 1) + stay().using(remaining - 1) } } when(TestCancelStateTimerInNamedTimerMessage) { @@ -256,7 +256,7 @@ object FSMTimingSpec { suspend(self) startSingleTimer("named", Tock, 1.millis.dilated) TestKit.awaitCond(context.asInstanceOf[ActorCell].mailbox.hasMessages, 1.second.dilated) - stay.forMax(1.millis.dilated).replying(Tick) + stay().forMax(1.millis.dilated).replying(Tick) case Event(Tock, _) => goto(TestCancelStateTimerInNamedTimerMessage2) } @@ -271,9 +271,9 @@ object FSMTimingSpec { whenUnhandled { case Event(Tick, _) => tester ! Unhandled(Tick) - stay + stay() } - stay + stay() case Event(Cancel, _) => whenUnhandled(NullFunction) goto(Initial) @@ -286,7 +286,7 @@ object FSMTimingSpec { when(Initial, 200 millis) { case Event(TestStoppingActorStateTimeout, _) => context.stop(self) - stay + stay() } } diff --git a/akka-actor-tests/src/test/scala/akka/actor/FSMTransitionSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/FSMTransitionSpec.scala index 67f9eaab3b..35738e45e0 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/FSMTransitionSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/FSMTransitionSpec.scala @@ -35,7 +35,7 @@ object FSMTransitionSpec { case Event("tick", _) => goto(0) } whenUnhandled { - case Event("reply", _) => stay.replying("reply") + case Event("reply", _) => stay().replying("reply") } initialize() override def preRestart(reason: Throwable, msg: Option[Any]): Unit = { target ! "restarted" } diff --git a/akka-actor-tests/src/test/scala/akka/actor/FunctionRefSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/FunctionRefSpec.scala index 08ca852cf1..6f7462870b 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/FunctionRefSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/FunctionRefSpec.scala @@ -28,7 +28,7 @@ object FunctionRefSpec { } class SupSuper extends Actor { - val s = context.actorOf(Props[Super], "super") + val s = context.actorOf(Props[Super](), "super") def receive = { case msg => s ! msg } @@ -86,12 +86,12 @@ class FunctionRefSpec extends AkkaSpec(""" "A FunctionRef" when { "created by a toplevel actor" must { - val s = system.actorOf(Props[Super], "super") + val s = system.actorOf(Props[Super](), "super") commonTests(s) } "created by a non-toplevel actor" must { - val s = system.actorOf(Props[SupSuper], "supsuper") + val s = system.actorOf(Props[SupSuper](), "supsuper") commonTests(s) } diff --git a/akka-actor-tests/src/test/scala/akka/actor/ReceiveTimeoutSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ReceiveTimeoutSpec.scala index 70f202dc4d..fdb5b47e68 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ReceiveTimeoutSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ReceiveTimeoutSpec.scala @@ -66,7 +66,7 @@ class ReceiveTimeoutSpec extends AkkaSpec() { context.setReceiveTimeout(500 milliseconds) def receive = { - case ReceiveTimeout => timeoutLatch.open + case ReceiveTimeout => timeoutLatch.open() } })) @@ -82,7 +82,7 @@ class ReceiveTimeoutSpec extends AkkaSpec() { def receive = { case Tick => () - case ReceiveTimeout => timeoutLatch.open + case ReceiveTimeout => timeoutLatch.open() } })) @@ -103,7 +103,7 @@ class ReceiveTimeoutSpec extends AkkaSpec() { case Tick => () case ReceiveTimeout => count.incrementAndGet - timeoutLatch.open + timeoutLatch.open() context.setReceiveTimeout(Duration.Undefined) } })) @@ -120,7 +120,7 @@ class ReceiveTimeoutSpec extends AkkaSpec() { val timeoutActor = system.actorOf(Props(new Actor { def receive = { - case ReceiveTimeout => timeoutLatch.open + case ReceiveTimeout => timeoutLatch.open() } })) @@ -135,7 +135,7 @@ class ReceiveTimeoutSpec extends AkkaSpec() { context.setReceiveTimeout(1 second) def receive = { - case ReceiveTimeout => timeoutLatch.open + case ReceiveTimeout => timeoutLatch.open() case TransparentTick => } })) @@ -179,7 +179,7 @@ class ReceiveTimeoutSpec extends AkkaSpec() { context.setReceiveTimeout(1 second) def receive: Receive = { case ReceiveTimeout => - timeoutLatch.open + timeoutLatch.open() case TransparentTick => count.incrementAndGet() } @@ -198,7 +198,7 @@ class ReceiveTimeoutSpec extends AkkaSpec() { val timeoutActor = system.actorOf(Props(new Actor { def receive = { case TransparentTick => context.setReceiveTimeout(500 milliseconds) - case ReceiveTimeout => timeoutLatch.open + case ReceiveTimeout => timeoutLatch.open() } })) @@ -216,7 +216,7 @@ class ReceiveTimeoutSpec extends AkkaSpec() { def receive = { case TransparentTick => context.setReceiveTimeout(Duration.Inf) - case ReceiveTimeout => timeoutLatch.open + case ReceiveTimeout => timeoutLatch.open() } })) @@ -235,7 +235,7 @@ class ReceiveTimeoutSpec extends AkkaSpec() { def receive: Receive = { case TransparentTick => context.setReceiveTimeout(Duration.Undefined) - case ReceiveTimeout => timeoutLatch.open + case ReceiveTimeout => timeoutLatch.open() } })) diff --git a/akka-actor-tests/src/test/scala/akka/actor/RestartStrategySpec.scala b/akka-actor-tests/src/test/scala/akka/actor/RestartStrategySpec.scala index 95c9a4b226..941340036b 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/RestartStrategySpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/RestartStrategySpec.scala @@ -116,7 +116,7 @@ class RestartStrategySpec extends AkkaSpec with DefaultTimeout { def receive = { case Ping => - if (!pingLatch.isOpen) pingLatch.open else secondPingLatch.open + if (!pingLatch.isOpen) pingLatch.open() else secondPingLatch.open() case Crash => throw new Exception("Crashing...") } override def postRestart(reason: Throwable) = { diff --git a/akka-actor-tests/src/test/scala/akka/actor/SchedulerSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/SchedulerSpec.scala index 0d52807f66..5ec64dd108 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/SchedulerSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/SchedulerSpec.scala @@ -330,7 +330,7 @@ trait SchedulerSpec extends BeforeAndAfterEach with DefaultTimeout with Implicit case Crash => throw new Exception("CRASH") } - override def postRestart(reason: Throwable) = restartLatch.open + override def postRestart(reason: Throwable) = restartLatch.open() }) val actor = Await.result((supervisor ? props).mapTo[ActorRef], timeout.duration) diff --git a/akka-actor-tests/src/test/scala/akka/actor/SupervisorHierarchySpec.scala b/akka-actor-tests/src/test/scala/akka/actor/SupervisorHierarchySpec.scala index dd800e8f52..27699f5266 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/SupervisorHierarchySpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/SupervisorHierarchySpec.scala @@ -53,7 +53,7 @@ object SupervisorHierarchySpec { class Resumer extends Actor { override def supervisorStrategy = OneForOneStrategy() { case _ => SupervisorStrategy.Resume } def receive = { - case "spawn" => sender() ! context.actorOf(Props[Resumer]) + case "spawn" => sender() ! context.actorOf(Props[Resumer]()) case "fail" => throw new Exception("expected") case "ping" => sender() ! "pong" } @@ -294,7 +294,7 @@ object SupervisorHierarchySpec { setFlags(f.directive) stateCache.put(self.path, stateCache.get(self.path).copy(failConstr = f.copy())) throw f - case "ping" => { Thread.sleep((random.nextFloat * 1.03).toLong); sender() ! "pong" } + case "ping" => { Thread.sleep((random.nextFloat() * 1.03).toLong); sender() ! "pong" } case Dump(0) => abort("dump") case Dump(level) => context.children.foreach(_ ! Dump(level - 1)) case Terminated(ref) => @@ -432,7 +432,7 @@ object SupervisorHierarchySpec { var idleChildren = Vector.empty[ActorRef] var pingChildren = Set.empty[ActorRef] - val nextJob = Iterator.continually(random.nextFloat match { + val nextJob = Iterator.continually(random.nextFloat() match { case x if x >= 0.5 => // ping one child val pick = ((x - 0.5) * 2 * idleChildren.size).toInt @@ -479,7 +479,7 @@ object SupervisorHierarchySpec { } else { children :+= ref if (children.size == size) goto(Stress) - else stay + else stay() } case Event(StateTimeout, _) => testActor ! "did not get children list" @@ -497,7 +497,7 @@ object SupervisorHierarchySpec { val workSchedule = 50.millis - private def random012: Int = random.nextFloat match { + private def random012: Int = random.nextFloat() match { case x if x > 0.1 => 0 case x if x > 0.03 => 1 case _ => 2 @@ -516,9 +516,9 @@ object SupervisorHierarchySpec { when(Stress) { case Event(Work, _) if idleChildren.isEmpty => context.system.scheduler.scheduleOnce(workSchedule, self, Work)(context.dispatcher) - stay + stay() case Event(Work, x) if x > 0 => - nextJob.next match { + nextJob.next() match { case Ping(ref) => ref ! "ping" case Fail(ref, dir) => val f = Failure( @@ -537,15 +537,15 @@ object SupervisorHierarchySpec { } if (idleChildren.nonEmpty) self ! Work else context.system.scheduler.scheduleOnce(workSchedule, self, Work)(context.dispatcher) - stay.using(x - 1) + stay().using(x - 1) case Event(Work, _) => if (pingChildren.isEmpty) goto(LastPing) else goto(Finishing) case Event(Died(path), _) => bury(path) - stay + stay() case Event("pong", _) => pingChildren -= sender() idleChildren :+= sender() - stay + stay() case Event(StateTimeout, todo) => log.info("dumping state due to StateTimeout") log.info( @@ -566,10 +566,10 @@ object SupervisorHierarchySpec { case Event("pong", _) => pingChildren -= sender() idleChildren :+= sender() - if (pingChildren.isEmpty) goto(LastPing) else stay + if (pingChildren.isEmpty) goto(LastPing) else stay() case Event(Died(ref), _) => bury(ref) - if (pingChildren.isEmpty) goto(LastPing) else stay + if (pingChildren.isEmpty) goto(LastPing) else stay() } onTransition { @@ -583,10 +583,10 @@ object SupervisorHierarchySpec { case Event("pong", _) => pingChildren -= sender() idleChildren :+= sender() - if (pingChildren.isEmpty) goto(Stopping) else stay + if (pingChildren.isEmpty) goto(Stopping) else stay() case Event(Died(ref), _) => bury(ref) - if (pingChildren.isEmpty) goto(Stopping) else stay + if (pingChildren.isEmpty) goto(Stopping) else stay() } onTransition { @@ -596,14 +596,14 @@ object SupervisorHierarchySpec { } when(Stopping, stateTimeout = 5.seconds.dilated) { - case Event(PongOfDeath, _) => stay + case Event(PongOfDeath, _) => stay() case Event(Terminated(r), _) if r == hierarchy => @silent val undead = children.filterNot(_.isTerminated) if (undead.nonEmpty) { log.info("undead:\n" + undead.mkString("\n")) testActor ! "stressTestFailed (" + undead.size + " undead)" - stop + stop() } else if (false) { /* * This part of the test is normally disabled, because it does not @@ -621,7 +621,7 @@ object SupervisorHierarchySpec { goto(GC) } else { testActor ! "stressTestSuccessful" - stop + stop() } case Event(StateTimeout, _) => errors :+= self -> ErrorLog("timeout while Stopping", Vector.empty) @@ -630,7 +630,7 @@ object SupervisorHierarchySpec { printErrors() idleChildren.foreach(println) testActor ! "timeout in Stopping" - stop + stop() case Event(e: ErrorLog, _) => errors :+= sender() -> e goto(Failed) @@ -642,14 +642,14 @@ object SupervisorHierarchySpec { if (next.nonEmpty) { context.system.scheduler.scheduleOnce(workSchedule, self, GCcheck(next))(context.dispatcher) System.gc() - stay + stay() } else { testActor ! "stressTestSuccessful" - stop + stop() } case Event(StateTimeout, _) => testActor ! "timeout in GC" - stop + stop() } var errors = Vector.empty[(ActorRef, ErrorLog)] @@ -658,19 +658,19 @@ object SupervisorHierarchySpec { case Event(e: ErrorLog, _) => if (!e.msg.startsWith("not resumed") || !ignoreNotResumedLogs) errors :+= sender() -> e - stay + stay() case Event(Terminated(r), _) if r == hierarchy => printErrors() testActor ! "stressTestFailed" - stop + stop() case Event(StateTimeout, _) => getErrors(hierarchy, 10) printErrors() testActor ! "timeout in Failed" - stop - case Event("pong", _) => stay // don’t care? - case Event(Work, _) => stay - case Event(Died(_), _) => stay + stop() + case Event("pong", _) => stay() // don’t care? + case Event(Work, _) => stay() + case Event(Died(_), _) => stay() } def getErrors(target: ActorRef, depth: Int): Unit = { @@ -716,9 +716,9 @@ object SupervisorHierarchySpec { activeChildren :+= ref children :+= ref idleChildren :+= ref - stay + stay() case Event(e: ErrorLog, _) => - if (e.msg.startsWith("not resumed")) stay + if (e.msg.startsWith("not resumed")) stay() else { errors :+= sender() -> e // don’t stop the hierarchy, that is going to happen all by itself and in the right order @@ -737,7 +737,7 @@ object SupervisorHierarchySpec { goto(Failed) case Event(msg, _) => testActor ! ("received unexpected msg: " + msg) - stop + stop() } initialize() @@ -801,7 +801,7 @@ class SupervisorHierarchySpec extends AkkaSpec(SupervisorHierarchySpec.config) w } "resume children after Resume" taggedAs LongRunningTest in { - val boss = system.actorOf(Props[Resumer], "resumer") + val boss = system.actorOf(Props[Resumer](), "resumer") boss ! "spawn" val middle = expectMsgType[ActorRef] middle ! "spawn" @@ -824,7 +824,7 @@ class SupervisorHierarchySpec extends AkkaSpec(SupervisorHierarchySpec.config) w case _ => Await.ready(latch, 4.seconds.dilated); SupervisorStrategy.Resume } def receive = { - case "spawn" => sender() ! context.actorOf(Props[Resumer]) + case "spawn" => sender() ! context.actorOf(Props[Resumer]()) } }), "slowResumer") slowResumer ! "spawn" diff --git a/akka-actor-tests/src/test/scala/akka/actor/Ticket669Spec.scala b/akka-actor-tests/src/test/scala/akka/actor/Ticket669Spec.scala index 28bb0ef52c..64ca158c39 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/Ticket669Spec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/Ticket669Spec.scala @@ -28,7 +28,7 @@ class Ticket669Spec extends AkkaSpec with BeforeAndAfterAll with ImplicitSender filterEvents(EventFilter[Exception]("test", occurrences = 1)) { val supervisor = system.actorOf(Props(new Supervisor(AllForOneStrategy(5, 10 seconds)(List(classOf[Exception]))))) - val supervised = Await.result((supervisor ? Props[Supervised]).mapTo[ActorRef], timeout.duration) + val supervised = Await.result((supervisor ? Props[Supervised]()).mapTo[ActorRef], timeout.duration) supervised.!("test")(testActor) expectMsg("failure1") @@ -40,7 +40,7 @@ class Ticket669Spec extends AkkaSpec with BeforeAndAfterAll with ImplicitSender filterEvents(EventFilter[Exception]("test", occurrences = 1)) { val supervisor = system.actorOf(Props(new Supervisor(AllForOneStrategy(maxNrOfRetries = 0)(List(classOf[Exception]))))) - val supervised = Await.result((supervisor ? Props[Supervised]).mapTo[ActorRef], timeout.duration) + val supervised = Await.result((supervisor ? Props[Supervised]()).mapTo[ActorRef], timeout.duration) supervised.!("test")(testActor) expectMsg("failure2") diff --git a/akka-actor-tests/src/test/scala/akka/actor/TimerSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/TimerSpec.scala index 21e4ff218d..0caee03c8f 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/TimerSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/TimerSpec.scala @@ -108,7 +108,7 @@ object TimerSpec { startTimerWithFixedDelay("T", Tick(bumpCount + 1), interval) else startSingleTimer("T", Tick(bumpCount + 1), interval) - stay.using(bumpCount + 1) + stay().using(bumpCount + 1) } def autoReceive(): State = { @@ -116,7 +116,7 @@ object TimerSpec { startTimerWithFixedDelay("A", PoisonPill, interval) else startSingleTimer("A", PoisonPill, interval) - stay + stay() } { @@ -131,7 +131,7 @@ object TimerSpec { when(TheState) { case Event(Tick(n), _) => monitor ! Tock(n) - stay + stay() case Event(Bump, bumpCount) => bump(bumpCount) case Event(SlowThenBump(latch), bumpCount) => @@ -141,7 +141,7 @@ object TimerSpec { stop() case Event(Cancel, _) => cancelTimer("T") - stay + stay() case Event(Throw(e), _) => throw e case Event(SlowThenThrow(latch, e), _) => diff --git a/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala index c3a787f871..7d0ce425e5 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala @@ -123,11 +123,11 @@ object TypedActorSpec { def pigdog = "Pigdog" - def futurePigdog(): Future[String] = Future.successful(pigdog) + def futurePigdog(): Future[String] = Future.successful(pigdog()) def futurePigdog(delay: FiniteDuration): Future[String] = { Thread.sleep(delay.toMillis) - futurePigdog + futurePigdog() } def futurePigdog(delay: FiniteDuration, numbered: Int): Future[String] = { @@ -140,16 +140,16 @@ object TypedActorSpec { foo.futurePigdog(500 millis).map(_.toUpperCase) } - def optionPigdog(): Option[String] = Some(pigdog) + def optionPigdog(): Option[String] = Some(pigdog()) def optionPigdog(delay: FiniteDuration): Option[String] = { Thread.sleep(delay.toMillis) - Some(pigdog) + Some(pigdog()) } def joptionPigdog(delay: FiniteDuration): JOption[String] = { Thread.sleep(delay.toMillis) - JOption.some(pigdog) + JOption.some(pigdog()) } var internalNumber = 0 @@ -408,14 +408,14 @@ class TypedActorSpec t.failingPigdog() t.read() should ===(1) //Make sure state is not reset after failure - intercept[IllegalStateException] { Await.result(t.failingFuturePigdog, 2 seconds) }.getMessage should ===( + intercept[IllegalStateException] { Await.result(t.failingFuturePigdog(), 2 seconds) }.getMessage should ===( "expected") t.read() should ===(1) //Make sure state is not reset after failure - intercept[IllegalStateException] { t.failingJOptionPigdog }.getMessage should ===("expected") + intercept[IllegalStateException] { t.failingJOptionPigdog() }.getMessage should ===("expected") t.read() should ===(1) //Make sure state is not reset after failure - intercept[IllegalStateException] { t.failingOptionPigdog }.getMessage should ===("expected") + intercept[IllegalStateException] { t.failingOptionPigdog() }.getMessage should ===("expected") t.read() should ===(1) //Make sure state is not reset after failure @@ -466,7 +466,7 @@ class TypedActorSpec val thais = for (_ <- 1 to 60) yield newFooBar("pooled-dispatcher", 6 seconds) val iterator = new CyclicIterator(thais) - val results = for (i <- 1 to 120) yield (i, iterator.next.futurePigdog(200 millis, i)) + val results = for (i <- 1 to 120) yield (i, iterator.next().futurePigdog(200 millis, i)) for ((i, r) <- results) Await.result(r, remaining) should ===("Pigdog" + i) diff --git a/akka-actor-tests/src/test/scala/akka/actor/UidClashTest.scala b/akka-actor-tests/src/test/scala/akka/actor/UidClashTest.scala index 1fe2f05570..950cfde03c 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/UidClashTest.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/UidClashTest.scala @@ -76,7 +76,7 @@ object UidClashTest { Stop case _ => Restart } - val theRestartedOne = context.actorOf(Props[RestartedActor], "theRestartedOne") + val theRestartedOne = context.actorOf(Props[RestartedActor](), "theRestartedOne") def receive = { case PleaseRestart => theRestartedOne ! PleaseRestart diff --git a/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala index da6acbef52..a5e9aa1608 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala @@ -257,7 +257,7 @@ abstract class ActorModelSpec(config: String) extends AkkaSpec(config) with Defa import ActorModelSpec._ - def newTestActor(dispatcher: String) = system.actorOf(Props[DispatcherActor].withDispatcher(dispatcher)) + def newTestActor(dispatcher: String) = system.actorOf(Props[DispatcherActor]().withDispatcher(dispatcher)) def awaitStarted(ref: ActorRef): Unit = { awaitCond(ref match { @@ -352,7 +352,7 @@ abstract class ActorModelSpec(config: String) extends AkkaSpec(config) with Defa val a = newTestActor(dispatcher.id).asInstanceOf[InternalActorRef] awaitStarted(a) val done = new CountDownLatch(1) - a.suspend + a.suspend() a ! CountDown(done) assertNoCountDown(done, 1000, "Should not process messages while suspended") assertRefDefaultZero(a)(registers = 1, msgsReceived = 1, suspensions = 1) @@ -373,7 +373,7 @@ abstract class ActorModelSpec(config: String) extends AkkaSpec(config) with Defa "handle waves of actors" in { val dispatcher = interceptedDispatcher() - val props = Props[DispatcherActor].withDispatcher(dispatcher.id) + val props = Props[DispatcherActor]().withDispatcher(dispatcher.id) def flood(num: Int): Unit = { val cachedMessage = CountDownNStop(new CountDownLatch(num)) @@ -417,7 +417,7 @@ abstract class ActorModelSpec(config: String) extends AkkaSpec(config) with Defa } System.err.println("Mailbox: " + mq.numberOfMessages + " " + mq.hasMessages) - Iterator.continually(mq.dequeue).takeWhile(_ ne null).foreach(System.err.println) + Iterator.continually(mq.dequeue()).takeWhile(_ ne null).foreach(System.err.println) case _ => } diff --git a/akka-actor-tests/src/test/scala/akka/actor/dispatch/DispatcherActorSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/dispatch/DispatcherActorSpec.scala index ea6086fc69..75dcb22163 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/dispatch/DispatcherActorSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/dispatch/DispatcherActorSpec.scala @@ -59,14 +59,14 @@ class DispatcherActorSpec extends AkkaSpec(DispatcherActorSpec.config) with Defa "A Dispatcher and an Actor" must { "support tell" in { - val actor = system.actorOf(Props[OneWayTestActor].withDispatcher("test-dispatcher")) + val actor = system.actorOf(Props[OneWayTestActor]().withDispatcher("test-dispatcher")) actor ! "OneWay" assert(OneWayTestActor.oneWay.await(1, TimeUnit.SECONDS)) system.stop(actor) } "support ask/reply" in { - val actor = system.actorOf(Props[TestActor].withDispatcher("test-dispatcher")) + val actor = system.actorOf(Props[TestActor]().withDispatcher("test-dispatcher")) assert("World" === Await.result(actor ? "Hello", timeout.duration)) system.stop(actor) } diff --git a/akka-actor-tests/src/test/scala/akka/actor/dispatch/DispatchersSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/dispatch/DispatchersSpec.scala index a38daf15ad..2432f0d953 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/dispatch/DispatchersSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/dispatch/DispatchersSpec.scala @@ -182,11 +182,11 @@ class DispatchersSpec extends AkkaSpec(DispatchersSpec.config) with ImplicitSend } "include system name and dispatcher id in thread names for fork-join-executor" in { - assertMyDispatcherIsUsed(system.actorOf(Props[ThreadNameEcho].withDispatcher("myapp.mydispatcher"))) + assertMyDispatcherIsUsed(system.actorOf(Props[ThreadNameEcho]().withDispatcher("myapp.mydispatcher"))) } "include system name and dispatcher id in thread names for thread-pool-executor" in { - system.actorOf(Props[ThreadNameEcho].withDispatcher("myapp.thread-pool-dispatcher")) ! "what's the name?" + system.actorOf(Props[ThreadNameEcho]().withDispatcher("myapp.thread-pool-dispatcher")) ! "what's the name?" val Expected = R("(DispatchersSpec-myapp.thread-pool-dispatcher-[1-9][0-9]*)") expectMsgPF() { case Expected(_) => @@ -194,7 +194,7 @@ class DispatchersSpec extends AkkaSpec(DispatchersSpec.config) with ImplicitSend } "include system name and dispatcher id in thread names for default-dispatcher" in { - system.actorOf(Props[ThreadNameEcho]) ! "what's the name?" + system.actorOf(Props[ThreadNameEcho]()) ! "what's the name?" val Expected = R("(DispatchersSpec-akka.actor.default-dispatcher-[1-9][0-9]*)") expectMsgPF() { case Expected(_) => @@ -202,7 +202,7 @@ class DispatchersSpec extends AkkaSpec(DispatchersSpec.config) with ImplicitSend } "include system name and dispatcher id in thread names for pinned dispatcher" in { - system.actorOf(Props[ThreadNameEcho].withDispatcher("myapp.my-pinned-dispatcher")) ! "what's the name?" + system.actorOf(Props[ThreadNameEcho]().withDispatcher("myapp.my-pinned-dispatcher")) ! "what's the name?" val Expected = R("(DispatchersSpec-myapp.my-pinned-dispatcher-[1-9][0-9]*)") expectMsgPF() { case Expected(_) => @@ -210,7 +210,7 @@ class DispatchersSpec extends AkkaSpec(DispatchersSpec.config) with ImplicitSend } "include system name and dispatcher id in thread names for balancing dispatcher" in { - system.actorOf(Props[ThreadNameEcho].withDispatcher("myapp.balancing-dispatcher")) ! "what's the name?" + system.actorOf(Props[ThreadNameEcho]().withDispatcher("myapp.balancing-dispatcher")) ! "what's the name?" val Expected = R("(DispatchersSpec-myapp.balancing-dispatcher-[1-9][0-9]*)") expectMsgPF() { case Expected(_) => @@ -218,16 +218,16 @@ class DispatchersSpec extends AkkaSpec(DispatchersSpec.config) with ImplicitSend } "use dispatcher in deployment config" in { - assertMyDispatcherIsUsed(system.actorOf(Props[ThreadNameEcho], name = "echo1")) + assertMyDispatcherIsUsed(system.actorOf(Props[ThreadNameEcho](), name = "echo1")) } "use dispatcher in deployment config, trumps code" in { assertMyDispatcherIsUsed( - system.actorOf(Props[ThreadNameEcho].withDispatcher("myapp.my-pinned-dispatcher"), name = "echo2")) + system.actorOf(Props[ThreadNameEcho]().withDispatcher("myapp.my-pinned-dispatcher"), name = "echo2")) } "use pool-dispatcher router of deployment config" in { - val pool = system.actorOf(FromConfig.props(Props[ThreadNameEcho]), name = "pool1") + val pool = system.actorOf(FromConfig.props(Props[ThreadNameEcho]()), name = "pool1") pool ! Identify(None) val routee = expectMsgType[ActorIdentity].ref.get routee ! "what's the name?" @@ -238,7 +238,7 @@ class DispatchersSpec extends AkkaSpec(DispatchersSpec.config) with ImplicitSend } "use balancing-pool router with special routees mailbox of deployment config" in { - system.actorOf(FromConfig.props(Props[ThreadNameEcho]), name = "balanced") ! "what's the name?" + system.actorOf(FromConfig.props(Props[ThreadNameEcho]()), name = "balanced") ! "what's the name?" val Expected = R("""(DispatchersSpec-BalancingPool-/balanced-[1-9][0-9]*)""") expectMsgPF() { case Expected(_) => diff --git a/akka-actor-tests/src/test/scala/akka/actor/dispatch/PinnedActorSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/dispatch/PinnedActorSpec.scala index 2d681beaf7..eb6f86c4eb 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/dispatch/PinnedActorSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/dispatch/PinnedActorSpec.scala @@ -44,7 +44,7 @@ class PinnedActorSpec extends AkkaSpec(PinnedActorSpec.config) with BeforeAndAft } "support ask/reply" in { - val actor = system.actorOf(Props[TestActor].withDispatcher("pinned-dispatcher")) + val actor = system.actorOf(Props[TestActor]().withDispatcher("pinned-dispatcher")) assert("World" === Await.result(actor ? "Hello", timeout.duration)) system.stop(actor) } diff --git a/akka-actor-tests/src/test/scala/akka/actor/dungeon/DispatchSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/dungeon/DispatchSpec.scala index d8f85593e3..6697baecb5 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/dungeon/DispatchSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/dungeon/DispatchSpec.scala @@ -25,7 +25,7 @@ class DispatchSpec extends AkkaSpec(""" "The dispatcher" should { "log an appropriate message when akka.actor.serialize-messages triggers a serialization error" in { - val actor = system.actorOf(Props[EmptyActor]) + val actor = system.actorOf(Props[EmptyActor]()) EventFilter[Exception](pattern = ".*NoSerializationVerificationNeeded.*", occurrences = 1).intercept { actor ! new UnserializableMessageClass } diff --git a/akka-actor-tests/src/test/scala/akka/dispatch/MailboxConfigSpec.scala b/akka-actor-tests/src/test/scala/akka/dispatch/MailboxConfigSpec.scala index aaafb8bbe9..baee353ac5 100644 --- a/akka-actor-tests/src/test/scala/akka/dispatch/MailboxConfigSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/dispatch/MailboxConfigSpec.scala @@ -157,7 +157,7 @@ abstract class MailboxSpec extends AkkaSpec with BeforeAndAfterAll with BeforeAn def createConsumer: Future[Vector[Envelope]] = spawn { var r = Vector[Envelope]() - while (producers.exists(_.isCompleted == false) || q.hasMessages) Option(q.dequeue).foreach { message => + while (producers.exists(_.isCompleted == false) || q.hasMessages) Option(q.dequeue()).foreach { message => r = r :+ message } diff --git a/akka-actor-tests/src/test/scala/akka/event/EventStreamSpec.scala b/akka-actor-tests/src/test/scala/akka/event/EventStreamSpec.scala index 0a9a279068..528ecaf8f2 100644 --- a/akka-actor-tests/src/test/scala/akka/event/EventStreamSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/event/EventStreamSpec.scala @@ -85,7 +85,7 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) { expectMsg(M(42)) bus.unsubscribe(testActor) bus.publish(M(13)) - expectNoMessage + expectNoMessage() } } @@ -159,7 +159,7 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) { bus.publish(a) expectMsg(b2) expectMsg(a) - expectNoMessage + expectNoMessage() } } diff --git a/akka-actor-tests/src/test/scala/akka/event/LoggerSpec.scala b/akka-actor-tests/src/test/scala/akka/event/LoggerSpec.scala index 704c89f77d..fae97a472b 100644 --- a/akka-actor-tests/src/test/scala/akka/event/LoggerSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/event/LoggerSpec.scala @@ -235,7 +235,7 @@ class LoggerSpec extends AnyWordSpec with Matchers { system.eventStream.publish(SetTarget(probe.ref, qualifier = 1)) probe.expectMsg("OK") - val ref = system.actorOf(Props[ActorWithMDC]) + val ref = system.actorOf(Props[ActorWithMDC]()) ref ! "Processing new Request" probe.expectMsgPF(max = 3.seconds) { diff --git a/akka-actor-tests/src/test/scala/akka/event/LoggingReceiveSpec.scala b/akka-actor-tests/src/test/scala/akka/event/LoggingReceiveSpec.scala index 94c6115716..b1eac39922 100644 --- a/akka-actor-tests/src/test/scala/akka/event/LoggingReceiveSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/event/LoggingReceiveSpec.scala @@ -195,7 +195,7 @@ class LoggingReceiveSpec extends AnyWordSpec with BeforeAndAfterAll { within(3 seconds) { val lifecycleGuardian = appLifecycle.asInstanceOf[ActorSystemImpl].guardian val lname = lifecycleGuardian.path.toString - val supervisor = TestActorRef[TestLogActor](Props[TestLogActor]) + val supervisor = TestActorRef[TestLogActor](Props[TestLogActor]()) val sname = supervisor.path.toString fishForMessage(hint = "now supervising") { @@ -203,7 +203,7 @@ class LoggingReceiveSpec extends AnyWordSpec with BeforeAndAfterAll { case _ => false } - TestActorRef[TestLogActor](Props[TestLogActor], supervisor, "none") + TestActorRef[TestLogActor](Props[TestLogActor](), supervisor, "none") fishForMessage(hint = "now supervising") { case Logging.Debug(`sname`, _, msg: String) if msg.startsWith("now supervising") => true @@ -217,9 +217,9 @@ class LoggingReceiveSpec extends AnyWordSpec with BeforeAndAfterAll { new TestKit(appLifecycle) { system.eventStream.subscribe(testActor, classOf[Logging.Debug]) within(3 seconds) { - val supervisor = TestActorRef[TestLogActor](Props[TestLogActor]) + val supervisor = TestActorRef[TestLogActor](Props[TestLogActor]()) val sclass = classOf[TestLogActor] - val actor = TestActorRef[TestLogActor](Props[TestLogActor], supervisor, "none") + val actor = TestActorRef[TestLogActor](Props[TestLogActor](), supervisor, "none") val aname = actor.path.toString supervisor.watch(actor) @@ -242,7 +242,7 @@ class LoggingReceiveSpec extends AnyWordSpec with BeforeAndAfterAll { system.eventStream.subscribe(testActor, classOf[Logging.Debug]) system.eventStream.subscribe(testActor, classOf[Logging.Error]) within(3 seconds) { - val supervisor = TestActorRef[TestLogActor](Props[TestLogActor]) + val supervisor = TestActorRef[TestLogActor](Props[TestLogActor]()) val sname = supervisor.path.toString val sclass = classOf[TestLogActor] @@ -251,7 +251,7 @@ class LoggingReceiveSpec extends AnyWordSpec with BeforeAndAfterAll { case Logging.Debug(_, _, msg: String) if msg.startsWith("now supervising") => 1 } - val actor = TestActorRef[TestLogActor](Props[TestLogActor], supervisor, "none") + val actor = TestActorRef[TestLogActor](Props[TestLogActor](), supervisor, "none") val aname = actor.path.toString val aclass = classOf[TestLogActor] diff --git a/akka-actor-tests/src/test/scala/akka/event/jul/JavaLoggerSpec.scala b/akka-actor-tests/src/test/scala/akka/event/jul/JavaLoggerSpec.scala index aeabab9b76..ca9726c6ec 100644 --- a/akka-actor-tests/src/test/scala/akka/event/jul/JavaLoggerSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/event/jul/JavaLoggerSpec.scala @@ -46,7 +46,7 @@ class JavaLoggerSpec extends AkkaSpec(JavaLoggerSpec.config) { def close(): Unit = {} }) - val producer = system.actorOf(Props[JavaLoggerSpec.LogProducer], name = "log") + val producer = system.actorOf(Props[JavaLoggerSpec.LogProducer](), name = "log") "JavaLogger" must { diff --git a/akka-actor-tests/src/test/scala/akka/pattern/AskSpec.scala b/akka-actor-tests/src/test/scala/akka/pattern/AskSpec.scala index cc89300f5d..2cbbe97609 100644 --- a/akka-actor-tests/src/test/scala/akka/pattern/AskSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/pattern/AskSpec.scala @@ -161,8 +161,8 @@ class AskSpec extends AkkaSpec { val echo = system.actorOf(Props(new Actor { def receive = { case x => - val name = sender.path.name - val parent = sender.path.parent + val name = sender().path.name + val parent = sender().path.parent context.actorSelection(parent / ".." / "temp" / name) ! x } }), "select-echo4") @@ -182,7 +182,7 @@ class AskSpec extends AkkaSpec { val echo = system.actorOf(Props(new Actor { def receive = { case x => - val parent = sender.path.parent + val parent = sender().path.parent context.actorSelection(parent / "missing") ! x } }), "select-echo5") diff --git a/akka-actor-tests/src/test/scala/akka/pattern/BackoffOnRestartSupervisorSpec.scala b/akka-actor-tests/src/test/scala/akka/pattern/BackoffOnRestartSupervisorSpec.scala index 6e1ab61aaa..27d2ceef71 100644 --- a/akka-actor-tests/src/test/scala/akka/pattern/BackoffOnRestartSupervisorSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/pattern/BackoffOnRestartSupervisorSpec.scala @@ -119,7 +119,7 @@ class BackoffOnRestartSupervisorSpec extends AkkaSpec(""" val supervisorChildSelection = system.actorSelection(supervisor.path / "*") supervisorChildSelection.tell("testmsg", probe.ref) probe.expectMsg("testmsg") - probe.expectNoMessage + probe.expectNoMessage() } } diff --git a/akka-actor-tests/src/test/scala/akka/pattern/CircuitBreakerSpec.scala b/akka-actor-tests/src/test/scala/akka/pattern/CircuitBreakerSpec.scala index 736c87e8dc..3a6e5420be 100644 --- a/akka-actor-tests/src/test/scala/akka/pattern/CircuitBreakerSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/pattern/CircuitBreakerSpec.scala @@ -180,7 +180,7 @@ class CircuitBreakerSpec extends AkkaSpec { val breaker = shortResetTimeoutCb() intercept[TestException] { breaker().withSyncCircuitBreaker(throwException) } checkLatch(breaker.halfOpenLatch) - breaker.openLatch.reset + breaker.openLatch.reset() intercept[TestException] { breaker().withSyncCircuitBreaker(throwException) } checkLatch(breaker.openLatch) } @@ -190,7 +190,7 @@ class CircuitBreakerSpec extends AkkaSpec { val breaker = shortResetTimeoutCb() intercept[TestException] { breaker().withSyncCircuitBreaker(throwException) } checkLatch(breaker.halfOpenLatch) - breaker.openLatch.reset + breaker.openLatch.reset() breaker().withSyncCircuitBreaker(2, evenNumberIsFailure) checkLatch(breaker.openLatch) } @@ -200,7 +200,7 @@ class CircuitBreakerSpec extends AkkaSpec { val breaker = shortResetTimeoutCb() intercept[TestException] { breaker().withSyncCircuitBreaker(throwException) } checkLatch(breaker.halfOpenLatch) - breaker.openLatch.reset + breaker.openLatch.reset() breaker().fail() checkLatch(breaker.openLatch) } @@ -451,7 +451,7 @@ class CircuitBreakerSpec extends AkkaSpec { checkLatch(breaker.halfOpenLatch) // transit to open again - breaker.openLatch.reset + breaker.openLatch.reset() breaker().withCircuitBreaker(Future(throwException)) checkLatch(breaker.openLatch) @@ -513,7 +513,7 @@ class CircuitBreakerSpec extends AkkaSpec { val breaker = shortResetTimeoutCb() breaker().withCircuitBreaker(Future(throwException)) checkLatch(breaker.halfOpenLatch) - breaker.openLatch.reset + breaker.openLatch.reset() intercept[TestException] { Await.result(breaker().withCircuitBreaker(Future(throwException)), awaitTimeout) } checkLatch(breaker.openLatch) } @@ -523,7 +523,7 @@ class CircuitBreakerSpec extends AkkaSpec { val breaker = shortResetTimeoutCb() intercept[TestException] { breaker().withSyncCircuitBreaker(throwException) } checkLatch(breaker.halfOpenLatch) - breaker.openLatch.reset + breaker.openLatch.reset() Await.result(breaker().withCircuitBreaker(Future(2), evenNumberIsFailure), awaitTimeout) checkLatch(breaker.openLatch) } @@ -534,7 +534,7 @@ class CircuitBreakerSpec extends AkkaSpec { breaker().withCircuitBreaker(Future(throwException)) checkLatch(breaker.halfOpenLatch) - breaker.openLatch.reset + breaker.openLatch.reset() breaker().withCircuitBreaker(Future(throwException)) checkLatch(breaker.openLatch) } diff --git a/akka-actor-tests/src/test/scala/akka/pattern/PatternSpec.scala b/akka-actor-tests/src/test/scala/akka/pattern/PatternSpec.scala index ccd298f143..ccb5628442 100644 --- a/akka-actor-tests/src/test/scala/akka/pattern/PatternSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/pattern/PatternSpec.scala @@ -29,19 +29,19 @@ class PatternSpec extends AkkaSpec { "pattern.gracefulStop" must { "provide Future for stopping an actor" in { - val target = system.actorOf(Props[TargetActor]) + val target = system.actorOf(Props[TargetActor]()) val result = gracefulStop(target, 5 seconds) Await.result(result, 6 seconds) should ===(true) } "complete Future when actor already terminated" in { - val target = system.actorOf(Props[TargetActor]) + val target = system.actorOf(Props[TargetActor]()) Await.ready(gracefulStop(target, 5 seconds), 6 seconds) Await.ready(gracefulStop(target, 1 millis), 1 second) } "complete Future with AskTimeoutException when actor not terminated within timeout" in { - val target = system.actorOf(Props[TargetActor]) + val target = system.actorOf(Props[TargetActor]()) val latch = TestLatch() target ! ((latch, remainingOrDefault)) intercept[AskTimeoutException] { Await.result(gracefulStop(target, 500 millis), remainingOrDefault) } diff --git a/akka-actor-tests/src/test/scala/akka/pattern/RetrySpec.scala b/akka-actor-tests/src/test/scala/akka/pattern/RetrySpec.scala index 2f89e8a10e..a8225fb875 100644 --- a/akka-actor-tests/src/test/scala/akka/pattern/RetrySpec.scala +++ b/akka-actor-tests/src/test/scala/akka/pattern/RetrySpec.scala @@ -59,7 +59,7 @@ class RetrySpec extends AkkaSpec with RetrySupport { } else Future.successful(5) } - val retried = retry(() => attempt, 10, 100 milliseconds) + val retried = retry(() => attempt(), 10, 100 milliseconds) within(3 seconds) { Await.result(retried, remaining) should ===(5) @@ -76,7 +76,7 @@ class RetrySpec extends AkkaSpec with RetrySupport { } else Future.successful(5) } - val retried = retry(() => attempt, 5, 100 milliseconds) + val retried = retry(() => attempt(), 5, 100 milliseconds) within(3 seconds) { intercept[IllegalStateException] { Await.result(retried, remaining) }.getMessage should ===("6") @@ -94,7 +94,7 @@ class RetrySpec extends AkkaSpec with RetrySupport { } else Future.successful(5) } - val retried = retry(() => attempt, 5, attempted => { + val retried = retry(() => attempt(), 5, attempted => { attemptedCount = attempted Some(100.milliseconds * attempted) }) @@ -114,7 +114,7 @@ class RetrySpec extends AkkaSpec with RetrySupport { } else Future.successful(1) } val start = System.currentTimeMillis() - val retried = retry(() => attempt, 999) + val retried = retry(() => attempt(), 999) within(1 seconds) { intercept[IllegalStateException] { diff --git a/akka-actor-tests/src/test/scala/akka/routing/BalancingSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/BalancingSpec.scala index 83081831fe..537f002930 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/BalancingSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/BalancingSpec.scala @@ -118,14 +118,14 @@ class BalancingSpec extends AkkaSpec(""" "work with anonymous actor names" in { // the dispatcher-id must not contain invalid config key characters (e.g. $a) - system.actorOf(Props[Parent]) ! 1000 + system.actorOf(Props[Parent]()) ! 1000 expectMsgType[Int] } "work with encoded actor names" in { val encName = URLEncoder.encode("abcå6#$€xyz", "utf-8") // % is a valid config key character (e.g. %C3%A5) - system.actorOf(Props[Parent], encName) ! 1001 + system.actorOf(Props[Parent](), encName) ! 1001 expectMsgType[Int] } diff --git a/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala index b90c1c5e79..1790d43c9e 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala @@ -127,26 +127,26 @@ class ConfiguredLocalRoutingSpec "RouterConfig" must { "be picked up from Props" in { - val actor = system.actorOf(RoundRobinPool(12).props(routeeProps = Props[EchoProps]), "someOther") + val actor = system.actorOf(RoundRobinPool(12).props(routeeProps = Props[EchoProps]()), "someOther") routerConfig(actor) should ===(RoundRobinPool(12)) Await.result(gracefulStop(actor, 3 seconds), 3 seconds) } "be overridable in config" in { - val actor = system.actorOf(RoundRobinPool(12).props(routeeProps = Props[EchoProps]), "config") + val actor = system.actorOf(RoundRobinPool(12).props(routeeProps = Props[EchoProps]()), "config") routerConfig(actor) should ===(RandomPool(nrOfInstances = 4, usePoolDispatcher = true)) Await.result(gracefulStop(actor, 3 seconds), 3 seconds) } "use routees.paths from config" in { - val actor = system.actorOf(RandomPool(12).props(routeeProps = Props[EchoProps]), "paths") + val actor = system.actorOf(RandomPool(12).props(routeeProps = Props[EchoProps]()), "paths") routerConfig(actor) should ===(RandomGroup(List("/user/service1", "/user/service2"))) Await.result(gracefulStop(actor, 3 seconds), 3 seconds) } "be overridable in explicit deployment" in { val actor = system.actorOf( - FromConfig.props(routeeProps = Props[EchoProps]).withDeploy(Deploy(routerConfig = RoundRobinPool(12))), + FromConfig.props(routeeProps = Props[EchoProps]()).withDeploy(Deploy(routerConfig = RoundRobinPool(12))), "someOther") routerConfig(actor) should ===(RoundRobinPool(12)) Await.result(gracefulStop(actor, 3 seconds), 3 seconds) @@ -154,7 +154,7 @@ class ConfiguredLocalRoutingSpec "be overridable in config even with explicit deployment" in { val actor = system.actorOf( - FromConfig.props(routeeProps = Props[EchoProps]).withDeploy(Deploy(routerConfig = RoundRobinPool(12))), + FromConfig.props(routeeProps = Props[EchoProps]()).withDeploy(Deploy(routerConfig = RoundRobinPool(12))), "config") routerConfig(actor) should ===(RandomPool(nrOfInstances = 4, usePoolDispatcher = true)) Await.result(gracefulStop(actor, 3 seconds), 3 seconds) @@ -185,7 +185,7 @@ class ConfiguredLocalRoutingSpec // we don't really support deployment configuration of system actors, but // it's used for the pool of the SimpleDnsManager "/IO-DNS/inet-address" val probe = TestProbe() - val parent = system.asInstanceOf[ExtendedActorSystem].systemActorOf(Props[Parent], "sys-parent") + val parent = system.asInstanceOf[ExtendedActorSystem].systemActorOf(Props[Parent](), "sys-parent") parent.tell((FromConfig.props(echoActorProps), "round"), probe.ref) val router = probe.expectMsgType[ActorRef] val replies = collectRouteePaths(probe, router, 10) diff --git a/akka-actor-tests/src/test/scala/akka/routing/ConsistentHashingRouterSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/ConsistentHashingRouterSpec.scala index d293e7cb29..ca9c482108 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/ConsistentHashingRouterSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/ConsistentHashingRouterSpec.scala @@ -59,7 +59,7 @@ class ConsistentHashingRouterSpec import ConsistentHashingRouterSpec._ implicit val ec: ExecutionContextExecutor = system.dispatcher - val router1 = system.actorOf(FromConfig.props(Props[Echo]), "router1") + val router1 = system.actorOf(FromConfig.props(Props[Echo]()), "router1") "consistent hashing router" must { "create routees from configuration" in { @@ -90,7 +90,7 @@ class ConsistentHashingRouterSpec } val router2 = system.actorOf( - ConsistentHashingPool(nrOfInstances = 1, hashMapping = hashMapping).props(Props[Echo]), + ConsistentHashingPool(nrOfInstances = 1, hashMapping = hashMapping).props(Props[Echo]()), "router2") router2 ! Msg2("a", "A") diff --git a/akka-actor-tests/src/test/scala/akka/routing/ResizerSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/ResizerSpec.scala index 6ea9e7bfc0..3688cd5c05 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/ResizerSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/ResizerSpec.scala @@ -100,7 +100,7 @@ class ResizerSpec extends AkkaSpec(ResizerSpec.config) with DefaultTimeout with c1 should ===(2) val current = - Vector(ActorRefRoutee(system.actorOf(Props[TestActor])), ActorRefRoutee(system.actorOf(Props[TestActor]))) + Vector(ActorRefRoutee(system.actorOf(Props[TestActor]())), ActorRefRoutee(system.actorOf(Props[TestActor]()))) val c2 = resizer.capacity(current) c2 should ===(0) } @@ -129,7 +129,7 @@ class ResizerSpec extends AkkaSpec(ResizerSpec.config) with DefaultTimeout with val latch = new TestLatch(3) val resizer = DefaultResizer(lowerBound = 2, upperBound = 3) - val router = system.actorOf(RoundRobinPool(nrOfInstances = 0, resizer = Some(resizer)).props(Props[TestActor])) + val router = system.actorOf(RoundRobinPool(nrOfInstances = 0, resizer = Some(resizer)).props(Props[TestActor]())) router ! latch router ! latch @@ -144,7 +144,7 @@ class ResizerSpec extends AkkaSpec(ResizerSpec.config) with DefaultTimeout with "be possible to define in configuration" in { val latch = new TestLatch(3) - val router = system.actorOf(FromConfig.props(Props[TestActor]), "router1") + val router = system.actorOf(FromConfig.props(Props[TestActor]()), "router1") router ! latch router ! latch diff --git a/akka-actor-tests/src/test/scala/akka/routing/RoutingSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/RoutingSpec.scala index b37ca3bbd6..f4a3afe6c4 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/RoutingSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/RoutingSpec.scala @@ -56,7 +56,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with "routers in general" must { "evict terminated routees" in { - val router = system.actorOf(RoundRobinPool(2).props(routeeProps = Props[Echo])) + val router = system.actorOf(RoundRobinPool(2).props(routeeProps = Props[Echo]())) router ! "" router ! "" val c1, c2 = expectMsgType[ActorRef] @@ -87,7 +87,8 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with } } val router = - system.actorOf(RoundRobinPool(nrOfInstances = 0, resizer = Some(resizer)).props(routeeProps = Props[TestActor])) + system.actorOf( + RoundRobinPool(nrOfInstances = 0, resizer = Some(resizer)).props(routeeProps = Props[TestActor]())) watch(router) Await.ready(latch, remainingOrDefault) router ! GetRoutees @@ -99,7 +100,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with } "use configured nr-of-instances when FromConfig" in { - val router = system.actorOf(FromConfig.props(routeeProps = Props[TestActor]), "router1") + val router = system.actorOf(FromConfig.props(routeeProps = Props[TestActor]()), "router1") router ! GetRoutees expectMsgType[Routees].routees.size should ===(3) watch(router) @@ -108,7 +109,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with } "use configured nr-of-instances when router is specified" in { - val router = system.actorOf(RoundRobinPool(nrOfInstances = 2).props(routeeProps = Props[TestActor]), "router2") + val router = system.actorOf(RoundRobinPool(nrOfInstances = 2).props(routeeProps = Props[TestActor]()), "router2") router ! GetRoutees expectMsgType[Routees].routees.size should ===(3) system.stop(router) @@ -125,7 +126,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with } val router = system.actorOf( - RoundRobinPool(nrOfInstances = 0, resizer = Some(resizer)).props(routeeProps = Props[TestActor]), + RoundRobinPool(nrOfInstances = 0, resizer = Some(resizer)).props(routeeProps = Props[TestActor]()), "router3") Await.ready(latch, remainingOrDefault) router ! GetRoutees @@ -141,7 +142,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with //#custom-strategy } val router = - system.actorOf(RoundRobinPool(1, supervisorStrategy = escalator).props(routeeProps = Props[TestActor])) + system.actorOf(RoundRobinPool(1, supervisorStrategy = escalator).props(routeeProps = Props[TestActor]())) //#supervision router ! GetRoutees EventFilter[ActorKilledException](occurrences = 1).intercept { @@ -150,7 +151,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with expectMsgType[ActorKilledException] val router2 = - system.actorOf(RoundRobinPool(1).withSupervisorStrategy(escalator).props(routeeProps = Props[TestActor])) + system.actorOf(RoundRobinPool(1).withSupervisorStrategy(escalator).props(routeeProps = Props[TestActor]())) router2 ! GetRoutees EventFilter[ActorKilledException](occurrences = 1).intercept { expectMsgType[Routees].routees.head.send(Kill, testActor) @@ -163,7 +164,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with case e => testActor ! e; SupervisorStrategy.Escalate } val router = - system.actorOf(FromConfig.withSupervisorStrategy(escalator).props(routeeProps = Props[TestActor]), "router1") + system.actorOf(FromConfig.withSupervisorStrategy(escalator).props(routeeProps = Props[TestActor]()), "router1") router ! GetRoutees EventFilter[ActorKilledException](occurrences = 1).intercept { expectMsgType[Routees].routees.head.send(Kill, testActor) @@ -227,7 +228,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with "router FromConfig" must { "throw suitable exception when not configured" in { val e = intercept[ConfigurationException] { - system.actorOf(FromConfig.props(routeeProps = Props[TestActor]), "routerNotDefined") + system.actorOf(FromConfig.props(routeeProps = Props[TestActor]()), "routerNotDefined") } e.getMessage should include("routerNotDefined") } @@ -239,7 +240,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with .parseString("akka.actor.deployment./routed.router=round-robin-pool") .withFallback(system.settings.config)) try { - sys.actorOf(FromConfig.props(routeeProps = Props[TestActor]), "routed") + sys.actorOf(FromConfig.props(routeeProps = Props[TestActor]()), "routed") } finally { shutdown(sys) } diff --git a/akka-actor-tests/src/test/scala/akka/serialization/SerializeSpec.scala b/akka-actor-tests/src/test/scala/akka/serialization/SerializeSpec.scala index f53f3795d3..775797ca4d 100644 --- a/akka-actor-tests/src/test/scala/akka/serialization/SerializeSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/serialization/SerializeSpec.scala @@ -284,7 +284,7 @@ class VerifySerializabilitySpec extends AkkaSpec(SerializationTests.verifySerial } "verify creators" in { - val a = system.actorOf(Props[FooActor]) + val a = system.actorOf(Props[FooActor]()) system.stop(a) val b = system.actorOf(Props(new FooAbstractActor)) @@ -307,7 +307,7 @@ class VerifySerializabilitySpec extends AkkaSpec(SerializationTests.verifySerial } "verify messages" in { - val a = system.actorOf(Props[FooActor]) + val a = system.actorOf(Props[FooActor]()) Await.result(a ? "pigdog", timeout.duration) should ===("pigdog") EventFilter[SerializationCheckFailedException]( @@ -319,7 +319,7 @@ class VerifySerializabilitySpec extends AkkaSpec(SerializationTests.verifySerial } "not verify akka messages" in { - val a = system.actorOf(Props[FooActor]) + val a = system.actorOf(Props[FooActor]()) EventFilter.warning(start = "ok", occurrences = 1).intercept { // ActorSystem is not possible to serialize, but ok since it starts with "akka." val message = system diff --git a/akka-actor-tests/src/test/scala/akka/util/ByteStringSpec.scala b/akka-actor-tests/src/test/scala/akka/util/ByteStringSpec.scala index 5977403ac2..d12c25bffb 100644 --- a/akka-actor-tests/src/test/scala/akka/util/ByteStringSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/ByteStringSpec.scala @@ -191,7 +191,7 @@ class ByteStringSpec extends AnyWordSpec with Matchers with Checkers { body(bsBuilder) body(vecBuilder) - bsBuilder.result == vecBuilder.result + bsBuilder.result() == vecBuilder.result() } def testShortDecoding(slice: ByteStringSlice, byteOrder: ByteOrder): Boolean = { @@ -275,7 +275,7 @@ class ByteStringSpec extends AnyWordSpec with Matchers with Checkers { for (i <- 0 until from) builder.putShort(data(i))(byteOrder) builder.putShorts(data, from, to - from)(byteOrder) for (i <- to until data.length) builder.putShort(data(i))(byteOrder) - reference.toSeq == builder.result + reference.toSeq == builder.result() } def testIntEncoding(slice: ArraySlice[Int], byteOrder: ByteOrder): Boolean = { @@ -287,7 +287,7 @@ class ByteStringSpec extends AnyWordSpec with Matchers with Checkers { for (i <- 0 until from) builder.putInt(data(i))(byteOrder) builder.putInts(data, from, to - from)(byteOrder) for (i <- to until data.length) builder.putInt(data(i))(byteOrder) - reference.toSeq == builder.result + reference.toSeq == builder.result() } def testLongEncoding(slice: ArraySlice[Long], byteOrder: ByteOrder): Boolean = { @@ -299,7 +299,7 @@ class ByteStringSpec extends AnyWordSpec with Matchers with Checkers { for (i <- 0 until from) builder.putLong(data(i))(byteOrder) builder.putLongs(data, from, to - from)(byteOrder) for (i <- to until data.length) builder.putLong(data(i))(byteOrder) - reference.toSeq == builder.result + reference.toSeq == builder.result() } def testLongPartEncoding(anb: ArrayNumBytes[Long], byteOrder: ByteOrder): Boolean = { @@ -316,7 +316,7 @@ class ByteStringSpec extends AnyWordSpec with Matchers with Checkers { case (r, i) if byteOrder == ByteOrder.LITTLE_ENDIAN && i % elemSize < nBytes => r case (r, i) if byteOrder == ByteOrder.BIG_ENDIAN && i % elemSize >= (elemSize - nBytes) => r }) - .toSeq == builder.result + .toSeq == builder.result() } def testFloatEncoding(slice: ArraySlice[Float], byteOrder: ByteOrder): Boolean = { @@ -328,7 +328,7 @@ class ByteStringSpec extends AnyWordSpec with Matchers with Checkers { for (i <- 0 until from) builder.putFloat(data(i))(byteOrder) builder.putFloats(data, from, to - from)(byteOrder) for (i <- to until data.length) builder.putFloat(data(i))(byteOrder) - reference.toSeq == builder.result + reference.toSeq == builder.result() } def testDoubleEncoding(slice: ArraySlice[Double], byteOrder: ByteOrder): Boolean = { @@ -340,7 +340,7 @@ class ByteStringSpec extends AnyWordSpec with Matchers with Checkers { for (i <- 0 until from) builder.putDouble(data(i))(byteOrder) builder.putDoubles(data, from, to - from)(byteOrder) for (i <- to until data.length) builder.putDouble(data(i))(byteOrder) - reference.toSeq == builder.result + reference.toSeq == builder.result() } "ByteString1" must { @@ -1301,7 +1301,7 @@ class ByteStringSpec extends AnyWordSpec with Matchers with Checkers { for (i <- 0 until from) builder.putByte(data(i)) builder.putBytes(data, from, to - from) for (i <- to until data.length) builder.putByte(data(i)) - data.toSeq == builder.result + data.toSeq == builder.result() } } @@ -1313,7 +1313,7 @@ class ByteStringSpec extends AnyWordSpec with Matchers with Checkers { for (i <- 0 until from) builder.asOutputStream.write(data(i).toInt) builder.asOutputStream.write(data, from, to - from) for (i <- to until data.length) builder.asOutputStream.write(data(i).toInt) - data.toSeq == builder.result + data.toSeq == builder.result() } } } diff --git a/akka-actor-tests/src/test/scala/akka/util/IndexSpec.scala b/akka-actor-tests/src/test/scala/akka/util/IndexSpec.scala index cad784c348..32c5d44041 100644 --- a/akka-actor-tests/src/test/scala/akka/util/IndexSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/IndexSpec.scala @@ -132,7 +132,7 @@ class IndexSpec extends AkkaSpec with Matchers with DefaultTimeout { case 3 => readTask() } - val tasks = List.fill(nrOfTasks)(executeRandomTask) + val tasks = List.fill(nrOfTasks)(executeRandomTask()) tasks.foreach(Await.result(_, timeout.duration)) } diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ActorContextSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ActorContextSpec.scala index 221a6bb2fc..16e9f680a2 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ActorContextSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ActorContextSpec.scala @@ -520,7 +520,7 @@ abstract class ActorContextSpec extends ScalaTestWithActorTestKit with AnyWordSp "return the right context info" in { type Info = (ActorSystem[Nothing], ActorRef[String]) - val probe = TestProbe[Info] + val probe = TestProbe[Info]() val actor = spawn( Behaviors .receivePartial[String] { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/SupervisionSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/SupervisionSpec.scala index 07acae49ae..e0a9b9aa5b 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/SupervisionSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/SupervisionSpec.scala @@ -1274,7 +1274,7 @@ class SupervisionSpec extends ScalaTestWithActorTestKit(""" } "not allow AbstractBehavior without setup" in { - val contextProbe = createTestProbe[ActorContext[String]] + val contextProbe = createTestProbe[ActorContext[String]]() spawn(Behaviors.setup[String] { context => contextProbe.ref ! context Behaviors.empty @@ -1298,7 +1298,7 @@ class SupervisionSpec extends ScalaTestWithActorTestKit(""" } "detect AbstractBehavior with wrong ActorContext" in { - val contextProbe = createTestProbe[ActorContext[String]] + val contextProbe = createTestProbe[ActorContext[String]]() spawn(Behaviors.setup[String] { context => contextProbe.ref ! context Behaviors.empty diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/TypedSupervisingClassicSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/TypedSupervisingClassicSpec.scala index 335308b78c..8b086e2ead 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/TypedSupervisingClassicSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/TypedSupervisingClassicSpec.scala @@ -49,8 +49,8 @@ class TypedSupervisingClassicSpec extends ScalaTestWithActorTestKit(""" "Typed supervising classic" should { "default to restart" in { val ref: ActorRef[Protocol] = spawn(classicActorOf()) - val lifecycleProbe = TestProbe[String] - val probe = TestProbe[SpawnedClassicActor] + val lifecycleProbe = TestProbe[String]() + val probe = TestProbe[SpawnedClassicActor]() ref ! SpawnClassicActor(classic.Props(new CLassicActor(lifecycleProbe.ref)), probe.ref) val spawnedClassic = probe.expectMessageType[SpawnedClassicActor].ref lifecycleProbe.expectMessage("preStart") diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/eventstream/EventStreamSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/eventstream/EventStreamSpec.scala index 826c52cc4d..6cd723c3fa 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/eventstream/EventStreamSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/eventstream/EventStreamSpec.scala @@ -45,9 +45,9 @@ class EventStreamSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike wit } "a system event stream subscriber" must { - val rootEventListener = testKit.createTestProbe[Root] - val level1EventListener = testKit.createTestProbe[Level1] - val rootEventListenerForLevel1 = testKit.createTestProbe[Root] + val rootEventListener = testKit.createTestProbe[Root]() + val level1EventListener = testKit.createTestProbe[Level1]() + val rootEventListenerForLevel1 = testKit.createTestProbe[Root]() testKit.system.eventStream ! Subscribe(rootEventListener.ref) testKit.system.eventStream ! Subscribe(level1EventListener.ref) testKit.system.eventStream ! Subscribe[Level1](rootEventListenerForLevel1.ref) diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorSystemSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorSystemSpec.scala index ee90e38b75..3fee397c65 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorSystemSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorSystemSpec.scala @@ -133,7 +133,7 @@ class ActorSystemSpec "have a working thread factory" in { withSystem("thread", Behaviors.empty[String]) { sys => - val p = Promise[Int] + val p = Promise[Int]() sys.threadFactory .newThread(new Runnable { def run(): Unit = p.success(42) diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/RoutersSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/RoutersSpec.scala index 8c2ed4f247..cd5d344f50 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/RoutersSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/RoutersSpec.scala @@ -210,8 +210,8 @@ class RoutersSpec extends ScalaTestWithActorTestKit(""" val router = spawn(Behaviors.setup[String](context => new GroupRouterImpl(context, serviceKey, false, new RoutingLogics.RoundRobinLogic[String], true))) - val reachableProbe = createTestProbe[String] - val unreachableProbe = createTestProbe[String] + val reachableProbe = createTestProbe[String]() + val unreachableProbe = createTestProbe[String]() router .unsafeUpcast[Any] ! Receptionist.Listing(serviceKey, Set(reachableProbe.ref), Set(unreachableProbe.ref), false) router ! "one" @@ -225,7 +225,7 @@ class RoutersSpec extends ScalaTestWithActorTestKit(""" val router = spawn(Behaviors.setup[String](context => new GroupRouterImpl(context, serviceKey, false, new RoutingLogics.RoundRobinLogic[String], true))) - val unreachableProbe = createTestProbe[String] + val unreachableProbe = createTestProbe[String]() router.unsafeUpcast[Any] ! Receptionist.Listing( serviceKey, Set.empty[ActorRef[String]], diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StashSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StashSpec.scala index 684ec950db..14ed700f16 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StashSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StashSpec.scala @@ -660,7 +660,7 @@ class UnstashingSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with } "deal with initial stop" in { - val probe = TestProbe[Any] + val probe = TestProbe[Any]() val ref = spawn(Behaviors.withStash[String](10) { stash => stash.stash("one") @@ -675,7 +675,7 @@ class UnstashingSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with } "deal with stop" in { - val probe = TestProbe[Any] + val probe = TestProbe[Any]() val deadLetterProbe = createDeadLetterProbe() val ref = spawn(Behaviors.withStash[String](10) { stash => @@ -699,7 +699,7 @@ class UnstashingSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with } "work with initial same" in { - val probe = TestProbe[Any] + val probe = TestProbe[Any]() val ref = spawn(Behaviors.withStash[String](10) { stash => stash.stash("one") stash.stash("two") diff --git a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/Supervision.scala b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/Supervision.scala index 699e509667..6b0e8a2fb4 100644 --- a/akka-actor-typed/src/main/scala/akka/actor/typed/internal/Supervision.scala +++ b/akka-actor-typed/src/main/scala/akka/actor/typed/internal/Supervision.scala @@ -195,7 +195,7 @@ private class RestartSupervisor[T, Thr <: Throwable: ClassTag](initial: Behavior private def deadlineHasTimeLeft: Boolean = deadline match { case OptionVal.None => true - case OptionVal.Some(d) => d.hasTimeLeft + case OptionVal.Some(d) => d.hasTimeLeft() } override def aroundSignal(ctx: TypedActorContext[Any], signal: Signal, target: SignalTarget[T]): Behavior[T] = { diff --git a/akka-actor/src/main/scala-2.13/akka/util/ByteIterator.scala b/akka-actor/src/main/scala-2.13/akka/util/ByteIterator.scala index 4f15f7e147..073b0f9b77 100644 --- a/akka-actor/src/main/scala-2.13/akka/util/ByteIterator.scala +++ b/akka-actor/src/main/scala-2.13/akka/util/ByteIterator.scala @@ -168,7 +168,7 @@ object ByteIterator { if ((off < 0) || (len < 0) || (off + len > b.length)) throw new IndexOutOfBoundsException if (len == 0) 0 else if (!isEmpty) { - val nRead = math.min(available, len) + val nRead = math.min(available(), len) copyToArray(b, off, nRead) nRead } else -1 @@ -269,7 +269,7 @@ object ByteIterator { } iterators = iterators.tail } - iterators = builder.result + iterators = builder.result() normalize() } @@ -294,7 +294,7 @@ object ByteIterator { if (current.len < lastLen) stop = true dropCurrent() } - iterators = builder.result + iterators = builder.result() normalize() } diff --git a/akka-actor/src/main/scala-2.13/akka/util/ByteString.scala b/akka-actor/src/main/scala-2.13/akka/util/ByteString.scala index 450b57544c..4baeccc56e 100644 --- a/akka-actor/src/main/scala-2.13/akka/util/ByteString.scala +++ b/akka-actor/src/main/scala-2.13/akka/util/ByteString.scala @@ -1334,7 +1334,7 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] { if (_length == 0) ByteString.empty else { clearTemp() - val bytestrings = _builder.result + val bytestrings = _builder.result() if (bytestrings.size == 1) bytestrings.head else diff --git a/akka-actor/src/main/scala/akka/actor/ActorSystem.scala b/akka-actor/src/main/scala/akka/actor/ActorSystem.scala index 808b562dd1..b823c223fd 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorSystem.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorSystem.scala @@ -1017,7 +1017,7 @@ private[akka] class ActorSystemImpl( _initialized = true if (settings.LogDeadLetters > 0) - logDeadLetterListener = Some(systemActorOf(Props[DeadLetterListener], "deadLetterListener")) + logDeadLetterListener = Some(systemActorOf(Props[DeadLetterListener](), "deadLetterListener")) eventStream.startUnsubscriber() ManifestInfo(this).checkSameVersion("Akka", allModules, logWarning = true) if (!terminating) diff --git a/akka-actor/src/main/scala/akka/actor/CoordinatedShutdown.scala b/akka-actor/src/main/scala/akka/actor/CoordinatedShutdown.scala index e7f9731a58..95859704e3 100644 --- a/akka-actor/src/main/scala/akka/actor/CoordinatedShutdown.scala +++ b/akka-actor/src/main/scala/akka/actor/CoordinatedShutdown.scala @@ -710,7 +710,7 @@ final class CoordinatedShutdown private[akka] ( val deadline = Deadline.now + timeout val timeoutFut = try { after(timeout, system.scheduler) { - if (phaseName == CoordinatedShutdown.PhaseActorSystemTerminate && deadline.hasTimeLeft) { + if (phaseName == CoordinatedShutdown.PhaseActorSystemTerminate && deadline.hasTimeLeft()) { // too early, i.e. triggered by system termination result } else if (result.isCompleted) diff --git a/akka-actor/src/main/scala/akka/actor/FSM.scala b/akka-actor/src/main/scala/akka/actor/FSM.scala index e8842f1ca9..7dcdf38098 100644 --- a/akka-actor/src/main/scala/akka/actor/FSM.scala +++ b/akka-actor/src/main/scala/akka/actor/FSM.scala @@ -466,7 +466,7 @@ trait FSM[S, D] extends Actor with Listeners with ActorLogging { /** * Produce change descriptor to stop this FSM actor including specified reason. */ - final def stop(reason: Reason, stateData: D): State = stay.using(stateData).withStopReason(reason) + final def stop(reason: Reason, stateData: D): State = stay().using(stateData).withStopReason(reason) final class TransformHelper(func: StateFunction) { def using(andThen: PartialFunction[State, State]): StateFunction = @@ -559,7 +559,7 @@ trait FSM[S, D] extends Actor with Listeners with ActorLogging { if (timers contains name) { timers(name).cancel() } - val timer = Timer(name, msg, mode, timerGen.next, this)(context) + val timer = Timer(name, msg, mode, timerGen.next(), this)(context) timer.schedule(self, timeout) timers(name) = timer } @@ -728,7 +728,7 @@ trait FSM[S, D] extends Actor with Listeners with ActorLogging { private val handleEventDefault: StateFunction = { case Event(value, _) => log.warning("unhandled event " + value + " in state " + stateName) - stay + stay() } private var handleEvent: StateFunction = handleEventDefault @@ -821,7 +821,7 @@ trait FSM[S, D] extends Actor with Listeners with ActorLogging { private[akka] def makeTransition(nextState: State): Unit = { if (!stateFunctions.contains(nextState.stateName)) { - terminate(stay.withStopReason(Failure("Next state %s does not exist".format(nextState.stateName)))) + terminate(stay().withStopReason(Failure("Next state %s does not exist".format(nextState.stateName)))) } else { nextState.replies.reverse.foreach { r => sender() ! r @@ -862,7 +862,7 @@ trait FSM[S, D] extends Actor with Listeners with ActorLogging { * setting this instance’s state to terminated does no harm during restart * since the new instance will initialize fresh using startWith() */ - terminate(stay.withStopReason(Shutdown)) + terminate(stay().withStopReason(Shutdown)) super.postStop() } diff --git a/akka-actor/src/main/scala/akka/actor/Props.scala b/akka-actor/src/main/scala/akka/actor/Props.scala index a170bbcd33..6e007f88ce 100644 --- a/akka-actor/src/main/scala/akka/actor/Props.scala +++ b/akka-actor/src/main/scala/akka/actor/Props.scala @@ -39,7 +39,7 @@ object Props extends AbstractProps { /** * A Props instance whose creator will create an actor that doesn't respond to any message */ - final val empty = Props[EmptyActor] + final val empty = Props[EmptyActor]() /** * The default Props instance, uses the settings from the Props object starting with default*. diff --git a/akka-actor/src/main/scala/akka/actor/RepointableActorRef.scala b/akka-actor/src/main/scala/akka/actor/RepointableActorRef.scala index a4bdb6564a..30fab13023 100644 --- a/akka-actor/src/main/scala/akka/actor/RepointableActorRef.scala +++ b/akka-actor/src/main/scala/akka/actor/RepointableActorRef.scala @@ -149,7 +149,7 @@ private[akka] class RepointableActorRef( def getChild(name: Iterator[String]): InternalActorRef = if (name.hasNext) { - name.next match { + name.next() match { case ".." => getParent.getChild(name) case "" => getChild(name) case other => diff --git a/akka-actor/src/main/scala/akka/actor/TypedActor.scala b/akka-actor/src/main/scala/akka/actor/TypedActor.scala index e0dd151848..5b5ff89dac 100644 --- a/akka-actor/src/main/scala/akka/actor/TypedActor.scala +++ b/akka-actor/src/main/scala/akka/actor/TypedActor.scala @@ -48,7 +48,7 @@ trait TypedActorFactory { */ def stop(proxy: AnyRef): Boolean = getActorRefFor(proxy) match { case null => false - case ref => ref.asInstanceOf[InternalActorRef].stop; true + case ref => ref.asInstanceOf[InternalActorRef].stop(); true } /** @@ -77,7 +77,7 @@ trait TypedActorFactory { val proxyVar = new AtomVar[R] //Chicken'n'egg-resolver val c = props.creator //Cache this to avoid closing over the Props val i = props.interfaces //Cache this to avoid closing over the Props - val ap = Props(new TypedActor.TypedActor[R, T](proxyVar, c(), i)).withDeploy(props.actorProps.deploy) + val ap = Props(new TypedActor.TypedActor[R, T](proxyVar, c(), i)).withDeploy(props.actorProps().deploy) typedActor.createActorRefProxy(props, proxyVar, actorFactory.actorOf(ap)) } @@ -88,7 +88,7 @@ trait TypedActorFactory { val proxyVar = new AtomVar[R] //Chicken'n'egg-resolver val c = props.creator //Cache this to avoid closing over the Props val i = props.interfaces //Cache this to avoid closing over the Props - val ap = Props(new akka.actor.TypedActor.TypedActor[R, T](proxyVar, c(), i)).withDeploy(props.actorProps.deploy) + val ap = Props(new akka.actor.TypedActor.TypedActor[R, T](proxyVar, c(), i)).withDeploy(props.actorProps().deploy) typedActor.createActorRefProxy(props, proxyVar, actorFactory.actorOf(ap, name)) } @@ -272,7 +272,7 @@ object TypedActor extends ExtensionId[TypedActorExtension] with ExtensionIdProvi private val me = withContext[T](createInstance) override def supervisorStrategy: SupervisorStrategy = me match { - case l: Supervisor => l.supervisorStrategy + case l: Supervisor => l.supervisorStrategy() case _ => super.supervisorStrategy } diff --git a/akka-actor/src/main/scala/akka/actor/dungeon/Dispatch.scala b/akka-actor/src/main/scala/akka/actor/dungeon/Dispatch.scala index f6520576ab..4878d19964 100644 --- a/akka-actor/src/main/scala/akka/actor/dungeon/Dispatch.scala +++ b/akka-actor/src/main/scala/akka/actor/dungeon/Dispatch.scala @@ -73,7 +73,7 @@ private[akka] trait Dispatch { this: ActorCell => */ // we need to delay the failure to the point of actor creation so we can handle // it properly in the normal way - val actorClass = props.actorClass + val actorClass = props.actorClass() val createMessage = mailboxType match { case _: ProducesMessageQueue[_] if system.mailboxes.hasRequiredType(actorClass) => val req = system.mailboxes.getRequiredType(actorClass) diff --git a/akka-actor/src/main/scala/akka/dispatch/BalancingDispatcher.scala b/akka-actor/src/main/scala/akka/dispatch/BalancingDispatcher.scala index 2fb512d805..5f3e980997 100644 --- a/akka-actor/src/main/scala/akka/dispatch/BalancingDispatcher.scala +++ b/akka-actor/src/main/scala/akka/dispatch/BalancingDispatcher.scala @@ -103,7 +103,7 @@ private[akka] class BalancingDispatcher( if (messageQueue.hasMessages && i.hasNext && (executorService.executor match { - case lm: LoadMetrics => !lm.atFullThrottle + case lm: LoadMetrics => !lm.atFullThrottle() case _ => true }) && !registerForExecution(i.next.mailbox, false, false)) diff --git a/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala b/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala index 701ba4981e..9357c960ce 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala @@ -510,10 +510,10 @@ trait QueueBasedMessageQueue extends MessageQueue with MultipleConsumerSemantics def hasMessages = !queue.isEmpty def cleanUp(owner: ActorRef, deadLetters: MessageQueue): Unit = { if (hasMessages) { - var envelope = dequeue + var envelope = dequeue() while (envelope ne null) { deadLetters.enqueue(owner, envelope) - envelope = dequeue + envelope = dequeue() } } } diff --git a/akka-actor/src/main/scala/akka/dispatch/Mailboxes.scala b/akka-actor/src/main/scala/akka/dispatch/Mailboxes.scala index 67cc2812a0..8a56767b5f 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Mailboxes.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Mailboxes.scala @@ -139,7 +139,7 @@ private[akka] class Mailboxes( protected[akka] def getMailboxType(props: Props, dispatcherConfig: Config): MailboxType = { val id = dispatcherConfig.getString("id") val deploy = props.deploy - val actorClass = props.actorClass + val actorClass = props.actorClass() lazy val actorRequirement = getRequiredType(actorClass) val mailboxRequirement: Class[_] = getMailboxRequirement(dispatcherConfig) diff --git a/akka-actor/src/main/scala/akka/event/LoggerMailbox.scala b/akka-actor/src/main/scala/akka/event/LoggerMailbox.scala index ce14253e3b..3cd59721cb 100644 --- a/akka-actor/src/main/scala/akka/event/LoggerMailbox.scala +++ b/akka-actor/src/main/scala/akka/event/LoggerMailbox.scala @@ -39,7 +39,7 @@ private[akka] class LoggerMailbox(@unused owner: ActorRef, system: ActorSystem) override def cleanUp(owner: ActorRef, deadLetters: MessageQueue): Unit = { if (hasMessages) { val logLevel = system.eventStream.logLevel - var envelope = dequeue + var envelope = dequeue() // Drain all remaining messages to the StandardOutLogger. // cleanUp is called after switching out the mailbox, which is why // this kind of look works without a limit. @@ -54,7 +54,7 @@ private[akka] class LoggerMailbox(@unused owner: ActorRef, system: ActorSystem) case _ => // skip } - envelope = dequeue + envelope = dequeue() } } super.cleanUp(owner, deadLetters) diff --git a/akka-actor/src/main/scala/akka/event/japi/EventBusJavaAPI.scala b/akka-actor/src/main/scala/akka/event/japi/EventBusJavaAPI.scala index 1eed68f01b..d15d6f559a 100644 --- a/akka-actor/src/main/scala/akka/event/japi/EventBusJavaAPI.scala +++ b/akka-actor/src/main/scala/akka/event/japi/EventBusJavaAPI.scala @@ -50,7 +50,7 @@ abstract class LookupEventBus[E, S, C] extends EventBus[E, S, C] { type Subscriber = S type Classifier = C - override protected def mapSize: Int = LookupEventBus.this.mapSize + override protected def mapSize: Int = LookupEventBus.this.mapSize() override protected def compareSubscribers(a: S, b: S): Int = LookupEventBus.this.compareSubscribers(a, b) @@ -197,7 +197,7 @@ abstract class ManagedActorEventBus[E](system: ActorSystem) extends EventBus[E, override val system = ManagedActorEventBus.this.system - override protected def mapSize: Int = ManagedActorEventBus.this.mapSize + override protected def mapSize: Int = ManagedActorEventBus.this.mapSize() override protected def classify(event: E): ActorRef = ManagedActorEventBus.this.classify(event) diff --git a/akka-actor/src/main/scala/akka/io/SimpleDnsCache.scala b/akka-actor/src/main/scala/akka/io/SimpleDnsCache.scala index d474aab4b0..c982a125cf 100644 --- a/akka-actor/src/main/scala/akka/io/SimpleDnsCache.scala +++ b/akka-actor/src/main/scala/akka/io/SimpleDnsCache.scala @@ -30,7 +30,7 @@ class SimpleDnsCache extends Dns with PeriodicCacheCleanup with NoSerializationV new Cache[(String, RequestType), Resolved]( immutable.SortedSet()(expiryEntryOrdering()), immutable.Map(), - () => clock)) + () => clock())) private val nanoBase = System.nanoTime() diff --git a/akka-actor/src/main/scala/akka/pattern/CircuitBreaker.scala b/akka-actor/src/main/scala/akka/pattern/CircuitBreaker.scala index e19e5372a0..e500fdfbfd 100644 --- a/akka-actor/src/main/scala/akka/pattern/CircuitBreaker.scala +++ b/akka-actor/src/main/scala/akka/pattern/CircuitBreaker.scala @@ -769,12 +769,12 @@ class CircuitBreaker( materialize(body).onComplete { case Success(result) => p.trySuccess(result) - timeout.cancel + timeout.cancel() case Failure(ex) => if (p.tryFailure(ex)) { notifyCallFailureListeners(start) } - timeout.cancel + timeout.cancel() }(parasitic) p.future } diff --git a/akka-bench-jmh/src/main/scala/akka/actor/ActorCreationBenchmark.scala b/akka-bench-jmh/src/main/scala/akka/actor/ActorCreationBenchmark.scala index b9f898e2ba..8476a5fefd 100644 --- a/akka-bench-jmh/src/main/scala/akka/actor/ActorCreationBenchmark.scala +++ b/akka-bench-jmh/src/main/scala/akka/actor/ActorCreationBenchmark.scala @@ -26,7 +26,7 @@ hand checking: class ActorCreationBenchmark { implicit val system: ActorSystem = ActorSystem() - final val props = Props[MyActor] + final val props = Props[MyActor]() var i = 1 def name = { diff --git a/akka-bench-jmh/src/main/scala/akka/actor/BenchmarkActors.scala b/akka-bench-jmh/src/main/scala/akka/actor/BenchmarkActors.scala index 2003ebc804..33660e9ca1 100644 --- a/akka-bench-jmh/src/main/scala/akka/actor/BenchmarkActors.scala +++ b/akka-bench-jmh/src/main/scala/akka/actor/BenchmarkActors.scala @@ -48,7 +48,7 @@ object BenchmarkActors { } class EchoSender(messagesPerPair: Int, latch: CountDownLatch, batchSize: Int) extends Actor { - private val echo = context.actorOf(Props[Echo].withDispatcher(context.props.dispatcher), "echo") + private val echo = context.actorOf(Props[Echo]().withDispatcher(context.props.dispatcher), "echo") private var left = messagesPerPair / 2 private var batch = 0 diff --git a/akka-bench-jmh/src/main/scala/akka/actor/RouterPoolCreationBenchmark.scala b/akka-bench-jmh/src/main/scala/akka/actor/RouterPoolCreationBenchmark.scala index daf3cf9e9e..aef3d4505a 100644 --- a/akka-bench-jmh/src/main/scala/akka/actor/RouterPoolCreationBenchmark.scala +++ b/akka-bench-jmh/src/main/scala/akka/actor/RouterPoolCreationBenchmark.scala @@ -21,7 +21,7 @@ class RouterPoolCreationBenchmark { implicit val system: ActorSystem = ActorSystem() val probe = TestProbe() - Props[TestActors.EchoActor] + Props[TestActors.EchoActor]() @Param(Array("1000", "2000", "3000", "4000")) var size = 0 diff --git a/akka-bench-jmh/src/main/scala/akka/actor/StashCreationBenchmark.scala b/akka-bench-jmh/src/main/scala/akka/actor/StashCreationBenchmark.scala index bc4a8cbc79..d0a43c628b 100644 --- a/akka-bench-jmh/src/main/scala/akka/actor/StashCreationBenchmark.scala +++ b/akka-bench-jmh/src/main/scala/akka/actor/StashCreationBenchmark.scala @@ -18,7 +18,7 @@ object StashCreationBenchmark { } } - val props = Props[StashingActor] + val props = Props[StashingActor]() } @State(Scope.Benchmark) diff --git a/akka-bench-jmh/src/main/scala/akka/actor/TellOnlyBenchmark.scala b/akka-bench-jmh/src/main/scala/akka/actor/TellOnlyBenchmark.scala index 1aeb412e67..7fe52bcc47 100644 --- a/akka-bench-jmh/src/main/scala/akka/actor/TellOnlyBenchmark.scala +++ b/akka-bench-jmh/src/main/scala/akka/actor/TellOnlyBenchmark.scala @@ -61,7 +61,7 @@ class TellOnlyBenchmark { @Setup(Level.Iteration) def setupIteration(): Unit = { - actor = system.actorOf(Props[TellOnlyBenchmark.Echo].withDispatcher("dropping-dispatcher")) + actor = system.actorOf(Props[TellOnlyBenchmark.Echo]().withDispatcher("dropping-dispatcher")) probe = TestProbe() probe.watch(actor) probe.send(actor, message) diff --git a/akka-bench-jmh/src/main/scala/akka/persistence/LevelDbBatchingBenchmark.scala b/akka-bench-jmh/src/main/scala/akka/persistence/LevelDbBatchingBenchmark.scala index 598eb7c8c8..4f9eb634ca 100644 --- a/akka-bench-jmh/src/main/scala/akka/persistence/LevelDbBatchingBenchmark.scala +++ b/akka-bench-jmh/src/main/scala/akka/persistence/LevelDbBatchingBenchmark.scala @@ -52,7 +52,7 @@ class LevelDbBatchingBenchmark { SharedLeveldbJournal.setStore(store, sys) probe = TestProbe()(sys) - store = sys.actorOf(Props[SharedLeveldbStore], "store") + store = sys.actorOf(Props[SharedLeveldbStore](), "store") } @TearDown(Level.Trial) diff --git a/akka-bench-jmh/src/main/scala/akka/persistence/PersistentActorWithAtLeastOnceDeliveryBenchmark.scala b/akka-bench-jmh/src/main/scala/akka/persistence/PersistentActorWithAtLeastOnceDeliveryBenchmark.scala index c621464f6c..b63a8b8c7b 100644 --- a/akka-bench-jmh/src/main/scala/akka/persistence/PersistentActorWithAtLeastOnceDeliveryBenchmark.scala +++ b/akka-bench-jmh/src/main/scala/akka/persistence/PersistentActorWithAtLeastOnceDeliveryBenchmark.scala @@ -45,7 +45,7 @@ class PersistentActorWithAtLeastOnceDeliveryBenchmark { storageLocations.foreach(FileUtils.deleteDirectory) - destinationActor = system.actorOf(Props[DestinationActor], "destination") + destinationActor = system.actorOf(Props[DestinationActor](), "destination") noPersistPersistentActorWithAtLeastOnceDelivery = system.actorOf( Props(classOf[NoPersistPersistentActorWithAtLeastOnceDelivery], dataCount, probe.ref, destinationActor.path), diff --git a/akka-cluster-metrics/src/main/scala/akka/cluster/metrics/MetricsCollector.scala b/akka-cluster-metrics/src/main/scala/akka/cluster/metrics/MetricsCollector.scala index 06aad30061..4be9a24b34 100644 --- a/akka-cluster-metrics/src/main/scala/akka/cluster/metrics/MetricsCollector.scala +++ b/akka-cluster-metrics/src/main/scala/akka/cluster/metrics/MetricsCollector.scala @@ -108,7 +108,7 @@ class JmxMetricsCollector(address: Address, decayFactor: Double) extends Metrics * Samples and collects new data points. * Creates a new instance each time. */ - def sample(): NodeMetrics = NodeMetrics(address, newTimestamp, metrics) + def sample(): NodeMetrics = NodeMetrics(address, newTimestamp, metrics()) /** * Generate metrics set. @@ -209,7 +209,7 @@ class SigarMetricsCollector(address: Address, decayFactor: Double, sigar: SigarP override def metrics(): Set[Metric] = { // Must obtain cpuPerc in one shot. See https://github.com/akka/akka/issues/16121 val cpuPerc = sigar.getCpuPerc - super.metrics.union(Set(cpuCombined(cpuPerc), cpuStolen(cpuPerc)).flatten) + super.metrics().union(Set(cpuCombined(cpuPerc), cpuStolen(cpuPerc)).flatten) } /** diff --git a/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/ClusterMetricsExtensionSpec.scala b/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/ClusterMetricsExtensionSpec.scala index 5c88b5d23a..62387dedf2 100644 --- a/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/ClusterMetricsExtensionSpec.scala +++ b/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/ClusterMetricsExtensionSpec.scala @@ -111,7 +111,7 @@ abstract class ClusterMetricsEnabledSpec //awaitAssert(clusterView.clusterMetrics.size should ===(roles.size)) awaitAssert(metricsView.clusterMetrics.size should ===(roles.size)) val collector = MetricsCollector(cluster.system) - collector.sample.metrics.size should be > (3) + collector.sample().metrics.size should be > (3) enterBarrier("after") } "reflect the correct number of node metrics in cluster view" in within(30 seconds) { @@ -150,7 +150,7 @@ abstract class ClusterMetricsDisabledSpec //clusterView.clusterMetrics.size should ===(0) metricsView.clusterMetrics.size should ===(0) ClusterMetricsExtension(system).subscribe(testActor) - expectNoMessage + expectNoMessage() // TODO ensure same contract //clusterView.clusterMetrics.size should ===(0) metricsView.clusterMetrics.size should ===(0) diff --git a/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/ClusterMetricsRoutingSpec.scala b/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/ClusterMetricsRoutingSpec.scala index ee8615312e..ec63882192 100644 --- a/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/ClusterMetricsRoutingSpec.scala +++ b/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/ClusterMetricsRoutingSpec.scala @@ -150,7 +150,7 @@ abstract class AdaptiveLoadBalancingRouterSpec ClusterRouterPool( local = AdaptiveLoadBalancingPool(HeapMetricsSelector), settings = ClusterRouterPoolSettings(totalInstances = 10, maxInstancesPerNode = 1, allowLocalRoutees = true)) - .props(Props[Echo]), + .props(Props[Echo]()), name) // it may take some time until router receives cluster member events awaitAssert { currentRoutees(router).size should ===(roles.size) } @@ -201,7 +201,7 @@ abstract class AdaptiveLoadBalancingRouterSpec runOn(node2) { within(20.seconds) { - system.actorOf(Props[Memory], "memory") ! AllocateMemory + system.actorOf(Props[Memory](), "memory") ! AllocateMemory expectMsg("done") } } @@ -230,7 +230,7 @@ abstract class AdaptiveLoadBalancingRouterSpec "create routees from configuration" taggedAs LongRunningTest in { runOn(node1) { - val router3 = system.actorOf(FromConfig.props(Props[Memory]), "router3") + val router3 = system.actorOf(FromConfig.props(Props[Memory]()), "router3") // it may take some time until router receives cluster member events awaitAssert { currentRoutees(router3).size should ===(9) } val routees = currentRoutees(router3) @@ -241,7 +241,7 @@ abstract class AdaptiveLoadBalancingRouterSpec "create routees from cluster.enabled configuration" taggedAs LongRunningTest in { runOn(node1) { - val router4 = system.actorOf(FromConfig.props(Props[Memory]), "router4") + val router4 = system.actorOf(FromConfig.props(Props[Memory]()), "router4") // it may take some time until router receives cluster member events awaitAssert { currentRoutees(router4).size should ===(6) } val routees = currentRoutees(router4) diff --git a/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/sample/StatsSampleSpec.scala b/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/sample/StatsSampleSpec.scala index cb8dda8266..6cb8ce15d7 100644 --- a/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/sample/StatsSampleSpec.scala +++ b/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/sample/StatsSampleSpec.scala @@ -107,8 +107,8 @@ abstract class StatsSampleSpec Cluster(system).join(firstAddress) //#join - system.actorOf(Props[StatsWorker], "statsWorker") - system.actorOf(Props[StatsService], "statsService") + system.actorOf(Props[StatsWorker](), "statsWorker") + system.actorOf(Props[StatsService](), "statsService") receiveN(3).collect { case MemberUp(m) => m.address }.toSet should be( Set(firstAddress, secondAddress, thirdAddress)) diff --git a/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/sample/StatsService.scala b/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/sample/StatsService.scala index f950194c02..2ae9a247e1 100644 --- a/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/sample/StatsService.scala +++ b/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/sample/StatsService.scala @@ -15,7 +15,7 @@ class StatsService extends Actor { // This router is used both with lookup and deploy of routees. If you // have a router with only lookup of routees you can use Props.empty // instead of Props[StatsWorker.class]. - val workerRouter = context.actorOf(FromConfig.props(Props[StatsWorker]), name = "workerRouter") + val workerRouter = context.actorOf(FromConfig.props(Props[StatsWorker]()), name = "workerRouter") def receive = { case StatsJob(text) if text != "" => @@ -76,7 +76,7 @@ abstract class StatsService3 extends Actor { ClusterRouterPool( ConsistentHashingPool(0), ClusterRouterPoolSettings(totalInstances = 100, maxInstancesPerNode = 3, allowLocalRoutees = false)) - .props(Props[StatsWorker]), + .props(Props[StatsWorker]()), name = "workerRouter3") //#router-deploy-in-code } diff --git a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/EWMASpec.scala b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/EWMASpec.scala index 8f6c743e04..0a45c10d86 100644 --- a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/EWMASpec.scala +++ b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/EWMASpec.scala @@ -82,7 +82,7 @@ class EWMASpec extends AkkaSpec(MetricsConfig.defaultEnabled) with MetricsCollec // wait a while between each message to give the metrics a chance to change Thread.sleep(100) usedMemory = usedMemory ++ Array.fill(1024)(ThreadLocalRandom.current.nextInt(127).toByte) - val changes = collector.sample.metrics.flatMap { latest => + val changes = collector.sample().metrics.flatMap { latest => streamingDataSet.get(latest.name) match { case None => Some(latest) case Some(previous) => diff --git a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricSpec.scala b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricSpec.scala index a11883a092..994a8f7fa4 100644 --- a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricSpec.scala +++ b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricSpec.scala @@ -146,13 +146,13 @@ class MetricsGossipSpec */ def newSample(previousSample: Set[Metric]): Set[Metric] = { // Metric.equals is based on name equality - collector.sample.metrics.filter(previousSample.contains) ++ previousSample + collector.sample().metrics.filter(previousSample.contains) ++ previousSample } "A MetricsGossip" must { "add new NodeMetrics" in { - val m1 = NodeMetrics(Address("akka", "sys", "a", 2554), newTimestamp, collector.sample.metrics) - val m2 = NodeMetrics(Address("akka", "sys", "a", 2555), newTimestamp, collector.sample.metrics) + val m1 = NodeMetrics(Address("akka", "sys", "a", 2554), newTimestamp, collector.sample().metrics) + val m2 = NodeMetrics(Address("akka", "sys", "a", 2555), newTimestamp, collector.sample().metrics) m1.metrics.size should be > 3 m2.metrics.size should be > 3 @@ -168,8 +168,8 @@ class MetricsGossipSpec } "merge peer metrics" in { - val m1 = NodeMetrics(Address("akka", "sys", "a", 2554), newTimestamp, collector.sample.metrics) - val m2 = NodeMetrics(Address("akka", "sys", "a", 2555), newTimestamp, collector.sample.metrics) + val m1 = NodeMetrics(Address("akka", "sys", "a", 2554), newTimestamp, collector.sample().metrics) + val m2 = NodeMetrics(Address("akka", "sys", "a", 2555), newTimestamp, collector.sample().metrics) val g1 = MetricsGossip.empty :+ m1 :+ m2 g1.nodes.size should ===(2) @@ -183,9 +183,9 @@ class MetricsGossipSpec } "merge an existing metric set for a node and update node ring" in { - val m1 = NodeMetrics(Address("akka", "sys", "a", 2554), newTimestamp, collector.sample.metrics) - val m2 = NodeMetrics(Address("akka", "sys", "a", 2555), newTimestamp, collector.sample.metrics) - val m3 = NodeMetrics(Address("akka", "sys", "a", 2556), newTimestamp, collector.sample.metrics) + val m1 = NodeMetrics(Address("akka", "sys", "a", 2554), newTimestamp, collector.sample().metrics) + val m2 = NodeMetrics(Address("akka", "sys", "a", 2555), newTimestamp, collector.sample().metrics) + val m3 = NodeMetrics(Address("akka", "sys", "a", 2556), newTimestamp, collector.sample().metrics) val m2Updated = m2.copy(metrics = newSample(m2.metrics), timestamp = m2.timestamp + 1000) val g1 = MetricsGossip.empty :+ m1 :+ m2 @@ -204,14 +204,14 @@ class MetricsGossipSpec } "get the current NodeMetrics if it exists in the local nodes" in { - val m1 = NodeMetrics(Address("akka", "sys", "a", 2554), newTimestamp, collector.sample.metrics) + val m1 = NodeMetrics(Address("akka", "sys", "a", 2554), newTimestamp, collector.sample().metrics) val g1 = MetricsGossip.empty :+ m1 g1.nodeMetricsFor(m1.address).map(_.metrics) should ===(Some(m1.metrics)) } "remove a node if it is no longer Up" in { - val m1 = NodeMetrics(Address("akka", "sys", "a", 2554), newTimestamp, collector.sample.metrics) - val m2 = NodeMetrics(Address("akka", "sys", "a", 2555), newTimestamp, collector.sample.metrics) + val m1 = NodeMetrics(Address("akka", "sys", "a", 2554), newTimestamp, collector.sample().metrics) + val m2 = NodeMetrics(Address("akka", "sys", "a", 2555), newTimestamp, collector.sample().metrics) val g1 = MetricsGossip.empty :+ m1 :+ m2 g1.nodes.size should ===(2) @@ -223,8 +223,8 @@ class MetricsGossipSpec } "filter nodes" in { - val m1 = NodeMetrics(Address("akka", "sys", "a", 2554), newTimestamp, collector.sample.metrics) - val m2 = NodeMetrics(Address("akka", "sys", "a", 2555), newTimestamp, collector.sample.metrics) + val m1 = NodeMetrics(Address("akka", "sys", "a", 2554), newTimestamp, collector.sample().metrics) + val m2 = NodeMetrics(Address("akka", "sys", "a", 2555), newTimestamp, collector.sample().metrics) val g1 = MetricsGossip.empty :+ m1 :+ m2 g1.nodes.size should ===(2) @@ -243,16 +243,20 @@ class MetricValuesSpec extends AkkaSpec(MetricsConfig.defaultEnabled) with Metri val collector = createMetricsCollector - val node1 = NodeMetrics(Address("akka", "sys", "a", 2554), 1, collector.sample.metrics) - val node2 = NodeMetrics(Address("akka", "sys", "a", 2555), 1, collector.sample.metrics) + val node1 = NodeMetrics(Address("akka", "sys", "a", 2554), 1, collector.sample().metrics) + val node2 = NodeMetrics(Address("akka", "sys", "a", 2555), 1, collector.sample().metrics) val nodes: Seq[NodeMetrics] = { (1 to 100).foldLeft(List(node1, node2)) { (nodes, _) => nodes.map { n => - n.copy(metrics = collector.sample.metrics.flatMap(latest => - n.metrics.collect { - case streaming if latest.sameAs(streaming) => streaming :+ latest - })) + n.copy( + metrics = collector + .sample() + .metrics + .flatMap(latest => + n.metrics.collect { + case streaming if latest.sameAs(streaming) => streaming :+ latest + })) } } } diff --git a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricsCollectorSpec.scala b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricsCollectorSpec.scala index 161a103188..5a47b42408 100644 --- a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricsCollectorSpec.scala +++ b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricsCollectorSpec.scala @@ -23,8 +23,8 @@ class MetricsCollectorSpec "merge 2 metrics that are tracking the same metric" in { for (_ <- 1 to 20) { - val sample1 = collector.sample.metrics - val sample2 = collector.sample.metrics + val sample1 = collector.sample().metrics + val sample2 = collector.sample().metrics sample2.flatMap(latest => sample1.collect { case peer if latest.sameAs(peer) => @@ -34,8 +34,8 @@ class MetricsCollectorSpec m }) - val sample3 = collector.sample.metrics - val sample4 = collector.sample.metrics + val sample3 = collector.sample().metrics + val sample4 = collector.sample().metrics sample4.flatMap(latest => sample3.collect { case peer if latest.sameAs(peer) => @@ -55,7 +55,7 @@ class MetricsCollectorSpec } "collect accurate metrics for a node" in { - val sample = collector.sample + val sample = collector.sample() val metrics = sample.metrics.collect { case m => (m.name, m.value) } val used = metrics.collectFirst { case (HeapMemoryUsed, b) => b } val committed = metrics.collectFirst { case (HeapMemoryCommitted, b) => b } @@ -93,7 +93,7 @@ class MetricsCollectorSpec "collect 50 node metrics samples in an acceptable duration" taggedAs LongRunningTest in within(10 seconds) { (1 to 50).foreach { _ => - val sample = collector.sample + val sample = collector.sample() sample.metrics.size should be >= 3 Thread.sleep(100) } diff --git a/akka-cluster-sharding-typed/src/multi-jvm/scala/akka/cluster/sharding/typed/MultiDcClusterShardingSpec.scala b/akka-cluster-sharding-typed/src/multi-jvm/scala/akka/cluster/sharding/typed/MultiDcClusterShardingSpec.scala index b36b0b4166..cd0f344888 100644 --- a/akka-cluster-sharding-typed/src/multi-jvm/scala/akka/cluster/sharding/typed/MultiDcClusterShardingSpec.scala +++ b/akka-cluster-sharding-typed/src/multi-jvm/scala/akka/cluster/sharding/typed/MultiDcClusterShardingSpec.scala @@ -67,14 +67,14 @@ abstract class MultiDcClusterShardingSpec "init sharding" in { val sharding = ClusterSharding(typedSystem) val shardRegion: ActorRef[ShardingEnvelope[Command]] = sharding.init(Entity(typeKey)(_ => MultiDcPinger())) - val probe = TestProbe[Pong] + val probe = TestProbe[Pong]() shardRegion ! ShardingEnvelope(entityId, Ping(probe.ref)) probe.expectMessage(max = 15.seconds, Pong(cluster.selfMember.dataCenter)) enterBarrier("sharding-initialized") } "be able to message via entity ref" in { - val probe = TestProbe[Pong] + val probe = TestProbe[Pong]() val entityRef = ClusterSharding(typedSystem).entityRefFor(typeKey, entityId) entityRef ! Ping(probe.ref) probe.expectMessage(Pong(cluster.selfMember.dataCenter)) @@ -94,7 +94,7 @@ abstract class MultiDcClusterShardingSpec runOn(first, second) { val proxy: ActorRef[ShardingEnvelope[Command]] = ClusterSharding(typedSystem).init( Entity(typeKey)(_ => MultiDcPinger()).withSettings(ClusterShardingSettings(typedSystem).withDataCenter("dc2"))) - val probe = TestProbe[Pong] + val probe = TestProbe[Pong]() proxy ! ShardingEnvelope(entityId, Ping(probe.ref)) probe.expectMessage(remainingOrDefault, Pong("dc2")) } @@ -108,7 +108,7 @@ abstract class MultiDcClusterShardingSpec val proxy: ActorRef[ShardingEnvelope[Command]] = ClusterSharding(system).init(Entity(typeKey)(_ => MultiDcPinger()).withDataCenter("dc2")) //#proxy-dc - val probe = TestProbe[Pong] + val probe = TestProbe[Pong]() proxy ! ShardingEnvelope(entityId, Ping(probe.ref)) probe.expectMessage(remainingOrDefault, Pong("dc2")) } @@ -125,7 +125,7 @@ abstract class MultiDcClusterShardingSpec val entityRef = ClusterSharding(system).entityRefFor(typeKey, entityId, "dc2") //#proxy-dc-entityref - val probe = TestProbe[Pong] + val probe = TestProbe[Pong]() entityRef ! Ping(probe.ref) probe.expectMessage(remainingOrDefault, Pong("dc2")) } diff --git a/akka-cluster-sharding/src/main/scala/akka/cluster/sharding/ClusterSharding.scala b/akka-cluster-sharding/src/main/scala/akka/cluster/sharding/ClusterSharding.scala index b5ad320ea1..abf39643c3 100755 --- a/akka-cluster-sharding/src/main/scala/akka/cluster/sharding/ClusterSharding.scala +++ b/akka-cluster-sharding/src/main/scala/akka/cluster/sharding/ClusterSharding.scala @@ -181,7 +181,7 @@ class ClusterSharding(system: ExtendedActorSystem) extends Extension { val guardianName: String = system.settings.config.getString("akka.cluster.sharding.guardian-name") val dispatcher = system.settings.config.getString("akka.cluster.sharding.use-dispatcher") - system.systemActorOf(Props[ClusterShardingGuardian].withDispatcher(dispatcher), guardianName) + system.systemActorOf(Props[ClusterShardingGuardian]().withDispatcher(dispatcher), guardianName) } /** diff --git a/akka-cluster-sharding/src/main/scala/akka/cluster/sharding/RemoveInternalClusterShardingData.scala b/akka-cluster-sharding/src/main/scala/akka/cluster/sharding/RemoveInternalClusterShardingData.scala index c0946dee45..0525381989 100644 --- a/akka-cluster-sharding/src/main/scala/akka/cluster/sharding/RemoveInternalClusterShardingData.scala +++ b/akka-cluster-sharding/src/main/scala/akka/cluster/sharding/RemoveInternalClusterShardingData.scala @@ -91,7 +91,7 @@ object RemoveInternalClusterShardingData { if (journalPluginId == "") system.settings.config.getString("akka.persistence.journal.plugin") else journalPluginId if (resolvedJournalPluginId == "akka.persistence.journal.leveldb-shared") { - val store = system.actorOf(Props[SharedLeveldbStore], "store") + val store = system.actorOf(Props[SharedLeveldbStore](), "store") SharedLeveldbJournal.setStore(store, system) } diff --git a/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingCustomShardAllocationSpec.scala b/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingCustomShardAllocationSpec.scala index 12693ffb96..e95db6040a 100644 --- a/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingCustomShardAllocationSpec.scala +++ b/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingCustomShardAllocationSpec.scala @@ -113,7 +113,7 @@ abstract class ClusterShardingCustomShardAllocationSpec(multiNodeConfig: Cluster lazy val region = ClusterSharding(system).shardRegion("Entity") - lazy val allocator = system.actorOf(Props[Allocator], "allocator") + lazy val allocator = system.actorOf(Props[Allocator](), "allocator") s"Cluster sharding ($mode) with custom allocation strategy" must { diff --git a/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingFailureSpec.scala b/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingFailureSpec.scala index eb4753e34e..b3819a827f 100644 --- a/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingFailureSpec.scala +++ b/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingFailureSpec.scala @@ -95,7 +95,7 @@ abstract class ClusterShardingFailureSpec(multiNodeConfig: ClusterShardingFailur startSharding( system, typeName = "Entity", - entityProps = Props[Entity], + entityProps = Props[Entity](), extractEntityId = extractEntityId, extractShardId = extractShardId)) } diff --git a/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingGracefulShutdownSpec.scala b/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingGracefulShutdownSpec.scala index 1a67f3e187..988b114882 100644 --- a/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingGracefulShutdownSpec.scala +++ b/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingGracefulShutdownSpec.scala @@ -56,7 +56,7 @@ abstract class ClusterShardingGracefulShutdownSpec(multiNodeConfig: ClusterShard startSharding( system, typeName, - entityProps = Props[ShardedEntity], + entityProps = Props[ShardedEntity](), extractEntityId = MultiNodeClusterShardingSpec.intExtractEntityId, extractShardId = MultiNodeClusterShardingSpec.intExtractShardId, allocationStrategy = diff --git a/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingLeavingSpec.scala b/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingLeavingSpec.scala index 44c99e421a..9b97851b4f 100644 --- a/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingLeavingSpec.scala +++ b/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingLeavingSpec.scala @@ -91,7 +91,7 @@ abstract class ClusterShardingLeavingSpec(multiNodeConfig: ClusterShardingLeavin startSharding( system, typeName = "Entity", - entityProps = Props[Entity], + entityProps = Props[Entity](), extractEntityId = extractEntityId, extractShardId = extractShardId) } @@ -120,7 +120,7 @@ abstract class ClusterShardingLeavingSpec(multiNodeConfig: ClusterShardingLeavin "initialize shards" in { runOn(first) { - val shardLocations = system.actorOf(Props[ShardLocations], "shardLocations") + val shardLocations = system.actorOf(Props[ShardLocations](), "shardLocations") val locations = (for (n <- 1 to 10) yield { val id = n.toString region ! Ping(id) diff --git a/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingRegistrationCoordinatedShutdownSpec.scala b/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingRegistrationCoordinatedShutdownSpec.scala index 8326ed0326..779b93366d 100644 --- a/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingRegistrationCoordinatedShutdownSpec.scala +++ b/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingRegistrationCoordinatedShutdownSpec.scala @@ -66,7 +66,7 @@ abstract class ClusterShardingRegistrationCoordinatedShutdownSpec startSharding( system, typeName = "Entity", - entityProps = Props[ShardedEntity], + entityProps = Props[ShardedEntity](), extractEntityId = MultiNodeClusterShardingSpec.intExtractEntityId, extractShardId = MultiNodeClusterShardingSpec.intExtractShardId) diff --git a/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingSingleShardPerEntitySpec.scala b/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingSingleShardPerEntitySpec.scala index 8ee217a0ab..8c7deaa751 100644 --- a/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingSingleShardPerEntitySpec.scala +++ b/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingSingleShardPerEntitySpec.scala @@ -45,7 +45,7 @@ abstract class ClusterShardingSingleShardPerEntitySpec startSharding( system, typeName = "Entity", - entityProps = Props[ShardedEntity], + entityProps = Props[ShardedEntity](), extractEntityId = MultiNodeClusterShardingSpec.intExtractEntityId, extractShardId = MultiNodeClusterShardingSpec.intExtractShardId)) } diff --git a/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingSpec.scala b/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingSpec.scala index b21d1c4f9e..679a95b97a 100644 --- a/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingSpec.scala +++ b/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingSpec.scala @@ -90,7 +90,7 @@ object ClusterShardingSpec { //#supervisor class CounterSupervisor extends Actor { - val counter = context.actorOf(Props[Counter], "theCounter") + val counter = context.actorOf(Props[Counter](), "theCounter") override val supervisorStrategy = OneForOneStrategy() { case _: IllegalArgumentException => SupervisorStrategy.Resume @@ -348,7 +348,7 @@ abstract class ClusterShardingSpec(multiNodeConfig: ClusterShardingSpecConfig) // start the Persistence extension Persistence(system) runOn(controller) { - system.actorOf(Props[SharedLeveldbStore], "store") + system.actorOf(Props[SharedLeveldbStore](), "store") } enterBarrier("peristence-started") @@ -619,7 +619,7 @@ abstract class ClusterShardingSpec(multiNodeConfig: ClusterShardingSpecConfig) //#counter-start val counterRegion: ActorRef = ClusterSharding(system).start( typeName = "Counter", - entityProps = Props[Counter], + entityProps = Props[Counter](), settings = ClusterShardingSettings(system), extractEntityId = extractEntityId, extractShardId = extractShardId) @@ -628,7 +628,7 @@ abstract class ClusterShardingSpec(multiNodeConfig: ClusterShardingSpecConfig) ClusterSharding(system).start( typeName = "AnotherCounter", - entityProps = Props[AnotherCounter], + entityProps = Props[AnotherCounter](), settings = ClusterShardingSettings(system), extractEntityId = extractEntityId, extractShardId = extractShardId) @@ -636,7 +636,7 @@ abstract class ClusterShardingSpec(multiNodeConfig: ClusterShardingSpecConfig) //#counter-supervisor-start ClusterSharding(system).start( typeName = "SupervisedCounter", - entityProps = Props[CounterSupervisor], + entityProps = Props[CounterSupervisor](), settings = ClusterShardingSettings(system), extractEntityId = extractEntityId, extractShardId = extractShardId) @@ -678,7 +678,7 @@ abstract class ClusterShardingSpec(multiNodeConfig: ClusterShardingSpecConfig) runOn(first) { val counterRegionViaStart: ActorRef = ClusterSharding(system).start( typeName = "ApiTest", - entityProps = Props[Counter], + entityProps = Props[Counter](), settings = ClusterShardingSettings(system), extractEntityId = extractEntityId, extractShardId = extractShardId) diff --git a/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ExternalShardAllocationSpec.scala b/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ExternalShardAllocationSpec.scala index e0164e50c2..0a2fca01b2 100644 --- a/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ExternalShardAllocationSpec.scala +++ b/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ExternalShardAllocationSpec.scala @@ -86,7 +86,7 @@ abstract class ExternalShardAllocationSpec lazy val shardRegion = startSharding( system, typeName = typeName, - entityProps = Props[GiveMeYourHome], + entityProps = Props[GiveMeYourHome](), extractEntityId = extractEntityId, extractShardId = extractShardId, allocationStrategy = new ExternalShardAllocationStrategy(system, typeName)) diff --git a/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/MultiNodeClusterShardingSpec.scala b/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/MultiNodeClusterShardingSpec.scala index b8559b4668..a3e6fe2f1a 100644 --- a/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/MultiNodeClusterShardingSpec.scala +++ b/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/MultiNodeClusterShardingSpec.scala @@ -204,7 +204,7 @@ abstract class MultiNodeClusterShardingSpec(val config: MultiNodeClusterSharding Persistence(system) runOn(startOn) { - system.actorOf(Props[SharedLeveldbStore], "store") + system.actorOf(Props[SharedLeveldbStore](), "store") } enterBarrier("persistence-started") diff --git a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ClusterShardingLeaseSpec.scala b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ClusterShardingLeaseSpec.scala index 97bc907eda..f2f3a1a30d 100644 --- a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ClusterShardingLeaseSpec.scala +++ b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ClusterShardingLeaseSpec.scala @@ -76,7 +76,7 @@ class ClusterShardingLeaseSpec(config: Config, rememberEntities: Boolean) } ClusterSharding(system).start( typeName = typeName, - entityProps = Props[EchoActor], + entityProps = Props[EchoActor](), settings = ClusterShardingSettings(system).withRememberEntities(rememberEntities), extractEntityId = extractEntityId, extractShardId = extractShardId) diff --git a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ShardRegionSpec.scala b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ShardRegionSpec.scala index 0c003eae72..89640e3bc5 100644 --- a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ShardRegionSpec.scala +++ b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/ShardRegionSpec.scala @@ -92,7 +92,7 @@ class ShardRegionSpec extends AkkaSpec(ShardRegionSpec.config) { def startShard(sys: ActorSystem): ActorRef = ClusterSharding(sys).start( shardTypeName, - Props[EntityActor], + Props[EntityActor](), ClusterShardingSettings(system).withRememberEntities(true), extractEntityId, extractShardId) diff --git a/akka-cluster-tools/src/main/scala/akka/cluster/singleton/ClusterSingletonManager.scala b/akka-cluster-tools/src/main/scala/akka/cluster/singleton/ClusterSingletonManager.scala index 68499c3d0f..bf29e56e01 100644 --- a/akka-cluster-tools/src/main/scala/akka/cluster/singleton/ClusterSingletonManager.scala +++ b/akka-cluster-tools/src/main/scala/akka/cluster/singleton/ClusterSingletonManager.scala @@ -535,7 +535,7 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se removed += node -> (Deadline.now + 15.minutes) def cleanupOverdueNotMemberAnyMore(): Unit = { - removed = removed.filter { case (_, deadline) => deadline.hasTimeLeft } + removed = removed.filter { case (_, deadline) => deadline.hasTimeLeft() } } // for CoordinatedShutdown @@ -613,7 +613,7 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se oldestChangedBuffer = context.actorOf(Props(classOf[OldestChangedBuffer], role).withDispatcher(context.props.dispatcher)) getNextOldestChanged() - stay + stay() case Event(InitialOldestState(oldest, safeToBeOldest), _) => oldestChangedReceived = true @@ -648,7 +648,7 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se case Some(oldest) if !previousOldest.contains(oldest) => oldest :: previousOldest case _ => previousOldest } - stay.using(YoungerData(newPreviousOldest)) + stay().using(YoungerData(newPreviousOldest)) } case Event(MemberDowned(m), _) if m.uniqueAddress == cluster.selfUniqueAddress => @@ -661,14 +661,14 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se case Event(MemberRemoved(m, _), _) => scheduleDelayedMemberRemoved(m) - stay + stay() case Event(DelayedMemberRemoved(m), YoungerData(previousOldest)) => if (!selfExited) logInfo("Member removed [{}]", m.address) addRemoved(m.uniqueAddress) // transition when OldestChanged - stay.using(YoungerData(previousOldest.filterNot(_ == m.uniqueAddress))) + stay().using(YoungerData(previousOldest.filterNot(_ == m.uniqueAddress))) case Event(HandOverToMe, _) => val selfStatus = cluster.selfMember.status @@ -680,7 +680,7 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se sender() ! HandOverDone } - stay + stay() } when(BecomingOldest) { @@ -689,7 +689,7 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se // confirmation that the hand-over process has started logInfo("Hand-over in progress at [{}]", sender().path.address) cancelTimer(HandOverRetryTimer) - stay + stay() case Event(HandOverDone, BecomingOldestData(previousOldest)) => previousOldest.headOption match { @@ -701,11 +701,11 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se "Ignoring HandOverDone in BecomingOldest from [{}]. Expected previous oldest [{}]", sender().path.address, oldest.address) - stay + stay() } case None => logInfo("Ignoring HandOverDone in BecomingOldest from [{}].", sender().path.address) - stay + stay() } case Event(MemberDowned(m), _) if m.uniqueAddress == cluster.selfUniqueAddress => @@ -718,7 +718,7 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se case Event(MemberRemoved(m, _), _) => scheduleDelayedMemberRemoved(m) - stay + stay() case Event(DelayedMemberRemoved(m), BecomingOldestData(previousOldest)) => if (!selfExited) @@ -727,11 +727,11 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se if (cluster.isTerminated) { // don't act on DelayedMemberRemoved (starting singleton) if this node is shutting its self down, // just wait for self MemberRemoved - stay + stay() } else if (previousOldest.contains(m.uniqueAddress) && previousOldest.forall(removed.contains)) tryGotoOldest() else - stay.using(BecomingOldestData(previousOldest.filterNot(_ == m.uniqueAddress))) + stay().using(BecomingOldestData(previousOldest.filterNot(_ == m.uniqueAddress))) case Event(TakeOverFromMe, BecomingOldestData(previousOldest)) => val senderAddress = sender().path.address @@ -741,7 +741,7 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se case None => // from unknown node, ignore logInfo("Ignoring TakeOver request from unknown node in BecomingOldest from [{}].", senderAddress) - stay + stay() case Some(senderUniqueAddress) => previousOldest.headOption match { case Some(oldest) => @@ -752,10 +752,10 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se "Ignoring TakeOver request in BecomingOldest from [{}]. Expected previous oldest [{}]", sender().path.address, oldest.address) - stay + stay() case None => sender() ! HandOverToMe - stay.using(BecomingOldestData(senderUniqueAddress :: previousOldest)) + stay().using(BecomingOldestData(senderUniqueAddress :: previousOldest)) } } @@ -812,7 +812,7 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se gotoOldest() } else { startSingleTimer(LeaseRetryTimer, LeaseRetry, leaseRetryInterval) - stay.using(AcquiringLeaseData(leaseRequestInProgress = false, None)) + stay().using(AcquiringLeaseData(leaseRequestInProgress = false, None)) } case Event(Terminated(ref), AcquiringLeaseData(_, Some(singleton))) if ref == singleton => logInfo( @@ -823,7 +823,7 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se case Event(AcquireLeaseFailure(t), _) => log.error(t, "failed to get lease (will be retried)") startSingleTimer(LeaseRetryTimer, LeaseRetry, leaseRetryInterval) - stay.using(AcquiringLeaseData(leaseRequestInProgress = false, None)) + stay().using(AcquiringLeaseData(leaseRequestInProgress = false, None)) case Event(LeaseRetry, _) => // If lease was lost (so previous state was oldest) then we don't try and get the lease // until the old singleton instance has been terminated so we know there isn't an @@ -836,12 +836,12 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se case Event(TakeOverFromMe, _) => // already oldest, so confirm and continue like that sender() ! HandOverToMe - stay + stay() case Event(SelfExiting, _) => selfMemberExited() // complete memberExitingProgress when handOverDone sender() ! Done // reply to ask - stay + stay() case Event(MemberDowned(m), _) if m.uniqueAddress == cluster.selfUniqueAddress => logInfo("Self downed, stopping ClusterSingletonManager") stop() @@ -863,7 +863,7 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se oldestOption match { case Some(a) if a == cluster.selfUniqueAddress => // already oldest - stay + stay() case Some(a) if !selfExited && removed.contains(a) => // The member removal was not completed and the old removed node is considered // oldest again. Safest is to terminate the singleton instance and goto Younger. @@ -889,17 +889,17 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se case Event(TakeOverFromMe, _) => // already oldest, so confirm and continue like that sender() ! HandOverToMe - stay + stay() case Event(Terminated(ref), d @ OldestData(Some(singleton))) if ref == singleton => logInfo(ClusterLogMarker.singletonTerminated, "Singleton actor [{}] was terminated", singleton.path) - stay.using(d.copy(singleton = None)) + stay().using(d.copy(singleton = None)) case Event(SelfExiting, _) => selfMemberExited() // complete memberExitingProgress when handOverDone sender() ! Done // reply to ask - stay + stay() case Event(MemberDowned(m), OldestData(singleton)) if m.uniqueAddress == cluster.selfUniqueAddress => singleton match { @@ -936,7 +936,7 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se log.debug("Retry [{}], sending TakeOverFromMe to [{}]", count, newOldestOption.map(_.address)) newOldestOption.foreach(node => peer(node.address) ! TakeOverFromMe) startSingleTimer(TakeOverRetryTimer, TakeOverRetry(count + 1), handOverRetryInterval) - stay + stay() } else throw new ClusterSingletonManagerIsStuck(s"Expected hand-over to [$newOldestOption] never occurred") @@ -953,13 +953,13 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se case Event(Terminated(ref), d @ WasOldestData(singleton, _)) if singleton.contains(ref) => logInfo(ClusterLogMarker.singletonTerminated, "Singleton actor [{}] was terminated", ref.path) - stay.using(d.copy(singleton = None)) + stay().using(d.copy(singleton = None)) case Event(SelfExiting, _) => selfMemberExited() // complete memberExitingProgress when handOverDone sender() ! Done // reply to ask - stay + stay() case Event(MemberDowned(m), WasOldestData(singleton, _)) if m.uniqueAddress == cluster.selfUniqueAddress => singleton match { @@ -991,13 +991,13 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se case Event(HandOverToMe, HandingOverData(_, handOverTo)) if handOverTo.contains(sender()) => // retry sender() ! HandOverInProgress - stay + stay() case Event(SelfExiting, _) => selfMemberExited() // complete memberExitingProgress when handOverDone sender() ! Done // reply to ask - stay + stay() } def handOverDone(handOverTo: Option[ActorRef]): State = { @@ -1049,33 +1049,33 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se selfMemberExited() memberExitingProgress.trySuccess(Done) sender() ! Done // reply to ask - stay + stay() case Event(MemberRemoved(m, _), _) if m.uniqueAddress == cluster.selfUniqueAddress && !selfExited => logInfo("Self removed, stopping ClusterSingletonManager") stop() case Event(MemberRemoved(m, _), _) => if (!selfExited) logInfo("Member removed [{}]", m.address) addRemoved(m.uniqueAddress) - stay + stay() case Event(DelayedMemberRemoved(m), _) => if (!selfExited) logInfo("Member removed [{}]", m.address) addRemoved(m.uniqueAddress) - stay + stay() case Event(TakeOverFromMe, _) => log.debug("Ignoring TakeOver request in [{}] from [{}].", stateName, sender().path.address) - stay + stay() case Event(Cleanup, _) => cleanupOverdueNotMemberAnyMore() - stay + stay() case Event(MemberDowned(m), _) => if (m.uniqueAddress == cluster.selfUniqueAddress) logInfo("Self downed, waiting for removal") - stay + stay() case Event(ReleaseLeaseFailure(t), _) => log.error( t, "Failed to release lease. Singleton may not be able to run on another node until lease timeout occurs") - stay + stay() case Event(ReleaseLeaseResult(released), _) => if (released) { logInfo("Lease released") @@ -1084,7 +1084,7 @@ class ClusterSingletonManager(singletonProps: Props, terminationMessage: Any, se log.error( "Failed to release lease. Singleton may not be able to run on another node until lease timeout occurs") } - stay + stay() } onTransition { diff --git a/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/client/ClusterClientSpec.scala b/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/client/ClusterClientSpec.scala index 81a758d2d1..f239d08b92 100644 --- a/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/client/ClusterClientSpec.scala +++ b/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/client/ClusterClientSpec.scala @@ -266,12 +266,12 @@ class ClusterClientSpec extends MultiNodeSpec(ClusterClientSpec) with STMultiNod //#server runOn(host1) { - val serviceA = system.actorOf(Props[Service], "serviceA") + val serviceA = system.actorOf(Props[Service](), "serviceA") ClusterClientReceptionist(system).registerService(serviceA) } runOn(host2, host3) { - val serviceB = system.actorOf(Props[Service], "serviceB") + val serviceB = system.actorOf(Props[Service](), "serviceB") ClusterClientReceptionist(system).registerService(serviceB) } //#server diff --git a/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/pubsub/DistributedPubSubMediatorSpec.scala b/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/pubsub/DistributedPubSubMediatorSpec.scala index f410eceb18..b258fb03bc 100644 --- a/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/pubsub/DistributedPubSubMediatorSpec.scala +++ b/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/pubsub/DistributedPubSubMediatorSpec.scala @@ -344,17 +344,17 @@ class DistributedPubSubMediatorSpec //#start-subscribers runOn(first) { - system.actorOf(Props[Subscriber], "subscriber1") + system.actorOf(Props[Subscriber](), "subscriber1") } runOn(second) { - system.actorOf(Props[Subscriber], "subscriber2") - system.actorOf(Props[Subscriber], "subscriber3") + system.actorOf(Props[Subscriber](), "subscriber2") + system.actorOf(Props[Subscriber](), "subscriber3") } //#start-subscribers //#publish-message runOn(third) { - val publisher = system.actorOf(Props[Publisher], "publisher") + val publisher = system.actorOf(Props[Publisher](), "publisher") later() // after a while the subscriptions are replicated publisher ! "hello" @@ -371,16 +371,16 @@ class DistributedPubSubMediatorSpec //#start-send-destinations runOn(first) { - system.actorOf(Props[Destination], "destination") + system.actorOf(Props[Destination](), "destination") } runOn(second) { - system.actorOf(Props[Destination], "destination") + system.actorOf(Props[Destination](), "destination") } //#start-send-destinations //#send-message runOn(third) { - val sender = system.actorOf(Props[Sender], "sender") + val sender = system.actorOf(Props[Sender](), "sender") later() // after a while the destinations are replicated sender ! "hello" diff --git a/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/pubsub/DistributedPubSubRestartSpec.scala b/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/pubsub/DistributedPubSubRestartSpec.scala index 4ad1b6f7c4..aa636ae10b 100644 --- a/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/pubsub/DistributedPubSubRestartSpec.scala +++ b/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/pubsub/DistributedPubSubRestartSpec.scala @@ -161,7 +161,7 @@ class DistributedPubSubRestartSpec newMediator.tell(Internal.DeltaCount, probe.ref) probe.expectMsg(0L) - newSystem.actorOf(Props[Shutdown], "shutdown") + newSystem.actorOf(Props[Shutdown](), "shutdown") Await.ready(newSystem.whenTerminated, 20.seconds) } finally newSystem.terminate() } diff --git a/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/singleton/ClusterSingletonManagerSpec.scala b/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/singleton/ClusterSingletonManagerSpec.scala index 29d8d7c52f..349a12d50a 100644 --- a/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/singleton/ClusterSingletonManagerSpec.scala +++ b/akka-cluster-tools/src/multi-jvm/scala/akka/cluster/singleton/ClusterSingletonManagerSpec.scala @@ -333,7 +333,7 @@ class ClusterSingletonManagerSpec runOn(controller) { // watch that it is not terminated, which would indicate misbehavior - watch(system.actorOf(Props[PointToPointChannel], "queue")) + watch(system.actorOf(Props[PointToPointChannel](), "queue")) } enterBarrier("queue-started") diff --git a/akka-cluster-tools/src/test/scala/akka/cluster/TestLease.scala b/akka-cluster-tools/src/test/scala/akka/cluster/TestLease.scala index 681b135b97..f5f07318a5 100644 --- a/akka-cluster-tools/src/test/scala/akka/cluster/TestLease.scala +++ b/akka-cluster-tools/src/test/scala/akka/cluster/TestLease.scala @@ -63,7 +63,7 @@ class TestLease(settings: LeaseSettings, system: ExtendedActorSystem) extends Le TestLeaseExt(system).setTestLease(settings.leaseName, this) - val initialPromise = Promise[Boolean] + val initialPromise = Promise[Boolean]() private val nextAcquireResult = new AtomicReference[Future[Boolean]](initialPromise.future) private val nextCheckLeaseResult = new AtomicReference[Boolean](false) diff --git a/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonLeaseSpec.scala b/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonLeaseSpec.scala index 23a3616e7c..1dc7ff3958 100644 --- a/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonLeaseSpec.scala +++ b/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonLeaseSpec.scala @@ -121,7 +121,7 @@ class ClusterSingletonLeaseSpec extends AkkaSpec(ConfigFactory.parseString(""" } // allow singleton manager to create the lease testLease.probe.expectMsg(AcquireReq(leaseOwner)) singletonProbe.expectNoMessage(shortDuration) - val nextResponse = Promise[Boolean] + val nextResponse = Promise[Boolean]() testLease.setNextAcquireResult(nextResponse.future) testLease.initialPromise.complete(Success(false)) testLease.probe.expectMsg(AcquireReq(leaseOwner)) @@ -155,7 +155,7 @@ class ClusterSingletonLeaseSpec extends AkkaSpec(ConfigFactory.parseString(""" } // allow singleton manager to create the lease testLease.probe.expectMsg(AcquireReq(leaseOwner)) singletonProbe.expectNoMessage(shortDuration) - val nextResponse = Promise[Boolean] + val nextResponse = Promise[Boolean]() testLease.setNextAcquireResult(nextResponse.future) testLease.initialPromise.failure(TestException("no lease for you")) testLease.probe.expectMsg(AcquireReq(leaseOwner)) diff --git a/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonProxySpec.scala b/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonProxySpec.scala index 56cba45dd8..980bd0811a 100644 --- a/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonProxySpec.scala +++ b/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonProxySpec.scala @@ -47,7 +47,7 @@ object ClusterSingletonProxySpec { cluster.registerOnMemberUp { system.actorOf( ClusterSingletonManager.props( - singletonProps = Props[Singleton], + singletonProps = Props[Singleton](), terminationMessage = PoisonPill, settings = ClusterSingletonManagerSettings(system).withRemovalMargin(5.seconds)), name = "singletonManager") diff --git a/akka-cluster-typed/src/main/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionist.scala b/akka-cluster-typed/src/main/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionist.scala index 5b67dacfeb..99f4f6531b 100644 --- a/akka-cluster-typed/src/main/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionist.scala +++ b/akka-cluster-typed/src/main/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionist.scala @@ -106,7 +106,7 @@ private[typed] object ClusterReceptionist extends ReceptionistBehaviorProvider { tombstones.foldLeft(tombstones) { case (acc, (actorRef, entries)) => val entriesToKeep = entries.filter { - case (_, deadline) => deadline.hasTimeLeft + case (_, deadline) => deadline.hasTimeLeft() } if (entriesToKeep.size == entries.size) acc else if (entriesToKeep.isEmpty) acc - actorRef diff --git a/akka-cluster-typed/src/multi-jvm/scala/akka/cluster/typed/MultiDcClusterSingletonSpec.scala b/akka-cluster-typed/src/multi-jvm/scala/akka/cluster/typed/MultiDcClusterSingletonSpec.scala index 6afd7d2c4b..5ed5d3a282 100644 --- a/akka-cluster-typed/src/multi-jvm/scala/akka/cluster/typed/MultiDcClusterSingletonSpec.scala +++ b/akka-cluster-typed/src/multi-jvm/scala/akka/cluster/typed/MultiDcClusterSingletonSpec.scala @@ -65,7 +65,7 @@ abstract class MultiDcClusterSingletonSpec runOn(first) { val singleton = ClusterSingleton(typedSystem) val pinger = singleton.init(SingletonActor(MultiDcPinger(), "ping").withStopMessage(NoMore)) - val probe = TestProbe[Pong] + val probe = TestProbe[Pong]() pinger ! Ping(probe.ref) probe.expectMessage(Pong("dc1")) enterBarrier("singleton-up") @@ -82,7 +82,7 @@ abstract class MultiDcClusterSingletonSpec SingletonActor(MultiDcPinger(), "ping") .withStopMessage(NoMore) .withSettings(ClusterSingletonSettings(typedSystem).withDataCenter("dc1"))) - val probe = TestProbe[Pong] + val probe = TestProbe[Pong]() pinger ! Ping(probe.ref) probe.expectMessage(Pong("dc1")) } @@ -94,7 +94,7 @@ abstract class MultiDcClusterSingletonSpec runOn(second, third) { val singleton = ClusterSingleton(typedSystem) val pinger = singleton.init(SingletonActor(MultiDcPinger(), "ping").withStopMessage(NoMore)) - val probe = TestProbe[Pong] + val probe = TestProbe[Pong]() pinger ! Ping(probe.ref) probe.expectMessage(Pong("dc2")) } diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ActorSystemSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ActorSystemSpec.scala index ecd0f9f216..985f73c276 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ActorSystemSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ActorSystemSpec.scala @@ -186,7 +186,7 @@ class ActorSystemSpec "have a working thread factory" in { withSystem("thread", Behaviors.empty[String]) { sys => - val p = Promise[Int] + val p = Promise[Int]() sys.threadFactory .newThread(new Runnable { def run(): Unit = p.success(42) diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPoisonPillSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPoisonPillSpec.scala index a2bb04cee9..63f59c7e7a 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPoisonPillSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPoisonPillSpec.scala @@ -38,7 +38,7 @@ class ClusterSingletonPoisonPillSpec "A typed cluster singleton" must { "support using PoisonPill to stop" in { - val probe = TestProbe[ActorRef[Any]] + val probe = TestProbe[ActorRef[Any]]() val singleton = ClusterSingleton(system).init(SingletonActor(ClusterSingletonPoisonPillSpec.sneakyBehavior, "sneaky")) singleton ! GetSelf(probe.ref) diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/GroupRouterSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/GroupRouterSpec.scala index da4cd5d396..a2ae4f39d0 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/GroupRouterSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/GroupRouterSpec.scala @@ -105,7 +105,7 @@ class GroupRouterSpec extends ScalaTestWithActorTestKit(GroupRouterSpec.config) val node2 = Cluster(system2) node2.manager ! Join(node1.selfMember.address) - val statsPromise = Promise[(Seq[ActorRef[Ping.type]], Seq[ActorRef[Ping.type]])] + val statsPromise = Promise[(Seq[ActorRef[Ping.type]], Seq[ActorRef[Ping.type]])]() val cancelable = system.scheduler.scheduleAtFixedRate(200.millis, 200.millis)(() => { implicit val timeout = Timeout(3.seconds) val actorRefsInNode1 = system1.ask[Seq[ActorRef[Ping.type]]](ref => GetWorkers(ref)).futureValue diff --git a/akka-cluster/src/main/scala/akka/cluster/ClusterDaemon.scala b/akka-cluster/src/main/scala/akka/cluster/ClusterDaemon.scala index 5f9f4abef8..157498bab7 100644 --- a/akka-cluster/src/main/scala/akka/cluster/ClusterDaemon.scala +++ b/akka-cluster/src/main/scala/akka/cluster/ClusterDaemon.scala @@ -268,7 +268,7 @@ private[cluster] final class ClusterCoreSupervisor(joinConfigCompatChecker: Join def createChildren(): Unit = { val publisher = - context.actorOf(Props[ClusterDomainEventPublisher].withDispatcher(context.props.dispatcher), name = "publisher") + context.actorOf(Props[ClusterDomainEventPublisher]().withDispatcher(context.props.dispatcher), name = "publisher") coreDaemon = Some( context.watch(context.actorOf( Props(classOf[ClusterCoreDaemon], publisher, joinConfigCompatChecker).withDispatcher(context.props.dispatcher), @@ -476,7 +476,7 @@ private[cluster] class ClusterCoreDaemon(publisher: ActorRef, joinConfigCompatCh case Welcome(from, gossip) => welcome(from.address, from, gossip) case _: Tick => - if (joinSeedNodesDeadline.exists(_.isOverdue)) + if (joinSeedNodesDeadline.exists(_.isOverdue())) joinSeedNodesWasUnsuccessful() }: Actor.Receive).orElse(receiveExitingCompleted) @@ -496,9 +496,9 @@ private[cluster] class ClusterCoreDaemon(publisher: ActorRef, joinConfigCompatCh joinSeedNodes(newSeedNodes) case msg: SubscriptionMessage => publisher.forward(msg) case _: Tick => - if (joinSeedNodesDeadline.exists(_.isOverdue)) + if (joinSeedNodesDeadline.exists(_.isOverdue())) joinSeedNodesWasUnsuccessful() - else if (deadline.exists(_.isOverdue)) { + else if (deadline.exists(_.isOverdue())) { // join attempt failed, retry becomeUninitialized() if (seedNodes.nonEmpty) joinSeedNodes(seedNodes) @@ -1082,10 +1082,10 @@ private[cluster] class ClusterCoreDaemon(publisher: ActorRef, joinConfigCompatCh if (statsEnabled) { gossipStats = gossipType match { - case Merge => gossipStats.incrementMergeCount - case Same => gossipStats.incrementSameCount - case Newer => gossipStats.incrementNewerCount - case Older => gossipStats.incrementOlderCount + case Merge => gossipStats.incrementMergeCount() + case Same => gossipStats.incrementSameCount() + case Newer => gossipStats.incrementNewerCount() + case Older => gossipStats.incrementOlderCount() case Ignored => gossipStats // included in receivedGossipCount } } diff --git a/akka-cluster/src/main/scala/akka/cluster/CoordinatedShutdownLeave.scala b/akka-cluster/src/main/scala/akka/cluster/CoordinatedShutdownLeave.scala index 84672a8ff0..8594545e1d 100644 --- a/akka-cluster/src/main/scala/akka/cluster/CoordinatedShutdownLeave.scala +++ b/akka-cluster/src/main/scala/akka/cluster/CoordinatedShutdownLeave.scala @@ -15,7 +15,7 @@ import akka.cluster.MemberStatus._ * INTERNAL API */ private[akka] object CoordinatedShutdownLeave { - def props(): Props = Props[CoordinatedShutdownLeave] + def props(): Props = Props[CoordinatedShutdownLeave]() case object LeaveReq } diff --git a/akka-cluster/src/main/scala/akka/cluster/Gossip.scala b/akka-cluster/src/main/scala/akka/cluster/Gossip.scala index 87b64baee8..0720a688d1 100644 --- a/akka-cluster/src/main/scala/akka/cluster/Gossip.scala +++ b/akka-cluster/src/main/scala/akka/cluster/Gossip.scala @@ -315,7 +315,7 @@ private[cluster] class GossipEnvelope private ( private def deserialize(): Unit = { if ((g eq null) && (ser ne null)) { - if (serDeadline.hasTimeLeft) + if (serDeadline.hasTimeLeft()) g = ser() else g = Gossip.empty diff --git a/akka-cluster/src/main/scala/akka/cluster/SeedNodeProcess.scala b/akka-cluster/src/main/scala/akka/cluster/SeedNodeProcess.scala index eea6a41d70..16cae77d75 100644 --- a/akka-cluster/src/main/scala/akka/cluster/SeedNodeProcess.scala +++ b/akka-cluster/src/main/scala/akka/cluster/SeedNodeProcess.scala @@ -186,7 +186,7 @@ private[cluster] final class FirstSeedNodeProcess( def receive: Receive = { case JoinSeedNode => - if (timeout.hasTimeLeft) { + if (timeout.hasTimeLeft()) { // send InitJoin to remaining seed nodes (except myself) receiveJoinSeedNode(remainingSeedNodes) } else { diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/AttemptSysMsgRedeliverySpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/AttemptSysMsgRedeliverySpec.scala index a843df4863..297f7cfb74 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/AttemptSysMsgRedeliverySpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/AttemptSysMsgRedeliverySpec.scala @@ -51,7 +51,7 @@ class AttemptSysMsgRedeliverySpec } "redeliver system message after inactivity" taggedAs LongRunningTest in { - system.actorOf(Props[Echo], "echo") + system.actorOf(Props[Echo](), "echo") enterBarrier("echo-started") system.actorSelection(node(first) / "user" / "echo") ! Identify(None) diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterDeathWatchSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterDeathWatchSpec.scala index 4f9a5c85f3..d284e66a33 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterDeathWatchSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterDeathWatchSpec.scala @@ -91,10 +91,10 @@ abstract class ClusterDeathWatchSpec def receive = { case ActorIdentity(`path2`, Some(ref)) => context.watch(ref) - watchEstablished.countDown + watchEstablished.countDown() case ActorIdentity(`path3`, Some(ref)) => context.watch(ref) - watchEstablished.countDown + watchEstablished.countDown() case Terminated(actor) => testActor ! actor.path } }).withDeploy(Deploy.local), name = "observer1") @@ -242,7 +242,7 @@ abstract class ClusterDeathWatchSpec enterBarrier("end-actor-created") runOn(fourth) { - val hello = system.actorOf(Props[Hello], "hello") + val hello = system.actorOf(Props[Hello](), "hello") hello.isInstanceOf[RemoteActorRef] should ===(true) hello.path.address should ===(address(first)) watch(hello) diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/JoinInProgressSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/JoinInProgressSpec.scala index 96a06edbe8..c6c774a898 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/JoinInProgressSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/JoinInProgressSpec.scala @@ -48,7 +48,7 @@ abstract class JoinInProgressSpec extends MultiNodeSpec(JoinInProgressMultiJvmSp runOn(first) { val until = Deadline.now + 5.seconds - while (!until.isOverdue) { + while (!until.isOverdue()) { Thread.sleep(200) cluster.failureDetector.isAvailable(second) should ===(true) } diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/RemoteFeaturesWithClusterSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/RemoteFeaturesWithClusterSpec.scala index 907c0bfe3e..3c152997c6 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/RemoteFeaturesWithClusterSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/RemoteFeaturesWithClusterSpec.scala @@ -98,7 +98,7 @@ abstract class ClusterRemoteFeaturesSpec(multiNodeConfig: ClusterRemoteFeaturesC enterBarrier("cluster-up") runOn(first) { - val actor = system.actorOf(Props[AddressPing], "kattdjur") + val actor = system.actorOf(Props[AddressPing](), "kattdjur") actor.isInstanceOf[RemoteActorRef] shouldBe true actor.path.address shouldEqual node(second).address actor.path.address.hasGlobalScope shouldBe true @@ -110,7 +110,7 @@ abstract class ClusterRemoteFeaturesSpec(multiNodeConfig: ClusterRemoteFeaturesC enterBarrier("CARP-in-cluster-remote-validated") def assertIsLocalRef(): Unit = { - val actor = system.actorOf(Props[AddressPing], "kattdjur") + val actor = system.actorOf(Props[AddressPing](), "kattdjur") actor.isInstanceOf[RepointableActorRef] shouldBe true val localAddress = AddressFromURIString(s"akka://${system.name}") actor.path.address shouldEqual localAddress diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/StressSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/StressSpec.scala index f794ad6f50..4b422bcd5d 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/StressSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/StressSpec.scala @@ -454,7 +454,7 @@ private[cluster] object StressMultiJvmSpec extends MultiNodeConfig { * itself. */ class Master(settings: StressMultiJvmSpec.Settings, batchInterval: FiniteDuration, tree: Boolean) extends Actor { - val workers = context.actorOf(FromConfig.props(Props[Worker]), "workers") + val workers = context.actorOf(FromConfig.props(Props[Worker]()), "workers") val payload = Array.fill(settings.payloadSize)(ThreadLocalRandom.current.nextInt(127).toByte) val retryTimeout = 5.seconds.dilated(context.system) val idCounter = Iterator.from(0) @@ -528,7 +528,7 @@ private[cluster] object StressMultiJvmSpec extends MultiNodeConfig { def resend(): Unit = { outstanding.values.foreach { jobState => - if (jobState.deadline.isOverdue) + if (jobState.deadline.isOverdue()) send(jobState.job) } } @@ -785,7 +785,7 @@ abstract class StressSpec // always create one worker when the cluster is started lazy val createWorker: Unit = - system.actorOf(Props[Worker], "worker") + system.actorOf(Props[Worker](), "worker") def createResultAggregator(title: String, expectedResults: Int, includeInHistory: Boolean): Unit = { runOn(roles.head) { @@ -809,12 +809,12 @@ abstract class StressSpec } lazy val clusterResultHistory = - if (settings.infolog) system.actorOf(Props[ClusterResultHistory], "resultHistory") + if (settings.infolog) system.actorOf(Props[ClusterResultHistory](), "resultHistory") else system.deadLetters - lazy val phiObserver = system.actorOf(Props[PhiObserver], "phiObserver") + lazy val phiObserver = system.actorOf(Props[PhiObserver](), "phiObserver") - lazy val statsObserver = system.actorOf(Props[StatsObserver], "statsObserver") + lazy val statsObserver = system.actorOf(Props[StatsObserver](), "statsObserver") def awaitClusterResult(): Unit = { runOn(roles.head) { @@ -892,7 +892,7 @@ abstract class StressSpec val removeRole = roles(nbrUsedRoles - 1) val removeAddress = address(removeRole) runOn(removeRole) { - system.actorOf(Props[Watchee], "watchee") + system.actorOf(Props[Watchee](), "watchee") if (!shutdown) cluster.leave(myself) } enterBarrier("watchee-created-" + step) @@ -1100,7 +1100,7 @@ abstract class StressSpec def exerciseSupervision(title: String, duration: FiniteDuration, oneIteration: Duration): Unit = within(duration + 10.seconds) { val rounds = (duration.toMillis / oneIteration.toMillis).max(1).toInt - val supervisor = system.actorOf(Props[Supervisor], "supervisor") + val supervisor = system.actorOf(Props[Supervisor](), "supervisor") for (_ <- 0 until rounds) { createResultAggregator(title, expectedResults = nbrUsedRoles, includeInHistory = false) @@ -1108,7 +1108,7 @@ abstract class StressSpec runOn(masterRoles: _*) { reportResult { roles.take(nbrUsedRoles).foreach { r => - supervisor ! Props[RemoteChild].withDeploy(Deploy(scope = RemoteScope(address(r)))) + supervisor ! Props[RemoteChild]().withDeploy(Deploy(scope = RemoteScope(address(r)))) } supervisor ! GetChildrenCount expectMsgType[ChildrenCount] should ===(ChildrenCount(nbrUsedRoles, 0)) @@ -1161,7 +1161,7 @@ abstract class StressSpec "log settings" taggedAs LongRunningTest in { if (infolog) { - log.info("StressSpec JVM:\n{}", jvmInfo) + log.info("StressSpec JVM:\n{}", jvmInfo()) runOn(roles.head) { log.info("StressSpec settings:\n{}", settings) } @@ -1369,7 +1369,7 @@ abstract class StressSpec "log jvm info" taggedAs LongRunningTest in { if (infolog) { - log.info("StressSpec JVM:\n{}", jvmInfo) + log.info("StressSpec JVM:\n{}", jvmInfo()) } enterBarrier("after-" + step) } diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/SurviveNetworkInstabilitySpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/SurviveNetworkInstabilitySpec.scala index 32e91397b9..c482cbc7c0 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/SurviveNetworkInstabilitySpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/SurviveNetworkInstabilitySpec.scala @@ -121,11 +121,11 @@ abstract class SurviveNetworkInstabilitySpec awaitAssert(clusterView.unreachableMembers.map(_.address) should ===(expected)) } - system.actorOf(Props[Echo], "echo") + system.actorOf(Props[Echo](), "echo") def assertCanTalk(alive: RoleName*): Unit = { runOn(alive: _*) { - awaitAllReachable + awaitAllReachable() } enterBarrier("reachable-ok") @@ -284,7 +284,7 @@ abstract class SurviveNetworkInstabilitySpec val others = Vector(first, third, fourth, fifth, sixth, seventh) runOn(third) { - system.actorOf(Props[Watcher], "watcher") + system.actorOf(Props[Watcher](), "watcher") // undelivered system messages in RemoteChild on third should trigger QuarantinedEvent system.eventStream.subscribe(testActor, quarantinedEventClass) @@ -292,7 +292,7 @@ abstract class SurviveNetworkInstabilitySpec enterBarrier("watcher-created") runOn(second) { - val refs = Vector.fill(sysMsgBufferSize + 1)(system.actorOf(Props[Echo])).toSet + val refs = Vector.fill(sysMsgBufferSize + 1)(system.actorOf(Props[Echo]())).toSet system.actorSelection(node(third) / "user" / "watcher") ! Targets(refs) expectMsg(TargetsRegistered) } diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterConsistentHashingGroupSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterConsistentHashingGroupSpec.scala index 794dea532f..72e2961f15 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterConsistentHashingGroupSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterConsistentHashingGroupSpec.scala @@ -52,7 +52,7 @@ abstract class ClusterConsistentHashingGroupSpec "A cluster router with a consistent hashing group" must { "start cluster with 3 nodes" taggedAs LongRunningTest in { - system.actorOf(Props[Destination], "dest") + system.actorOf(Props[Destination](), "dest") awaitClusterUp(first, second, third) enterBarrier("after-1") } diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterConsistentHashingRouterSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterConsistentHashingRouterSpec.scala index d2f97b0494..b258d151e8 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterConsistentHashingRouterSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterConsistentHashingRouterSpec.scala @@ -65,7 +65,7 @@ abstract class ClusterConsistentHashingRouterSpec with DefaultTimeout { import ClusterConsistentHashingRouterMultiJvmSpec._ - lazy val router1 = system.actorOf(FromConfig.props(Props[Echo]), "router1") + lazy val router1 = system.actorOf(FromConfig.props(Props[Echo]()), "router1") def currentRoutees(router: ActorRef) = Await.result(router ? GetRoutees, timeout.duration).asInstanceOf[Routees].routees @@ -125,7 +125,7 @@ abstract class ClusterConsistentHashingRouterSpec ClusterRouterPool( local = ConsistentHashingPool(nrOfInstances = 0), settings = ClusterRouterPoolSettings(totalInstances = 10, maxInstancesPerNode = 2, allowLocalRoutees = true)) - .props(Props[Echo]), + .props(Props[Echo]()), "router2") // it may take some time until router receives cluster member events awaitAssert { currentRoutees(router2).size should ===(6) } @@ -144,7 +144,7 @@ abstract class ClusterConsistentHashingRouterSpec val router3 = system.actorOf( - ConsistentHashingPool(nrOfInstances = 0, hashMapping = hashMapping).props(Props[Echo]), + ConsistentHashingPool(nrOfInstances = 0, hashMapping = hashMapping).props(Props[Echo]()), "router3") assertHashMapping(router3) @@ -165,7 +165,7 @@ abstract class ClusterConsistentHashingRouterSpec local = ConsistentHashingPool(nrOfInstances = 0, hashMapping = hashMapping), settings = ClusterRouterPoolSettings(totalInstances = 10, maxInstancesPerNode = 1, allowLocalRoutees = true)) - .props(Props[Echo]), + .props(Props[Echo]()), "router4") assertHashMapping(router4) diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterRoundRobinSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterRoundRobinSpec.scala index 5002367a01..39a0f4a413 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterRoundRobinSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterRoundRobinSpec.scala @@ -109,16 +109,16 @@ abstract class ClusterRoundRobinSpec with DefaultTimeout { import ClusterRoundRobinMultiJvmSpec._ - lazy val router1 = system.actorOf(FromConfig.props(Props[SomeActor]), "router1") + lazy val router1 = system.actorOf(FromConfig.props(Props[SomeActor]()), "router1") lazy val router2 = system.actorOf( ClusterRouterPool( RoundRobinPool(nrOfInstances = 0), ClusterRouterPoolSettings(totalInstances = 3, maxInstancesPerNode = 1, allowLocalRoutees = true)) - .props(Props[SomeActor]), + .props(Props[SomeActor]()), "router2") - lazy val router3 = system.actorOf(FromConfig.props(Props[SomeActor]), "router3") + lazy val router3 = system.actorOf(FromConfig.props(Props[SomeActor]()), "router3") lazy val router4 = system.actorOf(FromConfig.props(), "router4") - lazy val router5 = system.actorOf(RoundRobinPool(nrOfInstances = 0).props(Props[SomeActor]), "router5") + lazy val router5 = system.actorOf(RoundRobinPool(nrOfInstances = 0).props(Props[SomeActor]()), "router5") def receiveReplies(routeeType: RouteeType, expectedReplies: Int): Map[Address, Int] = { val zero = Map.empty[Address, Int] ++ roles.map(address(_) -> 0) diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/UseRoleIgnoredSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/UseRoleIgnoredSpec.scala index 199840fde3..9752dc1d20 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/UseRoleIgnoredSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/UseRoleIgnoredSpec.scala @@ -110,7 +110,7 @@ abstract class UseRoleIgnoredSpec totalInstances = 6, maxInstancesPerNode = 2, allowLocalRoutees = false, - useRoles = roles)).props(Props[SomeActor]), + useRoles = roles)).props(Props[SomeActor]()), "router-2") awaitAssert(currentRoutees(router).size should ===(4)) @@ -143,7 +143,7 @@ abstract class UseRoleIgnoredSpec totalInstances = 6, routeesPaths = List("/user/foo", "/user/bar"), allowLocalRoutees = false, - useRoles = roles)).props, + useRoles = roles)).props(), "router-2b") awaitAssert(currentRoutees(router).size should ===(4)) @@ -176,7 +176,7 @@ abstract class UseRoleIgnoredSpec totalInstances = 6, maxInstancesPerNode = 2, allowLocalRoutees = true, - useRoles = roles)).props(Props[SomeActor]), + useRoles = roles)).props(Props[SomeActor]()), "router-3") awaitAssert(currentRoutees(router).size should ===(4)) @@ -209,7 +209,7 @@ abstract class UseRoleIgnoredSpec totalInstances = 6, routeesPaths = List("/user/foo", "/user/bar"), allowLocalRoutees = true, - useRoles = roles)).props, + useRoles = roles)).props(), "router-3b") awaitAssert(currentRoutees(router).size should ===(4)) @@ -242,7 +242,7 @@ abstract class UseRoleIgnoredSpec totalInstances = 6, maxInstancesPerNode = 2, allowLocalRoutees = true, - useRoles = roles)).props(Props[SomeActor]), + useRoles = roles)).props(Props[SomeActor]()), "router-4") awaitAssert(currentRoutees(router).size should ===(2)) @@ -275,7 +275,7 @@ abstract class UseRoleIgnoredSpec totalInstances = 6, routeesPaths = List("/user/foo", "/user/bar"), allowLocalRoutees = true, - useRoles = roles)).props, + useRoles = roles)).props(), "router-4b") awaitAssert(currentRoutees(router).size should ===(2)) @@ -308,7 +308,7 @@ abstract class UseRoleIgnoredSpec totalInstances = 6, maxInstancesPerNode = 2, allowLocalRoutees = true, - useRoles = roles)).props(Props[SomeActor]), + useRoles = roles)).props(Props[SomeActor]()), "router-5") awaitAssert(currentRoutees(router).size should ===(6)) @@ -341,7 +341,7 @@ abstract class UseRoleIgnoredSpec totalInstances = 6, routeesPaths = List("/user/foo", "/user/bar"), allowLocalRoutees = true, - useRoles = roles)).props, + useRoles = roles)).props(), "router-5b") awaitAssert(currentRoutees(router).size should ===(6)) diff --git a/akka-cluster/src/test/scala/akka/cluster/ClusterDomainEventPublisherSpec.scala b/akka-cluster/src/test/scala/akka/cluster/ClusterDomainEventPublisherSpec.scala index 6a800c2e7d..e593a1dbb6 100644 --- a/akka-cluster/src/test/scala/akka/cluster/ClusterDomainEventPublisherSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/ClusterDomainEventPublisherSpec.scala @@ -101,7 +101,7 @@ class ClusterDomainEventPublisherSpec system.eventStream.subscribe(memberSubscriber.ref, classOf[LeaderChanged]) system.eventStream.subscribe(memberSubscriber.ref, ClusterShuttingDown.getClass) - publisher = system.actorOf(Props[ClusterDomainEventPublisher]) + publisher = system.actorOf(Props[ClusterDomainEventPublisher]()) publisher ! PublishChanges(state0) memberSubscriber.expectMsg(MemberUp(aUp)) memberSubscriber.expectMsg(LeaderChanged(Some(aUp.address))) diff --git a/akka-cluster/src/test/scala/akka/cluster/testkit/AutoDown.scala b/akka-cluster/src/test/scala/akka/cluster/testkit/AutoDown.scala index 7d612cccea..92cbe34983 100644 --- a/akka-cluster/src/test/scala/akka/cluster/testkit/AutoDown.scala +++ b/akka-cluster/src/test/scala/akka/cluster/testkit/AutoDown.scala @@ -155,7 +155,7 @@ private[cluster] abstract class AutoDownBase(autoDownUnreachableAfter: FiniteDur var leader = false override def postStop(): Unit = { - scheduledUnreachable.values.foreach { _.cancel } + scheduledUnreachable.values.foreach { _.cancel() } } def receive = { @@ -209,7 +209,7 @@ private[cluster] abstract class AutoDownBase(autoDownUnreachableAfter: FiniteDur } def remove(node: UniqueAddress): Unit = { - scheduledUnreachable.get(node).foreach { _.cancel } + scheduledUnreachable.get(node).foreach { _.cancel() } scheduledUnreachable -= node pendingUnreachable -= node } diff --git a/akka-distributed-data/src/main/scala/akka/cluster/ddata/DurableStore.scala b/akka-distributed-data/src/main/scala/akka/cluster/ddata/DurableStore.scala index c696a16024..757efa32d4 100644 --- a/akka-distributed-data/src/main/scala/akka/cluster/ddata/DurableStore.scala +++ b/akka-distributed-data/src/main/scala/akka/cluster/ddata/DurableStore.scala @@ -166,7 +166,7 @@ final class LmdbDurableStore(config: Config) extends Actor with ActorLogging { val valueBuffer = lmdb().valueBuffer if (valueBuffer.remaining < size) { DirectByteBufferPool.tryCleanDirectByteBuffer(valueBuffer) - _lmdb = OptionVal.Some(lmdb.copy(valueBuffer = ByteBuffer.allocateDirect(size * 2))) + _lmdb = OptionVal.Some(lmdb().copy(valueBuffer = ByteBuffer.allocateDirect(size * 2))) } } diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/LocalConcurrencySpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/LocalConcurrencySpec.scala index a249c0e5c5..e01188ca0b 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/LocalConcurrencySpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/LocalConcurrencySpec.scala @@ -64,8 +64,8 @@ class LocalConcurrencySpec(_system: ActorSystem) "Updates from same node" must { "be possible to do from two actors" in { - val updater1 = system.actorOf(Props[Updater], "updater1") - val updater2 = system.actorOf(Props[Updater], "updater2") + val updater1 = system.actorOf(Props[Updater](), "updater1") + val updater2 = system.actorOf(Props[Updater](), "updater2") val numMessages = 100 for (n <- 1 to numMessages) { diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/LotsOfDataBot.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/LotsOfDataBot.scala index 570e00168d..fa37a81ebb 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/LotsOfDataBot.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/LotsOfDataBot.scala @@ -57,7 +57,7 @@ object LotsOfDataBot { // Create an Akka system val system = ActorSystem("ClusterSystem", config) // Create an actor that handles cluster domain events - system.actorOf(Props[LotsOfDataBot], name = "dataBot") + system.actorOf(Props[LotsOfDataBot](), name = "dataBot") } } diff --git a/akka-multi-node-testkit/src/main/scala/akka/remote/testconductor/Conductor.scala b/akka-multi-node-testkit/src/main/scala/akka/remote/testconductor/Conductor.scala index ab5b8eeb9e..a372ff04fa 100644 --- a/akka-multi-node-testkit/src/main/scala/akka/remote/testconductor/Conductor.scala +++ b/akka-multi-node-testkit/src/main/scala/akka/remote/testconductor/Conductor.scala @@ -368,7 +368,7 @@ private[akka] class ServerFSM(val controller: ActorRef, val channel: Channel) stop() case Event(ToClient(msg), _) => log.warning("cannot send {} in state Initial", msg) - stay + stay() case Event(StateTimeout, _) => log.info("closing channel to {} because of Hello timeout", getAddrString(channel)) channel.close() @@ -378,22 +378,22 @@ private[akka] class ServerFSM(val controller: ActorRef, val channel: Channel) when(Ready) { case Event(d: Done, Some(s)) => s ! d - stay.using(None) + stay().using(None) case Event(op: ServerOp, _) => controller ! op - stay + stay() case Event(msg: NetworkOp, _) => log.warning("client {} sent unsupported message {}", getAddrString(channel), msg) stop() case Event(ToClient(msg: UnconfirmedClientOp), _) => channel.write(msg) - stay + stay() case Event(ToClient(msg), None) => channel.write(msg) - stay.using(Some(sender())) + stay().using(Some(sender())) case Event(ToClient(msg), _) => log.warning("cannot send {} while waiting for previous ACK", msg) - stay + stay() } initialize() @@ -451,7 +451,7 @@ private[akka] class Controller(private var initialParticipants: Int, controllerP SupervisorStrategy.Restart } - val barrier = context.actorOf(Props[BarrierCoordinator], "barriers") + val barrier = context.actorOf(Props[BarrierCoordinator](), "barriers") var nodes = Map[RoleName, NodeInfo]() // map keeping unanswered queries for node addresses (enqueued upon GetAddress, serviced upon NodeInfo) @@ -463,7 +463,7 @@ private[akka] class Controller(private var initialParticipants: Int, controllerP val (ip, port) = channel.getRemoteAddress match { case s: InetSocketAddress => (s.getAddress.getHostAddress, s.getPort) } - val name = ip + ":" + port + "-server" + generation.next + val name = ip + ":" + port + "-server" + generation.next() sender() ! context.actorOf(Props(classOf[ServerFSM], self, channel).withDeploy(Deploy.local), name) case c @ NodeInfo(name, address, fsm) => barrier.forward(c) @@ -593,13 +593,13 @@ private[akka] class BarrierCoordinator whenUnhandled { case Event(n: NodeInfo, d @ Data(clients, _, _, _)) => if (clients.find(_.name == n.name).isDefined) throw new DuplicateNode(d, n) - stay.using(d.copy(clients = clients + n)) + stay().using(d.copy(clients = clients + n)) case Event(ClientDisconnected(name), d @ Data(clients, _, arrived, _)) => if (arrived.isEmpty) - stay.using(d.copy(clients = clients.filterNot(_.name == name))) + stay().using(d.copy(clients = clients.filterNot(_.name == name))) else { clients.find(_.name == name) match { - case None => stay + case None => stay() case Some(c) => throw ClientLost(d.copy(clients = clients - c, arrived = arrived.filterNot(_ == c.fsm)), name) } } @@ -608,17 +608,17 @@ private[akka] class BarrierCoordinator when(Idle) { case Event(EnterBarrier(name, timeout), d @ Data(clients, _, _, _)) => if (failed) - stay.replying(ToClient(BarrierResult(name, false))) + stay().replying(ToClient(BarrierResult(name, false))) else if (clients.map(_.fsm) == Set(sender())) - stay.replying(ToClient(BarrierResult(name, true))) + stay().replying(ToClient(BarrierResult(name, true))) else if (clients.find(_.fsm == sender()).isEmpty) - stay.replying(ToClient(BarrierResult(name, false))) + stay().replying(ToClient(BarrierResult(name, false))) else { goto(Waiting).using(d.copy(barrier = name, arrived = sender() :: Nil, deadline = getDeadline(timeout))) } case Event(RemoveClient(name), d @ Data(clients, _, _, _)) => if (clients.isEmpty) throw BarrierEmpty(d, "cannot remove " + name + ": no client to remove") - stay.using(d.copy(clients = clients.filterNot(_.name == name))) + stay().using(d.copy(clients = clients.filterNot(_.name == name))) } onTransition { @@ -639,7 +639,7 @@ private[akka] class BarrierCoordinator handleBarrier(d.copy(arrived = together)) case Event(RemoveClient(name), d @ Data(clients, _, arrived, _)) => clients.find(_.name == name) match { - case None => stay + case None => stay() case Some(client) => handleBarrier(d.copy(clients = clients - client, arrived = arrived.filterNot(_ == client.fsm))) } @@ -660,7 +660,7 @@ private[akka] class BarrierCoordinator data.arrived.foreach(_ ! ToClient(BarrierResult(data.barrier, true))) goto(Idle).using(data.copy(barrier = "", arrived = Nil)) } else { - stay.using(data) + stay().using(data) } } diff --git a/akka-multi-node-testkit/src/main/scala/akka/remote/testconductor/Player.scala b/akka-multi-node-testkit/src/main/scala/akka/remote/testconductor/Player.scala index 003cdc4898..cdc4bc6702 100644 --- a/akka-multi-node-testkit/src/main/scala/akka/remote/testconductor/Player.scala +++ b/akka-multi-node-testkit/src/main/scala/akka/remote/testconductor/Player.scala @@ -60,7 +60,7 @@ object Player { } - def waiterProps = Props[Waiter] + def waiterProps = Props[Waiter]() } /** @@ -191,7 +191,7 @@ private[akka] class ClientFSM(name: RoleName, controllerAddr: InetSocketAddress) when(Connecting, stateTimeout = settings.ConnectTimeout) { case Event(_: ClientOp, _) => - stay.replying(Status.Failure(new IllegalStateException("not connected yet"))) + stay().replying(Status.Failure(new IllegalStateException("not connected yet"))) case Event(Connected(channel), _) => channel.write(Hello(name.name, TestConductor().address)) goto(AwaitDone).using(Data(Some(channel), None)) @@ -211,7 +211,7 @@ private[akka] class ClientFSM(name: RoleName, controllerAddr: InetSocketAddress) log.error("received {} instead of Done", msg) goto(Failed) case Event(_: ServerOp, _) => - stay.replying(Status.Failure(new IllegalStateException("not connected yet"))) + stay().replying(Status.Failure(new IllegalStateException("not connected yet"))) case Event(StateTimeout, _) => log.error("connect timeout to TestConductor") goto(Failed) @@ -223,7 +223,7 @@ private[akka] class ClientFSM(name: RoleName, controllerAddr: InetSocketAddress) throw new ConnectionFailure("disconnect") case Event(ToServer(_: Done), Data(Some(channel), _)) => channel.write(Done) - stay + stay() case Event(ToServer(msg), d @ Data(Some(channel), None)) => channel.write(msg) val token = msg match { @@ -231,10 +231,10 @@ private[akka] class ClientFSM(name: RoleName, controllerAddr: InetSocketAddress) case GetAddress(node) => Some(node.name -> sender()) case _ => None } - stay.using(d.copy(runningOp = token)) + stay().using(d.copy(runningOp = token)) case Event(ToServer(op), Data(_, Some((token, _)))) => log.error("cannot write {} while waiting for {}", op, token) - stay + stay() case Event(op: ClientOp, d @ Data(Some(channel @ _), runningOp)) => op match { case BarrierResult(b, success) => @@ -249,13 +249,13 @@ private[akka] class ClientFSM(name: RoleName, controllerAddr: InetSocketAddress) case None => log.warning("did not expect {}", op) } - stay.using(d.copy(runningOp = None)) + stay().using(d.copy(runningOp = None)) case AddressReply(_, address) => runningOp match { case Some((_, requester)) => requester ! address case None => log.warning("did not expect {}", op) } - stay.using(d.copy(runningOp = None)) + stay().using(d.copy(runningOp = None)) case t: ThrottleMsg => import context.dispatcher // FIXME is this the right EC for the future below? val mode = @@ -278,10 +278,10 @@ private[akka] class ClientFSM(name: RoleName, controllerAddr: InetSocketAddress) throw new RuntimeException("Throttle was requested from the TestConductor, but no transport " + "adapters available that support throttling. Specify `testTransport(on = true)` in your MultiNodeConfig") } - stay + stay() case _: DisconnectMsg => // FIXME: Currently ignoring, needs support from Remoting - stay + stay() case TerminateMsg(Left(false)) => context.system.terminate() stop() @@ -290,17 +290,17 @@ private[akka] class ClientFSM(name: RoleName, controllerAddr: InetSocketAddress) stop() case TerminateMsg(Right(exitValue)) => System.exit(exitValue) - stay // needed because Java doesn’t have Nothing - case _: Done => stay //FIXME what should happen? + stay() // needed because Java doesn’t have Nothing + case _: Done => stay() //FIXME what should happen? } } when(Failed) { case Event(msg: ClientOp, _) => - stay.replying(Status.Failure(new RuntimeException("cannot do " + msg + " while Failed"))) + stay().replying(Status.Failure(new RuntimeException("cannot do " + msg + " while Failed"))) case Event(msg: NetworkOp, _) => log.warning("ignoring network message {} while Failed", msg) - stay + stay() } onTermination { diff --git a/akka-osgi/src/test/scala/akka/osgi/test/TestActivators.scala b/akka-osgi/src/test/scala/akka/osgi/test/TestActivators.scala index c67f721a7f..74f998b1ec 100644 --- a/akka-osgi/src/test/scala/akka/osgi/test/TestActivators.scala +++ b/akka-osgi/src/test/scala/akka/osgi/test/TestActivators.scala @@ -24,7 +24,7 @@ object TestActivators { class PingPongActorSystemActivator extends ActorSystemActivator { def configure(context: BundleContext, system: ActorSystem): Unit = { - system.actorOf(Props[PongActor], name = "pong") + system.actorOf(Props[PongActor](), name = "pong") registerService(context, system) } diff --git a/akka-persistence-shared/src/test/scala/akka/persistence/serialization/SerializerSpec.scala b/akka-persistence-shared/src/test/scala/akka/persistence/serialization/SerializerSpec.scala index 30d6a0f31a..57b12e1065 100644 --- a/akka-persistence-shared/src/test/scala/akka/persistence/serialization/SerializerSpec.scala +++ b/akka-persistence-shared/src/test/scala/akka/persistence/serialization/SerializerSpec.scala @@ -330,7 +330,7 @@ class MessageSerializerRemotingSpec extends AkkaSpec(remote.withFallback(customS val serialization = SerializationExtension(system) override protected def atStartup(): Unit = { - remoteSystem.actorOf(Props[RemoteActor], "remote") + remoteSystem.actorOf(Props[RemoteActor](), "remote") } override def afterTermination(): Unit = { diff --git a/akka-persistence-tck/src/main/scala/akka/persistence/japi/journal/JavaJournalPerfSpec.scala b/akka-persistence-tck/src/main/scala/akka/persistence/japi/journal/JavaJournalPerfSpec.scala index a9ab591801..5601623aa5 100644 --- a/akka-persistence-tck/src/main/scala/akka/persistence/japi/journal/JavaJournalPerfSpec.scala +++ b/akka-persistence-tck/src/main/scala/akka/persistence/japi/journal/JavaJournalPerfSpec.scala @@ -49,7 +49,7 @@ class JavaJournalPerfSpec(config: Config) extends JournalPerfSpec(config) { System.out.println(message) } - override protected def supportsRejectingNonSerializableObjects: CapabilityFlag = CapabilityFlag.on + override protected def supportsRejectingNonSerializableObjects: CapabilityFlag = CapabilityFlag.on() - override protected def supportsSerialization: CapabilityFlag = CapabilityFlag.on + override protected def supportsSerialization: CapabilityFlag = CapabilityFlag.on() } diff --git a/akka-persistence-tck/src/main/scala/akka/persistence/japi/journal/JavaJournalSpec.scala b/akka-persistence-tck/src/main/scala/akka/persistence/japi/journal/JavaJournalSpec.scala index a9fade9961..625d8c01ef 100644 --- a/akka-persistence-tck/src/main/scala/akka/persistence/japi/journal/JavaJournalSpec.scala +++ b/akka-persistence-tck/src/main/scala/akka/persistence/japi/journal/JavaJournalSpec.scala @@ -21,7 +21,7 @@ import com.typesafe.config.Config * @param config configures the Journal plugin to be tested */ class JavaJournalSpec(config: Config) extends JournalSpec(config) { - override protected def supportsRejectingNonSerializableObjects: CapabilityFlag = CapabilityFlag.on + override protected def supportsRejectingNonSerializableObjects: CapabilityFlag = CapabilityFlag.on() - override protected def supportsSerialization: CapabilityFlag = CapabilityFlag.on + override protected def supportsSerialization: CapabilityFlag = CapabilityFlag.on() } diff --git a/akka-persistence-tck/src/main/scala/akka/persistence/japi/snapshot/JavaSnapshotStoreSpec.scala b/akka-persistence-tck/src/main/scala/akka/persistence/japi/snapshot/JavaSnapshotStoreSpec.scala index a89282aad9..2cef3c4117 100644 --- a/akka-persistence-tck/src/main/scala/akka/persistence/japi/snapshot/JavaSnapshotStoreSpec.scala +++ b/akka-persistence-tck/src/main/scala/akka/persistence/japi/snapshot/JavaSnapshotStoreSpec.scala @@ -20,5 +20,5 @@ import com.typesafe.config.Config * @see [[akka.persistence.snapshot.SnapshotStoreSpec]] */ class JavaSnapshotStoreSpec(config: Config) extends SnapshotStoreSpec(config) { - override protected def supportsSerialization: CapabilityFlag = CapabilityFlag.on + override protected def supportsSerialization: CapabilityFlag = CapabilityFlag.on() } diff --git a/akka-persistence-tck/src/test/scala/akka/persistence/snapshot/local/LocalSnapshotStoreSpec.scala b/akka-persistence-tck/src/test/scala/akka/persistence/snapshot/local/LocalSnapshotStoreSpec.scala index 726bc9ad83..f2d70314e5 100644 --- a/akka-persistence-tck/src/test/scala/akka/persistence/snapshot/local/LocalSnapshotStoreSpec.scala +++ b/akka-persistence-tck/src/test/scala/akka/persistence/snapshot/local/LocalSnapshotStoreSpec.scala @@ -19,5 +19,5 @@ class LocalSnapshotStoreSpec """)) with PluginCleanup { - override protected def supportsSerialization: CapabilityFlag = CapabilityFlag.on + override protected def supportsSerialization: CapabilityFlag = CapabilityFlag.on() } diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorReplySpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorReplySpec.scala index ac65750a10..297a4fab97 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorReplySpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorReplySpec.scala @@ -87,7 +87,7 @@ class EventSourcedBehaviorReplySpec "persist an event thenReply" in { val c = spawn(counter(nextPid())) - val probe = TestProbe[Done] + val probe = TestProbe[Done]() c ! IncrementWithConfirmation(probe.ref) probe.expectMessage(Done) @@ -99,17 +99,17 @@ class EventSourcedBehaviorReplySpec "persist an event thenReply later" in { val c = spawn(counter(nextPid())) - val probe = TestProbe[Done] + val probe = TestProbe[Done]() c ! IncrementReplyLater(probe.ref) probe.expectMessage(Done) } "reply to query command" in { val c = spawn(counter(nextPid())) - val updateProbe = TestProbe[Done] + val updateProbe = TestProbe[Done]() c ! IncrementWithConfirmation(updateProbe.ref) - val queryProbe = TestProbe[State] + val queryProbe = TestProbe[State]() c ! GetValue(queryProbe.ref) queryProbe.expectMessage(State(1, Vector(0))) } diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRetentionSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRetentionSpec.scala index 99b6fe16fb..08ccdda1d6 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRetentionSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRetentionSpec.scala @@ -207,7 +207,7 @@ class EventSourcedBehaviorRetentionSpec "snapshot via predicate" in { val pid = nextPid() - val snapshotSignalProbe = TestProbe[WrappedSignal] + val snapshotSignalProbe = TestProbe[WrappedSignal]() val alwaysSnapshot: Behavior[Command] = Behaviors.setup { ctx => counter(ctx, pid, snapshotSignalProbe = Some(snapshotSignalProbe.ref)).snapshotWhen { (_, _, _) => @@ -237,7 +237,7 @@ class EventSourcedBehaviorRetentionSpec "check all events for snapshot in PersistAll" in { val pid = nextPid() - val snapshotSignalProbe = TestProbe[WrappedSignal] + val snapshotSignalProbe = TestProbe[WrappedSignal]() val snapshotAtTwo = Behaviors.setup[Command](ctx => counter(ctx, pid, snapshotSignalProbe = Some(snapshotSignalProbe.ref)).snapshotWhen { (s, _, _) => s.value == 2 diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorSpec.scala index 9e63c07a05..d966f75e0e 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorSpec.scala @@ -130,9 +130,9 @@ object EventSourcedBehaviorSpec { counter( ctx, persistenceId, - loggingActor = TestProbe[String].ref, - probe = TestProbe[(State, Event)].ref, - snapshotProbe = TestProbe[Try[SnapshotMetadata]].ref) + loggingActor = TestProbe[String]().ref, + probe = TestProbe[(State, Event)]().ref, + snapshotProbe = TestProbe[Try[SnapshotMetadata]]().ref) def counter(ctx: ActorContext[Command], persistenceId: PersistenceId, logging: ActorRef[String])( implicit system: ActorSystem[_]): EventSourcedBehavior[Command, Event, State] = @@ -140,8 +140,8 @@ object EventSourcedBehaviorSpec { ctx, persistenceId, loggingActor = logging, - probe = TestProbe[(State, Event)].ref, - TestProbe[Try[SnapshotMetadata]].ref) + probe = TestProbe[(State, Event)]().ref, + TestProbe[Try[SnapshotMetadata]]().ref) def counterWithProbe( ctx: ActorContext[Command], @@ -149,18 +149,18 @@ object EventSourcedBehaviorSpec { probe: ActorRef[(State, Event)], snapshotProbe: ActorRef[Try[SnapshotMetadata]])( implicit system: ActorSystem[_]): EventSourcedBehavior[Command, Event, State] = - counter(ctx, persistenceId, TestProbe[String].ref, probe, snapshotProbe) + counter(ctx, persistenceId, TestProbe[String]().ref, probe, snapshotProbe) def counterWithProbe(ctx: ActorContext[Command], persistenceId: PersistenceId, probe: ActorRef[(State, Event)])( implicit system: ActorSystem[_]): EventSourcedBehavior[Command, Event, State] = - counter(ctx, persistenceId, TestProbe[String].ref, probe, TestProbe[Try[SnapshotMetadata]].ref) + counter(ctx, persistenceId, TestProbe[String]().ref, probe, TestProbe[Try[SnapshotMetadata]]().ref) def counterWithSnapshotProbe( ctx: ActorContext[Command], persistenceId: PersistenceId, probe: ActorRef[Try[SnapshotMetadata]])( implicit system: ActorSystem[_]): EventSourcedBehavior[Command, Event, State] = - counter(ctx, persistenceId, TestProbe[String].ref, TestProbe[(State, Event)].ref, snapshotProbe = probe) + counter(ctx, persistenceId, TestProbe[String]().ref, TestProbe[(State, Event)]().ref, snapshotProbe = probe) def counter( ctx: ActorContext[Command], @@ -182,7 +182,7 @@ object EventSourcedBehaviorSpec { .thenRun { (_: State) => loggingActor ! firstLogging } - .thenStop + .thenStop() case IncrementTwiceThenLogThenStop => Effect @@ -190,7 +190,7 @@ object EventSourcedBehaviorSpec { .thenRun { (_: State) => loggingActor ! firstLogging } - .thenStop + .thenStop() case IncrementWithPersistAll(n) => Effect.persist((0 until n).map(_ => Incremented(1))) @@ -253,7 +253,7 @@ object EventSourcedBehaviorSpec { .thenRun { _ => loggingActor ! firstLogging } - .thenStop + .thenStop() case Fail => throw new TestException("boom!") @@ -293,18 +293,18 @@ class EventSourcedBehaviorSpec "A typed persistent actor" must { "persist an event" in { - val c = spawn(counter(nextPid)) - val probe = TestProbe[State] + val c = spawn(counter(nextPid())) + val probe = TestProbe[State]() c ! Increment c ! GetValue(probe.ref) probe.expectMessage(State(1, Vector(0))) } "replay stored events" in { - val pid = nextPid + val pid = nextPid() val c = spawn(counter(pid)) - val probe = TestProbe[State] + val probe = TestProbe[State]() c ! Increment c ! Increment c ! Increment @@ -320,8 +320,8 @@ class EventSourcedBehaviorSpec } "handle Terminated signal" in { - val c = spawn(counter(nextPid)) - val probe = TestProbe[State] + val c = spawn(counter(nextPid())) + val probe = TestProbe[State]() c ! Increment c ! IncrementLater eventually { @@ -331,9 +331,9 @@ class EventSourcedBehaviorSpec } "handle receive timeout" in { - val c = spawn(counter(nextPid)) + val c = spawn(counter(nextPid())) - val probe = TestProbe[State] + val probe = TestProbe[State]() c ! Increment c ! IncrementAfterReceiveTimeout // let it timeout @@ -349,10 +349,10 @@ class EventSourcedBehaviorSpec * The [[IncrementTwiceAndThenLog]] command will emit two Increment events */ "chainable side effects with events" in { - val loggingProbe = TestProbe[String] - val c = spawn(counter(nextPid, loggingProbe.ref)) + val loggingProbe = TestProbe[String]() + val c = spawn(counter(nextPid(), loggingProbe.ref)) - val probe = TestProbe[State] + val probe = TestProbe[State]() c ! IncrementTwiceAndThenLog c ! GetValue(probe.ref) @@ -363,8 +363,8 @@ class EventSourcedBehaviorSpec } "persist then stop" in { - val loggingProbe = TestProbe[String] - val c = spawn(counter(nextPid, loggingProbe.ref)) + val loggingProbe = TestProbe[String]() + val c = spawn(counter(nextPid(), loggingProbe.ref)) val watchProbe = watcher(c) c ! IncrementThenLogThenStop @@ -373,8 +373,8 @@ class EventSourcedBehaviorSpec } "persist(All) then stop" in { - val loggingProbe = TestProbe[String] - val c = spawn(counter(nextPid, loggingProbe.ref)) + val loggingProbe = TestProbe[String]() + val c = spawn(counter(nextPid(), loggingProbe.ref)) val watchProbe = watcher(c) c ! IncrementTwiceThenLogThenStop @@ -384,8 +384,8 @@ class EventSourcedBehaviorSpec } "persist an event thenReply" in { - val c = spawn(counter(nextPid)) - val probe = TestProbe[Done] + val c = spawn(counter(nextPid())) + val probe = TestProbe[Done]() c ! IncrementWithConfirmation(probe.ref) probe.expectMessage(Done) @@ -397,10 +397,10 @@ class EventSourcedBehaviorSpec /** Proves that side-effects are called when emitting an empty list of events */ "chainable side effects without events" in { - val loggingProbe = TestProbe[String] - val c = spawn(counter(nextPid, loggingProbe.ref)) + val loggingProbe = TestProbe[String]() + val c = spawn(counter(nextPid(), loggingProbe.ref)) - val probe = TestProbe[State] + val probe = TestProbe[State]() c ! EmptyEventsListAndThenLog c ! GetValue(probe.ref) probe.expectMessage(State(0, Vector.empty)) @@ -409,10 +409,10 @@ class EventSourcedBehaviorSpec /** Proves that side-effects are called when explicitly calling Effect.none */ "chainable side effects when doing nothing (Effect.none)" in { - val loggingProbe = TestProbe[String] - val c = spawn(counter(nextPid, loggingProbe.ref)) + val loggingProbe = TestProbe[String]() + val c = spawn(counter(nextPid(), loggingProbe.ref)) - val probe = TestProbe[State] + val probe = TestProbe[State]() c ! DoNothingAndThenLog c ! GetValue(probe.ref) probe.expectMessage(State(0, Vector.empty)) @@ -420,9 +420,9 @@ class EventSourcedBehaviorSpec } "work when wrapped in other behavior" in { - val probe = TestProbe[State] + val probe = TestProbe[State]() val behavior = Behaviors - .supervise[Command](counter(nextPid)) + .supervise[Command](counter(nextPid())) .onFailure(SupervisorStrategy.restartWithBackoff(1.second, 10.seconds, 0.1)) val c = spawn(behavior) c ! Increment @@ -431,8 +431,8 @@ class EventSourcedBehaviorSpec } "stop after logging (no persisting)" in { - val loggingProbe = TestProbe[String] - val c: ActorRef[Command] = spawn(counter(nextPid, loggingProbe.ref)) + val loggingProbe = TestProbe[String]() + val c: ActorRef[Command] = spawn(counter(nextPid(), loggingProbe.ref)) val watchProbe = watcher(c) c ! LogThenStop loggingProbe.expectMessage(firstLogging) @@ -440,8 +440,8 @@ class EventSourcedBehaviorSpec } "wrap persistent behavior in tap" in { - val probe = TestProbe[Command] - val wrapped: Behavior[Command] = Behaviors.monitor(probe.ref, counter(nextPid)) + val probe = TestProbe[Command]() + val wrapped: Behavior[Command] = Behaviors.monitor(probe.ref, counter(nextPid())) val c = spawn(wrapped) c ! Increment @@ -452,7 +452,7 @@ class EventSourcedBehaviorSpec } "tag events" in { - val pid = nextPid + val pid = nextPid() val c = spawn(Behaviors.setup[Command](ctx => counter(ctx, pid).withTagger(_ => Set("tag1", "tag2")))) val replyProbe = TestProbe[State]() @@ -468,10 +468,10 @@ class EventSourcedBehaviorSpec val c = spawn(Behaviors.withTimers[Command] { timers => timers.startSingleTimer(Increment, 1.millis) Thread.sleep(30) // now it's probably already in the mailbox, and will be stashed - counter(nextPid) + counter(nextPid()) }) - val probe = TestProbe[State] + val probe = TestProbe[State]() c ! Increment probe.awaitAssert { c ! GetValue(probe.ref) @@ -483,10 +483,10 @@ class EventSourcedBehaviorSpec val c = spawn(Behaviors.withTimers[Command] { timers => // probably arrives after recovery completed timers.startSingleTimer(Increment, 200.millis) - counter(nextPid) + counter(nextPid()) }) - val probe = TestProbe[State] + val probe = TestProbe[State]() c ! Increment probe.awaitAssert { c ! GetValue(probe.ref) @@ -498,11 +498,11 @@ class EventSourcedBehaviorSpec LoggingTestKit.error("Exception during recovery from snapshot").expect { val c = spawn( Behaviors.setup[Command](ctx => - counter(ctx, nextPid) + counter(ctx, nextPid()) .withSnapshotPluginId("slow-snapshot-store") .withJournalPluginId("short-recovery-timeout"))) - val probe = TestProbe[State] + val probe = TestProbe[State]() probe.expectTerminated(c, probe.remainingOrDefault) } @@ -510,7 +510,7 @@ class EventSourcedBehaviorSpec "not wrap a failure caused by command stashed while recovering in a journal failure" in { val pid = nextPid() - val probe = TestProbe[AnyRef] + val probe = TestProbe[AnyRef]() // put some events in there, so that recovering takes a little time val c = spawn(Behaviors.setup[Command](counter(_, pid))) @@ -532,7 +532,7 @@ class EventSourcedBehaviorSpec intercept[IllegalArgumentException] { PersistenceId.ofUniqueId(null) } - val probe = TestProbe[AnyRef] + val probe = TestProbe[AnyRef]() LoggingTestKit.error[ActorInitializationException].withMessageContains("persistenceId must not be null").expect { val ref = spawn(Behaviors.setup[Command](counter(_, persistenceId = PersistenceId.ofUniqueId(null)))) probe.expectTerminated(ref) @@ -547,7 +547,7 @@ class EventSourcedBehaviorSpec intercept[IllegalArgumentException] { PersistenceId.ofUniqueId("") } - val probe = TestProbe[AnyRef] + val probe = TestProbe[AnyRef]() LoggingTestKit.error[ActorInitializationException].withMessageContains("persistenceId must not be empty").expect { val ref = spawn(Behaviors.setup[Command](counter(_, persistenceId = PersistenceId.ofUniqueId("")))) probe.expectTerminated(ref) diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorStashSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorStashSpec.scala index eab7f98fa6..050e0118d7 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorStashSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorStashSpec.scala @@ -177,8 +177,8 @@ class EventSourcedBehaviorStashSpec "stash and unstash" in { val c = spawn(counter(nextPid())) - val ackProbe = TestProbe[Ack] - val stateProbe = TestProbe[State] + val ackProbe = TestProbe[Ack]() + val stateProbe = TestProbe[State]() c ! Increment("1", ackProbe.ref) ackProbe.expectMessage(Ack("1")) @@ -205,8 +205,8 @@ class EventSourcedBehaviorStashSpec "handle mix of stash, persist and unstash" in { val c = spawn(counter(nextPid())) - val ackProbe = TestProbe[Ack] - val stateProbe = TestProbe[State] + val ackProbe = TestProbe[Ack]() + val stateProbe = TestProbe[State]() c ! Increment("1", ackProbe.ref) ackProbe.expectMessage(Ack("1")) @@ -233,8 +233,8 @@ class EventSourcedBehaviorStashSpec "unstash in right order" in { val c = spawn(counter(nextPid())) - val ackProbe = TestProbe[Ack] - val stateProbe = TestProbe[State] + val ackProbe = TestProbe[Ack]() + val stateProbe = TestProbe[State]() c ! Increment(s"inc-1", ackProbe.ref) @@ -270,9 +270,9 @@ class EventSourcedBehaviorStashSpec "handle many stashed" in { val c = spawn(counter(nextPid())) - val ackProbe = TestProbe[Ack] - val stateProbe = TestProbe[State] - val notUsedProbe = TestProbe[NotUsed] + val ackProbe = TestProbe[Ack]() + val stateProbe = TestProbe[State]() + val notUsedProbe = TestProbe[NotUsed]() val unhandledProbe = createTestProbe[UnhandledMessage]() system.eventStream ! EventStream.Subscribe(unhandledProbe.ref) @@ -383,8 +383,8 @@ class EventSourcedBehaviorStashSpec "discard user stash when restarted due to thrown exception" in { val c = spawn(counter(nextPid())) - val ackProbe = TestProbe[Ack] - val stateProbe = TestProbe[State] + val ackProbe = TestProbe[Ack]() + val stateProbe = TestProbe[State]() c ! Increment("inc-1", ackProbe.ref) ackProbe.expectMessage(Ack("inc-1")) @@ -418,8 +418,8 @@ class EventSourcedBehaviorStashSpec "discard internal stash when restarted due to thrown exception" in { val c = spawn(counter(nextPid())) - val ackProbe = TestProbe[Ack] - val stateProbe = TestProbe[State] + val ackProbe = TestProbe[Ack]() + val stateProbe = TestProbe[State]() val latch = new CountDownLatch(1) // make first command slow to ensure that all subsequent commands are enqueued first @@ -448,8 +448,8 @@ class EventSourcedBehaviorStashSpec "preserve internal stash when persist failed" in { val c = spawn(counter(PersistenceId.ofUniqueId("fail-fifth-a"))) - val ackProbe = TestProbe[Ack] - val stateProbe = TestProbe[State] + val ackProbe = TestProbe[Ack]() + val stateProbe = TestProbe[State]() (1 to 10).foreach { n => c ! Increment(s"inc-$n", ackProbe.ref) @@ -466,8 +466,8 @@ class EventSourcedBehaviorStashSpec "preserve user stash when persist failed" in { val c = spawn(counter(PersistenceId.ofUniqueId("fail-fifth-b"))) - val ackProbe = TestProbe[Ack] - val stateProbe = TestProbe[State] + val ackProbe = TestProbe[Ack]() + val stateProbe = TestProbe[State]() c ! Increment("inc-1", ackProbe.ref) ackProbe.expectMessage(Ack("inc-1")) @@ -604,7 +604,7 @@ class EventSourcedBehaviorStashSpec "stop from PoisonPill even though user stash is not empty" in { val c = spawn(counter(nextPid())) - val ackProbe = TestProbe[Ack] + val ackProbe = TestProbe[Ack]() c ! Increment("1", ackProbe.ref) ackProbe.expectMessage(Ack("1")) @@ -622,7 +622,7 @@ class EventSourcedBehaviorStashSpec "stop from PoisonPill after unstashing completed" in { val c = spawn(counter(nextPid())) - val ackProbe = TestProbe[Ack] + val ackProbe = TestProbe[Ack]() val unhandledProbe = createTestProbe[UnhandledMessage]() system.eventStream ! EventStream.Subscribe(unhandledProbe.ref) @@ -658,7 +658,7 @@ class EventSourcedBehaviorStashSpec "stop from PoisonPill after recovery completed" in { val pid = nextPid() val c = spawn(counter(pid)) - val ackProbe = TestProbe[Ack] + val ackProbe = TestProbe[Ack]() c ! Increment("1", ackProbe.ref) c ! Increment("2", ackProbe.ref) @@ -667,7 +667,7 @@ class EventSourcedBehaviorStashSpec ackProbe.expectMessage(Ack("2")) ackProbe.expectMessage(Ack("3")) - val signalProbe = TestProbe[String] + val signalProbe = TestProbe[String]() val c2 = spawn(counter(pid, Some(signalProbe.ref))) // this PoisonPill will most likely be received in RequestingRecoveryPermit since it's sent immediately c2.toClassic ! PoisonPill diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/OptionalSnapshotStoreSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/OptionalSnapshotStoreSpec.scala index 856d2945fb..9150c5a78a 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/OptionalSnapshotStoreSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/OptionalSnapshotStoreSpec.scala @@ -73,7 +73,7 @@ class OptionalSnapshotStoreSpec extends ScalaTestWithActorTestKit(s""" } "successfully save a snapshot when no default snapshot-store configured, yet PersistentActor picked one explicitly" in { - val stateProbe = TestProbe[State] + val stateProbe = TestProbe[State]() val persistentActor = spawn(persistentBehaviorWithSnapshotPlugin(stateProbe)) persistentActor ! AnyCommand stateProbe.expectMessageType[State] diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PerformanceSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PerformanceSpec.scala index c86123a3a1..37abf4628d 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PerformanceSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PerformanceSpec.scala @@ -145,7 +145,7 @@ class PerformanceSpec extends ScalaTestWithActorTestKit(ConfigFactory.parseStrin } def stressEventSourcedPersistentActor(failAt: Option[Long]): Unit = { - val probe = TestProbe[Reply] + val probe = TestProbe[Reply]() val name = s"${this.getClass.getSimpleName}-${UUID.randomUUID().toString}" val persistentActor = spawn(eventSourcedTestPersistenceBehavior(name, probe), name) stressPersistentActor(persistentActor, probe, failAt, "persistent events") diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PersistentActorCompileOnlyTest.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PersistentActorCompileOnlyTest.scala index 45908c7f75..545fac3c6c 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PersistentActorCompileOnlyTest.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PersistentActorCompileOnlyTest.scala @@ -290,7 +290,7 @@ object PersistentActorCompileOnlyTest { private val commandHandler: CommandHandler[Command, Event, State] = CommandHandler.command { case Enough => - Effect.persist(Done).thenRun((_: State) => println("yay")).thenStop + Effect.persist(Done).thenRun((_: State) => println("yay")).thenStop() } private val eventHandler: (State, Event) => State = { diff --git a/akka-persistence/src/main/scala/akka/persistence/fsm/PersistentFSMBase.scala b/akka-persistence/src/main/scala/akka/persistence/fsm/PersistentFSMBase.scala index a2e40d01ca..eb33fe0295 100644 --- a/akka-persistence/src/main/scala/akka/persistence/fsm/PersistentFSMBase.scala +++ b/akka-persistence/src/main/scala/akka/persistence/fsm/PersistentFSMBase.scala @@ -192,7 +192,7 @@ trait PersistentFSMBase[S, D, E] extends Actor with Listeners with ActorLogging /** * Produce change descriptor to stop this FSM actor including specified reason. */ - final def stop(reason: Reason, stateData: D): State = stay.copy(stopReason = Some(reason), stateData = stateData) + final def stop(reason: Reason, stateData: D): State = stay().copy(stopReason = Some(reason), stateData = stateData) final class TransformHelper(func: StateFunction) { def using(andThen: PartialFunction[State, State]): StateFunction = @@ -283,9 +283,9 @@ trait PersistentFSMBase[S, D, E] extends Actor with Listeners with ActorLogging if (debugEvent) log.debug("setting " + (if (mode.repeat) "repeating " else "") + "timer '" + name + "'/" + timeout + ": " + msg) if (timers contains name) { - timers(name).cancel + timers(name).cancel() } - val timer = Timer(name, msg, mode, timerGen.next, this)(context) + val timer = Timer(name, msg, mode, timerGen.next(), this)(context) timer.schedule(self, timeout) timers(name) = timer } @@ -298,7 +298,7 @@ trait PersistentFSMBase[S, D, E] extends Actor with Listeners with ActorLogging if (debugEvent) log.debug("canceling timer '" + name + "'") if (timers contains name) { - timers(name).cancel + timers(name).cancel() timers -= name } } @@ -458,7 +458,7 @@ trait PersistentFSMBase[S, D, E] extends Actor with Listeners with ActorLogging private val handleEventDefault: StateFunction = { case Event(value, _) => log.warning("unhandled event " + value + " in state " + stateName) - stay + stay() } private var handleEvent: StateFunction = handleEventDefault @@ -551,7 +551,7 @@ trait PersistentFSMBase[S, D, E] extends Actor with Listeners with ActorLogging private[akka] def makeTransition(nextState: State): Unit = { if (!stateFunctions.contains(nextState.stateName)) { - terminate(stay.withStopReason(Failure("Next state %s does not exist".format(nextState.stateName)))) + terminate(stay().withStopReason(Failure("Next state %s does not exist".format(nextState.stateName)))) } else { nextState.replies.reverse.foreach { r => sender() ! r @@ -594,7 +594,7 @@ trait PersistentFSMBase[S, D, E] extends Actor with Listeners with ActorLogging * setting this instance’s state to terminated does no harm during restart * since the new instance will initialize fresh using startWith() */ - terminate(stay.withStopReason(Shutdown)) + terminate(stay().withStopReason(Shutdown)) super.postStop() } diff --git a/akka-persistence/src/main/scala/akka/persistence/journal/PersistencePluginProxy.scala b/akka-persistence/src/main/scala/akka/persistence/journal/PersistencePluginProxy.scala index 2fb0d9e12f..af8ecde096 100644 --- a/akka-persistence/src/main/scala/akka/persistence/journal/PersistencePluginProxy.scala +++ b/akka-persistence/src/main/scala/akka/persistence/journal/PersistencePluginProxy.scala @@ -190,31 +190,31 @@ final class PersistencePluginProxy(config: Config) extends Actor with Stash with req match { // exhaustive match case WriteMessages(messages, persistentActor, actorInstanceId) => val atomicWriteCount = messages.count(_.isInstanceOf[AtomicWrite]) - persistentActor ! WriteMessagesFailed(timeoutException, atomicWriteCount) + persistentActor ! WriteMessagesFailed(timeoutException(), atomicWriteCount) messages.foreach { case a: AtomicWrite => a.payload.foreach { p => - persistentActor ! WriteMessageFailure(p, timeoutException, actorInstanceId) + persistentActor ! WriteMessageFailure(p, timeoutException(), actorInstanceId) } case r: NonPersistentRepr => persistentActor ! LoopMessageSuccess(r.payload, actorInstanceId) } case ReplayMessages(_, _, _, _, persistentActor) => - persistentActor ! ReplayMessagesFailure(timeoutException) + persistentActor ! ReplayMessagesFailure(timeoutException()) case DeleteMessagesTo(_, toSequenceNr, persistentActor) => - persistentActor ! DeleteMessagesFailure(timeoutException, toSequenceNr) + persistentActor ! DeleteMessagesFailure(timeoutException(), toSequenceNr) } case req: SnapshotProtocol.Request => req match { // exhaustive match case _: LoadSnapshot => - sender() ! LoadSnapshotFailed(timeoutException) + sender() ! LoadSnapshotFailed(timeoutException()) case SaveSnapshot(metadata, _) => - sender() ! SaveSnapshotFailure(metadata, timeoutException) + sender() ! SaveSnapshotFailure(metadata, timeoutException()) case DeleteSnapshot(metadata) => - sender() ! DeleteSnapshotFailure(metadata, timeoutException) + sender() ! DeleteSnapshotFailure(metadata, timeoutException()) case DeleteSnapshots(_, criteria) => - sender() ! DeleteSnapshotsFailure(criteria, timeoutException) + sender() ! DeleteSnapshotsFailure(criteria, timeoutException()) } case TargetLocation(address) => diff --git a/akka-persistence/src/main/scala/akka/persistence/snapshot/local/LocalSnapshotStore.scala b/akka-persistence/src/main/scala/akka/persistence/snapshot/local/LocalSnapshotStore.scala index b662345c48..ec3087072c 100644 --- a/akka-persistence/src/main/scala/akka/persistence/snapshot/local/LocalSnapshotStore.scala +++ b/akka-persistence/src/main/scala/akka/persistence/snapshot/local/LocalSnapshotStore.scala @@ -92,7 +92,7 @@ private[persistence] class LocalSnapshotStore(config: Config) extends SnapshotSt } private def snapshotFiles(metadata: SnapshotMetadata): immutable.Seq[File] = { - snapshotDir.listFiles(new SnapshotSeqNrFilenameFilter(metadata)).toVector + snapshotDir().listFiles(new SnapshotSeqNrFilenameFilter(metadata)).toVector } @scala.annotation.tailrec @@ -144,13 +144,13 @@ private[persistence] class LocalSnapshotStore(config: Config) extends SnapshotSt /** Only by persistenceId and sequenceNr, timestamp is informational - accommodates for 2.13.x series files */ protected def snapshotFileForWrite(metadata: SnapshotMetadata, extension: String = ""): File = new File( - snapshotDir, + snapshotDir(), s"snapshot-${URLEncoder.encode(metadata.persistenceId, UTF_8)}-${metadata.sequenceNr}-${metadata.timestamp}${extension}") private def snapshotMetadatas( persistenceId: String, criteria: SnapshotSelectionCriteria): immutable.Seq[SnapshotMetadata] = { - val files = snapshotDir.listFiles(new SnapshotFilenameFilter(persistenceId)) + val files = snapshotDir().listFiles(new SnapshotFilenameFilter(persistenceId)) if (files eq null) Nil // if the dir was removed else { files diff --git a/akka-persistence/src/test/scala/akka/persistence/TimerPersistentActorSpec.scala b/akka-persistence/src/test/scala/akka/persistence/TimerPersistentActorSpec.scala index ba97086936..dbdf39afd6 100644 --- a/akka-persistence/src/test/scala/akka/persistence/TimerPersistentActorSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/TimerPersistentActorSpec.scala @@ -101,7 +101,7 @@ class TimerPersistentActorSpec extends PersistenceSpec(ConfigFactory.parseString } "reject wrong order of traits, PersistentActor with Timer" in { - val pa = system.actorOf(Props[WrongOrder]) + val pa = system.actorOf(Props[WrongOrder]()) watch(pa) expectTerminated(pa) } diff --git a/akka-persistence/src/test/scala/akka/persistence/fsm/PersistentFSMSpec.scala b/akka-persistence/src/test/scala/akka/persistence/fsm/PersistentFSMSpec.scala index c03e1ce2f7..56d7e3b217 100644 --- a/akka-persistence/src/test/scala/akka/persistence/fsm/PersistentFSMSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/fsm/PersistentFSMSpec.scala @@ -464,7 +464,7 @@ object PersistentFSMSpec { startWith(LookingAround, EmptyShoppingCart) when(LookingAround) { - case Event("stay", _) => stay + case Event("stay", _) => stay() case Event(_, _) => goto(LookingAround) } @@ -493,12 +493,12 @@ object PersistentFSMSpec { case Event(AddItem(item), _) => goto(Shopping).applying(ItemAdded(item)).forMax(1 seconds) case Event(GetCurrentCart, data) => - stay.replying(data) + stay().replying(data) } when(Shopping) { case Event(AddItem(item), _) => - stay.applying(ItemAdded(item)).forMax(1 seconds) + stay().applying(ItemAdded(item)).forMax(1 seconds) case Event(Buy, _) => //#customer-andthen-example goto(Paid).applying(OrderExecuted).andThen { @@ -512,14 +512,14 @@ object PersistentFSMSpec { //#customer-andthen-example case Event(Leave, _) => //#customer-snapshot-example - stop.applying(OrderDiscarded).andThen { + stop().applying(OrderDiscarded).andThen { case _ => reportActor ! ShoppingCardDiscarded saveStateSnapshot() } //#customer-snapshot-example case Event(GetCurrentCart, data) => - stay.replying(data) + stay().replying(data) case Event(StateTimeout, _) => goto(Inactive).forMax(2 seconds) } @@ -528,7 +528,7 @@ object PersistentFSMSpec { case Event(AddItem(item), _) => goto(Shopping).applying(ItemAdded(item)).forMax(1 seconds) case Event(StateTimeout, _) => - stop.applying(OrderDiscarded).andThen { + stop().applying(OrderDiscarded).andThen { case _ => reportActor ! ShoppingCardDiscarded } } @@ -536,7 +536,7 @@ object PersistentFSMSpec { when(Paid) { case Event(Leave, _) => stop() case Event(GetCurrentCart, data) => - stay.replying(data) + stay().replying(data) } //#customer-fsm-body @@ -633,7 +633,7 @@ object PersistentFSMSpec { when(PersistSingleAtOnce) { case Event(i: Int, _) => - stay.applying(IntAdded(i)) + stay().applying(IntAdded(i)) case Event("4x", _) => goto(Persist4xAtOnce) case Event(SaveSnapshotSuccess(metadata), _) => @@ -643,7 +643,7 @@ object PersistentFSMSpec { when(Persist4xAtOnce) { case Event(i: Int, _) => - stay.applying(IntAdded(i), IntAdded(i), IntAdded(i), IntAdded(i)) + stay().applying(IntAdded(i), IntAdded(i), IntAdded(i), IntAdded(i)) case Event(SaveSnapshotSuccess(metadata), _) => probe ! s"SeqNo=${metadata.sequenceNr}, StateData=${stateData}" stay() diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/AttemptSysMsgRedeliverySpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/AttemptSysMsgRedeliverySpec.scala index 3b5e8311b7..a70cd0fe78 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/AttemptSysMsgRedeliverySpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/AttemptSysMsgRedeliverySpec.scala @@ -62,7 +62,7 @@ abstract class AttemptSysMsgRedeliverySpec(multiNodeConfig: AttemptSysMsgRedeliv "AttemptSysMsgRedelivery" must { "redeliver system message after inactivity" taggedAs LongRunningTest in { - system.actorOf(Props[Echo], "echo") + system.actorOf(Props[Echo](), "echo") enterBarrier("echo-started") system.actorSelection(node(first) / "user" / "echo") ! Identify(None) diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/LookupRemoteActorSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/LookupRemoteActorSpec.scala index 6c986ac655..b09b86abd1 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/LookupRemoteActorSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/LookupRemoteActorSpec.scala @@ -49,7 +49,7 @@ abstract class LookupRemoteActorSpec(multiNodeConfig: LookupRemoteActorMultiJvmS def initialParticipants = 2 runOn(master) { - system.actorOf(Props[SomeActor], "service-hello") + system.actorOf(Props[SomeActor](), "service-hello") } "Remoting" must { diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/NewRemoteActorSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/NewRemoteActorSpec.scala index 922bc7d0cf..b8b696fc24 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/NewRemoteActorSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/NewRemoteActorSpec.scala @@ -70,7 +70,7 @@ abstract class NewRemoteActorSpec(multiNodeConfig: NewRemoteActorMultiJvmSpec) "be locally instantiated on a remote node and be able to communicate through its RemoteActorRef" in { runOn(master) { - val actor = system.actorOf(Props[SomeActor], "service-hello") + val actor = system.actorOf(Props[SomeActor](), "service-hello") actor.isInstanceOf[RemoteActorRef] should ===(true) actor.path.address should ===(node(slave).address) @@ -100,7 +100,7 @@ abstract class NewRemoteActorSpec(multiNodeConfig: NewRemoteActorMultiJvmSpec) "be locally instantiated on a remote node and be able to communicate through its RemoteActorRef (with deployOnAll)" in { runOn(master) { - val actor = system.actorOf(Props[SomeActor], "service-hello2") + val actor = system.actorOf(Props[SomeActor](), "service-hello2") actor.isInstanceOf[RemoteActorRef] should ===(true) actor.path.address should ===(node(slave).address) @@ -114,7 +114,7 @@ abstract class NewRemoteActorSpec(multiNodeConfig: NewRemoteActorMultiJvmSpec) "be able to shutdown system when using remote deployed actor" in within(20 seconds) { runOn(master) { - val actor = system.actorOf(Props[SomeActor], "service-hello3") + val actor = system.actorOf(Props[SomeActor](), "service-hello3") actor.isInstanceOf[RemoteActorRef] should ===(true) actor.path.address should ===(node(slave).address) // This watch is in race with the shutdown of the watched system. This race should remain, as the test should diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/PiercingShouldKeepQuarantineSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/PiercingShouldKeepQuarantineSpec.scala index 77157f20ae..e22a50c4c3 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/PiercingShouldKeepQuarantineSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/PiercingShouldKeepQuarantineSpec.scala @@ -74,7 +74,7 @@ abstract class PiercingShouldKeepQuarantineSpec(multiNodeConfig: PiercingShouldK } runOn(second) { - system.actorOf(Props[Subject], "subject") + system.actorOf(Props[Subject](), "subject") enterBarrier("actors-started") enterBarrier("actor-identified") enterBarrier("quarantine-intact") diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteDeliverySpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteDeliverySpec.scala index 515175cbb1..c6a4fa0027 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteDeliverySpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteDeliverySpec.scala @@ -60,7 +60,7 @@ abstract class RemoteDeliverySpec(multiNodeConfig: RemoteDeliveryConfig) "Remote message delivery" must { "not drop messages under normal circumstances" in { - system.actorOf(Props[Postman], "postman-" + myself.name) + system.actorOf(Props[Postman](), "postman-" + myself.name) enterBarrier("actors-started") runOn(first) { diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteDeploymentDeathWatchSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteDeploymentDeathWatchSpec.scala index 3bb60ceeae..85cf027516 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteDeploymentDeathWatchSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteDeploymentDeathWatchSpec.scala @@ -82,7 +82,7 @@ abstract class RemoteDeploymentDeathWatchSpec(multiNodeConfig: RemoteDeploymentD "be able to shutdown when remote node crash" taggedAs LongRunningTest in within(20 seconds) { runOn(second) { // remote deployment to third - val hello = system.actorOf(Props[Hello], "hello") + val hello = system.actorOf(Props[Hello](), "hello") hello.path.address should ===(node(third).address) enterBarrier("hello-deployed") diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteFeaturesSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteFeaturesSpec.scala index 7ec34b395a..b6f6adb0f7 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteFeaturesSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteFeaturesSpec.scala @@ -272,7 +272,7 @@ abstract class RemotingFeaturesSpec(val multiNodeConfig: RemotingFeaturesConfig) "send messages to remote paths" in { runOn(first, second, third) { - system.actorOf(Props[SomeActor], name = "target-" + myself.name) + system.actorOf(Props[SomeActor](), name = "target-" + myself.name) enterBarrier("start", "end") } @@ -310,7 +310,7 @@ abstract class RemotingFeaturesSpec(val multiNodeConfig: RemotingFeaturesConfig) runOn(fourth) { enterBarrier("start") - val actor = system.actorOf(RoundRobinPool(nrOfInstances = 0).props(Props[SomeActor]), "service-hello") + val actor = system.actorOf(RoundRobinPool(nrOfInstances = 0).props(Props[SomeActor]()), "service-hello") actor.isInstanceOf[RoutedActorRef] should ===(true) for (_ <- 0 until iterationCount; _ <- 0 until workerInstances) { diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeRestartDeathWatchSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeRestartDeathWatchSpec.scala index bfc583575d..11a1393a27 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeRestartDeathWatchSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeRestartDeathWatchSpec.scala @@ -101,7 +101,7 @@ abstract class RemoteNodeRestartDeathWatchSpec(multiNodeConfig: RemoteNodeRestar runOn(second) { val address = system.asInstanceOf[ExtendedActorSystem].provider.getDefaultAddress - system.actorOf(Props[Subject], "subject") + system.actorOf(Props[Subject](), "subject") enterBarrier("actors-started") enterBarrier("watch-established") @@ -114,7 +114,7 @@ abstract class RemoteNodeRestartDeathWatchSpec(multiNodeConfig: RemoteNodeRestar akka.remote.classic.netty.tcp.port = ${address.port.get} akka.remote.artery.canonical.port = ${address.port.get} """).withFallback(system.settings.config)) - freshSystem.actorOf(Props[Subject], "subject") + freshSystem.actorOf(Props[Subject](), "subject") Await.ready(freshSystem.whenTerminated, 30.seconds) } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteQuarantinePiercingSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteQuarantinePiercingSpec.scala index c08276588f..7a11bb6cbe 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteQuarantinePiercingSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteQuarantinePiercingSpec.scala @@ -104,7 +104,7 @@ abstract class RemoteQuarantinePiercingSpec(multiNodeConfig: RemoteQuarantinePie runOn(second) { val address = system.asInstanceOf[ExtendedActorSystem].provider.getDefaultAddress - system.actorOf(Props[Subject], "subject") + system.actorOf(Props[Subject](), "subject") enterBarrier("actors-started") enterBarrier("actor-identified") @@ -117,7 +117,7 @@ abstract class RemoteQuarantinePiercingSpec(multiNodeConfig: RemoteQuarantinePie akka.remote.classic.netty.tcp.port = ${address.port.get} akka.remote.artery.canonical.port = ${address.port.get} """).withFallback(system.settings.config)) - freshSystem.actorOf(Props[Subject], "subject") + freshSystem.actorOf(Props[Subject](), "subject") Await.ready(freshSystem.whenTerminated, 30.seconds) } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteReDeploymentSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteReDeploymentSpec.scala index 36d2eb1759..e3438e7865 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteReDeploymentSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteReDeploymentSpec.scala @@ -131,7 +131,7 @@ abstract class RemoteReDeploymentMultiJvmSpec(multiNodeConfig: RemoteReDeploymen runOn(second) { // Create a 'Parent' actor on the 'second' node // have it create a 'Hello' child (which will be on the 'first' node due to the deployment config): - system.actorOf(Props[Parent], "parent") ! ((Props[Hello], "hello")) + system.actorOf(Props[Parent](), "parent") ! ((Props[Hello](), "hello")) // The 'Hello' child will send "HelloParent" to the 'Parent', which will pass it to the 'echo' monitor: expectMsg(15.seconds, "HelloParent") } @@ -189,7 +189,7 @@ abstract class RemoteReDeploymentMultiJvmSpec(multiNodeConfig: RemoteReDeploymen runOn(second) { val p = TestProbe()(sys) sys.actorOf(echoProps(p.ref), "echo") - p.send(sys.actorOf(Props[Parent], "parent"), (Props[Hello], "hello")) + p.send(sys.actorOf(Props[Parent](), "parent"), (Props[Hello](), "hello")) p.expectMsg(15.seconds, "HelloParent") } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/TransportFailSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/TransportFailSpec.scala index dcded25ffe..f60dc5fb48 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/TransportFailSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/TransportFailSpec.scala @@ -123,7 +123,7 @@ abstract class TransportFailSpec extends RemotingMultiNodeSpec(TransportFailConf } runOn(second) { - system.actorOf(Props[Subject], "subject") + system.actorOf(Props[Subject](), "subject") enterBarrier("actors-started") } @@ -155,7 +155,7 @@ abstract class TransportFailSpec extends RemotingMultiNodeSpec(TransportFailConf } runOn(second) { - val subject2 = system.actorOf(Props[Subject], "subject2") + val subject2 = system.actorOf(Props[Subject](), "subject2") enterBarrier("actors-started2") enterBarrier("watch-established2") subject2 ! PoisonPill diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/HandshakeRestartReceiverSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/HandshakeRestartReceiverSpec.scala index c79c71cea4..6d2cbe75c1 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/HandshakeRestartReceiverSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/HandshakeRestartReceiverSpec.scala @@ -81,7 +81,7 @@ abstract class HandshakeRestartReceiverSpec "detect restarted receiver and initiate new handshake" in { runOn(second) { - system.actorOf(Props[Subject], "subject") + system.actorOf(Props[Subject](), "subject") } enterBarrier("subject-started") @@ -124,7 +124,7 @@ abstract class HandshakeRestartReceiverSpec ConfigFactory.parseString(s""" akka.remote.artery.canonical.port = ${address.port.get} """).withFallback(system.settings.config)) - freshSystem.actorOf(Props[Subject], "subject2") + freshSystem.actorOf(Props[Subject](), "subject2") Await.result(freshSystem.whenTerminated, 45.seconds) } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/LatencySpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/LatencySpec.scala index 2c1e02b7af..1e78264dc4 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/LatencySpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/LatencySpec.scala @@ -341,7 +341,7 @@ abstract class LatencySpec extends RemotingMultiNodeSpec(LatencySpec) { "start echo" in { runOn(second) { // just echo back - system.actorOf(echoProps, "echo") + system.actorOf(echoProps(), "echo") } enterBarrier("echo-started") } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/RemoteRestartedQuarantinedSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/RemoteRestartedQuarantinedSpec.scala index b4ec1e510c..d886d03455 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/RemoteRestartedQuarantinedSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/RemoteRestartedQuarantinedSpec.scala @@ -63,7 +63,7 @@ abstract class RemoteRestartedQuarantinedSpec extends RemotingMultiNodeSpec(Remo "should not crash the other system (#17213)" taggedAs LongRunningTest in { - system.actorOf(Props[Subject], "subject") + system.actorOf(Props[Subject](), "subject") enterBarrier("subject-started") runOn(first) { @@ -128,7 +128,7 @@ abstract class RemoteRestartedQuarantinedSpec extends RemotingMultiNodeSpec(Remo probe.expectMsgType[ActorIdentity](5.seconds).ref should not be (None) // Now the other system will be able to pass, too - freshSystem.actorOf(Props[Subject], "subject") + freshSystem.actorOf(Props[Subject](), "subject") Await.ready(freshSystem.whenTerminated, 10.seconds) } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamConcistencySpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamConcistencySpec.scala index 594975891e..389a7bbd4d 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamConcistencySpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamConcistencySpec.scala @@ -97,7 +97,7 @@ abstract class AeronStreamConsistencySpec "Message consistency of Aeron Streams" must { "start upd port" in { - system.actorOf(Props[UdpPortActor], "updPort") + system.actorOf(Props[UdpPortActor](), "updPort") enterBarrier("udp-port-started") } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamLatencySpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamLatencySpec.scala index 7a859f8cd4..a8659f3b3f 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamLatencySpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamLatencySpec.scala @@ -305,7 +305,7 @@ abstract class AeronStreamLatencySpec "Latency of Aeron Streams" must { "start upd port" in { - system.actorOf(Props[UdpPortActor], "updPort") + system.actorOf(Props[UdpPortActor](), "updPort") enterBarrier("udp-port-started") } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamMaxThroughputSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamMaxThroughputSpec.scala index 938fa40c3d..9db0a66249 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamMaxThroughputSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/aeron/AeronStreamMaxThroughputSpec.scala @@ -226,7 +226,7 @@ abstract class AeronStreamMaxThroughputSpec "Max throughput of Aeron Streams" must { "start upd port" in { - system.actorOf(Props[UdpPortActor], "updPort") + system.actorOf(Props[UdpPortActor](), "updPort") enterBarrier("udp-port-started") } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteGatePiercingSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteGatePiercingSpec.scala index 1319098a4b..b9c95dd004 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteGatePiercingSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteGatePiercingSpec.scala @@ -62,7 +62,7 @@ abstract class RemoteGatePiercingSpec extends RemotingMultiNodeSpec(RemoteGatePi "RemoteGatePiercing" must { "allow restarted node to pass through gate" taggedAs LongRunningTest in { - system.actorOf(Props[Subject], "subject") + system.actorOf(Props[Subject](), "subject") enterBarrier("actors-started") runOn(first) { diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteNodeRestartGateSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteNodeRestartGateSpec.scala index 12b2fb0164..c112fdc57a 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteNodeRestartGateSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteNodeRestartGateSpec.scala @@ -60,7 +60,7 @@ abstract class RemoteNodeRestartGateSpec extends RemotingMultiNodeSpec(RemoteNod "allow restarted node to pass through gate" taggedAs LongRunningTest in { - system.actorOf(Props[Subject], "subject") + system.actorOf(Props[Subject](), "subject") enterBarrier("subject-started") runOn(first) { @@ -120,7 +120,7 @@ abstract class RemoteNodeRestartGateSpec extends RemotingMultiNodeSpec(RemoteNod } // Now the other system will be able to pass, too - freshSystem.actorOf(Props[Subject], "subject") + freshSystem.actorOf(Props[Subject](), "subject") Await.ready(freshSystem.whenTerminated, 30.seconds) } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteNodeShutdownAndComesBackSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteNodeShutdownAndComesBackSpec.scala index 2494d092f0..f7bcc066fc 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteNodeShutdownAndComesBackSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteNodeShutdownAndComesBackSpec.scala @@ -63,7 +63,7 @@ abstract class RemoteNodeShutdownAndComesBackSpec extends RemotingMultiNodeSpec( "properly reset system message buffer state when new system with same Address comes up" taggedAs LongRunningTest in { runOn(first) { val secondAddress = node(second).address - system.actorOf(Props[Subject], "subject1") + system.actorOf(Props[Subject](), "subject1") enterBarrier("actors-started") val subject = identify(second, "subject") @@ -127,8 +127,8 @@ abstract class RemoteNodeShutdownAndComesBackSpec extends RemotingMultiNodeSpec( runOn(second) { val address = system.asInstanceOf[ExtendedActorSystem].provider.getDefaultAddress - system.actorOf(Props[Subject], "subject") - system.actorOf(Props[Subject], "sysmsgBarrier") + system.actorOf(Props[Subject](), "subject") + system.actorOf(Props[Subject](), "sysmsgBarrier") enterBarrier("actors-started") enterBarrier("watch-established") @@ -141,7 +141,7 @@ abstract class RemoteNodeShutdownAndComesBackSpec extends RemotingMultiNodeSpec( akka.remote.classic.netty.tcp.port = ${address.port.get} akka.remote.artery.canonical.port = ${address.port.get} """).withFallback(system.settings.config)) - freshSystem.actorOf(Props[Subject], "subject") + freshSystem.actorOf(Props[Subject](), "subject") Await.ready(freshSystem.whenTerminated, 30.seconds) } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteRestartedQuarantinedSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteRestartedQuarantinedSpec.scala index 4446c22464..e7a33252c2 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteRestartedQuarantinedSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/RemoteRestartedQuarantinedSpec.scala @@ -67,7 +67,7 @@ abstract class RemoteRestartedQuarantinedSpec extends RemotingMultiNodeSpec(Remo "should not crash the other system (#17213)" taggedAs LongRunningTest in { - system.actorOf(Props[Subject], "subject") + system.actorOf(Props[Subject](), "subject") enterBarrier("subject-started") runOn(first) { @@ -140,7 +140,7 @@ abstract class RemoteRestartedQuarantinedSpec extends RemotingMultiNodeSpec(Remo 30.seconds) // Now the other system will be able to pass, too - freshSystem.actorOf(Props[Subject], "subject") + freshSystem.actorOf(Props[Subject](), "subject") Await.ready(freshSystem.whenTerminated, 10.seconds) } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/Ticket15109Spec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/Ticket15109Spec.scala index f98bd09fdd..d8aa88a684 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/Ticket15109Spec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/classic/Ticket15109Spec.scala @@ -73,7 +73,7 @@ abstract class Ticket15109Spec extends RemotingMultiNodeSpec(Ticket15109Spec) { var subject: ActorRef = system.deadLetters runOn(second) { - system.actorOf(Props[Subject], "subject") + system.actorOf(Props[Subject](), "subject") } enterBarrier("actors-started") diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteRandomSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteRandomSpec.scala index f6b797f5e3..0b44988480 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteRandomSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteRandomSpec.scala @@ -74,7 +74,7 @@ class RemoteRandomSpec(multiNodeConfig: RemoteRandomConfig) runOn(fourth) { enterBarrier("start") - val actor = system.actorOf(RandomPool(nrOfInstances = 0).props(Props[SomeActor]), "service-hello") + val actor = system.actorOf(RandomPool(nrOfInstances = 0).props(Props[SomeActor]()), "service-hello") actor.isInstanceOf[RoutedActorRef] should ===(true) val connectionCount = 3 diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteRoundRobinSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteRoundRobinSpec.scala index feaf67d5f4..1c38101291 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteRoundRobinSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteRoundRobinSpec.scala @@ -91,7 +91,7 @@ class RemoteRoundRobinSpec(multiNodeConfig: RemoteRoundRobinConfig) runOn(fourth) { enterBarrier("start") - val actor = system.actorOf(RoundRobinPool(nrOfInstances = 0).props(Props[SomeActor]), "service-hello") + val actor = system.actorOf(RoundRobinPool(nrOfInstances = 0).props(Props[SomeActor]()), "service-hello") actor.isInstanceOf[RoutedActorRef] should ===(true) val connectionCount = 3 @@ -136,7 +136,7 @@ class RemoteRoundRobinSpec(multiNodeConfig: RemoteRoundRobinConfig) enterBarrier("start") val actor = system.actorOf( - RoundRobinPool(nrOfInstances = 1, resizer = Some(new TestResizer)).props(Props[SomeActor]), + RoundRobinPool(nrOfInstances = 1, resizer = Some(new TestResizer)).props(Props[SomeActor]()), "service-hello2") actor.isInstanceOf[RoutedActorRef] should ===(true) @@ -173,7 +173,7 @@ class RemoteRoundRobinSpec(multiNodeConfig: RemoteRoundRobinConfig) "send messages with actor selection to remote paths" in { runOn(first, second, third) { - system.actorOf(Props[SomeActor], name = "target-" + myself.name) + system.actorOf(Props[SomeActor](), name = "target-" + myself.name) enterBarrier("start", "end") } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteScatterGatherSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteScatterGatherSpec.scala index 367ba21279..5f899a3b6d 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteScatterGatherSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteScatterGatherSpec.scala @@ -82,7 +82,7 @@ class RemoteScatterGatherSpec(multiNodeConfig: RemoteScatterGatherConfig) runOn(fourth) { enterBarrier("start") val actor = system.actorOf( - ScatterGatherFirstCompletedPool(nrOfInstances = 1, within = 10.seconds).props(Props[SomeActor]), + ScatterGatherFirstCompletedPool(nrOfInstances = 1, within = 10.seconds).props(Props[SomeActor]()), "service-hello") actor.isInstanceOf[RoutedActorRef] should ===(true) diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/sample/MultiNodeSample.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/sample/MultiNodeSample.scala index 45be1f0133..981a2341e5 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/sample/MultiNodeSample.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/sample/MultiNodeSample.scala @@ -55,7 +55,7 @@ class MultiNodeSample extends MultiNodeSpec(MultiNodeSampleConfig) with STMultiN } runOn(node2) { - system.actorOf(Props[Ponger], "ponger") + system.actorOf(Props[Ponger](), "ponger") enterBarrier("deployed") } diff --git a/akka-remote-tests/src/test/scala/akka/remote/testconductor/BarrierSpec.scala b/akka-remote-tests/src/test/scala/akka/remote/testconductor/BarrierSpec.scala index b4e3d3bf26..1a1b9bc591 100644 --- a/akka-remote-tests/src/test/scala/akka/remote/testconductor/BarrierSpec.scala +++ b/akka-remote-tests/src/test/scala/akka/remote/testconductor/BarrierSpec.scala @@ -564,7 +564,7 @@ class BarrierSpec extends AkkaSpec(BarrierSpec.config) with ImplicitSender { */ private def getBarrier(): ActorRef = { system.actorOf(Props(new Actor { - val barrier = context.actorOf(Props[BarrierCoordinator]) + val barrier = context.actorOf(Props[BarrierCoordinator]()) override def supervisorStrategy = OneForOneStrategy() { case x => testActor ! Failed(barrier, x); SupervisorStrategy.Restart } diff --git a/akka-remote/src/main/scala/akka/remote/RemoteDaemon.scala b/akka-remote/src/main/scala/akka/remote/RemoteDaemon.scala index 3309be0072..baeaa0d86d 100644 --- a/akka-remote/src/main/scala/akka/remote/RemoteDaemon.scala +++ b/akka-remote/src/main/scala/akka/remote/RemoteDaemon.scala @@ -169,13 +169,13 @@ private[akka] class RemoteSystemDaemon( doCreateActor(message, props, deploy, path, supervisor) else { val ex = - new NotWhitelistedClassRemoteDeploymentAttemptException(props.actorClass, remoteDeploymentWhitelist) + new NotWhitelistedClassRemoteDeploymentAttemptException(props.actorClass(), remoteDeploymentWhitelist) log.error( LogMarker.Security, ex, "Received command to create remote Actor, but class [{}] is not white-listed! " + "Target path: [{}]", - props.actorClass, + props.actorClass(), path) } case DaemonMsgCreate(props, deploy, path, supervisor) => diff --git a/akka-remote/src/main/scala/akka/remote/Remoting.scala b/akka-remote/src/main/scala/akka/remote/Remoting.scala index a78292fd8c..fc73ffc941 100644 --- a/akka-remote/src/main/scala/akka/remote/Remoting.scala +++ b/akka-remote/src/main/scala/akka/remote/Remoting.scala @@ -152,7 +152,7 @@ private[remote] class Remoting(_system: ExtendedActorSystem, _provider: RemoteAc private implicit val ec: MessageDispatcher = system.dispatchers.lookup(Dispatcher) - val transportSupervisor = system.systemActorOf(configureDispatcher(Props[TransportSupervisor]), "transports") + val transportSupervisor = system.systemActorOf(configureDispatcher(Props[TransportSupervisor]()), "transports") override def localAddressForRemote(remote: Address): Address = Remoting.localAddressForRemote(transportMapping, remote) @@ -460,17 +460,17 @@ private[remote] object EndpointManager { def prune(): Unit = { addressToWritable = addressToWritable.collect { - case entry @ (_, Gated(timeOfRelease)) if timeOfRelease.hasTimeLeft => + case entry @ (_, Gated(timeOfRelease)) if timeOfRelease.hasTimeLeft() => // Gated removed when no time left entry - case entry @ (_, Quarantined(_, timeOfRelease)) if timeOfRelease.hasTimeLeft => + case entry @ (_, Quarantined(_, timeOfRelease)) if timeOfRelease.hasTimeLeft() => // Quarantined removed when no time left entry case entry @ (_, _: Pass) => entry } addressToRefuseUid = addressToRefuseUid.collect { - case entry @ (_, (_, timeOfRelease)) if timeOfRelease.hasTimeLeft => + case entry @ (_, (_, timeOfRelease)) if timeOfRelease.hasTimeLeft() => // // Quarantined/refuseUid removed when no time left entry } diff --git a/akka-remote/src/main/scala/akka/remote/artery/Codecs.scala b/akka-remote/src/main/scala/akka/remote/artery/Codecs.scala index 7da4099870..e33434f415 100644 --- a/akka-remote/src/main/scala/akka/remote/artery/Codecs.scala +++ b/akka-remote/src/main/scala/akka/remote/artery/Codecs.scala @@ -304,7 +304,7 @@ private[remote] object Decoder { * External call from ChangeInboundCompression materialized value */ override def currentCompressionOriginUids: Future[Set[Long]] = { - val p = Promise[Set[Long]] + val p = Promise[Set[Long]]() currentCompressionOriginUidsCb.invoke(p) p.future } diff --git a/akka-remote/src/main/scala/akka/remote/artery/aeron/AeronSource.scala b/akka-remote/src/main/scala/akka/remote/artery/aeron/AeronSource.scala index 60b72006fb..901e51386d 100644 --- a/akka-remote/src/main/scala/akka/remote/artery/aeron/AeronSource.scala +++ b/akka-remote/src/main/scala/akka/remote/artery/aeron/AeronSource.scala @@ -35,7 +35,7 @@ private[remote] object AeronSource { handler: MessageHandler, onMessage: AsyncCallback[EnvelopeBuffer]): () => Boolean = { () => { - handler.reset + handler.reset() sub.poll(handler.fragmentsHandler, 1) val msg = handler.messageReceived handler.reset() // for GC @@ -167,7 +167,7 @@ private[remote] class AeronSource( } override def channelEndpointStatus(): Future[Long] = { - val promise = Promise[Long] + val promise = Promise[Long]() getStatusCb.invoke(promise) promise.future } diff --git a/akka-remote/src/main/scala/akka/remote/routing/RemoteRouterConfig.scala b/akka-remote/src/main/scala/akka/remote/routing/RemoteRouterConfig.scala index b43ab858ae..1879a7a906 100644 --- a/akka-remote/src/main/scala/akka/remote/routing/RemoteRouterConfig.scala +++ b/akka-remote/src/main/scala/akka/remote/routing/RemoteRouterConfig.scala @@ -53,7 +53,7 @@ final case class RemoteRouterConfig(local: Pool, nodes: Iterable[Address]) exten val deploy = Deploy( config = ConfigFactory.empty(), routerConfig = routeeProps.routerConfig, - scope = RemoteScope(nodeAddressIter.next)) + scope = RemoteScope(nodeAddressIter.next())) // attachChild means that the provider will treat this call as if possibly done out of the wrong // context and use RepointableActorRef instead of LocalActorRef. Seems like a slightly sub-optimal diff --git a/akka-remote/src/main/scala/akka/remote/transport/netty/NettyTransport.scala b/akka-remote/src/main/scala/akka/remote/transport/netty/NettyTransport.scala index ad6f8c826b..95fc7ceb12 100644 --- a/akka-remote/src/main/scala/akka/remote/transport/netty/NettyTransport.scala +++ b/akka-remote/src/main/scala/akka/remote/transport/netty/NettyTransport.scala @@ -73,7 +73,7 @@ object NettyFutureBridge { def apply(nettyFuture: ChannelGroupFuture): Future[ChannelGroup] = { import akka.util.ccompat.JavaConverters._ - val p = Promise[ChannelGroup] + val p = Promise[ChannelGroup]() nettyFuture.addListener(new ChannelGroupFutureListener { def operationComplete(future: ChannelGroupFuture): Unit = p.complete( diff --git a/akka-remote/src/test/scala/akka/remote/LogSourceSpec.scala b/akka-remote/src/test/scala/akka/remote/LogSourceSpec.scala index 4333ebca6d..889ebfd500 100644 --- a/akka-remote/src/test/scala/akka/remote/LogSourceSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/LogSourceSpec.scala @@ -31,7 +31,7 @@ class LogSourceSpec extends AkkaSpec(""" import LogSourceSpec._ - val reporter = system.actorOf(Props[Reporter], "reporter") + val reporter = system.actorOf(Props[Reporter](), "reporter") val logProbe = TestProbe() system.eventStream.subscribe(system.actorOf(Props(new Actor { def receive = { diff --git a/akka-remote/src/test/scala/akka/remote/MessageLoggingSpec.scala b/akka-remote/src/test/scala/akka/remote/MessageLoggingSpec.scala index fe936c0541..facb42b488 100644 --- a/akka-remote/src/test/scala/akka/remote/MessageLoggingSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/MessageLoggingSpec.scala @@ -60,7 +60,7 @@ abstract class MessageLoggingSpec(config: Config) extends AkkaSpec(config) with "Message logging" must { "not be on if debug logging not enabled" in { - remoteSystem.actorOf(Props[BadActor], "bad") + remoteSystem.actorOf(Props[BadActor](), "bad") val as = system.actorSelection(RootActorPath(remoteAddress) / "user" / "bad") as ! Identify("bad") val ref = expectMsgType[ActorIdentity].ref.get diff --git a/akka-remote/src/test/scala/akka/remote/NetworkFailureSpec.scala b/akka-remote/src/test/scala/akka/remote/NetworkFailureSpec.scala index b55ed00ba1..ccf6913fa0 100644 --- a/akka-remote/src/test/scala/akka/remote/NetworkFailureSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/NetworkFailureSpec.scala @@ -25,7 +25,7 @@ trait NetworkFailureSpec extends DefaultTimeout { self: AkkaSpec => enableTcpReset() println("===>>> Reply with [TCP RST] for [" + duration + "]") Thread.sleep(duration.toMillis) - restoreIP + restoreIP() } catch { case e: Throwable => dead.set(true) @@ -40,7 +40,7 @@ trait NetworkFailureSpec extends DefaultTimeout { self: AkkaSpec => enableNetworkThrottling() println("===>>> Throttling network with [" + BytesPerSecond + ", " + DelayMillis + "] for [" + duration + "]") Thread.sleep(duration.toMillis) - restoreIP + restoreIP() } catch { case e: Throwable => dead.set(true) @@ -55,7 +55,7 @@ trait NetworkFailureSpec extends DefaultTimeout { self: AkkaSpec => enableNetworkDrop() println("===>>> Blocking network [TCP DENY] for [" + duration + "]") Thread.sleep(duration.toMillis) - restoreIP + restoreIP() } catch { case e: Throwable => dead.set(true) diff --git a/akka-remote/src/test/scala/akka/remote/RemoteFeaturesSpec.scala b/akka-remote/src/test/scala/akka/remote/RemoteFeaturesSpec.scala index a818e18e3b..b9a21af23f 100644 --- a/akka-remote/src/test/scala/akka/remote/RemoteFeaturesSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/RemoteFeaturesSpec.scala @@ -144,7 +144,7 @@ class RemoteFeaturesDisabledSpec extends RemoteFeaturesSpec(RemoteFeaturesSpec.d } """)) - val masterRef = masterSystem.actorOf(Props[RemoteDeploymentSpec.Echo1], actorName) + val masterRef = masterSystem.actorOf(Props[RemoteDeploymentSpec.Echo1](), actorName) masterRef.path shouldEqual RootActorPath(AddressFromURIString(s"akka://${masterSystem.name}")) / "user" / actorName masterRef.path.address.hasLocalScope shouldBe true diff --git a/akka-remote/src/test/scala/akka/remote/RemoteRouterSpec.scala b/akka-remote/src/test/scala/akka/remote/RemoteRouterSpec.scala index a77106f6dc..ce2b39e1ad 100644 --- a/akka-remote/src/test/scala/akka/remote/RemoteRouterSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/RemoteRouterSpec.scala @@ -259,7 +259,7 @@ class RemoteRouterSpec extends AkkaSpec(s""" // we don't really support deployment configuration of system actors, but // it's used for the pool of the SimpleDnsManager "/IO-DNS/inet-address" val probe = TestProbe()(masterSystem) - val parent = masterSystem.asInstanceOf[ExtendedActorSystem].systemActorOf(Props[Parent], "sys-parent") + val parent = masterSystem.asInstanceOf[ExtendedActorSystem].systemActorOf(Props[Parent](), "sys-parent") parent.tell((FromConfig.props(echoActorProps), "round"), probe.ref) val router = probe.expectMsgType[ActorRef] val replies = collectRouteePaths(probe, router, 10) diff --git a/akka-remote/src/test/scala/akka/remote/TypedActorRemoteDeploySpec.scala b/akka-remote/src/test/scala/akka/remote/TypedActorRemoteDeploySpec.scala index f71484d8d1..707ea59d0f 100644 --- a/akka-remote/src/test/scala/akka/remote/TypedActorRemoteDeploySpec.scala +++ b/akka-remote/src/test/scala/akka/remote/TypedActorRemoteDeploySpec.scala @@ -47,7 +47,7 @@ class TypedActorRemoteDeploySpec extends AkkaSpec(conf) { def verify[T](f: RemoteNameService => Future[T], expected: T) = { val ts = TypedActor(system) val echoService: RemoteNameService = - ts.typedActorOf(TypedProps[RemoteNameServiceImpl].withDeploy(Deploy(scope = RemoteScope(remoteAddress)))) + ts.typedActorOf(TypedProps[RemoteNameServiceImpl]().withDeploy(Deploy(scope = RemoteScope(remoteAddress)))) Await.result(f(echoService), 3.seconds) should ===(expected) val actor = ts.getActorRefFor(echoService) system.stop(actor) diff --git a/akka-remote/src/test/scala/akka/remote/artery/BindCanonicalAddressSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/BindCanonicalAddressSpec.scala index 5529e8576d..3caadb05bf 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/BindCanonicalAddressSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/BindCanonicalAddressSpec.scala @@ -29,7 +29,7 @@ trait BindCanonicalAddressBehaviors { implicit val sys = ActorSystem("sys", config.withFallback(commonConfig)) - getInternal should contain(getExternal) + getInternal should contain(getExternal()) Await.result(sys.terminate(), Duration.Inf) } @@ -46,13 +46,13 @@ trait BindCanonicalAddressBehaviors { getExternal should ===(address.toAkkaAddress("akka")) // May have selected the same random port - bind another in that case while the other still has the canonical port val internals = - if (getInternal.collect { case Address(_, _, _, Some(port)) => port }.toSeq.contains(address.getPort)) { + if (getInternal().collect { case Address(_, _, _, Some(port)) => port }.toSeq.contains(address.getPort)) { val sys2 = ActorSystem("sys", config.withFallback(commonConfig)) val secondInternals = getInternal()(sys2) Await.result(sys2.terminate(), Duration.Inf) secondInternals } else { - getInternal + getInternal() } internals should not contain address.toAkkaAddress("akka") Await.result(sys.terminate(), Duration.Inf) @@ -92,8 +92,8 @@ trait BindCanonicalAddressBehaviors { implicit val sys = ActorSystem("sys", config.withFallback(commonConfig)) - getInternal.flatMap(_.port) should contain(getExternal.port.get) - getInternal.map(x => (x.host.get should include).regex("0.0.0.0".r)) // regexp dot is intentional to match IPv4 and 6 addresses + getInternal().flatMap(_.port) should contain(getExternal().port.get) + getInternal().map(x => (x.host.get should include).regex("0.0.0.0".r)) // regexp dot is intentional to match IPv4 and 6 addresses Await.result(sys.terminate(), Duration.Inf) } diff --git a/akka-remote/src/test/scala/akka/remote/artery/RemoteDeploymentSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/RemoteDeploymentSpec.scala index 3668e9a6fb..b238dfdfd7 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/RemoteDeploymentSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/RemoteDeploymentSpec.scala @@ -93,7 +93,7 @@ class RemoteDeploymentSpec "create and supervise children on remote node" in { val senderProbe = TestProbe()(masterSystem) - val r = masterSystem.actorOf(Props[Echo1], "blub") + val r = masterSystem.actorOf(Props[Echo1](), "blub") r.path.toString should ===( s"akka://${system.name}@localhost:${port}/remote/akka/${masterSystem.name}@localhost:${masterPort}/user/blub") @@ -111,7 +111,7 @@ class RemoteDeploymentSpec "create and supervise children on remote node for unknown exception" in { val senderProbe = TestProbe()(masterSystem) - val r = masterSystem.actorOf(Props[Echo1], "blub2") + val r = masterSystem.actorOf(Props[Echo1](), "blub2") r.path.toString should ===( s"akka://${system.name}@localhost:${port}/remote/akka/${masterSystem.name}@localhost:${masterPort}/user/blub2") @@ -130,7 +130,7 @@ class RemoteDeploymentSpec "notice immediate death" in { val parent = masterSystem.actorOf(parentProps(testActor), "parent") EventFilter[ActorInitializationException](occurrences = 1).intercept { - parent.tell(Props[DeadOnArrival], testActor) + parent.tell(Props[DeadOnArrival](), testActor) val child = expectMsgType[ActorRef] expectMsgType[ActorInitializationException] @@ -149,7 +149,7 @@ class RemoteDeploymentSpec }.toVector val probes = Vector.fill(numParents, numChildren)(TestProbe()(masterSystem)) - val childProps = Props[Echo1] + val childProps = Props[Echo1]() for (p <- (0 until numParents); c <- (0 until numChildren)) { parents(p).tell((childProps, numMessages), probes(p)(c).ref) } diff --git a/akka-remote/src/test/scala/akka/remote/artery/RemoteRouterSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/RemoteRouterSpec.scala index d4c90b810d..1c89ffdcec 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/RemoteRouterSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/RemoteRouterSpec.scala @@ -251,7 +251,7 @@ class RemoteRouterSpec // we don't really support deployment configuration of system actors, but // it's used for the pool of the SimpleDnsManager "/IO-DNS/inet-address" val probe = TestProbe()(masterSystem) - val parent = masterSystem.asInstanceOf[ExtendedActorSystem].systemActorOf(Props[Parent], "sys-parent") + val parent = masterSystem.asInstanceOf[ExtendedActorSystem].systemActorOf(Props[Parent](), "sys-parent") parent.tell((FromConfig.props(echoActorProps), "round"), probe.ref) val router = probe.expectMsgType[ActorRef] val replies = collectRouteePaths(probe, router, 10) diff --git a/akka-remote/src/test/scala/akka/remote/artery/RemoteWatcherSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/RemoteWatcherSpec.scala index 96315afa57..2b0db01e1e 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/RemoteWatcherSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/RemoteWatcherSpec.scala @@ -46,7 +46,7 @@ object RemoteWatcherSpec { class TestRemoteWatcher(heartbeatExpectedResponseAfter: FiniteDuration) extends RemoteWatcher( - createFailureDetector, + createFailureDetector(), heartbeatInterval = TurnOff, unreachableReaperInterval = TurnOff, heartbeatExpectedResponseAfter = heartbeatExpectedResponseAfter) { @@ -99,13 +99,13 @@ class RemoteWatcherSpec "A RemoteWatcher" must { "have correct interaction when watching" in { - val monitorA = system.actorOf(Props[TestRemoteWatcher], "monitor1") + val monitorA = system.actorOf(Props[TestRemoteWatcher](), "monitor1") val monitorB = createRemoteActor(Props(classOf[TestActorProxy], testActor), "monitor1") - val a1 = system.actorOf(Props[MyActor], "a1").asInstanceOf[InternalActorRef] - val a2 = system.actorOf(Props[MyActor], "a2").asInstanceOf[InternalActorRef] - val b1 = createRemoteActor(Props[MyActor], "b1") - val b2 = createRemoteActor(Props[MyActor], "b2") + val a1 = system.actorOf(Props[MyActor](), "a1").asInstanceOf[InternalActorRef] + val a2 = system.actorOf(Props[MyActor](), "a2").asInstanceOf[InternalActorRef] + val b1 = createRemoteActor(Props[MyActor](), "b1") + val b2 = createRemoteActor(Props[MyActor](), "b2") monitorA ! WatchRemote(b1, a1) monitorA ! WatchRemote(b2, a1) @@ -163,11 +163,11 @@ class RemoteWatcherSpec system.eventStream.subscribe(p.ref, classOf[TestRemoteWatcher.AddressTerm]) system.eventStream.subscribe(q.ref, classOf[TestRemoteWatcher.Quarantined]) - val monitorA = system.actorOf(Props[TestRemoteWatcher], "monitor4") + val monitorA = system.actorOf(Props[TestRemoteWatcher](), "monitor4") val monitorB = createRemoteActor(Props(classOf[TestActorProxy], testActor), "monitor4") - val a = system.actorOf(Props[MyActor], "a4").asInstanceOf[InternalActorRef] - val b = createRemoteActor(Props[MyActor], "b4") + val a = system.actorOf(Props[MyActor](), "a4").asInstanceOf[InternalActorRef] + val b = createRemoteActor(Props[MyActor](), "b4") monitorA ! WatchRemote(b, a) @@ -204,8 +204,8 @@ class RemoteWatcherSpec val monitorA = system.actorOf(Props(classOf[TestRemoteWatcher], heartbeatExpectedResponseAfter), "monitor5") createRemoteActor(Props(classOf[TestActorProxy], testActor), "monitor5") - val a = system.actorOf(Props[MyActor], "a5").asInstanceOf[InternalActorRef] - val b = createRemoteActor(Props[MyActor], "b5") + val a = system.actorOf(Props[MyActor](), "a5").asInstanceOf[InternalActorRef] + val b = createRemoteActor(Props[MyActor](), "b5") monitorA ! WatchRemote(b, a) @@ -235,11 +235,11 @@ class RemoteWatcherSpec system.eventStream.subscribe(p.ref, classOf[TestRemoteWatcher.AddressTerm]) system.eventStream.subscribe(q.ref, classOf[TestRemoteWatcher.Quarantined]) - val monitorA = system.actorOf(Props[TestRemoteWatcher], "monitor6") + val monitorA = system.actorOf(Props[TestRemoteWatcher](), "monitor6") val monitorB = createRemoteActor(Props(classOf[TestActorProxy], testActor), "monitor6") - val a = system.actorOf(Props[MyActor], "a6").asInstanceOf[InternalActorRef] - val b = createRemoteActor(Props[MyActor], "b6") + val a = system.actorOf(Props[MyActor](), "a6").asInstanceOf[InternalActorRef] + val b = createRemoteActor(Props[MyActor](), "b6") monitorA ! WatchRemote(b, a) @@ -271,7 +271,7 @@ class RemoteWatcherSpec expectNoMessage(2 seconds) // assume that connection comes up again, or remote system is restarted - val c = createRemoteActor(Props[MyActor], "c6") + val c = createRemoteActor(Props[MyActor](), "c6") monitorA ! WatchRemote(c, a) diff --git a/akka-remote/src/test/scala/akka/remote/classic/ActorsLeakSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/ActorsLeakSpec.scala index 80bf9b5f96..4fc2c564bd 100644 --- a/akka-remote/src/test/scala/akka/remote/classic/ActorsLeakSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/ActorsLeakSpec.scala @@ -75,7 +75,7 @@ class ActorsLeakSpec extends AkkaSpec(ActorsLeakSpec.config) with ImplicitSender "Remoting" must { "not leak actors" in { - system.actorOf(Props[EchoActor], "echo") + system.actorOf(Props[EchoActor](), "echo") val echoPath = RootActorPath(RARP(system).provider.getDefaultAddress) / "user" / "echo" val targets = List("/system/endpointManager", "/system/transports").map { path => @@ -120,7 +120,7 @@ class ActorsLeakSpec extends AkkaSpec(ActorsLeakSpec.config) with ImplicitSender try { val remoteAddress = RARP(remoteSystem).provider.getDefaultAddress - remoteSystem.actorOf(Props[StoppableActor], "stoppable") + remoteSystem.actorOf(Props[StoppableActor](), "stoppable") // the message from remote to local will cause inbound connection established val probe = TestProbe()(remoteSystem) @@ -185,7 +185,7 @@ class ActorsLeakSpec extends AkkaSpec(ActorsLeakSpec.config) with ImplicitSender ActorSystem("remote", ConfigFactory.parseString("akka.remote.classic.netty.tcp.port = 0").withFallback(config)) val remoteAddress = RARP(remoteSystem).provider.getDefaultAddress - remoteSystem.actorOf(Props[StoppableActor], "stoppable") + remoteSystem.actorOf(Props[StoppableActor](), "stoppable") try { val probe = TestProbe()(remoteSystem) diff --git a/akka-remote/src/test/scala/akka/remote/classic/RemoteDeploymentWhitelistSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/RemoteDeploymentWhitelistSpec.scala index 7dae281431..a07f4f7aae 100644 --- a/akka-remote/src/test/scala/akka/remote/classic/RemoteDeploymentWhitelistSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/RemoteDeploymentWhitelistSpec.scala @@ -149,7 +149,7 @@ class RemoteDeploymentWhitelistSpec "RemoteDeployment Whitelist" must { "allow deploying Echo actor (included in whitelist)" in { - val r = system.actorOf(Props[EchoWhitelisted], "blub") + val r = system.actorOf(Props[EchoWhitelisted](), "blub") r.path.toString should ===( s"akka.test://remote-sys@localhost:12346/remote/akka.test/${getClass.getSimpleName}@localhost:12345/user/blub") r ! 42 @@ -165,7 +165,7 @@ class RemoteDeploymentWhitelistSpec } "not deploy actor not listed in whitelist" in { - val r = system.actorOf(Props[EchoNotWhitelisted], "danger-mouse") + val r = system.actorOf(Props[EchoNotWhitelisted](), "danger-mouse") r.path.toString should ===( s"akka.test://remote-sys@localhost:12346/remote/akka.test/${getClass.getSimpleName}@localhost:12345/user/danger-mouse") r ! 42 diff --git a/akka-remote/src/test/scala/akka/remote/classic/RemoteWatcherSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/RemoteWatcherSpec.scala index 64cb8cb37c..709e9f0870 100644 --- a/akka-remote/src/test/scala/akka/remote/classic/RemoteWatcherSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/RemoteWatcherSpec.scala @@ -46,7 +46,7 @@ object RemoteWatcherSpec { class TestRemoteWatcher(heartbeatExpectedResponseAfter: FiniteDuration) extends RemoteWatcher( - createFailureDetector, + createFailureDetector(), heartbeatInterval = TurnOff, unreachableReaperInterval = TurnOff, heartbeatExpectedResponseAfter = heartbeatExpectedResponseAfter) { @@ -115,13 +115,13 @@ class RemoteWatcherSpec extends AkkaSpec(""" "A RemoteWatcher" must { "have correct interaction when watching" in { - val monitorA = system.actorOf(Props[TestRemoteWatcher], "monitor1") + val monitorA = system.actorOf(Props[TestRemoteWatcher](), "monitor1") val monitorB = createRemoteActor(Props(classOf[TestActorProxy], testActor), "monitor1") - val a1 = system.actorOf(Props[MyActor], "a1").asInstanceOf[InternalActorRef] - val a2 = system.actorOf(Props[MyActor], "a2").asInstanceOf[InternalActorRef] - val b1 = createRemoteActor(Props[MyActor], "b1") - val b2 = createRemoteActor(Props[MyActor], "b2") + val a1 = system.actorOf(Props[MyActor](), "a1").asInstanceOf[InternalActorRef] + val a2 = system.actorOf(Props[MyActor](), "a2").asInstanceOf[InternalActorRef] + val b1 = createRemoteActor(Props[MyActor](), "b1") + val b2 = createRemoteActor(Props[MyActor](), "b2") monitorA ! WatchRemote(b1, a1) monitorA ! WatchRemote(b2, a1) @@ -179,11 +179,11 @@ class RemoteWatcherSpec extends AkkaSpec(""" system.eventStream.subscribe(p.ref, classOf[TestRemoteWatcher.AddressTerm]) system.eventStream.subscribe(q.ref, classOf[TestRemoteWatcher.Quarantined]) - val monitorA = system.actorOf(Props[TestRemoteWatcher], "monitor4") + val monitorA = system.actorOf(Props[TestRemoteWatcher](), "monitor4") val monitorB = createRemoteActor(Props(classOf[TestActorProxy], testActor), "monitor4") - val a = system.actorOf(Props[MyActor], "a4").asInstanceOf[InternalActorRef] - val b = createRemoteActor(Props[MyActor], "b4") + val a = system.actorOf(Props[MyActor](), "a4").asInstanceOf[InternalActorRef] + val b = createRemoteActor(Props[MyActor](), "b4") monitorA ! WatchRemote(b, a) @@ -220,8 +220,8 @@ class RemoteWatcherSpec extends AkkaSpec(""" val monitorA = system.actorOf(Props(classOf[TestRemoteWatcher], heartbeatExpectedResponseAfter), "monitor5") createRemoteActor(Props(classOf[TestActorProxy], testActor), "monitor5") - val a = system.actorOf(Props[MyActor], "a5").asInstanceOf[InternalActorRef] - val b = createRemoteActor(Props[MyActor], "b5") + val a = system.actorOf(Props[MyActor](), "a5").asInstanceOf[InternalActorRef] + val b = createRemoteActor(Props[MyActor](), "b5") monitorA ! WatchRemote(b, a) @@ -251,11 +251,11 @@ class RemoteWatcherSpec extends AkkaSpec(""" system.eventStream.subscribe(p.ref, classOf[TestRemoteWatcher.AddressTerm]) system.eventStream.subscribe(q.ref, classOf[TestRemoteWatcher.Quarantined]) - val monitorA = system.actorOf(Props[TestRemoteWatcher], "monitor6") + val monitorA = system.actorOf(Props[TestRemoteWatcher](), "monitor6") val monitorB = createRemoteActor(Props(classOf[TestActorProxy], testActor), "monitor6") - val a = system.actorOf(Props[MyActor], "a6").asInstanceOf[InternalActorRef] - val b = createRemoteActor(Props[MyActor], "b6") + val a = system.actorOf(Props[MyActor](), "a6").asInstanceOf[InternalActorRef] + val b = createRemoteActor(Props[MyActor](), "b6") monitorA ! WatchRemote(b, a) @@ -287,7 +287,7 @@ class RemoteWatcherSpec extends AkkaSpec(""" expectNoMessage(2 seconds) // assume that connection comes up again, or remote system is restarted - val c = createRemoteActor(Props[MyActor], "c6") + val c = createRemoteActor(Props[MyActor](), "c6") monitorA ! WatchRemote(c, a) diff --git a/akka-remote/src/test/scala/akka/remote/classic/RemotingSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/RemotingSpec.scala index 7e1ec4afa0..a65b34a76f 100644 --- a/akka-remote/src/test/scala/akka/remote/classic/RemotingSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/RemotingSpec.scala @@ -33,7 +33,7 @@ object RemotingSpec { var target: ActorRef = context.system.deadLetters def receive = { - case (_: Props, n: String) => sender() ! context.actorOf(Props[Echo1], n) + case (_: Props, n: String) => sender() ! context.actorOf(Props[Echo1](), n) case ex: Exception => throw ex case ActorSelReq(s) => sender() ! context.actorSelection(s) case x => target = sender(); sender() ! x @@ -158,7 +158,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D sys.asInstanceOf[ExtendedActorSystem].provider.asInstanceOf[RemoteActorRefProvider].deployer.deploy(d) } - val remote = remoteSystem.actorOf(Props[Echo2], "echo") + val remote = remoteSystem.actorOf(Props[Echo2](), "echo") val here = RARP(system).provider.resolveActorRef("akka.test://remote-sys@localhost:12346/user/echo") @@ -246,7 +246,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D moreSystems.foreach { sys => sys.eventStream.publish(TestEvent .Mute(EventFilter[EndpointDisassociatedException](), EventFilter.warning(pattern = "received dead letter.*"))) - sys.actorOf(Props[Echo2], name = "echo") + sys.actorOf(Props[Echo2](), name = "echo") } val moreRefs = moreSystems.map(sys => system.actorSelection(RootActorPath(getOtherAddress(sys, "tcp")) / "user" / "echo")) @@ -284,7 +284,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D } "create and supervise children on remote node" in { - val r = system.actorOf(Props[Echo1], "blub") + val r = system.actorOf(Props[Echo1](), "blub") r.path.toString should ===( "akka.test://remote-sys@localhost:12346/remote/akka.test/RemotingSpec@localhost:12345/user/blub") r ! 42 @@ -300,7 +300,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D } "not send to remote re-created actor with same name" in { - val echo = remoteSystem.actorOf(Props[Echo1], "otherEcho1") + val echo = remoteSystem.actorOf(Props[Echo1](), "otherEcho1") echo ! 71 expectMsg(71) echo ! PoisonPill @@ -308,7 +308,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D echo ! 72 expectNoMessage(1.second) - val echo2 = remoteSystem.actorOf(Props[Echo1], "otherEcho1") + val echo2 = remoteSystem.actorOf(Props[Echo1](), "otherEcho1") echo2 ! 73 expectMsg(73) // msg to old ActorRef (different uid) should not get through @@ -337,10 +337,10 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D } }), "looker2") // child is configured to be deployed on remoteSystem - l ! ((Props[Echo1], "child")) + l ! ((Props[Echo1](), "child")) val child = expectMsgType[ActorRef] // grandchild is configured to be deployed on RemotingSpec (system) - child ! ((Props[Echo1], "grandchild")) + child ! ((Props[Echo1](), "grandchild")) val grandchild = expectMsgType[ActorRef] grandchild.asInstanceOf[ActorRefScope].isLocal should ===(true) grandchild ! 53 @@ -362,7 +362,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D expectMsgType[ActorSelection] ! Identify(None) (expectMsgType[ActorIdentity].ref.get should be).theSameInstanceAs(l) - grandchild ! ((Props[Echo1], "grandgrandchild")) + grandchild ! ((Props[Echo1](), "grandgrandchild")) val grandgrandchild = expectMsgType[ActorRef] system.actorSelection("/user/looker2/child") ! Identify("idReq1") @@ -404,7 +404,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D child ! PoisonPill expectMsg("postStop") expectMsgType[Terminated].actor should ===(child) - l ! ((Props[Echo1], "child")) + l ! ((Props[Echo1](), "child")) val child2 = expectMsgType[ActorRef] child2 ! Identify("idReq15") expectMsg(ActorIdentity("idReq15", Some(child2))) @@ -430,7 +430,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D } "be able to use multiple transports and use the appropriate one (TCP)" in { - val r = system.actorOf(Props[Echo1], "gonk") + val r = system.actorOf(Props[Echo1](), "gonk") r.path.toString should ===( s"akka.tcp://remote-sys@localhost:${port(remoteSystem, "tcp")}/remote/akka.tcp/RemotingSpec@localhost:${port(system, "tcp")}/user/gonk") r ! 42 @@ -446,7 +446,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D } "be able to use multiple transports and use the appropriate one (SSL)" in { - val r = system.actorOf(Props[Echo1], "roghtaar") + val r = system.actorOf(Props[Echo1](), "roghtaar") r.path.toString should ===( s"akka.ssl.tcp://remote-sys@localhost:${port(remoteSystem, "ssl.tcp")}/remote/akka.ssl.tcp/RemotingSpec@localhost:${port(system, "ssl.tcp")}/user/roghtaar") r ! 42 @@ -508,7 +508,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D .withFallback(remoteSystem.settings.config) val otherSystem = ActorSystem("other-system", config) try { - val otherGuy = otherSystem.actorOf(Props[Echo2], "other-guy") + val otherGuy = otherSystem.actorOf(Props[Echo2](), "other-guy") // check that we use the specified transport address instead of the default val otherGuyRemoteTcp = otherGuy.path.toSerializationFormatWithAddress(getOtherAddress(otherSystem, "tcp")) val remoteEchoHereTcp = @@ -795,7 +795,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D try { muteSystem(otherSystem) probe.expectNoMessage(2.seconds) - otherSystem.actorOf(Props[Echo2], "echo") + otherSystem.actorOf(Props[Echo2](), "echo") within(5.seconds) { awaitAssert { otherSelection.tell("ping", probe.ref) @@ -821,7 +821,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D muteSystem(thisSystem) val thisProbe = new TestProbe(thisSystem) val thisSender = thisProbe.ref - thisSystem.actorOf(Props[Echo2], "echo") + thisSystem.actorOf(Props[Echo2](), "echo") val otherAddress = temporaryServerAddress() val otherConfig = ConfigFactory.parseString(s""" akka.remote.classic.netty.tcp.port = ${otherAddress.getPort} diff --git a/akka-remote/src/test/scala/akka/remote/classic/transport/ThrottlerTransportAdapterSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/transport/ThrottlerTransportAdapterSpec.scala index 39c2459ecc..ca439774d6 100644 --- a/akka-remote/src/test/scala/akka/remote/classic/transport/ThrottlerTransportAdapterSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/transport/ThrottlerTransportAdapterSpec.scala @@ -77,7 +77,7 @@ object ThrottlerTransportAdapterSpec { class ThrottlerTransportAdapterSpec extends AkkaSpec(configA) with ImplicitSender with DefaultTimeout { val systemB = ActorSystem("systemB", system.settings.config) - val remote = systemB.actorOf(Props[Echo], "echo") + val remote = systemB.actorOf(Props[Echo](), "echo") val rootB = RootActorPath(systemB.asInstanceOf[ExtendedActorSystem].provider.getDefaultAddress) val here = { diff --git a/akka-remote/src/test/scala/akka/remote/classic/transport/netty/NettyTransportSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/transport/netty/NettyTransportSpec.scala index 922c201af2..08b103c586 100644 --- a/akka-remote/src/test/scala/akka/remote/classic/transport/netty/NettyTransportSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/transport/netty/NettyTransportSpec.scala @@ -116,8 +116,8 @@ class NettyTransportSpec extends AnyWordSpec with Matchers with BindBehavior { """) implicit val sys = ActorSystem("sys", bindConfig.withFallback(commonConfig)) - getInternal.flatMap(_.port) should contain(getExternal.port.get) - getInternal.map(x => (x.host.get should include).regex("0.0.0.0".r)) // regexp dot is intentional to match IPv4 and 6 addresses + getInternal().flatMap(_.port) should contain(getExternal().port.get) + getInternal().map(x => (x.host.get should include).regex("0.0.0.0".r)) // regexp dot is intentional to match IPv4 and 6 addresses Await.result(sys.terminate(), Duration.Inf) } diff --git a/akka-remote/src/test/scala/akka/remote/serialization/DaemonMsgCreateSerializerAllowJavaSerializationSpec.scala b/akka-remote/src/test/scala/akka/remote/serialization/DaemonMsgCreateSerializerAllowJavaSerializationSpec.scala index d2a3323497..3244890ba1 100644 --- a/akka-remote/src/test/scala/akka/remote/serialization/DaemonMsgCreateSerializerAllowJavaSerializationSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/serialization/DaemonMsgCreateSerializerAllowJavaSerializationSpec.scala @@ -74,7 +74,7 @@ class DaemonMsgCreateSerializerAllowJavaSerializationSpec import DaemonMsgCreateSerializerAllowJavaSerializationSpec._ val ser = SerializationExtension(system) - val supervisor = system.actorOf(Props[MyActor], "supervisor") + val supervisor = system.actorOf(Props[MyActor](), "supervisor") "Serialization" must { @@ -116,7 +116,7 @@ class DaemonMsgCreateSerializerAllowJavaSerializationSpec scope = RemoteScope(Address("akka", "Test", "host2", 1922)), dispatcher = Deploy.NoDispatcherGiven) DaemonMsgCreate( - props = Props[MyActor].withDispatcher("my-disp").withDeploy(deploy1), + props = Props[MyActor]().withDispatcher("my-disp").withDeploy(deploy1), deploy = deploy2, path = "foo", supervisor = supervisor) @@ -132,12 +132,12 @@ class DaemonMsgCreateSerializerNoJavaSerializationSpec extends AkkaSpec(""" import DaemonMsgCreateSerializerAllowJavaSerializationSpec.MyActor - val supervisor = system.actorOf(Props[MyActor], "supervisor") + val supervisor = system.actorOf(Props[MyActor](), "supervisor") val ser = SerializationExtension(system) "serialize and de-serialize DaemonMsgCreate with FromClassCreator" in { verifySerialization { - DaemonMsgCreate(props = Props[MyActor], deploy = Deploy(), path = "foo", supervisor = supervisor) + DaemonMsgCreate(props = Props[MyActor](), deploy = Deploy(), path = "foo", supervisor = supervisor) } } @@ -166,7 +166,7 @@ class DaemonMsgCreateSerializerNoJavaSerializationSpec extends AkkaSpec(""" scope = RemoteScope(Address("akka", "Test", "host2", 1922)), dispatcher = Deploy.NoDispatcherGiven) DaemonMsgCreate( - props = Props[MyActor].withDispatcher("my-disp").withDeploy(deploy1), + props = Props[MyActor]().withDispatcher("my-disp").withDeploy(deploy1), deploy = deploy2, path = "foo", supervisor = supervisor) diff --git a/akka-slf4j/src/test/scala/akka/event/slf4j/Slf4jLoggerSpec.scala b/akka-slf4j/src/test/scala/akka/event/slf4j/Slf4jLoggerSpec.scala index 85ed4804af..3f6229dcd9 100644 --- a/akka-slf4j/src/test/scala/akka/event/slf4j/Slf4jLoggerSpec.scala +++ b/akka-slf4j/src/test/scala/akka/event/slf4j/Slf4jLoggerSpec.scala @@ -75,7 +75,7 @@ object Slf4jLoggerSpec { class Slf4jLoggerSpec extends AkkaSpec(Slf4jLoggerSpec.config) with BeforeAndAfterEach { import Slf4jLoggerSpec._ - val producer = system.actorOf(Props[LogProducer], name = "logProducer") + val producer = system.actorOf(Props[LogProducer](), name = "logProducer") override def beforeEach(): Unit = { output.reset() diff --git a/akka-slf4j/src/test/scala/akka/event/slf4j/Slf4jLoggingFilterSpec.scala b/akka-slf4j/src/test/scala/akka/event/slf4j/Slf4jLoggingFilterSpec.scala index 86fb8b7891..98079ed491 100644 --- a/akka-slf4j/src/test/scala/akka/event/slf4j/Slf4jLoggingFilterSpec.scala +++ b/akka-slf4j/src/test/scala/akka/event/slf4j/Slf4jLoggingFilterSpec.scala @@ -93,7 +93,7 @@ class Slf4jLoggingFilterSpec extends AkkaSpec(Slf4jLoggingFilterSpec.config) wit val probe = TestProbe() system.eventStream.publish(SetTarget(probe.ref)) probe.expectMsg("OK") - val debugLevelProducer = system.actorOf(Props[DebugLevelProducer], name = "debugLevelProducer") + val debugLevelProducer = system.actorOf(Props[DebugLevelProducer](), name = "debugLevelProducer") debugLevelProducer ! "test1" probe.expectMsgType[Warning].message should be("test1") probe.expectMsgType[Info].message should be("test1") @@ -104,7 +104,7 @@ class Slf4jLoggingFilterSpec extends AkkaSpec(Slf4jLoggingFilterSpec.config) wit val probe = TestProbe() system.eventStream.publish(SetTarget(probe.ref)) probe.expectMsg("OK") - val debugLevelProducer = system.actorOf(Props[WarningLevelProducer], name = "warningLevelProducer") + val debugLevelProducer = system.actorOf(Props[WarningLevelProducer](), name = "warningLevelProducer") debugLevelProducer ! "test2" probe.expectMsgType[Warning].message should be("test2") probe.expectNoMessage(500.millis) diff --git a/akka-stream-testkit/src/main/scala/akka/stream/testkit/scaladsl/StreamTestKit.scala b/akka-stream-testkit/src/main/scala/akka/stream/testkit/scaladsl/StreamTestKit.scala index 6f2736469d..8be7ed1da5 100644 --- a/akka-stream-testkit/src/main/scala/akka/stream/testkit/scaladsl/StreamTestKit.scala +++ b/akka-stream-testkit/src/main/scala/akka/stream/testkit/scaladsl/StreamTestKit.scala @@ -102,7 +102,7 @@ object StreamTestKit { .append(logic.attributes.attributeList.mkString(", ")) .append("],\n") } - builder.setLength(builder.length - 2) + builder.setLength(builder.length() - 2) shell match { case running: RunningInterpreter => builder.append("\n ],\n connections: [\n") @@ -119,7 +119,7 @@ object StreamTestKit { .append(connection.state) .append(")\n") } - builder.setLength(builder.length - 2) + builder.setLength(builder.length() - 2) case _ => } diff --git a/akka-stream-testkit/src/test/scala/akka/stream/testkit/BaseTwoStreamsSetup.scala b/akka-stream-testkit/src/test/scala/akka/stream/testkit/BaseTwoStreamsSetup.scala index c9fb603bc1..64f65a9ef3 100644 --- a/akka-stream-testkit/src/test/scala/akka/stream/testkit/BaseTwoStreamsSetup.scala +++ b/akka-stream-testkit/src/test/scala/akka/stream/testkit/BaseTwoStreamsSetup.scala @@ -25,7 +25,7 @@ abstract class BaseTwoStreamsSetup extends AkkaSpec(""" def failedPublisher[T]: Publisher[T] = TestPublisher.error[T](TestException) - def completedPublisher[T]: Publisher[T] = TestPublisher.empty[T] + def completedPublisher[T]: Publisher[T] = TestPublisher.empty[T]() def nonemptyPublisher[T](elems: immutable.Iterable[T]): Publisher[T] = Source(elems).runWith(Sink.asPublisher(false)) diff --git a/akka-stream-testkit/src/test/scala/akka/stream/testkit/StreamTestDefaultMailbox.scala b/akka-stream-testkit/src/test/scala/akka/stream/testkit/StreamTestDefaultMailbox.scala index 9742071951..68c6666016 100644 --- a/akka-stream-testkit/src/test/scala/akka/stream/testkit/StreamTestDefaultMailbox.scala +++ b/akka-stream-testkit/src/test/scala/akka/stream/testkit/StreamTestDefaultMailbox.scala @@ -29,7 +29,7 @@ private[akka] final case class StreamTestDefaultMailbox() final override def create(owner: Option[ActorRef], system: Option[ActorSystem]): MessageQueue = { owner match { case Some(r: ActorRefWithCell) => - val actorClass = r.underlying.props.actorClass + val actorClass = r.underlying.props.actorClass() assert( actorClass != classOf[Actor], s"Don't use anonymous actor classes, actor class for $r was [${actorClass.getName}]") diff --git a/akka-stream-tests/src/test/scala/akka/stream/SystemMaterializerSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/SystemMaterializerSpec.scala index f609f2c129..8be2ba12b0 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/SystemMaterializerSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/SystemMaterializerSpec.scala @@ -38,7 +38,7 @@ class SystemMaterializerEagerStartupSpec extends StreamSpec { "The SystemMaterializer" must { "be eagerly started on system startup" in { - system.hasExtension(SystemMaterializer.lookup) should ===(true) + system.hasExtension(SystemMaterializer.lookup()) should ===(true) } } diff --git a/akka-stream-tests/src/test/scala/akka/stream/impl/fusing/GraphInterpreterSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/impl/fusing/GraphInterpreterSpec.scala index 1b275b692f..8760e27c8d 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/impl/fusing/GraphInterpreterSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/impl/fusing/GraphInterpreterSpec.scala @@ -15,7 +15,7 @@ class GraphInterpreterSpec extends StreamSpec with GraphInterpreterSpecKit { // Reusable components val identity = GraphStages.identity[Int] val detach = detacher[Int] - val zip = Zip[Int, String] + val zip = Zip[Int, String]() val bcast = Broadcast[Int](2) val merge = Merge[Int](2) val balance = Balance[Int](2) diff --git a/akka-stream-tests/src/test/scala/akka/stream/io/InputStreamSourceSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/io/InputStreamSourceSpec.scala index db9cf62f5b..a6521e6bc2 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/io/InputStreamSourceSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/io/InputStreamSourceSpec.scala @@ -54,7 +54,7 @@ class InputStreamSourceSpec extends StreamSpec(UnboundedMailboxConfig) { override def close(): Unit = throw fail }) .toMat(Sink.ignore)(Keep.left) - .run + .run() .failed .futureValue .getCause shouldEqual fail @@ -67,7 +67,7 @@ class InputStreamSourceSpec extends StreamSpec(UnboundedMailboxConfig) { throw fail }) .toMat(Sink.ignore)(Keep.left) - .run + .run() .failed .futureValue .getCause shouldEqual fail @@ -78,7 +78,7 @@ class InputStreamSourceSpec extends StreamSpec(UnboundedMailboxConfig) { StreamConverters .fromInputStream(() => () => throw fail) .toMat(Sink.ignore)(Keep.left) - .run + .run() .failed .futureValue .getCause shouldEqual fail diff --git a/akka-stream-tests/src/test/scala/akka/stream/io/OutputStreamSourceSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/io/OutputStreamSourceSpec.scala index 84a5a57436..afebdb7fd3 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/io/OutputStreamSourceSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/io/OutputStreamSourceSpec.scala @@ -57,7 +57,7 @@ class OutputStreamSourceSpec extends StreamSpec(UnboundedMailboxConfig) { "OutputStreamSource" must { "read bytes from OutputStream" in assertAllStagesStopped { - val (outputStream, probe) = StreamConverters.asOutputStream().toMat(TestSink.probe[ByteString])(Keep.both).run + val (outputStream, probe) = StreamConverters.asOutputStream().toMat(TestSink.probe[ByteString])(Keep.both).run() val s = probe.expectSubscription() outputStream.write(bytesArray) @@ -74,7 +74,7 @@ class OutputStreamSourceSpec extends StreamSpec(UnboundedMailboxConfig) { StreamConverters .asOutputStream() .toMat(Sink.fold[ByteString, ByteString](ByteString.empty)(_ ++ _))(Keep.both) - .run + .run() outputStream.write(bytesArray) outputStream.close() result.futureValue should be(ByteString(bytesArray)) @@ -82,7 +82,7 @@ class OutputStreamSourceSpec extends StreamSpec(UnboundedMailboxConfig) { } "not block flushes when buffer is empty" in assertAllStagesStopped { - val (outputStream, probe) = StreamConverters.asOutputStream().toMat(TestSink.probe[ByteString])(Keep.both).run + val (outputStream, probe) = StreamConverters.asOutputStream().toMat(TestSink.probe[ByteString])(Keep.both).run() val s = probe.expectSubscription() outputStream.write(bytesArray) @@ -104,7 +104,7 @@ class OutputStreamSourceSpec extends StreamSpec(UnboundedMailboxConfig) { .asOutputStream() .toMat(TestSink.probe[ByteString])(Keep.both) .withAttributes(Attributes.inputBuffer(16, 16)) - .run + .run() val s = probe.expectSubscription() (1 to 16).foreach { _ => @@ -126,7 +126,7 @@ class OutputStreamSourceSpec extends StreamSpec(UnboundedMailboxConfig) { } "throw error when write after stream is closed" in assertAllStagesStopped { - val (outputStream, probe) = StreamConverters.asOutputStream().toMat(TestSink.probe[ByteString])(Keep.both).run + val (outputStream, probe) = StreamConverters.asOutputStream().toMat(TestSink.probe[ByteString])(Keep.both).run() probe.expectSubscription() outputStream.close() @@ -135,7 +135,7 @@ class OutputStreamSourceSpec extends StreamSpec(UnboundedMailboxConfig) { } "throw IOException when writing to the stream after the subscriber has cancelled the reactive stream" in assertAllStagesStopped { - val (outputStream, sink) = StreamConverters.asOutputStream().toMat(TestSink.probe[ByteString])(Keep.both).run + val (outputStream, sink) = StreamConverters.asOutputStream().toMat(TestSink.probe[ByteString])(Keep.both).run() val s = sink.expectSubscription() @@ -202,7 +202,7 @@ class OutputStreamSourceSpec extends StreamSpec(UnboundedMailboxConfig) { .asOutputStream(timeout) .addAttributes(Attributes.inputBuffer(bufSize, bufSize)) .toMat(TestSink.probe[ByteString])(Keep.both) - .run + .run() // fill the buffer up (1 to (bufSize - 1)).foreach(outputStream.write) diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/ActorRefBackpressureSinkSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/ActorRefBackpressureSinkSpec.scala index a92a307fb2..31c64f483a 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/ActorRefBackpressureSinkSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/ActorRefBackpressureSinkSpec.scala @@ -131,7 +131,7 @@ class ActorRefBackpressureSinkSpec extends StreamSpec { val sink = Sink .actorRefWithBackpressure(fw, initMessage, ackMessage, completeMessage, _ => failMessage) .withAttributes(inputBuffer(bufferSize, bufferSize)) - val bufferFullProbe = Promise[akka.Done.type] + val bufferFullProbe = Promise[akka.Done.type]() Source(1 to streamElementCount) .alsoTo(Flow[Int].drop(bufferSize - 1).to(Sink.foreach(_ => bufferFullProbe.trySuccess(akka.Done)))) .to(sink) diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/AttributesSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/AttributesSpec.scala index a42eb47220..c3460d3a26 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/AttributesSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/AttributesSpec.scala @@ -459,7 +459,7 @@ class AttributesSpec "make the attributes on Flow.fromGraph source behave the same as the stage itself" in { val attributes: Attributes = javadsl.Source - .empty[Any] + .empty[Any]() .viaMat( javadsl.Flow .fromGraph(new AttributesFlow(Attributes.name("original-name"))) @@ -481,7 +481,7 @@ class AttributesSpec "make the attributes on Sink.fromGraph source behave the same as the stage itself" in { val attributes: Attributes = javadsl.Source - .empty[Any] + .empty[Any]() .toMat( javadsl.Sink .fromGraph(new AttributesSink(Attributes.name("original-name"))) diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/CoupledTerminationFlowSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/CoupledTerminationFlowSpec.scala index f11c33a8cb..e17380659c 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/CoupledTerminationFlowSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/CoupledTerminationFlowSpec.scala @@ -130,7 +130,7 @@ class CoupledTerminationFlowSpec extends StreamSpec(""" val flow = Flow.fromSinkAndSourceCoupledMat(sink, source)(Keep.right) - val (source1, source2) = TestSource.probe[Int].viaMat(flow)(Keep.both).toMat(Sink.ignore)(Keep.left).run + val (source1, source2) = TestSource.probe[Int].viaMat(flow)(Keep.both).toMat(Sink.ignore)(Keep.left).run() source1.sendComplete() source2.expectCancellation() diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowCompileSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowCompileSpec.scala index 7ee329e20e..728726a1e7 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowCompileSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowCompileSpec.scala @@ -51,14 +51,14 @@ class FlowCompileSpec extends StreamSpec { val appended: Sink[Int, _] = open.to(closedSink) "appended.run()" shouldNot compile "appended.to(Sink.head[Int])" shouldNot compile - intSeq.to(appended).run + intSeq.to(appended).run() } "be appended to Source" in { val open: Flow[Int, String, _] = Flow[Int].map(_.toString) val closedSource: Source[Int, _] = strSeq.via(Flow[String].map(_.hashCode)) val closedSource2: Source[String, _] = closedSource.via(open) "strSeq.to(closedSource2)" shouldNot compile - closedSource2.to(Sink.asPublisher[String](false)).run + closedSource2.to(Sink.asPublisher[String](false)).run() } } diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowDropWithinSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowDropWithinSpec.scala index c951ace068..57d3e54222 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowDropWithinSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowDropWithinSpec.scala @@ -17,18 +17,18 @@ class FlowDropWithinSpec extends StreamSpec { val p = TestPublisher.manualProbe[Int]() val c = TestSubscriber.manualProbe[Int]() Source.fromPublisher(p).dropWithin(1.second).to(Sink.fromSubscriber(c)).run() - val pSub = p.expectSubscription - val cSub = c.expectSubscription + val pSub = p.expectSubscription() + val cSub = c.expectSubscription() cSub.request(100) - val demand1 = pSub.expectRequest + val demand1 = pSub.expectRequest() (1 to demand1.toInt).foreach { _ => pSub.sendNext(input.next()) } - val demand2 = pSub.expectRequest + val demand2 = pSub.expectRequest() (1 to demand2.toInt).foreach { _ => pSub.sendNext(input.next()) } - val demand3 = pSub.expectRequest + val demand3 = pSub.expectRequest() c.expectNoMessage(1500.millis) (1 to demand3.toInt).foreach { _ => pSub.sendNext(input.next()) @@ -37,7 +37,7 @@ class FlowDropWithinSpec extends StreamSpec { c.expectNext(n) } pSub.sendComplete() - c.expectComplete + c.expectComplete() c.expectNoMessage(200.millis) } diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowFlatMapPrefixSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowFlatMapPrefixSpec.scala index 3941e1c45f..9c24f96afa 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowFlatMapPrefixSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowFlatMapPrefixSpec.scala @@ -36,7 +36,7 @@ class FlowFlatMapPrefixSpec extends StreamSpec { Flow[Int].mapMaterializedValue(_ => prefix) }(Keep.right) .toMat(Sink.seq)(Keep.both) - .run + .run() prefixF.futureValue should ===(0 until 2) suffixF.futureValue should ===(2 until 10) @@ -48,7 +48,7 @@ class FlowFlatMapPrefixSpec extends StreamSpec { Flow[Int].mapMaterializedValue(_ => prefix) }(Keep.right) .toMat(Sink.seq)(Keep.both) - .run + .run() prefixF.futureValue should ===(0 until 10) suffixF.futureValue should be(empty) @@ -60,7 +60,7 @@ class FlowFlatMapPrefixSpec extends StreamSpec { Flow[Int].mapMaterializedValue(_ => prefix) }(Keep.right) .toMat(Sink.seq)(Keep.both) - .run + .run() prefixF.futureValue should ===(0 until 10) suffixF.futureValue should be(empty) @@ -73,7 +73,7 @@ class FlowFlatMapPrefixSpec extends StreamSpec { }(Keep.right) .take(10) .toMat(Sink.seq)(Keep.both) - .run + .run() prefixF.futureValue should ===(0 until 10) suffixF.futureValue should ===(10 until 20) @@ -85,7 +85,7 @@ class FlowFlatMapPrefixSpec extends StreamSpec { throw TE(s"I hate mondays! (${prefix.size})") }(Keep.right) .to(Sink.ignore) - .run + .run() val ex = suffixF.failed.futureValue ex.getCause should not be null @@ -101,7 +101,7 @@ class FlowFlatMapPrefixSpec extends StreamSpec { } }(Keep.right) .toMat(Sink.ignore)(Keep.both) - .run + .run() prefixF.futureValue should ===(0 until 10) val ex = suffixF.failed.futureValue ex should ===(TE("don't like 15 either!")) @@ -182,7 +182,7 @@ class FlowFlatMapPrefixSpec extends StreamSpec { Flow[Int].mapMaterializedValue(_ => prefix).filter(_ => false) }(Keep.right) .toMat(Sink.seq)(Keep.both) - .run + .run() prefixF.futureValue should ===(0 until 4) suffixF.futureValue should be(empty) @@ -198,7 +198,7 @@ class FlowFlatMapPrefixSpec extends StreamSpec { Flow[Int].mapMaterializedValue(_ => prefix).take(0) }(Keep.right) .toMat(Sink.seq)(Keep.both) - .run + .run() prefixF.futureValue should ===(0 until 4) suffixF.futureValue should be(empty) @@ -210,7 +210,7 @@ class FlowFlatMapPrefixSpec extends StreamSpec { Flow[Int].mapMaterializedValue(_ => prefix).take(0).concat(Source(11 to 12)) }(Keep.right) .toMat(Sink.seq)(Keep.both) - .run + .run() prefixF.futureValue should ===(0 until 4) suffixF.futureValue should ===(11 :: 12 :: Nil) @@ -222,7 +222,7 @@ class FlowFlatMapPrefixSpec extends StreamSpec { Flow[Int].mapMaterializedValue(_ => throw TE(s"boom-bada-bang (${prefix.size})")) }(Keep.right) .toMat(Sink.seq)(Keep.both) - .run + .run() prefixF.failed.futureValue should be(a[NeverMaterializedException]) prefixF.failed.futureValue.getCause should ===(TE("boom-bada-bang (4)")) @@ -239,7 +239,7 @@ class FlowFlatMapPrefixSpec extends StreamSpec { }(Keep.both) }(Keep.right) .toMat(Sink.seq)(Keep.both) - .run + .run() suffixF.futureValue should be(empty) val (prefix, suffix) = prefixAndTailF.futureValue diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowFlattenMergeSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowFlattenMergeSpec.scala index 610dd89aa0..12646bef5e 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowFlattenMergeSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowFlattenMergeSpec.scala @@ -27,7 +27,7 @@ class FlowFlattenMergeSpec extends StreamSpec { import system.dispatcher def src10(i: Int) = Source(i until (i + 10)) - def blocked = Source.future(Promise[Int].future) + def blocked = Source.future(Promise[Int]().future) val toSeq = Flow[Int].grouped(1000).toMat(Sink.head)(Keep.right) val toSet = toSeq.mapMaterializedValue(_.map(_.toSet)) @@ -107,7 +107,7 @@ class FlowFlattenMergeSpec extends StreamSpec { "cancel substreams when failing from main stream" in assertAllStagesStopped { val p1, p2 = TestPublisher.probe[Int]() val ex = new Exception("buh") - val p = Promise[Source[Int, NotUsed]] + val p = Promise[Source[Int, NotUsed]]() (Source(List(Source.fromPublisher(p1), Source.fromPublisher(p2))) ++ Source.future(p.future)) .flatMapMerge(5, identity) .runWith(Sink.head) @@ -121,7 +121,7 @@ class FlowFlattenMergeSpec extends StreamSpec { "cancel substreams when failing from substream" in assertAllStagesStopped { val p1, p2 = TestPublisher.probe[Int]() val ex = new Exception("buh") - val p = Promise[Int] + val p = Promise[Int]() Source(List(Source.fromPublisher(p1), Source.fromPublisher(p2), Source.future(p.future))) .flatMapMerge(5, identity) .runWith(Sink.head) diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowGroupedWithinSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowGroupedWithinSpec.scala index fd8f0f2962..52934d81b2 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowGroupedWithinSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowGroupedWithinSpec.scala @@ -24,18 +24,18 @@ class FlowGroupedWithinSpec extends StreamSpec with ScriptedTest { val p = TestPublisher.manualProbe[Int]() val c = TestSubscriber.manualProbe[immutable.Seq[Int]]() Source.fromPublisher(p).groupedWithin(1000, 1.second).to(Sink.fromSubscriber(c)).run() - val pSub = p.expectSubscription - val cSub = c.expectSubscription + val pSub = p.expectSubscription() + val cSub = c.expectSubscription() cSub.request(100) - val demand1 = pSub.expectRequest.toInt + val demand1 = pSub.expectRequest().toInt (1 to demand1).foreach { _ => pSub.sendNext(input.next()) } - val demand2 = pSub.expectRequest.toInt + val demand2 = pSub.expectRequest().toInt (1 to demand2).foreach { _ => pSub.sendNext(input.next()) } - val demand3 = pSub.expectRequest.toInt + val demand3 = pSub.expectRequest().toInt c.expectNext((1 to (demand1 + demand2).toInt).toVector) (1 to demand3).foreach { _ => pSub.sendNext(input.next()) @@ -43,22 +43,22 @@ class FlowGroupedWithinSpec extends StreamSpec with ScriptedTest { c.expectNoMessage(300.millis) c.expectNext(((demand1 + demand2 + 1).toInt to (demand1 + demand2 + demand3).toInt).toVector) c.expectNoMessage(300.millis) - pSub.expectRequest + pSub.expectRequest() val last = input.next() pSub.sendNext(last) pSub.sendComplete() c.expectNext(List(last)) - c.expectComplete + c.expectComplete() c.expectNoMessage(200.millis) } "deliver buffered elements onComplete before the timeout" taggedAs TimingTest in { val c = TestSubscriber.manualProbe[immutable.Seq[Int]]() Source(1 to 3).groupedWithin(1000, 10.second).to(Sink.fromSubscriber(c)).run() - val cSub = c.expectSubscription + val cSub = c.expectSubscription() cSub.request(100) c.expectNext((1 to 3).toList) - c.expectComplete + c.expectComplete() c.expectNoMessage(200.millis) } @@ -67,15 +67,15 @@ class FlowGroupedWithinSpec extends StreamSpec with ScriptedTest { val p = TestPublisher.manualProbe[Int]() val c = TestSubscriber.manualProbe[immutable.Seq[Int]]() Source.fromPublisher(p).groupedWithin(1000, 1.second).to(Sink.fromSubscriber(c)).run() - val pSub = p.expectSubscription - val cSub = c.expectSubscription + val pSub = p.expectSubscription() + val cSub = c.expectSubscription() cSub.request(1) - val demand1 = pSub.expectRequest.toInt + val demand1 = pSub.expectRequest().toInt (1 to demand1).foreach { _ => pSub.sendNext(input.next()) } c.expectNext((1 to demand1).toVector) - val demand2 = pSub.expectRequest.toInt + val demand2 = pSub.expectRequest().toInt (1 to demand2).foreach { _ => pSub.sendNext(input.next()) } @@ -83,7 +83,7 @@ class FlowGroupedWithinSpec extends StreamSpec with ScriptedTest { cSub.request(1) c.expectNext(((demand1 + 1) to (demand1 + demand2)).toVector) pSub.sendComplete() - c.expectComplete + c.expectComplete() c.expectNoMessage(100.millis) } @@ -91,10 +91,10 @@ class FlowGroupedWithinSpec extends StreamSpec with ScriptedTest { val p = TestPublisher.manualProbe[Int]() val c = TestSubscriber.manualProbe[immutable.Seq[Int]]() Source.fromPublisher(p).groupedWithin(1000, 500.millis).to(Sink.fromSubscriber(c)).run() - val pSub = p.expectSubscription - val cSub = c.expectSubscription + val pSub = p.expectSubscription() + val cSub = c.expectSubscription() cSub.request(2) - pSub.expectRequest + pSub.expectRequest() c.expectNoMessage(600.millis) pSub.sendNext(1) pSub.sendNext(2) @@ -104,19 +104,19 @@ class FlowGroupedWithinSpec extends StreamSpec with ScriptedTest { cSub.request(3) c.expectNoMessage(600.millis) pSub.sendComplete() - c.expectComplete + c.expectComplete() } "not emit empty group when finished while not being pushed" taggedAs TimingTest in { val p = TestPublisher.manualProbe[Int]() val c = TestSubscriber.manualProbe[immutable.Seq[Int]]() Source.fromPublisher(p).groupedWithin(1000, 50.millis).to(Sink.fromSubscriber(c)).run() - val pSub = p.expectSubscription - val cSub = c.expectSubscription + val pSub = p.expectSubscription() + val cSub = c.expectSubscription() cSub.request(1) - pSub.expectRequest - pSub.sendComplete - c.expectComplete + pSub.expectRequest() + pSub.sendComplete() + c.expectComplete() } "reset time window when max elements reached" taggedAs TimingTest in { diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowInterleaveSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowInterleaveSpec.scala index e12eafd628..c89ea4b578 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowInterleaveSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowInterleaveSpec.scala @@ -228,7 +228,7 @@ class FlowInterleaveSpec extends BaseTwoStreamsSetup { .asSubscriber[Int] .interleaveMat(Source.asSubscriber[Int], 2)((_, _)) .toMat(Sink.fromSubscriber(down))(Keep.left) - .run + .run() val downstream = down.expectSubscription() downstream.cancel() diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowIntersperseSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowIntersperseSpec.scala index cd22a9425f..3ddecbd553 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowIntersperseSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowIntersperseSpec.scala @@ -55,14 +55,14 @@ class FlowIntersperseSpec extends StreamSpec(""" } "complete the stage when the Source has been completed" in { - val (p1, p2) = TestSource.probe[String].intersperse(",").toMat(TestSink.probe[String])(Keep.both).run + val (p1, p2) = TestSource.probe[String].intersperse(",").toMat(TestSink.probe[String])(Keep.both).run() p2.request(10) p1.sendNext("a").sendNext("b").sendComplete() p2.expectNext("a").expectNext(",").expectNext("b").expectComplete() } "complete the stage when the Sink has been cancelled" in { - val (p1, p2) = TestSource.probe[String].intersperse(",").toMat(TestSink.probe[String])(Keep.both).run + val (p1, p2) = TestSource.probe[String].intersperse(",").toMat(TestSink.probe[String])(Keep.both).run() p2.request(10) p1.sendNext("a").sendNext("b") p2.expectNext("a").expectNext(",").cancel() diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowJoinSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowJoinSpec.scala index a23c212957..0a2d99842b 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowJoinSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowJoinSpec.scala @@ -92,7 +92,7 @@ class FlowJoinSpec extends StreamSpec(""" val flow = Flow.fromGraph(GraphDSL.create(TestSink.probe[(String, String)]) { implicit b => sink => import GraphDSL.Implicits._ - val zip = b.add(Zip[String, String]) + val zip = b.add(Zip[String, String]()) val broadcast = b.add(Broadcast[(String, String)](2)) source ~> zip.in0 zip.out ~> broadcast.in diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapAsyncSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapAsyncSpec.scala index 7ca062ea17..045c30201c 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapAsyncSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapAsyncSpec.scala @@ -457,7 +457,7 @@ class FlowMapAsyncSpec extends StreamSpec { def deferred(): Future[Int] = { if (counter.incrementAndGet() > parallelism) Future.failed(new Exception("parallelism exceeded")) else { - val p = Promise[Int] + val p = Promise[Int]() queue.offer(p -> System.nanoTime()) p.future } diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapAsyncUnorderedSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapAsyncUnorderedSpec.scala index 7280800e3c..e661468aaa 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapAsyncUnorderedSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapAsyncUnorderedSpec.scala @@ -137,7 +137,7 @@ class FlowMapAsyncUnorderedSpec extends StreamSpec { .run() val sub = c.expectSubscription() sub.request(10) - c.expectError.getMessage should be("err1") + c.expectError().getMessage should be("err1") latch.countDown() } @@ -180,7 +180,7 @@ class FlowMapAsyncUnorderedSpec extends StreamSpec { .run() val sub = c.expectSubscription() sub.request(10) - c.expectError.getMessage should be("err2") + c.expectError().getMessage should be("err2") latch.countDown() } @@ -339,7 +339,7 @@ class FlowMapAsyncUnorderedSpec extends StreamSpec { def deferred(): Future[Int] = { if (counter.incrementAndGet() > parallelism) Future.failed(new Exception("parallelism exceeded")) else { - val p = Promise[Int] + val p = Promise[Int]() queue.offer(p -> System.nanoTime()) p.future } diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapConcatSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapConcatSpec.scala index a18e7af2e6..9d7634da34 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapConcatSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapConcatSpec.scala @@ -30,7 +30,7 @@ class FlowMapConcatSpec extends StreamSpec(""" } "map and concat grouping with slow downstream" in assertAllStagesStopped { - val s = TestSubscriber.manualProbe[Int] + val s = TestSubscriber.manualProbe[Int]() val input = (1 to 20).grouped(5).toList Source(input).mapConcat(identity).map(x => { Thread.sleep(10); x }).runWith(Sink.fromSubscriber(s)) val sub = s.expectSubscription() diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMergeSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMergeSpec.scala index 1534c06423..ed5a6f19ed 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMergeSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMergeSpec.scala @@ -90,7 +90,7 @@ class FlowMergeSpec extends BaseTwoStreamsSetup { .asSubscriber[Int] .mergeMat(Source.asSubscriber[Int])((_, _)) .toMat(Sink.fromSubscriber(down))(Keep.left) - .run + .run() val downstream = down.expectSubscription() downstream.cancel() @@ -106,7 +106,11 @@ class FlowMergeSpec extends BaseTwoStreamsSetup { val up2 = TestPublisher.probe[Int]() val down = TestSubscriber.probe[Int]() - Source.fromPublisher(up1).merge(Source.fromPublisher(up2), eagerComplete = true).to(Sink.fromSubscriber(down)).run + Source + .fromPublisher(up1) + .merge(Source.fromPublisher(up2), eagerComplete = true) + .to(Sink.fromSubscriber(down)) + .run() up1.ensureSubscription() up2.ensureSubscription() diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowOnCompleteSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowOnCompleteSpec.scala index 8162350b1c..36427e2440 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowOnCompleteSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowOnCompleteSpec.scala @@ -25,7 +25,7 @@ class FlowOnCompleteSpec extends StreamSpec(""" val onCompleteProbe = TestProbe() val p = TestPublisher.manualProbe[Int]() Source.fromPublisher(p).to(Sink.onComplete[Int](onCompleteProbe.ref ! _)).run() - val proc = p.expectSubscription + val proc = p.expectSubscription() proc.expectRequest() proc.sendNext(42) onCompleteProbe.expectNoMessage(100.millis) @@ -37,7 +37,7 @@ class FlowOnCompleteSpec extends StreamSpec(""" val onCompleteProbe = TestProbe() val p = TestPublisher.manualProbe[Int]() Source.fromPublisher(p).to(Sink.onComplete[Int](onCompleteProbe.ref ! _)).run() - val proc = p.expectSubscription + val proc = p.expectSubscription() proc.expectRequest() val ex = new RuntimeException("ex") with NoStackTrace proc.sendError(ex) @@ -49,7 +49,7 @@ class FlowOnCompleteSpec extends StreamSpec(""" val onCompleteProbe = TestProbe() val p = TestPublisher.manualProbe[Int]() Source.fromPublisher(p).to(Sink.onComplete[Int](onCompleteProbe.ref ! _)).run() - val proc = p.expectSubscription + val proc = p.expectSubscription() proc.expectRequest() proc.sendComplete() onCompleteProbe.expectMsg(Success(Done)) @@ -71,7 +71,7 @@ class FlowOnCompleteSpec extends StreamSpec(""" } .runWith(foreachSink) future.onComplete { onCompleteProbe.ref ! _ } - val proc = p.expectSubscription + val proc = p.expectSubscription() proc.expectRequest() proc.sendNext(42) proc.sendComplete() diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowPrefixAndTailSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowPrefixAndTailSpec.scala index 3bc76cf449..b6477a4e47 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowPrefixAndTailSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowPrefixAndTailSpec.scala @@ -30,7 +30,7 @@ class FlowPrefixAndTailSpec extends StreamSpec(""" val fut = Source.empty.prefixAndTail(10).runWith(futureSink) val (prefix, tailFlow) = Await.result(fut, 3.seconds) prefix should be(Nil) - val tailSubscriber = TestSubscriber.manualProbe[Int] + val tailSubscriber = TestSubscriber.manualProbe[Int]() tailFlow.to(Sink.fromSubscriber(tailSubscriber)).run() tailSubscriber.expectSubscriptionAndComplete() } @@ -40,7 +40,7 @@ class FlowPrefixAndTailSpec extends StreamSpec(""" val fut = Source(List(1, 2, 3)).prefixAndTail(10).runWith(futureSink) val (prefix, tailFlow) = Await.result(fut, 3.seconds) prefix should be(List(1, 2, 3)) - val tailSubscriber = TestSubscriber.manualProbe[Int] + val tailSubscriber = TestSubscriber.manualProbe[Int]() tailFlow.to(Sink.fromSubscriber(tailSubscriber)).run() tailSubscriber.expectSubscriptionAndComplete() } diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowScanAsyncSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowScanAsyncSpec.scala index d7008e4bd6..3b29e75b09 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowScanAsyncSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowScanAsyncSpec.scala @@ -128,7 +128,7 @@ class FlowScanAsyncSpec extends StreamSpec with Matchers { } "skip error values and handle stage completion after future get resolved" in { - val promises = Promise[Int].success(1) :: Promise[Int] :: Nil + val promises = Promise[Int]().success(1) :: Promise[Int]() :: Nil val (pub, sub) = whenEventualFuture(promises, 0, decider = Supervision.restartingDecider) pub.sendNext(0) sub.expectNext(0, 1) @@ -139,7 +139,7 @@ class FlowScanAsyncSpec extends StreamSpec with Matchers { } "skip error values and handle stage completion before future get resolved" in { - val promises = Promise[Int].success(1) :: Promise[Int] :: Nil + val promises = Promise[Int]().success(1) :: Promise[Int]() :: Nil val (pub, sub) = whenEventualFuture(promises, 0, decider = Supervision.restartingDecider) pub.sendNext(0) sub.expectNext(0, 1) @@ -162,7 +162,7 @@ class FlowScanAsyncSpec extends StreamSpec with Matchers { } "skip error values and handle stage completion after future get resolved" in { - val promises = Promise[Int].success(1) :: Promise[Int] :: Nil + val promises = Promise[Int]().success(1) :: Promise[Int]() :: Nil val (pub, sub) = whenEventualFuture(promises, 0, decider = Supervision.resumingDecider) pub.sendNext(0) sub.expectNext(0, 1) @@ -173,7 +173,7 @@ class FlowScanAsyncSpec extends StreamSpec with Matchers { } "skip error values and handle stage completion before future get resolved" in { - val promises = Promise[Int].success(1) :: Promise[Int] :: Nil + val promises = Promise[Int]().success(1) :: Promise[Int]() :: Nil val (pub, sub) = whenEventualFuture(promises, 0, decider = Supervision.resumingDecider) pub.sendNext(0) sub.expectNext(0, 1) diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowWithContextSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowWithContextSpec.scala index eb8ee7638c..270dd50838 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowWithContextSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowWithContextSpec.scala @@ -40,7 +40,7 @@ class FlowWithContextSpec extends StreamSpec { .asSourceWithContext(_.offset) .viaMat(mapMaterializedValueFlow)(Keep.both) .toMat(TestSink.probe[(Message, Long)])(Keep.both) - .run + .run() matValue shouldBe (42 -> materializedValue) probe.request(1).expectNext(((Message("a", 1L), 1L))).expectComplete() } diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FramingSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FramingSpec.scala index dec8e6772d..84858b549e 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FramingSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FramingSpec.scala @@ -385,7 +385,7 @@ class FramingSpec extends StreamSpec { def computeFrameSize(@unused arr: Array[Byte], @unused l: Int): Int = 8 - val bs = ByteString.newBuilder.putInt(0xFF010203).putInt(0x04050607).result + val bs = ByteString.newBuilder.putInt(0xFF010203).putInt(0x04050607).result() val res = Source diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/GraphOpsIntegrationSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/GraphOpsIntegrationSpec.scala index 623e6f58b0..d9cffc877b 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/GraphOpsIntegrationSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/GraphOpsIntegrationSpec.scala @@ -156,7 +156,7 @@ class GraphOpsIntegrationSpec extends StreamSpec(""" "be able to run plain flow" in { val p = Source(List(1, 2, 3)).runWith(Sink.asPublisher(false)) - val s = TestSubscriber.manualProbe[Int] + val s = TestSubscriber.manualProbe[Int]() val flow = Flow[Int].map(_ * 2) RunnableGraph .fromGraph(GraphDSL.create() { implicit builder => diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/GraphUnzipWithSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/GraphUnzipWithSpec.scala index de2b5d2418..098bf26c57 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/GraphUnzipWithSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/GraphUnzipWithSpec.scala @@ -81,7 +81,7 @@ class GraphUnzipWithSpec extends StreamSpec(""" "UnzipWith" must { "work with immediately completed publisher" in assertAllStagesStopped { - val subscribers = setup(TestPublisher.empty[Int]) + val subscribers = setup(TestPublisher.empty[Int]()) validateSubscriptionAndComplete(subscribers) } diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/LazyFlowSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/LazyFlowSpec.scala index cfb98626f5..db5336b8be 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/LazyFlowSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/LazyFlowSpec.scala @@ -244,12 +244,12 @@ class LazyFlowSpec extends StreamSpec(""" "complete when there was no elements in the stream" in assertAllStagesStopped { def flowMaker() = flowF - val probe = Source.empty.via(Flow.lazyInitAsync(() => flowMaker)).runWith(TestSink.probe[Int]) + val probe = Source.empty.via(Flow.lazyInitAsync(() => flowMaker())).runWith(TestSink.probe[Int]) probe.request(1).expectComplete() } "complete normally when upstream completes BEFORE the stage has switched to the inner flow" in assertAllStagesStopped { - val promise = Promise[Flow[Int, Int, NotUsed]] + val promise = Promise[Flow[Int, Int, NotUsed]]() val (pub, sub) = TestSource .probe[Int] .viaMat(Flow.lazyInitAsync(() => promise.future))(Keep.left) diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/QueueSinkSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/QueueSinkSpec.scala index de40efe0c7..3fd072ba4c 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/QueueSinkSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/QueueSinkSpec.scala @@ -170,7 +170,7 @@ class QueueSinkSpec extends StreamSpec { val bufferSize = 16 val streamElementCount = bufferSize + 4 val sink = Sink.queue[Int]().withAttributes(inputBuffer(bufferSize, bufferSize)) - val bufferFullProbe = Promise[akka.Done.type] + val bufferFullProbe = Promise[akka.Done.type]() val queue = Source(1 to streamElementCount) .alsoTo(Flow[Int].drop(bufferSize - 1).to(Sink.foreach(_ => bufferFullProbe.trySuccess(akka.Done)))) .toMat(sink)(Keep.right) diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/QueueSourceSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/QueueSourceSpec.scala index 910f8c74a6..f90afe8217 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/QueueSourceSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/QueueSourceSpec.scala @@ -38,7 +38,7 @@ class QueueSourceSpec extends StreamSpec { "emit received messages to the stream" in { val s = TestSubscriber.manualProbe[Int]() val queue = Source.queue(10, OverflowStrategy.fail).to(Sink.fromSubscriber(s)).run() - val sub = s.expectSubscription + val sub = s.expectSubscription() for (i <- 1 to 3) { sub.request(1) assertSuccess(queue.offer(i)) @@ -85,7 +85,7 @@ class QueueSourceSpec extends StreamSpec { "buffer when needed" in { val s = TestSubscriber.manualProbe[Int]() val queue = Source.queue(100, OverflowStrategy.dropHead).to(Sink.fromSubscriber(s)).run() - val sub = s.expectSubscription + val sub = s.expectSubscription() for (n <- 1 to 20) assertSuccess(queue.offer(n)) sub.request(10) for (n <- 1 to 10) assertSuccess(queue.offer(n)) @@ -101,7 +101,7 @@ class QueueSourceSpec extends StreamSpec { "not fail when 0 buffer space and demand is signalled" in assertAllStagesStopped { val s = TestSubscriber.manualProbe[Int]() val queue = Source.queue(0, OverflowStrategy.dropHead).to(Sink.fromSubscriber(s)).run() - val sub = s.expectSubscription + val sub = s.expectSubscription() sub.request(1) assertSuccess(queue.offer(1)) @@ -112,7 +112,7 @@ class QueueSourceSpec extends StreamSpec { "wait for demand when buffer is 0" in assertAllStagesStopped { val s = TestSubscriber.manualProbe[Int]() val queue = Source.queue(0, OverflowStrategy.dropHead).to(Sink.fromSubscriber(s)).run() - val sub = s.expectSubscription + val sub = s.expectSubscription() queue.offer(1).pipeTo(testActor) expectNoMessage(pause) sub.request(1) @@ -124,7 +124,7 @@ class QueueSourceSpec extends StreamSpec { "finish offer and complete futures when stream completed" in assertAllStagesStopped { val s = TestSubscriber.manualProbe[Int]() val queue = Source.queue(0, OverflowStrategy.dropHead).to(Sink.fromSubscriber(s)).run() - val sub = s.expectSubscription + val sub = s.expectSubscription() queue.watchCompletion.pipeTo(testActor) queue.offer(1).pipeTo(testActor) @@ -144,7 +144,7 @@ class QueueSourceSpec extends StreamSpec { "fail stream on buffer overflow in fail mode" in assertAllStagesStopped { val s = TestSubscriber.manualProbe[Int]() val queue = Source.queue(1, OverflowStrategy.fail).to(Sink.fromSubscriber(s)).run() - s.expectSubscription + s.expectSubscription() queue.offer(1) queue.offer(2) @@ -156,7 +156,7 @@ class QueueSourceSpec extends StreamSpec { val probe = TestProbe() val queue = TestSourceStage(new QueueSource[Int](1, OverflowStrategy.dropHead, 1), probe).to(Sink.fromSubscriber(s)).run() - val sub = s.expectSubscription + val sub = s.expectSubscription() sub.request(1) probe.expectMsg(GraphStageMessages.Pull) @@ -225,7 +225,7 @@ class QueueSourceSpec extends StreamSpec { "return false when element was not added to buffer" in assertAllStagesStopped { val s = TestSubscriber.manualProbe[Int]() val queue = Source.queue(1, OverflowStrategy.dropNew).to(Sink.fromSubscriber(s)).run() - val sub = s.expectSubscription + val sub = s.expectSubscription() queue.offer(1) queue.offer(2).pipeTo(testActor) @@ -239,7 +239,7 @@ class QueueSourceSpec extends StreamSpec { "wait when buffer is full and backpressure is on" in assertAllStagesStopped { val s = TestSubscriber.manualProbe[Int]() val queue = Source.queue(1, OverflowStrategy.backpressure).to(Sink.fromSubscriber(s)).run() - val sub = s.expectSubscription + val sub = s.expectSubscription() assertSuccess(queue.offer(1)) queue.offer(2).pipeTo(testActor) @@ -258,7 +258,7 @@ class QueueSourceSpec extends StreamSpec { "fail offer future when stream is completed" in assertAllStagesStopped { val s = TestSubscriber.manualProbe[Int]() val queue = Source.queue(1, OverflowStrategy.dropNew).to(Sink.fromSubscriber(s)).run() - val sub = s.expectSubscription + val sub = s.expectSubscription() queue.watchCompletion().pipeTo(testActor) sub.cancel() expectMsg(Done) diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/ReverseArrowSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/ReverseArrowSpec.scala index 0d1bc71e80..972fafa2ea 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/ReverseArrowSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/ReverseArrowSpec.scala @@ -41,7 +41,7 @@ class ReverseArrowSpec extends StreamSpec { } "work from Sink" in { - val sub = TestSubscriber.manualProbe[Int] + val sub = TestSubscriber.manualProbe[Int]() RunnableGraph .fromGraph(GraphDSL.create() { implicit b => Sink.fromSubscriber(sub) <~ source diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/RunnableGraphSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/RunnableGraphSpec.scala index 684136593b..feb2fb0ea3 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/RunnableGraphSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/RunnableGraphSpec.scala @@ -28,7 +28,7 @@ class RunnableGraphSpec extends StreamSpec { } "allow conversion from java to scala" in { - val runnable: RunnableGraph[NotUsed] = javadsl.Source.empty.to(javadsl.Sink.ignore).asScala + val runnable: RunnableGraph[NotUsed] = javadsl.Source.empty().to(javadsl.Sink.ignore()).asScala runnable.run() shouldBe NotUsed } diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/SinkSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/SinkSpec.scala index d51b77be55..4b9e16c7c8 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/SinkSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/SinkSpec.scala @@ -22,7 +22,7 @@ class SinkSpec extends StreamSpec with DefaultTimeout with ScalaFutures { "A Sink" must { "be composable without importing modules" in { - val probes = Array.fill(3)(TestSubscriber.manualProbe[Int]) + val probes = Array.fill(3)(TestSubscriber.manualProbe[Int]()) val sink = Sink.fromGraph(GraphDSL.create() { implicit b => val bcast = b.add(Broadcast[Int](3)) for (i <- 0 to 2) bcast.out(i).filter(_ == i) ~> Sink.fromSubscriber(probes(i)) @@ -39,7 +39,7 @@ class SinkSpec extends StreamSpec with DefaultTimeout with ScalaFutures { } "be composable with importing 1 module" in { - val probes = Array.fill(3)(TestSubscriber.manualProbe[Int]) + val probes = Array.fill(3)(TestSubscriber.manualProbe[Int]()) val sink = Sink.fromGraph(GraphDSL.create(Sink.fromSubscriber(probes(0))) { implicit b => s0 => val bcast = b.add(Broadcast[Int](3)) bcast.out(0) ~> Flow[Int].filter(_ == 0) ~> s0.in @@ -57,7 +57,7 @@ class SinkSpec extends StreamSpec with DefaultTimeout with ScalaFutures { } "be composable with importing 2 modules" in { - val probes = Array.fill(3)(TestSubscriber.manualProbe[Int]) + val probes = Array.fill(3)(TestSubscriber.manualProbe[Int]()) val sink = Sink.fromGraph(GraphDSL.create(Sink.fromSubscriber(probes(0)), Sink.fromSubscriber(probes(1)))(List(_, _)) { implicit b => (s0, s1) => @@ -78,7 +78,7 @@ class SinkSpec extends StreamSpec with DefaultTimeout with ScalaFutures { } "be composable with importing 3 modules" in { - val probes = Array.fill(3)(TestSubscriber.manualProbe[Int]) + val probes = Array.fill(3)(TestSubscriber.manualProbe[Int]()) val sink = Sink.fromGraph( GraphDSL.create(Sink.fromSubscriber(probes(0)), Sink.fromSubscriber(probes(1)), Sink.fromSubscriber(probes(2)))( List(_, _, _)) { implicit b => (s0, s1, s2) => @@ -120,7 +120,7 @@ class SinkSpec extends StreamSpec with DefaultTimeout with ScalaFutures { } probes.foreach { p => p.expectNextN(List(1, 2)) - p.expectComplete + p.expectComplete() } } @@ -144,7 +144,7 @@ class SinkSpec extends StreamSpec with DefaultTimeout with ScalaFutures { } probes.foreach { p => p.expectNextN(List(1, 2)) - p.expectComplete + p.expectComplete() } } diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/SourceSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/SourceSpec.scala index c7249670c5..ca6e17c147 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/SourceSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/SourceSpec.scala @@ -86,7 +86,7 @@ class SourceSpec extends StreamSpec with DefaultTimeout { "merge from many inputs" in { val probes = immutable.Seq.fill(5)(TestPublisher.manualProbe[Int]()) val source = Source.asSubscriber[Int] - val out = TestSubscriber.manualProbe[Int] + val out = TestSubscriber.manualProbe[Int]() val s = Source .fromGraph(GraphDSL.create(source, source, source, source, source)(immutable.Seq(_, _, _, _, _)) { @@ -122,7 +122,7 @@ class SourceSpec extends StreamSpec with DefaultTimeout { "combine from many inputs with simplified API" in { val probes = immutable.Seq.fill(3)(TestPublisher.manualProbe[Int]()) val source = for (i <- 0 to 2) yield Source.fromPublisher(probes(i)) - val out = TestSubscriber.manualProbe[Int] + val out = TestSubscriber.manualProbe[Int]() Source.combine(source(0), source(1), source(2))(Merge(_)).to(Sink.fromSubscriber(out)).run() val sub = out.expectSubscription() @@ -143,7 +143,7 @@ class SourceSpec extends StreamSpec with DefaultTimeout { "combine from two inputs with simplified API" in { val probes = immutable.Seq.fill(2)(TestPublisher.manualProbe[Int]()) val source = Source.fromPublisher(probes(0)) :: Source.fromPublisher(probes(1)) :: Nil - val out = TestSubscriber.manualProbe[Int] + val out = TestSubscriber.manualProbe[Int]() Source.combine(source(0), source(1))(Merge(_)).to(Sink.fromSubscriber(out)).run() diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/SourceWithContextSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/SourceWithContextSpec.scala index ca2d161a83..4b601a74e9 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/SourceWithContextSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/SourceWithContextSpec.scala @@ -20,7 +20,7 @@ class SourceWithContextSpec extends StreamSpec { Source(Vector(msg)) .asSourceWithContext(_.offset) .toMat(TestSink.probe[(Message, Long)])(Keep.right) - .run + .run() .request(1) .expectNext((msg, 1L)) .expectComplete() @@ -57,7 +57,7 @@ class SourceWithContextSpec extends StreamSpec { .filter(_ != "b") .filterNot(_ == "d") .toMat(TestSink.probe[(String, Long)])(Keep.right) - .run + .run() .request(2) .expectNext(("a", 1L)) .expectNext(("c", 4L)) @@ -100,7 +100,7 @@ class SourceWithContextSpec extends StreamSpec { } .grouped(2) .toMat(TestSink.probe[(Seq[String], Seq[Long])])(Keep.right) - .run + .run() .request(2) .expectNext((Seq("a-1", "a-2"), Seq(1L, 1L)), (Seq("a-3", "a-4"), Seq(1L, 1L))) .expectComplete() diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/UnfoldResourceAsyncSourceSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/UnfoldResourceAsyncSourceSpec.scala index f81b94d7ae..4a1c0c66c8 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/UnfoldResourceAsyncSourceSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/UnfoldResourceAsyncSourceSpec.scala @@ -80,7 +80,7 @@ class UnfoldResourceAsyncSourceSpec extends StreamSpec(UnboundedMailboxConfig) { val probe = TestSubscriber.probe[Int]() Source - .unfoldResourceAsync[Int, ResourceDummy[Int]](resource.create _, _.read, _.close) + .unfoldResourceAsync[Int, ResourceDummy[Int]](resource.create _, _.read, _.close()) .runWith(Sink.fromSubscriber(probe)) probe.request(1) @@ -106,7 +106,7 @@ class UnfoldResourceAsyncSourceSpec extends StreamSpec(UnboundedMailboxConfig) { val resource = new ResourceDummy[Int](1 :: Nil, firstReadFuture = firstRead.future) Source - .unfoldResourceAsync[Int, ResourceDummy[Int]](resource.create _, _.read, _.close) + .unfoldResourceAsync[Int, ResourceDummy[Int]](resource.create _, _.read, _.close()) .runWith(Sink.fromSubscriber(probe)) probe.request(1L) @@ -216,7 +216,7 @@ class UnfoldResourceAsyncSourceSpec extends StreamSpec(UnboundedMailboxConfig) { if (!failed) { failed = true throw TE("read-error") - } else if (reader.hasNext) Future.successful(Some(reader.next)) + } else if (reader.hasNext) Future.successful(Some(reader.next())) else Future.successful(None), _ => Future.successful(Done)) .withAttributes(ActorAttributes.supervisionStrategy(Supervision.restartingDecider)) @@ -241,7 +241,7 @@ class UnfoldResourceAsyncSourceSpec extends StreamSpec(UnboundedMailboxConfig) { if (!failed) { failed = true Future.failed(TE("read-error")) - } else if (reader.hasNext) Future.successful(Some(reader.next)) + } else if (reader.hasNext) Future.successful(Some(reader.next())) else Future.successful(None), _ => Future.successful(Done)) .withAttributes(ActorAttributes.supervisionStrategy(Supervision.restartingDecider)) @@ -319,7 +319,7 @@ class UnfoldResourceAsyncSourceSpec extends StreamSpec(UnboundedMailboxConfig) { Source .unfoldResourceAsync[String, Unit]( - () => Promise[Unit].future, // never complete + () => Promise[Unit]().future, // never complete _ => ???, _ => ???) .runWith(Sink.ignore) diff --git a/akka-stream/src/main/scala/akka/stream/KillSwitch.scala b/akka-stream/src/main/scala/akka/stream/KillSwitch.scala index 9ae737576f..d2078ac3ad 100644 --- a/akka-stream/src/main/scala/akka/stream/KillSwitch.scala +++ b/akka-stream/src/main/scala/akka/stream/KillSwitch.scala @@ -78,7 +78,7 @@ object KillSwitches { override def toString: String = "UniqueKillSwitchFlow" override def createLogicAndMaterializedValue(attr: Attributes) = { - val promise = Promise[Done] + val promise = Promise[Done]() val switch = new UniqueKillSwitch(promise) val logic = new KillableGraphStageLogic(promise.future, shape) with InHandler with OutHandler { @@ -104,7 +104,7 @@ object KillSwitches { override def toString: String = "UniqueKillSwitchBidi" override def createLogicAndMaterializedValue(attr: Attributes) = { - val promise = Promise[Done] + val promise = Promise[Done]() val switch = new UniqueKillSwitch(promise) val logic = new KillableGraphStageLogic(promise.future, shape) { @@ -159,7 +159,7 @@ trait KillSwitch { private[stream] final class TerminationSignal { final class Listener private[TerminationSignal] { - private[TerminationSignal] val promise = Promise[Done] + private[TerminationSignal] val promise = Promise[Done]() def future: Future[Done] = promise.future def unregister(): Unit = removeListener(this) } diff --git a/akka-stream/src/main/scala/akka/stream/impl/QueueSource.scala b/akka-stream/src/main/scala/akka/stream/impl/QueueSource.scala index 6747ebea25..3230939a1f 100644 --- a/akka-stream/src/main/scala/akka/stream/impl/QueueSource.scala +++ b/akka-stream/src/main/scala/akka/stream/impl/QueueSource.scala @@ -40,7 +40,7 @@ import scala.concurrent.{ Future, Promise } override val shape: SourceShape[T] = SourceShape.of(out) override def createLogicAndMaterializedValue(inheritedAttributes: Attributes) = { - val completion = Promise[Done] + val completion = Promise[Done]() val name = inheritedAttributes.nameOrDefault(getClass.toString) val stageLogic = new GraphStageLogic(shape) with OutHandler with SourceQueueWithComplete[T] with StageLogging { @@ -209,7 +209,7 @@ import scala.concurrent.{ Future, Promise } override def watchCompletion() = completion.future override def offer(element: T): Future[QueueOfferResult] = { - val p = Promise[QueueOfferResult] + val p = Promise[QueueOfferResult]() callback .invokeWithFeedback(Offer(element, p)) .onComplete { diff --git a/akka-stream/src/main/scala/akka/stream/impl/SetupStage.scala b/akka-stream/src/main/scala/akka/stream/impl/SetupStage.scala index 71e6a8f052..885b880681 100644 --- a/akka-stream/src/main/scala/akka/stream/impl/SetupStage.scala +++ b/akka-stream/src/main/scala/akka/stream/impl/SetupStage.scala @@ -27,7 +27,7 @@ import scala.util.control.NonFatal override val shape = SinkShape(in) override def createLogicAndMaterializedValue(inheritedAttributes: Attributes): (GraphStageLogic, Future[M]) = { - val matPromise = Promise[M] + val matPromise = Promise[M]() (createStageLogic(matPromise), matPromise.future) } @@ -63,7 +63,7 @@ import scala.util.control.NonFatal override val shape = FlowShape(in, out) override def createLogicAndMaterializedValue(inheritedAttributes: Attributes): (GraphStageLogic, Future[M]) = { - val matPromise = Promise[M] + val matPromise = Promise[M]() (createStageLogic(matPromise), matPromise.future) } @@ -106,7 +106,7 @@ import scala.util.control.NonFatal override val shape = SourceShape(out) override def createLogicAndMaterializedValue(inheritedAttributes: Attributes): (GraphStageLogic, Future[M]) = { - val matPromise = Promise[M] + val matPromise = Promise[M]() (createStageLogic(matPromise), matPromise.future) } diff --git a/akka-stream/src/main/scala/akka/stream/impl/Sinks.scala b/akka-stream/src/main/scala/akka/stream/impl/Sinks.scala index 158d6ac40a..23ce66bf21 100644 --- a/akka-stream/src/main/scala/akka/stream/impl/Sinks.scala +++ b/akka-stream/src/main/scala/akka/stream/impl/Sinks.scala @@ -391,7 +391,7 @@ import scala.util.control.NonFatal // SinkQueueWithCancel impl override def pull(): Future[Option[T]] = { - val p = Promise[Option[T]] + val p = Promise[Option[T]]() callback .invokeWithFeedback(Pull(p)) .failed diff --git a/akka-stream/src/main/scala/akka/stream/impl/fusing/FlatMapPrefix.scala b/akka-stream/src/main/scala/akka/stream/impl/fusing/FlatMapPrefix.scala index bf04363bba..1ffc3a40d1 100644 --- a/akka-stream/src/main/scala/akka/stream/impl/fusing/FlatMapPrefix.scala +++ b/akka-stream/src/main/scala/akka/stream/impl/fusing/FlatMapPrefix.scala @@ -27,7 +27,7 @@ import scala.util.control.NonFatal override def initialAttributes: Attributes = DefaultAttributes.flatMapPrefix override def createLogicAndMaterializedValue(inheritedAttributes: Attributes): (GraphStageLogic, Future[M]) = { - val matPromise = Promise[M] + val matPromise = Promise[M]() val logic = new GraphStageLogic(shape) with InHandler with OutHandler { val accumulated = collection.mutable.Buffer.empty[In] diff --git a/akka-stream/src/main/scala/akka/stream/impl/fusing/StreamOfStreams.scala b/akka-stream/src/main/scala/akka/stream/impl/fusing/StreamOfStreams.scala index 49460d197a..122dfac20b 100644 --- a/akka-stream/src/main/scala/akka/stream/impl/fusing/StreamOfStreams.scala +++ b/akka-stream/src/main/scala/akka/stream/impl/fusing/StreamOfStreams.scala @@ -221,7 +221,7 @@ import scala.util.control.NonFatal override def onUpstreamFinish(): Unit = { if (!prefixComplete) { // This handles the unpulled out case as well - emit(out, (builder.result, Source.empty), () => completeStage()) + emit(out, (builder.result(), Source.empty), () => completeStage()) } else { if (!tailSource.isClosed) tailSource.complete() completeStage() @@ -413,7 +413,7 @@ import scala.util.control.NonFatal override def onPull(): Unit = { cancelTimer(key) - if (firstPush) { + if (firstPush()) { firstPushCounter -= 1 push(firstElement) firstElement = null.asInstanceOf[T] diff --git a/akka-stream/src/main/scala/akka/stream/impl/io/FileOutputStage.scala b/akka-stream/src/main/scala/akka/stream/impl/io/FileOutputStage.scala index 2f9a76d88f..08d52da17b 100644 --- a/akka-stream/src/main/scala/akka/stream/impl/io/FileOutputStage.scala +++ b/akka-stream/src/main/scala/akka/stream/impl/io/FileOutputStage.scala @@ -38,7 +38,7 @@ private[akka] final class FileOutputStage(path: Path, startPosition: Long, openO override def initialAttributes: Attributes = DefaultAttributes.fileSink override def createLogicAndMaterializedValue(inheritedAttributes: Attributes): (GraphStageLogic, Future[IOResult]) = { - val mat = Promise[IOResult] + val mat = Promise[IOResult]() val logic = new GraphStageLogic(shape) with InHandler { private var chan: FileChannel = _ private var bytesWritten: Long = 0 diff --git a/akka-stream/src/main/scala/akka/stream/impl/io/InputStreamSource.scala b/akka-stream/src/main/scala/akka/stream/impl/io/InputStreamSource.scala index 18a2f5ebe4..c7a14e34b7 100644 --- a/akka-stream/src/main/scala/akka/stream/impl/io/InputStreamSource.scala +++ b/akka-stream/src/main/scala/akka/stream/impl/io/InputStreamSource.scala @@ -39,7 +39,7 @@ private[akka] final class InputStreamSource(factory: () => InputStream, chunkSiz override protected def initialAttributes: Attributes = DefaultAttributes.inputStreamSource override def createLogicAndMaterializedValue(inheritedAttributes: Attributes): (GraphStageLogic, Future[IOResult]) = { - val mat = Promise[IOResult] + val mat = Promise[IOResult]() val logic = new GraphStageLogicWithLogging(shape) with OutHandler { private val buffer = new Array[Byte](chunkSize) private var readBytesTotal = 0L diff --git a/akka-stream/src/main/scala/akka/stream/impl/io/OutputStreamGraphStage.scala b/akka-stream/src/main/scala/akka/stream/impl/io/OutputStreamGraphStage.scala index b0f322ecb0..ac8104775c 100644 --- a/akka-stream/src/main/scala/akka/stream/impl/io/OutputStreamGraphStage.scala +++ b/akka-stream/src/main/scala/akka/stream/impl/io/OutputStreamGraphStage.scala @@ -29,7 +29,7 @@ private[akka] final class OutputStreamGraphStage(factory: () => OutputStream, au override protected def initialAttributes: Attributes = DefaultAttributes.outputStreamSink override def createLogicAndMaterializedValue(inheritedAttributes: Attributes): (GraphStageLogic, Future[IOResult]) = { - val mat = Promise[IOResult] + val mat = Promise[IOResult]() val logic = new GraphStageLogicWithLogging(shape) with InHandler { var outputStream: OutputStream = _ var bytesWritten: Long = 0L diff --git a/akka-stream/src/main/scala/akka/stream/impl/io/TcpStages.scala b/akka-stream/src/main/scala/akka/stream/impl/io/TcpStages.scala index d69d1510ac..d0b385a2b7 100644 --- a/akka-stream/src/main/scala/akka/stream/impl/io/TcpStages.scala +++ b/akka-stream/src/main/scala/akka/stream/impl/io/TcpStages.scala @@ -53,7 +53,7 @@ import scala.concurrent.{ Future, Promise } // TODO: Timeout on bind override def createLogicAndMaterializedValue(inheritedAttributes: Attributes, eagerMaterialzer: Materializer) = { - val bindingPromise = Promise[ServerBinding] + val bindingPromise = Promise[ServerBinding]() val logic = new TimerGraphStageLogic(shape) with StageLogging { implicit def self: ActorRef = stageActor.ref @@ -521,7 +521,7 @@ private[stream] object ConnectionSourceStage { case _ => None } - val localAddressPromise = Promise[InetSocketAddress] + val localAddressPromise = Promise[InetSocketAddress]() val logic = new TcpStreamLogic( shape, Outbound( diff --git a/akka-stream/src/main/scala/akka/stream/javadsl/Sink.scala b/akka-stream/src/main/scala/akka/stream/javadsl/Sink.scala index 9e4638e8e5..6ae596fb7f 100644 --- a/akka-stream/src/main/scala/akka/stream/javadsl/Sink.scala +++ b/akka-stream/src/main/scala/akka/stream/javadsl/Sink.scala @@ -424,7 +424,7 @@ object Sink { * case the materialized future value is failed with a [[akka.stream.NeverMaterializedException]]. */ def lazySink[T, M](create: Creator[Sink[T, M]]): Sink[T, CompletionStage[M]] = - lazyCompletionStageSink(() => CompletableFuture.completedFuture(create.create)) + lazyCompletionStageSink(() => CompletableFuture.completedFuture(create.create())) /** * Defers invoking the `create` function to create a future sink until there is a first element passed from upstream. diff --git a/akka-stream/src/main/scala/akka/stream/javadsl/Source.scala b/akka-stream/src/main/scala/akka/stream/javadsl/Source.scala index 9d60e0ad22..7d1799de18 100755 --- a/akka-stream/src/main/scala/akka/stream/javadsl/Source.scala +++ b/akka-stream/src/main/scala/akka/stream/javadsl/Source.scala @@ -1626,7 +1626,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[ def zipMat[T, M, M2]( that: Graph[SourceShape[T], M], matF: function.Function2[Mat, M, M2]): javadsl.Source[Out @uncheckedVariance Pair T, M2] = - this.viaMat(Flow.create[Out].zipMat(that, Keep.right[NotUsed, M]), matF) + this.viaMat(Flow.create[Out]().zipMat(that, Keep.right[NotUsed, M]), matF) /** * Combine the elements of current flow and the given [[Source]] into a stream of tuples. @@ -1689,7 +1689,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[ def zipLatestMat[T, M, M2]( that: Graph[SourceShape[T], M], matF: function.Function2[Mat, M, M2]): javadsl.Source[Out @uncheckedVariance Pair T, M2] = - this.viaMat(Flow.create[Out].zipLatestMat(that, Keep.right[NotUsed, M]), matF) + this.viaMat(Flow.create[Out]().zipLatestMat(that, Keep.right[NotUsed, M]), matF) /** * Put together the elements of current [[Source]] and the given one diff --git a/akka-testkit/src/main/scala/akka/testkit/CallingThreadDispatcher.scala b/akka-testkit/src/main/scala/akka/testkit/CallingThreadDispatcher.scala index 06381cf045..3011ba04b3 100644 --- a/akka-testkit/src/main/scala/akka/testkit/CallingThreadDispatcher.scala +++ b/akka-testkit/src/main/scala/akka/testkit/CallingThreadDispatcher.scala @@ -77,7 +77,7 @@ private[testkit] class CallingThreadDispatcherQueues extends Extension { val nv = v.filter(_.get ne null) if (nv.isEmpty) m else m += (k -> nv) } - .result + .result() } protected[akka] def registerQueue(mbox: CallingThreadMailbox, q: MessageQueue): Unit = synchronized { @@ -236,7 +236,7 @@ class CallingThreadDispatcher(_configurator: MessageDispatcherConfigurator) exte } } - protected[akka] override def executeTask(invocation: TaskInvocation): Unit = { invocation.run } + protected[akka] override def executeTask(invocation: TaskInvocation): Unit = { invocation.run() } /* * This method must be called with this thread's queue. diff --git a/akka-testkit/src/test/scala/akka/testkit/Coroner.scala b/akka-testkit/src/test/scala/akka/testkit/Coroner.scala index 8423639e2d..e329701abf 100644 --- a/akka-testkit/src/test/scala/akka/testkit/Coroner.scala +++ b/akka-testkit/src/test/scala/akka/testkit/Coroner.scala @@ -39,7 +39,7 @@ object Coroner { } private class WatchHandleImpl(startAndStopDuration: FiniteDuration) extends WatchHandle { - val cancelPromise = Promise[Boolean] + val cancelPromise = Promise[Boolean]() val startedLatch = new CountDownLatch(1) val finishedLatch = new CountDownLatch(1) diff --git a/akka-testkit/src/test/scala/akka/testkit/DefaultTimeoutSpec.scala b/akka-testkit/src/test/scala/akka/testkit/DefaultTimeoutSpec.scala index 8ad409015a..ee4a1bd14c 100644 --- a/akka-testkit/src/test/scala/akka/testkit/DefaultTimeoutSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/DefaultTimeoutSpec.scala @@ -13,7 +13,7 @@ class DefaultTimeoutSpec extends AnyWordSpec with Matchers with BeforeAndAfterAl implicit lazy val system: ActorSystem = ActorSystem("AkkaCustomSpec") - override def afterAll = system.terminate + override def afterAll = system.terminate() "A spec with DefaultTimeout" should { "use timeout from settings" in { diff --git a/akka-testkit/src/test/scala/akka/testkit/ImplicitSenderSpec.scala b/akka-testkit/src/test/scala/akka/testkit/ImplicitSenderSpec.scala index 640e6e44f6..9fb008ed90 100644 --- a/akka-testkit/src/test/scala/akka/testkit/ImplicitSenderSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/ImplicitSenderSpec.scala @@ -13,7 +13,7 @@ class ImplicitSenderSpec extends AnyWordSpec with Matchers with BeforeAndAfterAl implicit lazy val system: ActorSystem = ActorSystem("AkkaCustomSpec") - override def afterAll = system.terminate + override def afterAll = system.terminate() "An ImplicitSender" should { "have testActor as its self" in { diff --git a/akka-testkit/src/test/scala/akka/testkit/TestActorRefSpec.scala b/akka-testkit/src/test/scala/akka/testkit/TestActorRefSpec.scala index aa6c8e6296..42a48d8085 100644 --- a/akka-testkit/src/test/scala/akka/testkit/TestActorRefSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/TestActorRefSpec.scala @@ -42,11 +42,11 @@ object TestActorRefSpec { def receiveT = { case "complexRequest" => { replyTo = sender() - val worker = TestActorRef(Props[WorkerActor]) + val worker = TestActorRef(Props[WorkerActor]()) worker ! "work" } case "complexRequest2" => - val worker = TestActorRef(Props[WorkerActor]) + val worker = TestActorRef(Props[WorkerActor]()) worker ! sender() case "workDone" => replyTo ! "complexReply" case "simpleRequest" => sender() ! "simpleReply" @@ -143,7 +143,7 @@ class TestActorRefSpec extends AkkaSpec("disp1.type=Dispatcher") with BeforeAndA } "support reply via sender()" in { - val serverRef = TestActorRef(Props[ReplyActor]) + val serverRef = TestActorRef(Props[ReplyActor]()) val clientRef = TestActorRef(Props(classOf[SenderActor], serverRef)) counter = 4 @@ -169,7 +169,7 @@ class TestActorRefSpec extends AkkaSpec("disp1.type=Dispatcher") with BeforeAndA "stop when sent a poison pill" in { EventFilter[ActorKilledException]().intercept { - val a = TestActorRef(Props[WorkerActor]) + val a = TestActorRef(Props[WorkerActor]()) system.actorOf(Props(new Actor { context.watch(a) def receive = { @@ -251,7 +251,7 @@ class TestActorRefSpec extends AkkaSpec("disp1.type=Dispatcher") with BeforeAndA } "allow override of dispatcher" in { - val a = TestActorRef(Props[WorkerActor].withDispatcher("disp1")) + val a = TestActorRef(Props[WorkerActor]().withDispatcher("disp1")) a.underlying.dispatcher.getClass should ===(classOf[Dispatcher]) } @@ -323,24 +323,24 @@ class TestActorRefSpec extends AkkaSpec("disp1.type=Dispatcher") with BeforeAndA } "allow creation of a TestActorRef with a default supervisor with Props" in { - val ref = TestActorRef[WorkerActor](Props[WorkerActor]) + val ref = TestActorRef[WorkerActor](Props[WorkerActor]()) ref.underlyingActor.supervisor should be(system.asInstanceOf[ActorSystemImpl].guardian) } "allow creation of a TestActorRef with a default supervisor and specified name with Props" in { - val ref = TestActorRef[WorkerActor](Props[WorkerActor], "specificPropsActor") + val ref = TestActorRef[WorkerActor](Props[WorkerActor](), "specificPropsActor") ref.underlyingActor.name should be("specificPropsActor") } "allow creation of a TestActorRef with a specified supervisor with Props" in { val parent = TestActorRef[ReplyActor] - val ref = TestActorRef[WorkerActor](Props[WorkerActor], parent) + val ref = TestActorRef[WorkerActor](Props[WorkerActor](), parent) ref.underlyingActor.supervisor should be(parent) } "allow creation of a TestActorRef with a specified supervisor and specified name with Props" in { val parent = TestActorRef[ReplyActor] - val ref = TestActorRef[WorkerActor](Props[WorkerActor], parent, "specificSupervisedPropsActor") + val ref = TestActorRef[WorkerActor](Props[WorkerActor](), parent, "specificSupervisedPropsActor") ref.underlyingActor.name should be("specificSupervisedPropsActor") ref.underlyingActor.supervisor should be(parent) } diff --git a/akka-testkit/src/test/scala/akka/testkit/TestFSMRefSpec.scala b/akka-testkit/src/test/scala/akka/testkit/TestFSMRefSpec.scala index cd8eb69f00..1277577c18 100644 --- a/akka-testkit/src/test/scala/akka/testkit/TestFSMRefSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/TestFSMRefSpec.scala @@ -45,7 +45,7 @@ class TestFSMRefSpec extends AkkaSpec { val fsm = TestFSMRef(new Actor with FSM[Int, Null] { startWith(1, null) when(1) { - case _ => stay + case _ => stay() } }, "test-fsm-ref-2") fsm.isTimerActive("test") should ===(false) @@ -65,7 +65,7 @@ class TestFSMRefSpec extends AkkaSpec { class TestFSMActor extends Actor with FSM[Int, Null] { startWith(1, null) when(1) { - case _ => stay + case _ => stay() } val supervisor = context.parent val name = context.self.path.name diff --git a/akka-testkit/src/test/scala/akka/testkit/metrics/reporter/AkkaConsoleReporter.scala b/akka-testkit/src/test/scala/akka/testkit/metrics/reporter/AkkaConsoleReporter.scala index b8b93a7066..3985cf5d33 100644 --- a/akka-testkit/src/test/scala/akka/testkit/metrics/reporter/AkkaConsoleReporter.scala +++ b/akka-testkit/src/test/scala/akka/testkit/metrics/reporter/AkkaConsoleReporter.scala @@ -116,7 +116,7 @@ class AkkaConsoleReporter(registry: AkkaMetricRegistry, verbose: Boolean, output private def printKnownOpsInTimespanCounter(counter: KnownOpsInTimespanTimer): Unit = { import concurrent.duration._ import akka.util.PrettyDuration._ - output.print(" ops = %d%n".format(counter.getCount)) + output.print(" ops = %d%n".format(counter.getCount())) output.print(" time = %s%n".format(counter.elapsedTime.nanos.pretty)) output.print(" ops/s = %2.2f%n".format(counter.opsPerSecond)) output.print(" avg = %s%n".format(counter.avgDuration.nanos.pretty)) @@ -140,7 +140,7 @@ class AkkaConsoleReporter(registry: AkkaMetricRegistry, verbose: Boolean, output } private def printAveragingGauge(gauge: AveragingGauge): Unit = { - output.print(" avg = %2.2f%n".format(gauge.getValue)) + output.print(" avg = %2.2f%n".format(gauge.getValue())) } private def printWithBanner(s: String, c: Char): Unit = {