diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/CapturedLogEvent.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/CapturedLogEvent.scala index 13c06cac00..836156e042 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/CapturedLogEvent.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/CapturedLogEvent.scala @@ -15,14 +15,15 @@ package org.apache.pekko.actor.testkit.typed import java.util.Optional -import org.slf4j.Marker -import org.slf4j.event.Level +import scala.jdk.OptionConverters._ import org.apache.pekko import pekko.annotation.InternalApi -import scala.jdk.OptionConverters._ import pekko.util.OptionVal +import org.slf4j.Marker +import org.slf4j.event.Level + /** * Representation of a Log Event issued by a [[pekko.actor.typed.Behavior]] * when testing with [[pekko.actor.testkit.typed.scaladsl.BehaviorTestKit]] diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/Effect.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/Effect.scala index 10bcdba274..51f57c6514 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/Effect.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/Effect.scala @@ -14,12 +14,12 @@ package org.apache.pekko.actor.testkit.typed import scala.concurrent.duration.FiniteDuration +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.actor.typed.{ ActorRef, Behavior, Props } import pekko.annotation.{ DoNotInherit, InternalApi } import pekko.util.FunctionConverters._ -import scala.jdk.DurationConverters._ import pekko.util.unused /** diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/LoggingEvent.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/LoggingEvent.scala index 6fd5c79ad8..87a03768e8 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/LoggingEvent.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/LoggingEvent.scala @@ -15,12 +15,12 @@ package org.apache.pekko.actor.testkit.typed import java.util.Optional -import org.slf4j.Marker -import org.slf4j.event.Level - import scala.jdk.CollectionConverters._ import scala.jdk.OptionConverters._ +import org.slf4j.Marker +import org.slf4j.event.Level + object LoggingEvent { /** diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/TestKitSettings.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/TestKitSettings.scala index 69818c9715..42251512a3 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/TestKitSettings.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/TestKitSettings.scala @@ -14,16 +14,16 @@ package org.apache.pekko.actor.testkit.typed import scala.concurrent.duration.{ Duration, FiniteDuration } - -import com.typesafe.config.Config +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.actor.typed.ActorSystem import pekko.actor.typed.Extension import pekko.actor.typed.ExtensionId -import scala.jdk.DurationConverters._ import pekko.util.Timeout +import com.typesafe.config.Config + object TestKitSettings { /** diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/ActorSystemStub.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/ActorSystemStub.scala index ac4f841b57..325cfb89c4 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/ActorSystemStub.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/ActorSystemStub.scala @@ -14,11 +14,11 @@ package org.apache.pekko.actor.testkit.typed.internal import java.util.concurrent.{ CompletionStage, ThreadFactory } -import scala.concurrent._ + import scala.annotation.nowarn -import com.typesafe.config.{ Config, ConfigFactory } -import org.slf4j.Logger -import org.slf4j.LoggerFactory +import scala.concurrent._ +import scala.jdk.FutureConverters._ + import org.apache.pekko import pekko.{ actor => classic } import pekko.Done @@ -37,7 +37,11 @@ import pekko.actor.typed.internal.ActorRefImpl import pekko.actor.typed.internal.InternalRecipientRef import pekko.actor.typed.receptionist.Receptionist import pekko.annotation.InternalApi -import scala.jdk.FutureConverters._ + +import org.slf4j.Logger +import org.slf4j.LoggerFactory + +import com.typesafe.config.{ Config, ConfigFactory } /** * INTERNAL API diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/BehaviorTestKitImpl.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/BehaviorTestKitImpl.scala index 0b5e0e7027..29e3c371cb 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/BehaviorTestKitImpl.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/BehaviorTestKitImpl.scala @@ -17,19 +17,20 @@ import java.util import scala.annotation.tailrec import scala.collection.immutable +import scala.jdk.CollectionConverters._ import scala.reflect.ClassTag import scala.util.control.Exception.Catcher import scala.util.control.NonFatal + import org.apache.pekko import pekko.actor.ActorPath import pekko.actor.testkit.typed.{ CapturedLogEvent, Effect } import pekko.actor.testkit.typed.Effect._ -import pekko.actor.typed.internal.AdaptWithRegisteredMessageAdapter import pekko.actor.typed.{ ActorRef, Behavior, BehaviorInterceptor, PostStop, Signal, TypedActorContext } +import pekko.actor.typed.internal.AdaptWithRegisteredMessageAdapter import pekko.actor.typed.receptionist.Receptionist import pekko.actor.typed.scaladsl.Behaviors import pekko.annotation.InternalApi -import scala.jdk.CollectionConverters._ /** * INTERNAL API diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/EffectfulActorContext.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/EffectfulActorContext.scala index 67e24c75e4..ed2b47bea5 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/EffectfulActorContext.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/EffectfulActorContext.scala @@ -15,17 +15,17 @@ package org.apache.pekko.actor.testkit.typed.internal import java.util.concurrent.ConcurrentLinkedQueue -import org.apache.pekko -import pekko.actor.testkit.typed.Effect -import pekko.actor.testkit.typed.Effect._ -import pekko.actor.typed.internal.TimerSchedulerCrossDslSupport -import pekko.actor.typed.{ ActorRef, Behavior, Props } -import pekko.actor.{ ActorPath, Cancellable } -import pekko.annotation.InternalApi - import scala.concurrent.duration.FiniteDuration import scala.reflect.ClassTag +import org.apache.pekko +import pekko.actor.{ ActorPath, Cancellable } +import pekko.actor.testkit.typed.Effect +import pekko.actor.testkit.typed.Effect._ +import pekko.actor.typed.{ ActorRef, Behavior, Props } +import pekko.actor.typed.internal.TimerSchedulerCrossDslSupport +import pekko.annotation.InternalApi + /** * INTERNAL API */ diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/LogbackUtil.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/LogbackUtil.scala index 4e7cd82f31..d0c2c538e3 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/LogbackUtil.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/LogbackUtil.scala @@ -13,11 +13,12 @@ package org.apache.pekko.actor.testkit.typed.internal -import org.slf4j.LoggerFactory -import org.slf4j.event.Level +import scala.annotation.tailrec + import org.apache.pekko.annotation.InternalApi -import scala.annotation.tailrec +import org.slf4j.LoggerFactory +import org.slf4j.event.Level /** * INTERNAL API diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/LoggingTestKitImpl.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/LoggingTestKitImpl.scala index 0c4b5568e6..d2187e9176 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/LoggingTestKitImpl.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/LoggingTestKitImpl.scala @@ -19,8 +19,6 @@ import scala.concurrent.duration.Duration import scala.reflect.ClassTag import scala.util.matching.Regex -import org.slf4j.event.Level - import org.apache.pekko import pekko.actor.testkit.typed.LoggingEvent import pekko.actor.testkit.typed.TestKitSettings @@ -30,6 +28,8 @@ import pekko.actor.typed.ActorSystem import pekko.annotation.InternalApi import pekko.testkit.TestKit +import org.slf4j.event.Level + /** * INTERNAL API */ diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/StubbedActorContext.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/StubbedActorContext.scala index 6a0450fefd..4bf7f51746 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/StubbedActorContext.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/StubbedActorContext.scala @@ -13,22 +13,24 @@ package org.apache.pekko.actor.testkit.typed.internal -import org.apache.pekko -import pekko.actor.testkit.typed.CapturedLogEvent -import pekko.actor.typed._ -import pekko.actor.typed.internal._ -import pekko.actor.{ ActorPath, ActorRefProvider, InvalidMessageException } -import pekko.annotation.InternalApi -import pekko.util.Helpers -import pekko.{ actor => classic } -import org.slf4j.{ Logger, Marker } -import org.slf4j.helpers.{ MessageFormatter, SubstituteLoggerFactory } - import java.util.concurrent.ThreadLocalRandom.{ current => rnd } + import scala.collection.immutable.TreeMap import scala.concurrent.ExecutionContextExecutor import scala.concurrent.duration.FiniteDuration +import org.apache.pekko +import pekko.{ actor => classic } +import pekko.actor.{ ActorPath, ActorRefProvider, InvalidMessageException } +import pekko.actor.testkit.typed.CapturedLogEvent +import pekko.actor.typed._ +import pekko.actor.typed.internal._ +import pekko.annotation.InternalApi +import pekko.util.Helpers + +import org.slf4j.{ Logger, Marker } +import org.slf4j.helpers.{ MessageFormatter, SubstituteLoggerFactory } + /** * INTERNAL API * diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestAppender.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestAppender.scala index 8b143ad6e7..917ed1119b 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestAppender.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestAppender.scala @@ -13,15 +13,17 @@ package org.apache.pekko.actor.testkit.typed.internal +import java.util.Collections + import ch.qos.logback.classic.spi.ILoggingEvent import ch.qos.logback.classic.spi.ThrowableProxy import ch.qos.logback.core.AppenderBase -import org.slf4j.{ MDC, Marker } + import org.apache.pekko import pekko.actor.testkit.typed.LoggingEvent import pekko.annotation.InternalApi -import java.util.Collections +import org.slf4j.{ MDC, Marker } /** * INTERNAL API diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestProbeImpl.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestProbeImpl.scala index d4b9f75d08..1bb38e9e93 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestProbeImpl.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestProbeImpl.scala @@ -22,6 +22,8 @@ import java.util.function.Supplier import scala.annotation.tailrec import scala.collection.immutable import scala.concurrent.duration._ +import scala.jdk.CollectionConverters._ +import scala.jdk.DurationConverters._ import scala.reflect.ClassTag import scala.util.control.NonFatal @@ -43,9 +45,7 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.annotation.InternalApi import pekko.japi.function.Creator import pekko.util.BoxedType -import scala.jdk.DurationConverters._ import pekko.util.PrettyDuration._ -import scala.jdk.CollectionConverters._ @InternalApi private[pekko] object TestProbeImpl { diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKit.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKit.scala index 093e95294c..bbc650021b 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKit.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKit.scala @@ -15,7 +15,7 @@ package org.apache.pekko.actor.testkit.typed.javadsl import java.time.Duration -import com.typesafe.config.Config +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.actor.DeadLetter @@ -29,9 +29,10 @@ import pekko.actor.typed.ActorSystem import pekko.actor.typed.Behavior import pekko.actor.typed.Props import pekko.actor.typed.Scheduler -import scala.jdk.DurationConverters._ import pekko.util.Timeout +import com.typesafe.config.Config + object ActorTestKit { /** diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/BehaviorTestKit.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/BehaviorTestKit.scala index 385b6549e2..20909fc06b 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/BehaviorTestKit.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/BehaviorTestKit.scala @@ -13,16 +13,17 @@ package org.apache.pekko.actor.testkit.typed.javadsl -import org.apache.pekko -import pekko.actor.testkit.typed.internal.{ ActorSystemStub, BehaviorTestKitImpl } -import pekko.actor.testkit.typed.{ CapturedLogEvent, Effect } -import pekko.actor.typed.receptionist.Receptionist -import pekko.actor.typed.{ ActorRef, Behavior, Signal } -import pekko.annotation.{ ApiMayChange, DoNotInherit } -import com.typesafe.config.Config - import java.util.concurrent.ThreadLocalRandom +import org.apache.pekko +import pekko.actor.testkit.typed.{ CapturedLogEvent, Effect } +import pekko.actor.testkit.typed.internal.{ ActorSystemStub, BehaviorTestKitImpl } +import pekko.actor.typed.{ ActorRef, Behavior, Signal } +import pekko.actor.typed.receptionist.Receptionist +import pekko.annotation.{ ApiMayChange, DoNotInherit } + +import com.typesafe.config.Config + object BehaviorTestKit { /** diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/Effects.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/Effects.scala index 5bbedea2ad..ad7d77d4a4 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/Effects.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/Effects.scala @@ -15,9 +15,10 @@ package org.apache.pekko.actor.testkit.typed.javadsl import java.time.Duration +import scala.jdk.DurationConverters._ + import org.apache.pekko import pekko.actor.typed.{ ActorRef, Behavior, Props } -import scala.jdk.DurationConverters._ /** * Factories for behavior effects for [[BehaviorTestKit]], each effect has a suitable equals and can be used to compare diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala index ac3ae80e6e..cb6558b013 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala @@ -18,11 +18,12 @@ package org.apache.pekko.actor.testkit.typed.javadsl import org.apache.pekko -import com.typesafe.config.Config import pekko.actor.testkit.typed.internal.TestKitUtils import pekko.actor.testkit.typed.scaladsl.ActorTestKit.ApplicationTestConfig import pekko.actor.typed.ActorSystem +import com.typesafe.config.Config + final class JUnit5TestKitBuilder() { var system: Option[ActorSystem[_]] = None diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturing.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturing.scala index 57028154c0..e8b670504f 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturing.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturing.scala @@ -18,10 +18,11 @@ import scala.util.control.NonFatal import org.junit.rules.TestRule import org.junit.runner.Description import org.junit.runners.model.Statement -import org.slf4j.LoggerFactory import org.apache.pekko.actor.testkit.typed.internal.CapturingAppender +import org.slf4j.LoggerFactory + /** * JUnit `TestRule` to make log lines appear only when the test failed. * diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtension.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtension.scala index e4fd37c41e..01586dc983 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtension.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtension.scala @@ -9,13 +9,16 @@ package org.apache.pekko.actor.testkit.typed.javadsl -import org.junit.jupiter.api.extension.InvocationInterceptor.Invocation +import java.lang.reflect.Method + +import scala.util.control.NonFatal + import org.junit.jupiter.api.extension.{ ExtensionContext, InvocationInterceptor, ReflectiveInvocationContext } -import org.slf4j.LoggerFactory +import org.junit.jupiter.api.extension.InvocationInterceptor.Invocation + import org.apache.pekko.actor.testkit.typed.internal.CapturingAppender -import java.lang.reflect.Method -import scala.util.control.NonFatal +import org.slf4j.LoggerFactory final class LogCapturingExtension extends InvocationInterceptor { diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LoggingTestKit.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LoggingTestKit.scala index 63432d9e96..d8a7723722 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LoggingTestKit.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LoggingTestKit.scala @@ -15,14 +15,14 @@ package org.apache.pekko.actor.testkit.typed.javadsl import java.util.function.Supplier -import org.slf4j.event.Level - import org.apache.pekko import pekko.actor.testkit.typed.LoggingEvent import pekko.actor.testkit.typed.internal.LoggingTestKitImpl import pekko.actor.typed.ActorSystem import pekko.annotation.DoNotInherit +import org.slf4j.event.Level + /** * Facilities for verifying logs. * diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ManualTime.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ManualTime.scala index 7d7a7bda7a..896932a58f 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ManualTime.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ManualTime.scala @@ -16,13 +16,13 @@ package org.apache.pekko.actor.testkit.typed.javadsl import java.time.Duration import scala.annotation.varargs - -import com.typesafe.config.Config +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.actor.typed.ActorSystem import pekko.actor.typed.internal.adapter.SchedulerAdapter -import scala.jdk.DurationConverters._ + +import com.typesafe.config.Config /** * Manual time allows you to do async tests while controlling the scheduler of the system. diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestInbox.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestInbox.scala index dbf462f0c5..ca3ff85c4e 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestInbox.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestInbox.scala @@ -16,12 +16,12 @@ package org.apache.pekko.actor.testkit.typed.javadsl import java.util.concurrent.ThreadLocalRandom import scala.collection.immutable +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.actor.testkit.typed.internal.TestInboxImpl import pekko.actor.typed.ActorRef import pekko.annotation.DoNotInherit -import scala.jdk.CollectionConverters._ object TestInbox { import pekko.actor.testkit.typed.scaladsl.TestInbox.address diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala index 50d63af760..9dc544b0b0 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala @@ -17,10 +17,11 @@ package org.apache.pekko.actor.testkit.typed.javadsl -import org.apache.pekko.actor.testkit.typed.annotations.JUnit5TestKit import org.junit.jupiter.api.extension.{ AfterAllCallback, BeforeTestExecutionCallback, ExtensionContext } import org.junit.platform.commons.support.AnnotationSupport +import org.apache.pekko.actor.testkit.typed.annotations.JUnit5TestKit + final class TestKitJUnit5Extension() extends AfterAllCallback with BeforeTestExecutionCallback { var testKit: Option[ActorTestKit] = None diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunitResource.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunitResource.scala index ad7e445b6b..3c240c662f 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunitResource.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunitResource.scala @@ -15,8 +15,6 @@ package org.apache.pekko.actor.testkit.typed.javadsl import java.time.Duration -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory import org.junit.Rule import org.junit.rules.ExternalResource @@ -33,6 +31,9 @@ import pekko.actor.typed.Props import pekko.actor.typed.Scheduler import pekko.util.Timeout +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + /** * A Junit external resource for the [[ActorTestKit]], making it possible to have Junit manage the lifecycle of the testkit. * The testkit will be automatically shut down when the test completes or fails. diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestProbe.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestProbe.scala index 1d7bf62122..b93c6f321d 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestProbe.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestProbe.scala @@ -18,7 +18,6 @@ import java.util.{ List => JList } import java.util.function.Supplier import org.apache.pekko -import pekko.japi.function.Creator import pekko.actor.testkit.typed.FishingOutcome import pekko.actor.testkit.typed.TestKitSettings import pekko.actor.testkit.typed.internal.TestProbeImpl @@ -27,6 +26,7 @@ import pekko.actor.typed.ActorSystem import pekko.actor.typed.RecipientRef import pekko.actor.typed.internal.InternalRecipientRef import pekko.annotation.DoNotInherit +import pekko.japi.function.Creator import pekko.util.unused object FishingOutcomes { diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKit.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKit.scala index ffad923a50..2d1fb7be35 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKit.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKit.scala @@ -20,10 +20,6 @@ import scala.concurrent.Await import scala.concurrent.duration._ import scala.reflect.ClassTag -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import org.slf4j.LoggerFactory - import org.apache.pekko import pekko.actor.DeadLetter import pekko.actor.DeadLetterSuppression @@ -43,6 +39,11 @@ import pekko.actor.typed.scaladsl.adapter._ import pekko.annotation.InternalApi import pekko.util.Timeout +import org.slf4j.LoggerFactory + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object ActorTestKit { private val testKitGuardianCounter = new AtomicInteger(0) diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKitBase.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKitBase.scala index a9f6b1afe5..357f3c5f7b 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKitBase.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKitBase.scala @@ -13,9 +13,6 @@ package org.apache.pekko.actor.testkit.typed.scaladsl -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.DeadLetter import pekko.actor.Dropped @@ -28,6 +25,9 @@ import pekko.actor.typed.Behavior import pekko.actor.typed.Props import pekko.util.Timeout +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object ActorTestKitBase { @noinline def testNameFromCallStack(): String = TestKitUtils.testNameFromCallStack(classOf[ActorTestKitBase]) } diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/BehaviorTestKit.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/BehaviorTestKit.scala index a69b05778b..9dd5efe821 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/BehaviorTestKit.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/BehaviorTestKit.scala @@ -13,18 +13,20 @@ package org.apache.pekko.actor.testkit.typed.scaladsl -import org.apache.pekko -import pekko.actor.testkit.typed.internal.{ ActorSystemStub, BehaviorTestKitImpl } -import pekko.actor.testkit.typed.{ CapturedLogEvent, Effect } -import pekko.actor.typed.receptionist.Receptionist -import pekko.actor.typed.{ ActorRef, Behavior, Signal, TypedActorContext } -import pekko.annotation.{ ApiMayChange, DoNotInherit } -import com.typesafe.config.Config - import java.util.concurrent.ThreadLocalRandom + import scala.collection.immutable import scala.reflect.ClassTag +import org.apache.pekko +import pekko.actor.testkit.typed.{ CapturedLogEvent, Effect } +import pekko.actor.testkit.typed.internal.{ ActorSystemStub, BehaviorTestKitImpl } +import pekko.actor.typed.{ ActorRef, Behavior, Signal, TypedActorContext } +import pekko.actor.typed.receptionist.Receptionist +import pekko.annotation.{ ApiMayChange, DoNotInherit } + +import com.typesafe.config.Config + @ApiMayChange object BehaviorTestKit { diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/LogCapturing.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/LogCapturing.scala index 9241c9fdcb..334fceb714 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/LogCapturing.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/LogCapturing.scala @@ -15,12 +15,13 @@ package org.apache.pekko.actor.testkit.typed.scaladsl import scala.util.control.NonFatal +import org.apache.pekko.actor.testkit.typed.internal.CapturingAppender + import org.scalatest.BeforeAndAfterAll import org.scalatest.Outcome import org.scalatest.TestSuite -import org.slf4j.LoggerFactory -import org.apache.pekko.actor.testkit.typed.internal.CapturingAppender +import org.slf4j.LoggerFactory /** * Mixin this trait to a ScalaTest test to make log lines appear only when the test failed. diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/LoggingTestKit.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/LoggingTestKit.scala index 26c2ed13da..23d238c0b6 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/LoggingTestKit.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/LoggingTestKit.scala @@ -15,14 +15,14 @@ package org.apache.pekko.actor.testkit.typed.scaladsl import scala.reflect.ClassTag -import org.slf4j.event.Level - import org.apache.pekko import pekko.actor.testkit.typed.LoggingEvent import pekko.actor.testkit.typed.internal.LoggingTestKitImpl import pekko.actor.typed.ActorSystem import pekko.annotation.DoNotInherit +import org.slf4j.event.Level + /** * Facilities for verifying logs. * diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ManualTime.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ManualTime.scala index 2499cb683e..7074941447 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ManualTime.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ManualTime.scala @@ -16,12 +16,12 @@ package org.apache.pekko.actor.testkit.typed.scaladsl import scala.annotation.varargs import scala.concurrent.duration.{ Duration, FiniteDuration } -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.actor.typed.ActorSystem import pekko.actor.typed.internal.adapter.SchedulerAdapter +import com.typesafe.config.{ Config, ConfigFactory } + /** * Manual time allows you to do async tests while controlling the scheduler of the system. * diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ScalaTestWithActorTestKit.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ScalaTestWithActorTestKit.scala index ee244dff23..cfa2a49248 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ScalaTestWithActorTestKit.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ScalaTestWithActorTestKit.scala @@ -13,17 +13,18 @@ package org.apache.pekko.actor.testkit.typed.scaladsl -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory +import org.apache.pekko +import pekko.actor.testkit.typed.TestKitSettings +import pekko.actor.typed.ActorSystem + import org.scalatest.{ BeforeAndAfterAll, TestSuite } import org.scalatest.concurrent.Eventually import org.scalatest.concurrent.ScalaFutures import org.scalatest.matchers.should.Matchers import org.scalatest.time.Span -import org.apache.pekko -import pekko.actor.testkit.typed.TestKitSettings -import pekko.actor.typed.ActorSystem +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory /** * A ScalaTest base class for the [[ActorTestKit]], making it possible to have ScalaTest manage the lifecycle of the testkit. diff --git a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKitSpec.scala b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKitSpec.scala index c3cdc0eb79..5061ca4fe5 100644 --- a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKitSpec.scala +++ b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKitSpec.scala @@ -15,11 +15,6 @@ package org.apache.pekko.actor.testkit.typed.scaladsl import scala.concurrent.Promise -import com.typesafe.config.ConfigFactory -import org.scalatest.BeforeAndAfterAll -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.{ AnyWordSpec, AnyWordSpecLike } - import org.apache.pekko import pekko.Done import pekko.actor.Dropped @@ -29,6 +24,12 @@ import pekko.actor.typed.ActorSystem import pekko.actor.typed.eventstream.EventStream import pekko.actor.typed.scaladsl.Behaviors +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.{ AnyWordSpec, AnyWordSpecLike } + +import com.typesafe.config.ConfigFactory + class ActorTestKitSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "the Scala testkit" should { diff --git a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/BehaviorTestKitSpec.scala b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/BehaviorTestKitSpec.scala index f41be488a8..d5497952b1 100644 --- a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/BehaviorTestKitSpec.scala +++ b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/BehaviorTestKitSpec.scala @@ -13,22 +13,24 @@ package org.apache.pekko.actor.testkit.typed.scaladsl +import scala.concurrent.duration.{ FiniteDuration, _ } +import scala.reflect.ClassTag + import org.apache.pekko import pekko.Done import pekko.actor.Address -import pekko.actor.testkit.typed.Effect._ -import pekko.actor.testkit.typed.scaladsl.BehaviorTestKitSpec.Parent._ -import pekko.actor.testkit.typed.scaladsl.BehaviorTestKitSpec.{ Child, Parent } import pekko.actor.testkit.typed.{ CapturedLogEvent, Effect } +import pekko.actor.testkit.typed.Effect._ +import pekko.actor.testkit.typed.scaladsl.BehaviorTestKitSpec.{ Child, Parent } +import pekko.actor.testkit.typed.scaladsl.BehaviorTestKitSpec.Parent._ +import pekko.actor.typed.{ ActorRef, Behavior, Props, Terminated } import pekko.actor.typed.receptionist.{ Receptionist, ServiceKey } import pekko.actor.typed.scaladsl.Behaviors -import pekko.actor.typed.{ ActorRef, Behavior, Props, Terminated } + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import org.slf4j.event.Level -import scala.concurrent.duration.{ FiniteDuration, _ } -import scala.reflect.ClassTag +import org.slf4j.event.Level object BehaviorTestKitSpec { object Parent { diff --git a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/JUnit5TestKitBuilderSpec.scala b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/JUnit5TestKitBuilderSpec.scala index 15bc751dad..46b6e8ba69 100644 --- a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/JUnit5TestKitBuilderSpec.scala +++ b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/JUnit5TestKitBuilderSpec.scala @@ -18,11 +18,13 @@ package org.apache.pekko.actor.testkit.typed.scaladsl import org.apache.pekko -import pekko.actor.typed.ActorSystem -import com.typesafe.config.ConfigFactory import org.apache.pekko.actor.testkit.typed.javadsl.JUnit5TestKitBuilder +import pekko.actor.typed.ActorSystem + import org.scalatest.wordspec.AnyWordSpec +import com.typesafe.config.ConfigFactory + class JUnit5TestKitBuilderSpec extends AnyWordSpec { "the JUnit5TestKitBuilder" should { diff --git a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/LoggingEventFilterSpec.scala b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/LoggingEventFilterSpec.scala index d695dff73b..45cf33530e 100644 --- a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/LoggingEventFilterSpec.scala +++ b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/LoggingEventFilterSpec.scala @@ -13,11 +13,12 @@ package org.apache.pekko.actor.testkit.typed.scaladsl -import org.scalatest.wordspec.AnyWordSpecLike -import org.slf4j.event.Level - import org.apache.pekko.actor.testkit.typed.LoggingEvent +import org.scalatest.wordspec.AnyWordSpecLike + +import org.slf4j.event.Level + class LoggingTestKitSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { private class AnError extends Exception diff --git a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/TestAppenderSpec.scala b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/TestAppenderSpec.scala index 10ea14dc4c..cbfa24cf41 100644 --- a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/TestAppenderSpec.scala +++ b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/TestAppenderSpec.scala @@ -17,11 +17,12 @@ import java.util.concurrent.atomic.AtomicInteger import scala.concurrent.Future -import org.scalatest.wordspec.AnyWordSpecLike -import org.slf4j.LoggerFactory - import org.apache.pekko.actor.testkit.typed.TestException +import org.scalatest.wordspec.AnyWordSpecLike + +import org.slf4j.LoggerFactory + class TestAppenderSpec extends ScalaTestWithActorTestKit( """ diff --git a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/TestProbeSpec.scala b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/TestProbeSpec.scala index c74509c757..4935d54a15 100644 --- a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/TestProbeSpec.scala +++ b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/TestProbeSpec.scala @@ -15,10 +15,11 @@ package org.apache.pekko.actor.testkit.typed.scaladsl import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory +import org.apache.pekko.actor.typed.scaladsl.Behaviors + import org.scalatest.wordspec.AnyWordSpecLike -import org.apache.pekko.actor.typed.scaladsl.Behaviors +import com.typesafe.config.ConfigFactory class TestProbeSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { diff --git a/actor-tests/src/test/scala-2/org/apache/pekko/util/TypedMultiMapSpec.scala b/actor-tests/src/test/scala-2/org/apache/pekko/util/TypedMultiMapSpec.scala index 591b9e168b..98f7f213d7 100644 --- a/actor-tests/src/test/scala-2/org/apache/pekko/util/TypedMultiMapSpec.scala +++ b/actor-tests/src/test/scala-2/org/apache/pekko/util/TypedMultiMapSpec.scala @@ -14,6 +14,7 @@ package org.apache.pekko.util import org.scalactic.TypeCheckedTripleEquals + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/actor-tests/src/test/scala-jdk21-only/org/apache/pekko/dispatch/ForkJoinPoolVirtualThreadSpec.scala b/actor-tests/src/test/scala-jdk21-only/org/apache/pekko/dispatch/ForkJoinPoolVirtualThreadSpec.scala index 1d4ca6db94..550f34ef90 100644 --- a/actor-tests/src/test/scala-jdk21-only/org/apache/pekko/dispatch/ForkJoinPoolVirtualThreadSpec.scala +++ b/actor-tests/src/test/scala-jdk21-only/org/apache/pekko/dispatch/ForkJoinPoolVirtualThreadSpec.scala @@ -17,12 +17,12 @@ package org.apache.pekko.dispatch -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ Actor, Props } import pekko.testkit.{ ImplicitSender, PekkoSpec } +import com.typesafe.config.ConfigFactory + object ForkJoinPoolVirtualThreadSpec { val config = ConfigFactory.parseString(""" |custom { diff --git a/actor-tests/src/test/scala-jdk21-only/org/apache/pekko/dispatch/ThreadPoolVirtualThreadSpec.scala b/actor-tests/src/test/scala-jdk21-only/org/apache/pekko/dispatch/ThreadPoolVirtualThreadSpec.scala index 583f911877..406730c233 100644 --- a/actor-tests/src/test/scala-jdk21-only/org/apache/pekko/dispatch/ThreadPoolVirtualThreadSpec.scala +++ b/actor-tests/src/test/scala-jdk21-only/org/apache/pekko/dispatch/ThreadPoolVirtualThreadSpec.scala @@ -17,11 +17,12 @@ package org.apache.pekko.dispatch -import com.typesafe.config.ConfigFactory import org.apache.pekko import pekko.actor.{ Actor, Props } import pekko.testkit.{ ImplicitSender, PekkoSpec } +import com.typesafe.config.ConfigFactory + object ThreadPoolVirtualThreadSpec { val config = ConfigFactory.parseString(""" |custom { diff --git a/actor-tests/src/test/scala-jdk21-only/org/apache/pekko/dispatch/VirtualThreadPoolDispatcherSpec.scala b/actor-tests/src/test/scala-jdk21-only/org/apache/pekko/dispatch/VirtualThreadPoolDispatcherSpec.scala index 3050d70db5..2c8266c6fa 100644 --- a/actor-tests/src/test/scala-jdk21-only/org/apache/pekko/dispatch/VirtualThreadPoolDispatcherSpec.scala +++ b/actor-tests/src/test/scala-jdk21-only/org/apache/pekko/dispatch/VirtualThreadPoolDispatcherSpec.scala @@ -17,12 +17,12 @@ package org.apache.pekko.dispatch -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ Actor, Props } import pekko.testkit.{ ImplicitSender, PekkoSpec } +import com.typesafe.config.ConfigFactory + object VirtualThreadPoolDispatcherSpec { val config = ConfigFactory.parseString(""" |virtual-thread-dispatcher { diff --git a/actor-tests/src/test/scala/org/apache/pekko/PekkoExceptionSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/PekkoExceptionSpec.scala index 79439d1cb4..8a0ec42f9a 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/PekkoExceptionSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/PekkoExceptionSpec.scala @@ -13,11 +13,11 @@ package org.apache.pekko +import org.apache.pekko.actor._ + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import org.apache.pekko.actor._ - /** * A spec that verified that the PekkoException has at least a single argument constructor of type String. * diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorConfigurationVerificationSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorConfigurationVerificationSpec.scala index 6bcd2a1c44..cf47b35b54 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorConfigurationVerificationSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorConfigurationVerificationSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.actor import scala.concurrent.duration._ -import org.scalatest.BeforeAndAfterEach - import org.apache.pekko import pekko.ConfigurationException import pekko.routing._ @@ -24,6 +22,8 @@ import pekko.testkit._ import pekko.testkit.DefaultTimeout import pekko.testkit.TestEvent._ +import org.scalatest.BeforeAndAfterEach + object ActorConfigurationVerificationSpec { class TestActor extends Actor { diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorCreationPerfSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorCreationPerfSpec.scala index d09e922191..606e6f22f1 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorCreationPerfSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorCreationPerfSpec.scala @@ -16,14 +16,16 @@ package org.apache.pekko.actor import scala.concurrent.duration._ import com.codahale.metrics.Histogram -import com.typesafe.config.ConfigFactory -import org.scalatest.BeforeAndAfterAll import org.apache.pekko import pekko.testkit.{ ImplicitSender, PekkoSpec, PerformanceTest } import pekko.testkit.metrics._ import pekko.testkit.metrics.HeapMemoryUsage +import org.scalatest.BeforeAndAfterAll + +import com.typesafe.config.ConfigFactory + object ActorCreationPerfSpec { val config = ConfigFactory.parseString(""" diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorLifeCycleSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorLifeCycleSpec.scala index 24f4bd18c8..9ae6d2480e 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorLifeCycleSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorLifeCycleSpec.scala @@ -19,13 +19,13 @@ import java.util.concurrent.atomic._ import scala.concurrent.{ Await, Future } -import org.scalatest.BeforeAndAfterEach - import org.apache.pekko import pekko.actor.Actor._ import pekko.pattern.ask import pekko.testkit._ +import org.scalatest.BeforeAndAfterEach + object ActorLifeCycleSpec { class LifeCycleTestActor(testActor: ActorRef, id: String, generationProvider: AtomicInteger) extends Actor { diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorMailboxSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorMailboxSpec.scala index 99222249ff..2d49a608d1 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorMailboxSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorMailboxSpec.scala @@ -15,9 +15,6 @@ package org.apache.pekko.actor import scala.concurrent.duration.{ Duration, FiniteDuration } -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.ConfigurationException import pekko.dispatch._ @@ -25,6 +22,9 @@ import pekko.testkit._ import pekko.util.Helpers.ConfigOps import pekko.util.unused +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object ActorMailboxSpec { val mailboxConf = ConfigFactory.parseString(s""" unbounded-dispatcher { diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorSystemDispatcherSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorSystemDispatcherSpec.scala index 82620268eb..26593792f0 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorSystemDispatcherSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorSystemDispatcherSpec.scala @@ -16,14 +16,14 @@ package org.apache.pekko.actor import scala.concurrent.ExecutionContext import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.ConfigurationException import pekko.actor.setup.ActorSystemSetup import pekko.dispatch.{ Dispatchers, ExecutionContexts } import pekko.testkit.{ ImplicitSender, PekkoSpec, TestActors, TestProbe } +import com.typesafe.config.ConfigFactory + object ActorSystemDispatchersSpec { class SnitchingExecutionContext(testActor: ActorRef, underlying: ExecutionContext) extends ExecutionContext { diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorSystemSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorSystemSpec.scala index 0e9f7e29f7..8b51fe9e2e 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorSystemSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorSystemSpec.scala @@ -16,11 +16,10 @@ package org.apache.pekko.actor import java.util.concurrent.{ ConcurrentLinkedQueue, RejectedExecutionException } import java.util.concurrent.atomic.AtomicInteger +import scala.annotation.nowarn import scala.concurrent.{ Await, Future } import scala.concurrent.duration._ -import scala.annotation.nowarn -import com.typesafe.config.{ Config, ConfigFactory } import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import org.apache.pekko @@ -32,6 +31,8 @@ import pekko.testkit.{ TestKit, _ } import pekko.util.{ Switch, Timeout } import pekko.util.Helpers.ConfigOps +import com.typesafe.config.{ Config, ConfigFactory } + object ActorSystemSpec { class Waves extends Actor { diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorWithBoundedStashSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorWithBoundedStashSpec.scala index f179d807d3..bcc8c37e7f 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorWithBoundedStashSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorWithBoundedStashSpec.scala @@ -15,9 +15,6 @@ package org.apache.pekko.actor import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigFactory } -import org.scalatest.BeforeAndAfterEach - import org.apache.pekko import pekko.actor.ActorSystem.Settings import pekko.dispatch.BoundedDequeBasedMailbox @@ -26,6 +23,10 @@ import pekko.testkit.DefaultTimeout import pekko.testkit.TestEvent._ import pekko.util.unused +import org.scalatest.BeforeAndAfterEach + +import com.typesafe.config.{ Config, ConfigFactory } + object ActorWithBoundedStashSpec { class StashingActor extends Actor with Stash { diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorWithStashSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorWithStashSpec.scala index 25526c80b5..c31c81c294 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorWithStashSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorWithStashSpec.scala @@ -13,18 +13,18 @@ package org.apache.pekko.actor +import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.duration._ -import scala.annotation.nowarn -import org.scalatest.BeforeAndAfterEach - import org.apache.pekko import pekko.pattern.ask import pekko.testkit._ import pekko.testkit.DefaultTimeout import pekko.testkit.TestEvent._ +import org.scalatest.BeforeAndAfterEach + object ActorWithStashSpec { class StashingActor extends Actor with Stash { diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/CoordinatedShutdownSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/CoordinatedShutdownSpec.scala index 9cb9e5ca75..f2dfe81ba6 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/CoordinatedShutdownSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/CoordinatedShutdownSpec.scala @@ -13,26 +13,28 @@ package org.apache.pekko.actor +import java.util.concurrent.Executors +import java.util.concurrent.TimeoutException + +import scala.concurrent.Await +import scala.concurrent.ExecutionContext +import scala.concurrent.Future +import scala.concurrent.Promise +import scala.concurrent.duration._ + import org.apache.pekko import pekko.ConfigurationException import pekko.Done import pekko.actor.CoordinatedShutdown.Phase import pekko.actor.CoordinatedShutdown.UnknownReason -import pekko.testkit.PekkoSpec import pekko.testkit.EventFilter +import pekko.testkit.PekkoSpec import pekko.testkit.TestKit import pekko.testkit.TestProbe + import com.typesafe.config.Config import com.typesafe.config.ConfigFactory -import java.util.concurrent.Executors -import java.util.concurrent.TimeoutException -import scala.concurrent.duration._ -import scala.concurrent.Await -import scala.concurrent.ExecutionContext -import scala.concurrent.Future -import scala.concurrent.Promise - class CoordinatedShutdownSpec extends PekkoSpec(ConfigFactory.parseString(""" pekko.loglevel=INFO diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/DeadLetterSupressionSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/DeadLetterSupressionSpec.scala index 22a777057b..3d6b03945a 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/DeadLetterSupressionSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/DeadLetterSupressionSpec.scala @@ -17,8 +17,8 @@ import scala.concurrent.duration._ import org.apache.pekko import pekko.event.Logging -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.testkit.TestActors import pekko.testkit.TestProbe diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/DeadLetterSuspensionSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/DeadLetterSuspensionSpec.scala index 2b05e6199c..a05548c883 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/DeadLetterSuspensionSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/DeadLetterSuspensionSpec.scala @@ -14,9 +14,9 @@ package org.apache.pekko.actor import org.apache.pekko -import pekko.testkit.PekkoSpec import pekko.testkit.EventFilter import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.testkit.TestActors object DeadLetterSuspensionSpec { diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/DeathWatchSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/DeathWatchSpec.scala index 835f277f3e..60b15f3d17 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/DeathWatchSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/DeathWatchSpec.scala @@ -13,11 +13,10 @@ package org.apache.pekko.actor +import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.duration._ -import scala.annotation.nowarn - import org.apache.pekko import pekko.actor.Props.EmptyActor import pekko.dispatch.sysmsg.{ DeathWatchNotification, Failed } diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/DeployerSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/DeployerSpec.scala index 1a49950f88..511823bb4c 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/DeployerSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/DeployerSpec.scala @@ -15,13 +15,13 @@ package org.apache.pekko.actor import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import com.typesafe.config.ConfigParseOptions - import org.apache.pekko import pekko.routing._ import pekko.testkit.PekkoSpec +import com.typesafe.config.ConfigFactory +import com.typesafe.config.ConfigParseOptions + object DeployerSpec { val deployerConf = ConfigFactory.parseString( """ diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/ExtensionSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/ExtensionSpec.scala index 28975a7f23..18707cd610 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/ExtensionSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/ExtensionSpec.scala @@ -17,14 +17,15 @@ import java.util.concurrent.atomic.AtomicInteger import scala.util.control.NoStackTrace -import com.typesafe.config.ConfigFactory -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.testkit.EventFilter import pekko.testkit.TestKit._ +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + +import com.typesafe.config.ConfigFactory + object TestExtension extends ExtensionId[TestExtension] with ExtensionIdProvider { def lookup = this def createExtension(s: ExtendedActorSystem) = new TestExtension(s) diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/FSMActorSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/FSMActorSpec.scala index ecc8579999..06d8e3db39 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/FSMActorSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/FSMActorSpec.scala @@ -16,13 +16,13 @@ package org.apache.pekko.actor import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.event._ import pekko.testkit._ import pekko.util.{ unused, Timeout } +import com.typesafe.config.ConfigFactory + object FSMActorSpec { class Latches(implicit system: ActorSystem) { diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/FunctionRefSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/FunctionRefSpec.scala index 11ddaf7acd..c897f26df1 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/FunctionRefSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/FunctionRefSpec.scala @@ -15,9 +15,9 @@ package org.apache.pekko.actor import org.apache.pekko import pekko.actor.dungeon.SerializationCheckFailedException -import pekko.testkit.PekkoSpec import pekko.testkit.EventFilter import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec object FunctionRefSpec { diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/LocalActorRefProviderSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/LocalActorRefProviderSpec.scala index 5876747385..b0fe725657 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/LocalActorRefProviderSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/LocalActorRefProviderSpec.scala @@ -13,14 +13,13 @@ package org.apache.pekko.actor +import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.Future import scala.concurrent.duration._ import scala.util.Failure import scala.util.Success -import scala.annotation.nowarn - import org.apache.pekko import pekko.testkit._ import pekko.util.Timeout diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/ProviderSelectionSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/ProviderSelectionSpec.scala index 745094fee6..efc3b8d9f5 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/ProviderSelectionSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/ProviderSelectionSpec.scala @@ -13,14 +13,14 @@ package org.apache.pekko.actor -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.ActorSystem.Settings import pekko.actor.ActorSystem.findClassLoader import pekko.actor.setup.ActorSystemSetup import pekko.testkit.AbstractSpec +import com.typesafe.config.ConfigFactory + class ProviderSelectionSpec extends AbstractSpec { import ProviderSelection.{ ClusterActorRefProvider, RemoteActorRefProvider } diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/RestartStrategySpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/RestartStrategySpec.scala index 3fd012f554..891a5f2995 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/RestartStrategySpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/RestartStrategySpec.scala @@ -15,16 +15,15 @@ package org.apache.pekko.actor import java.lang.Thread.sleep +import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.duration._ -import scala.annotation.nowarn - import org.apache.pekko import pekko.pattern.ask -import pekko.testkit.PekkoSpec import pekko.testkit.DefaultTimeout import pekko.testkit.EventFilter +import pekko.testkit.PekkoSpec import pekko.testkit.TestEvent._ import pekko.testkit.TestLatch diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/SchedulerSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/SchedulerSpec.scala index f9e30481f9..9d6cc95a15 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/SchedulerSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/SchedulerSpec.scala @@ -17,6 +17,7 @@ import java.io.Closeable import java.util.concurrent._ import java.util.concurrent.ThreadLocalRandom +import scala.annotation.nowarn import scala.concurrent.{ Await, ExecutionContext, Future } import scala.concurrent.duration._ import scala.util.Try @@ -24,15 +25,16 @@ import scala.util.control.NoStackTrace import scala.util.control.NonFatal import atomic.{ AtomicInteger, AtomicReference } -import scala.annotation.nowarn -import com.typesafe.config.{ Config, ConfigFactory } -import org.scalatest.BeforeAndAfterEach import org.apache.pekko import pekko.pattern.ask import pekko.testkit._ import pekko.util.Helpers +import org.scalatest.BeforeAndAfterEach + +import com.typesafe.config.{ Config, ConfigFactory } + object SchedulerSpec { val testConfRevolver = ConfigFactory.parseString(""" diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/SupervisorHierarchySpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/SupervisorHierarchySpec.scala index edbee05493..8e7daa5ce7 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/SupervisorHierarchySpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/SupervisorHierarchySpec.scala @@ -19,14 +19,13 @@ import java.util.concurrent.{ CountDownLatch, TimeUnit } import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.atomic.AtomicInteger +import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.duration._ import scala.util.Random import scala.util.control.NoStackTrace import SupervisorStrategy.{ Directive, Restart, Resume, Stop } -import scala.annotation.nowarn -import com.typesafe.config.{ Config, ConfigFactory } import org.apache.pekko import pekko.actor.SupervisorStrategy.seqThrowable2Decider @@ -39,6 +38,8 @@ import pekko.testkit.LongRunningTest import pekko.testkit.TestEvent.Mute import pekko.util.Helpers.ConfigOps +import com.typesafe.config.{ Config, ConfigFactory } + object SupervisorHierarchySpec { class FireWorkerException(msg: String) extends Exception(msg) diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/SupervisorMiscSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/SupervisorMiscSpec.scala index e115f4a10b..d46996ef49 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/SupervisorMiscSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/SupervisorMiscSpec.scala @@ -15,17 +15,16 @@ package org.apache.pekko.actor import java.util.concurrent.{ CountDownLatch, TimeUnit } +import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.duration._ import scala.util.control.NonFatal -import scala.annotation.nowarn - import org.apache.pekko import pekko.pattern.ask import pekko.testkit.{ filterEvents, EventFilter } -import pekko.testkit.PekkoSpec import pekko.testkit.DefaultTimeout +import pekko.testkit.PekkoSpec object SupervisorMiscSpec { val config = """ diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/SupervisorSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/SupervisorSpec.scala index 9df4e76f15..ee97967c38 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/SupervisorSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/SupervisorSpec.scala @@ -18,10 +18,6 @@ import java.util.concurrent.atomic.AtomicInteger import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import org.scalatest.BeforeAndAfterEach - import org.apache.pekko import pekko.{ Die, Ping } import pekko.ConfigurationException @@ -33,6 +29,11 @@ import pekko.testkit._ import pekko.testkit.TestEvent._ import pekko.util.unused +import org.scalatest.BeforeAndAfterEach + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object SupervisorSpec { val Timeout = 5.seconds diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/Ticket669Spec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/Ticket669Spec.scala index faf1968b0a..0a29353210 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/Ticket669Spec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/Ticket669Spec.scala @@ -16,14 +16,14 @@ package org.apache.pekko.actor import scala.concurrent.Await import scala.concurrent.duration._ -import org.scalatest.BeforeAndAfterAll - import org.apache.pekko import pekko.pattern.ask import pekko.testkit.{ filterEvents, EventFilter } -import pekko.testkit.PekkoSpec import pekko.testkit.DefaultTimeout import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec + +import org.scalatest.BeforeAndAfterAll class Ticket669Spec extends PekkoSpec with BeforeAndAfterAll with ImplicitSender with DefaultTimeout { import Ticket669Spec._ diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/ActorModelSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/ActorModelSpec.scala index 02e6b8f894..39bc418e69 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/ActorModelSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/ActorModelSpec.scala @@ -17,14 +17,11 @@ import java.rmi.RemoteException import java.util.concurrent.{ ConcurrentHashMap, CountDownLatch, TimeUnit } import java.util.concurrent.atomic.{ AtomicInteger, AtomicLong } +import scala.annotation.nowarn import scala.annotation.tailrec import scala.concurrent.{ Await, Future } import scala.concurrent.duration._ -import scala.annotation.nowarn -import com.typesafe.config.Config -import org.scalatest.Assertions._ - import org.apache.pekko import pekko.actor._ import pekko.dispatch._ @@ -33,6 +30,10 @@ import pekko.pattern.ask import pekko.testkit._ import pekko.util.Switch +import org.scalatest.Assertions._ + +import com.typesafe.config.Config + object ActorModelSpec { sealed trait ActorModelMessage extends NoSerializationVerificationNeeded diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/DispatcherActorSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/DispatcherActorSpec.scala index f505b3a3ef..8d8407c6be 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/DispatcherActorSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/DispatcherActorSpec.scala @@ -22,8 +22,8 @@ import scala.concurrent.duration._ import org.apache.pekko import pekko.actor.{ Actor, Props } import pekko.pattern.ask -import pekko.testkit.PekkoSpec import pekko.testkit.DefaultTimeout +import pekko.testkit.PekkoSpec object DispatcherActorSpec { val config = """ diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/DispatchersSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/DispatchersSpec.scala index b52868b585..d0b21786f1 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/DispatchersSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/DispatchersSpec.scala @@ -18,9 +18,6 @@ import java.util.concurrent.atomic.AtomicBoolean import scala.reflect.ClassTag -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.ConfigurationException import pekko.actor._ @@ -29,6 +26,9 @@ import pekko.routing.FromConfig import pekko.testkit.{ ImplicitSender, PekkoSpec } import pekko.util.unused +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object DispatchersSpec { val config = """ myapp { diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/PinnedActorSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/PinnedActorSpec.scala index ac1b443b32..716452157e 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/PinnedActorSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/PinnedActorSpec.scala @@ -17,14 +17,14 @@ import java.util.concurrent.{ CountDownLatch, TimeUnit } import scala.concurrent.Await -import org.scalatest.BeforeAndAfterEach - import org.apache.pekko import pekko.actor.{ Actor, Props } import pekko.pattern.ask import pekko.testkit._ import pekko.testkit.PekkoSpec +import org.scalatest.BeforeAndAfterEach + object PinnedActorSpec { val config = """ pinned-dispatcher { diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/setup/ActorSystemSetupSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/setup/ActorSystemSetupSpec.scala index b4dbcd31ef..ce79405f8c 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/setup/ActorSystemSetupSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/setup/ActorSystemSetupSpec.scala @@ -13,13 +13,13 @@ package org.apache.pekko.actor.setup -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.ActorSystem import pekko.testkit.TestKit +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + case class DummySetup(name: String) extends Setup case class DummySetup2(name: String) extends Setup case class DummySetup3(name: String) extends Setup diff --git a/actor-tests/src/test/scala/org/apache/pekko/config/ConfigSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/config/ConfigSpec.scala index 90cc700fdb..264ff45ee6 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/config/ConfigSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/config/ConfigSpec.scala @@ -17,9 +17,6 @@ import java.util.concurrent.TimeUnit import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.Assertions - import org.apache.pekko import pekko.actor.ActorSystem import pekko.actor.ExtendedActorSystem @@ -27,6 +24,10 @@ import pekko.event.DefaultLoggingFilter import pekko.event.Logging.DefaultLogger import pekko.testkit.PekkoSpec +import org.scalatest.Assertions + +import com.typesafe.config.ConfigFactory + class ConfigSpec extends PekkoSpec(ConfigFactory.defaultReference(ActorSystem.findClassLoader())) with Assertions { "The default configuration file (i.e. reference.conf)" must { diff --git a/actor-tests/src/test/scala/org/apache/pekko/dispatch/DispatcherShutdownSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/dispatch/DispatcherShutdownSpec.scala index 465f4041e8..2e00f0195b 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/dispatch/DispatcherShutdownSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/dispatch/DispatcherShutdownSpec.scala @@ -18,13 +18,13 @@ import java.lang.management.ManagementFactory import scala.concurrent.{ Await, Future } import scala.concurrent.duration._ -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.ActorSystem import pekko.testkit.TestKit +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class DispatcherShutdownSpec extends AnyWordSpec with Matchers { "pekko dispatcher" should { diff --git a/actor-tests/src/test/scala/org/apache/pekko/dispatch/ForkJoinPoolStarvationSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/dispatch/ForkJoinPoolStarvationSpec.scala index bce7b584fa..4816990c5d 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/dispatch/ForkJoinPoolStarvationSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/dispatch/ForkJoinPoolStarvationSpec.scala @@ -13,13 +13,13 @@ package org.apache.pekko.dispatch -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ Actor, Props } import pekko.testkit.{ ImplicitSender, PekkoSpec } import pekko.util.JavaVersion +import com.typesafe.config.ConfigFactory + object ForkJoinPoolStarvationSpec { val config = ConfigFactory.parseString(""" |actorhang { diff --git a/actor-tests/src/test/scala/org/apache/pekko/dispatch/MailboxConfigSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/dispatch/MailboxConfigSpec.scala index d9e26a4d86..223cf259ab 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/dispatch/MailboxConfigSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/dispatch/MailboxConfigSpec.scala @@ -18,14 +18,15 @@ import java.util.concurrent.{ BlockingQueue, ConcurrentLinkedQueue } import scala.concurrent.{ Await, ExecutionContext, Future } import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigFactory } -import org.scalatest.{ BeforeAndAfterAll, BeforeAndAfterEach } - import org.apache.pekko import pekko.actor._ import pekko.testkit.{ EventFilter, PekkoSpec } import pekko.util.unused +import org.scalatest.{ BeforeAndAfterAll, BeforeAndAfterEach } + +import com.typesafe.config.{ Config, ConfigFactory } + abstract class MailboxSpec extends PekkoSpec with BeforeAndAfterAll with BeforeAndAfterEach { def name: String diff --git a/actor-tests/src/test/scala/org/apache/pekko/dispatch/PriorityDispatcherSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/dispatch/PriorityDispatcherSpec.scala index 088446bcc9..765a1ecdf1 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/dispatch/PriorityDispatcherSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/dispatch/PriorityDispatcherSpec.scala @@ -15,13 +15,13 @@ package org.apache.pekko.dispatch import scala.concurrent.duration._ -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.{ Actor, ActorSystem, Props } import pekko.testkit.{ DefaultTimeout, PekkoSpec } import pekko.util.unused +import com.typesafe.config.Config + object PriorityDispatcherSpec { case object Result diff --git a/actor-tests/src/test/scala/org/apache/pekko/dispatch/SameThreadExecutionContextSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/dispatch/SameThreadExecutionContextSpec.scala index f4c7c04e88..eb7681bf14 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/dispatch/SameThreadExecutionContextSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/dispatch/SameThreadExecutionContextSpec.scala @@ -16,12 +16,12 @@ package org.apache.pekko.dispatch import scala.concurrent.ExecutionContext import scala.concurrent.Promise -import org.scalatest.matchers.should.Matchers - import org.apache.pekko import pekko.Done import pekko.testkit.PekkoSpec +import org.scalatest.matchers.should.Matchers + class SameThreadExecutionContextSpec extends PekkoSpec with Matchers { "The SameThreadExecutionContext" should { diff --git a/actor-tests/src/test/scala/org/apache/pekko/dispatch/StablePriorityDispatcherSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/dispatch/StablePriorityDispatcherSpec.scala index 9289409e4a..943b28fd91 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/dispatch/StablePriorityDispatcherSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/dispatch/StablePriorityDispatcherSpec.scala @@ -15,13 +15,13 @@ package org.apache.pekko.dispatch import scala.concurrent.duration._ -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.{ Actor, ActorSystem, Props } import pekko.testkit.{ DefaultTimeout, PekkoSpec } import pekko.util.unused +import com.typesafe.config.Config + object StablePriorityDispatcherSpec { case object Result diff --git a/actor-tests/src/test/scala/org/apache/pekko/event/EventBusSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/event/EventBusSpec.scala index ce93d92568..bdffc760fb 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/event/EventBusSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/event/EventBusSpec.scala @@ -13,14 +13,15 @@ package org.apache.pekko.event -import com.typesafe.config.{ Config, ConfigFactory } -import org.scalatest.BeforeAndAfterEach - import org.apache.pekko import pekko.actor.{ Actor, ActorRef, ActorSystem, PoisonPill, Props } import pekko.japi.function.Procedure import pekko.testkit._ +import org.scalatest.BeforeAndAfterEach + +import com.typesafe.config.{ Config, ConfigFactory } + object EventBusSpec { class TestActorWrapperActor(testActor: ActorRef) extends Actor { def receive = { diff --git a/actor-tests/src/test/scala/org/apache/pekko/event/EventStreamSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/event/EventStreamSpec.scala index ac19fb1c18..476135829e 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/event/EventStreamSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/event/EventStreamSpec.scala @@ -15,12 +15,12 @@ package org.apache.pekko.event import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.testkit.{ PekkoSpec, TestProbe } +import com.typesafe.config.ConfigFactory + object EventStreamSpec { val config = ConfigFactory.parseString(""" diff --git a/actor-tests/src/test/scala/org/apache/pekko/event/LoggerSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/event/LoggerSpec.scala index 409027a5e9..6cb61dd31b 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/event/LoggerSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/event/LoggerSpec.scala @@ -22,10 +22,6 @@ import java.util.concurrent.TimeUnit import scala.concurrent.duration._ import scala.util.control.NoStackTrace -import com.typesafe.config.{ Config, ConfigFactory } -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor._ import pekko.event.Logging._ @@ -35,6 +31,11 @@ import pekko.serialization.SerializationExtension import pekko.testkit._ import pekko.util.Helpers +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + +import com.typesafe.config.{ Config, ConfigFactory } + object LoggerSpec { val defaultConfig = ConfigFactory.parseString(""" diff --git a/actor-tests/src/test/scala/org/apache/pekko/event/LoggingReceiveSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/event/LoggingReceiveSpec.scala index b0418cca8c..e40858e408 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/event/LoggingReceiveSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/event/LoggingReceiveSpec.scala @@ -15,15 +15,16 @@ package org.apache.pekko.event import scala.annotation.tailrec import scala.concurrent.duration._ - -import com.typesafe.config.ConfigFactory -import org.scalatest.BeforeAndAfterAll -import org.scalatest.wordspec.AnyWordSpec +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.actor._ import pekko.testkit._ -import scala.jdk.CollectionConverters._ + +import org.scalatest.BeforeAndAfterAll +import org.scalatest.wordspec.AnyWordSpec + +import com.typesafe.config.ConfigFactory object LoggingReceiveSpec { class TestLogActor extends Actor { diff --git a/actor-tests/src/test/scala/org/apache/pekko/io/SimpleDnsCacheSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/io/SimpleDnsCacheSpec.scala index e1a478c386..4360018f41 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/io/SimpleDnsCacheSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/io/SimpleDnsCacheSpec.scala @@ -19,15 +19,15 @@ import java.util.concurrent.atomic.AtomicLong import scala.collection.immutable import scala.concurrent.duration._ -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.io.dns.ARecord import pekko.io.dns.CachePolicy.Ttl import pekko.io.dns.DnsProtocol import pekko.io.dns.DnsProtocol.Ip +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class SimpleDnsCacheSpec extends AnyWordSpec with Matchers { "Cache" should { "not reply with expired but not yet swept out entries" in { diff --git a/actor-tests/src/test/scala/org/apache/pekko/io/TcpConnectionSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/io/TcpConnectionSpec.scala index 1c65489214..abf3f1608f 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/io/TcpConnectionSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/io/TcpConnectionSpec.scala @@ -30,8 +30,6 @@ import scala.util.Try import scala.util.control.NonFatal import com.google.common.jimfs.{ Configuration, Jimfs } -import com.typesafe.config.ConfigFactory -import org.scalatest.matchers._ import org.apache.pekko import pekko.actor._ @@ -43,6 +41,10 @@ import pekko.testkit.SocketUtil.temporaryServerAddress import pekko.testkit.WithLogCapturing import pekko.util.{ ByteString, Helpers } +import org.scalatest.matchers._ + +import com.typesafe.config.ConfigFactory + object TcpConnectionSpec { case class Ack(i: Int) extends Event object Ack extends Ack(0) diff --git a/actor-tests/src/test/scala/org/apache/pekko/io/TcpIntegrationSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/io/TcpIntegrationSpec.scala index 499b8ed021..f7e3b857fe 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/io/TcpIntegrationSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/io/TcpIntegrationSpec.scala @@ -18,8 +18,6 @@ import java.net.{ InetSocketAddress, ServerSocket } import scala.concurrent.duration._ -import org.scalatest.concurrent.TimeLimits - import org.apache.pekko import pekko.actor.{ ActorRef, PoisonPill } import pekko.io.Tcp._ @@ -27,6 +25,8 @@ import pekko.testkit.{ PekkoSpec, TestProbe } import pekko.testkit.WithLogCapturing import pekko.util.ByteString +import org.scalatest.concurrent.TimeLimits + class TcpIntegrationSpec extends PekkoSpec(""" pekko.loglevel = debug pekko.loggers = ["org.apache.pekko.testkit.SilenceAllTestEventListener"] diff --git a/actor-tests/src/test/scala/org/apache/pekko/io/TcpIntegrationSpecSupport.scala b/actor-tests/src/test/scala/org/apache/pekko/io/TcpIntegrationSpecSupport.scala index 170d949fca..658f4bfd31 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/io/TcpIntegrationSpecSupport.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/io/TcpIntegrationSpecSupport.scala @@ -15,13 +15,13 @@ package org.apache.pekko.io import scala.annotation.tailrec import scala.collection.immutable +import scala.concurrent.ExecutionContext import Tcp._ import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ActorSystem -import scala.concurrent.ExecutionContext import pekko.io.Inet.SocketOption import pekko.testkit.{ PekkoSpec, TestProbe } import pekko.testkit.SocketUtil.temporaryServerAddress diff --git a/actor-tests/src/test/scala/org/apache/pekko/io/UdpConnectedIntegrationSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/io/UdpConnectedIntegrationSpec.scala index 18ea067e9c..d509c55958 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/io/UdpConnectedIntegrationSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/io/UdpConnectedIntegrationSpec.scala @@ -19,8 +19,8 @@ import scala.concurrent.duration._ import org.apache.pekko import pekko.actor.ActorRef -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.testkit.SocketUtil.temporaryServerAddresses import pekko.testkit.TestProbe import pekko.testkit.WithLogCapturing diff --git a/actor-tests/src/test/scala/org/apache/pekko/io/UdpIntegrationSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/io/UdpIntegrationSpec.scala index e716d329f1..957b7828e8 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/io/UdpIntegrationSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/io/UdpIntegrationSpec.scala @@ -15,6 +15,7 @@ package org.apache.pekko.io import java.net.DatagramSocket import java.net.InetSocketAddress + import org.apache.pekko import pekko.actor.ActorRef import pekko.io.Inet._ diff --git a/actor-tests/src/test/scala/org/apache/pekko/io/dns/AsyncDnsResolverIntegrationSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/io/dns/AsyncDnsResolverIntegrationSpec.scala index 1f7e658b58..0aed5bc0aa 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/io/dns/AsyncDnsResolverIntegrationSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/io/dns/AsyncDnsResolverIntegrationSpec.scala @@ -17,11 +17,8 @@ import java.net.InetAddress import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.time.Millis -import org.scalatest.time.Span - import CachePolicy.Ttl + import org.apache.pekko import pekko.io.{ Dns, IO } import pekko.io.dns.DnsProtocol.{ Ip, RequestType, Srv } @@ -31,6 +28,11 @@ import pekko.testkit.SocketUtil.Both import pekko.testkit.WithLogCapturing import pekko.util.Timeout +import org.scalatest.time.Millis +import org.scalatest.time.Span + +import com.typesafe.config.ConfigFactory + /** * These tests rely on a DNS server with 2 zones configured, foo.test and bar.example. * diff --git a/actor-tests/src/test/scala/org/apache/pekko/io/dns/DnsSettingsSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/io/dns/DnsSettingsSpec.scala index 74509863c5..c658106a23 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/io/dns/DnsSettingsSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/io/dns/DnsSettingsSpec.scala @@ -17,12 +17,12 @@ import java.net.InetAddress import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.testkit.PekkoSpec +import com.typesafe.config.ConfigFactory + class DnsSettingsSpec extends PekkoSpec { val eas = system.asInstanceOf[ExtendedActorSystem] diff --git a/actor-tests/src/test/scala/org/apache/pekko/io/dns/DockerBindDnsService.scala b/actor-tests/src/test/scala/org/apache/pekko/io/dns/DockerBindDnsService.scala index 97fe875866..e8d10a7d15 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/io/dns/DockerBindDnsService.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/io/dns/DockerBindDnsService.scala @@ -14,21 +14,23 @@ package org.apache.pekko.io.dns import scala.concurrent.duration._ +import scala.jdk.CollectionConverters._ import scala.util.Try import scala.util.control.NonFatal -import com.typesafe.config.Config import com.github.dockerjava.api.DockerClient import com.github.dockerjava.api.async.ResultCallback import com.github.dockerjava.api.command.CreateContainerCmd import com.github.dockerjava.api.model._ import com.github.dockerjava.core.{ DefaultDockerClientConfig, DockerClientConfig, DockerClientImpl } import com.github.dockerjava.httpclient5.ApacheDockerHttpClient -import org.scalatest.concurrent.Eventually import org.apache.pekko import pekko.testkit.PekkoSpec -import scala.jdk.CollectionConverters._ + +import org.scalatest.concurrent.Eventually + +import com.typesafe.config.Config abstract class DockerBindDnsService(config: Config) extends PekkoSpec(config) with Eventually { diff --git a/actor-tests/src/test/scala/org/apache/pekko/io/dns/internal/AsyncDnsResolverSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/io/dns/internal/AsyncDnsResolverSpec.scala index 2c504f6bca..51b51d88eb 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/io/dns/internal/AsyncDnsResolverSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/io/dns/internal/AsyncDnsResolverSpec.scala @@ -18,7 +18,6 @@ import java.net.{ Inet6Address, InetAddress } import scala.collection.{ immutable => im } import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigFactory, ConfigValueFactory } import org.apache.pekko import pekko.actor.{ ActorRef, ExtendedActorSystem, Props } import pekko.actor.Status.Failure @@ -30,6 +29,8 @@ import pekko.io.dns.internal.AsyncDnsResolver.ResolveFailedException import pekko.io.dns.internal.DnsClient.{ Answer, DuplicateId, Question4, Question6, SrvQuestion } import pekko.testkit.{ PekkoSpec, TestProbe, WithLogCapturing } +import com.typesafe.config.{ Config, ConfigFactory, ConfigValueFactory } + class AsyncDnsResolverSpec extends PekkoSpec(""" pekko.loglevel = DEBUG pekko.loggers = ["org.apache.pekko.testkit.SilenceAllTestEventListener"] diff --git a/actor-tests/src/test/scala/org/apache/pekko/io/dns/internal/DnsClientSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/io/dns/internal/DnsClientSpec.scala index 11c4910de9..8c8e9bb4de 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/io/dns/internal/DnsClientSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/io/dns/internal/DnsClientSpec.scala @@ -15,7 +15,9 @@ package org.apache.pekko.io.dns.internal import java.net.{ InetAddress, InetSocketAddress } import java.util.concurrent.atomic.AtomicBoolean + import scala.collection.{ immutable => im } + import org.apache.pekko import org.apache.pekko.actor.Status.Failure import pekko.actor.Props diff --git a/actor-tests/src/test/scala/org/apache/pekko/io/dns/internal/MessageSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/io/dns/internal/MessageSpec.scala index 18b10d4843..cffbd246ab 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/io/dns/internal/MessageSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/io/dns/internal/MessageSpec.scala @@ -13,13 +13,13 @@ package org.apache.pekko.io.dns.internal -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.io.dns.{ RecordClass, RecordType } import pekko.util.ByteString +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class MessageSpec extends AnyWordSpec with Matchers { "The Message" should { "parse a response that is truncated mid-message" in { diff --git a/actor-tests/src/test/scala/org/apache/pekko/pattern/AskSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/pattern/AskSpec.scala index e79024c34d..b34e001f1c 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/pattern/AskSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/pattern/AskSpec.scala @@ -13,10 +13,10 @@ package org.apache.pekko.pattern +import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.duration._ import scala.util.Failure -import scala.annotation.nowarn import org.apache.pekko import pekko.actor._ diff --git a/actor-tests/src/test/scala/org/apache/pekko/pattern/BackoffOnRestartSupervisorSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/pattern/BackoffOnRestartSupervisorSpec.scala index f17bff441b..f25635be66 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/pattern/BackoffOnRestartSupervisorSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/pattern/BackoffOnRestartSupervisorSpec.scala @@ -15,9 +15,8 @@ package org.apache.pekko.pattern import java.util.concurrent.{ CountDownLatch, TimeUnit } -import scala.concurrent.duration._ - import scala.annotation.nowarn +import scala.concurrent.duration._ import org.apache.pekko import pekko.actor._ diff --git a/actor-tests/src/test/scala/org/apache/pekko/pattern/BackoffSupervisorSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/pattern/BackoffSupervisorSpec.scala index 6e9ab97419..1ae76002e2 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/pattern/BackoffSupervisorSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/pattern/BackoffSupervisorSpec.scala @@ -16,13 +16,13 @@ package org.apache.pekko.pattern import scala.concurrent.duration._ import scala.util.control.NoStackTrace -import org.scalatest.concurrent.Eventually -import org.scalatest.prop.TableDrivenPropertyChecks._ - import org.apache.pekko import pekko.actor._ import pekko.testkit._ +import org.scalatest.concurrent.Eventually +import org.scalatest.prop.TableDrivenPropertyChecks._ + object BackoffSupervisorSpec { class TestException extends RuntimeException with NoStackTrace diff --git a/actor-tests/src/test/scala/org/apache/pekko/pattern/CircuitBreakerSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/pattern/CircuitBreakerSpec.scala index 72f3691d58..b64e0a9e59 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/pattern/CircuitBreakerSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/pattern/CircuitBreakerSpec.scala @@ -22,6 +22,7 @@ import scala.concurrent.duration._ import scala.util.Failure import scala.util.Success import scala.util.Try + import org.apache.pekko import pekko.actor.{ ActorSystem, ExtendedActorSystem } import pekko.testkit._ diff --git a/actor-tests/src/test/scala/org/apache/pekko/pattern/CircuitBreakerStressSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/pattern/CircuitBreakerStressSpec.scala index 2123862d05..b74d5442da 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/pattern/CircuitBreakerStressSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/pattern/CircuitBreakerStressSpec.scala @@ -24,8 +24,8 @@ import pekko.actor.Actor import pekko.actor.ActorLogging import pekko.actor.Props import pekko.actor.Status.Failure -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec object CircuitBreakerStressSpec { case object JobDone diff --git a/actor-tests/src/test/scala/org/apache/pekko/pattern/PatternSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/pattern/PatternSpec.scala index e18148d849..04111fee20 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/pattern/PatternSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/pattern/PatternSpec.scala @@ -15,6 +15,7 @@ package org.apache.pekko.pattern import scala.concurrent.{ Await, ExecutionContextExecutor, Future, Promise, TimeoutException } import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.{ Actor, Props } import pekko.testkit.{ PekkoSpec, TestLatch } diff --git a/actor-tests/src/test/scala/org/apache/pekko/pattern/RetrySpec.scala b/actor-tests/src/test/scala/org/apache/pekko/pattern/RetrySpec.scala index 26b78b37a9..bc7168876c 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/pattern/RetrySpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/pattern/RetrySpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.pattern +import java.util.concurrent.atomic.AtomicInteger + import scala.concurrent.{ Await, ExecutionContextExecutor, Future } import scala.concurrent.duration._ @@ -20,8 +22,6 @@ import org.apache.pekko import pekko.actor.Scheduler import pekko.testkit.PekkoSpec -import java.util.concurrent.atomic.AtomicInteger - class RetrySpec extends PekkoSpec with RetrySupport { implicit val ec: ExecutionContextExecutor = system.dispatcher implicit val scheduler: Scheduler = system.scheduler diff --git a/actor-tests/src/test/scala/org/apache/pekko/pattern/StatusReplySpec.scala b/actor-tests/src/test/scala/org/apache/pekko/pattern/StatusReplySpec.scala index cc0cffb91c..364dc8529d 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/pattern/StatusReplySpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/pattern/StatusReplySpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.pattern import scala.concurrent.{ Await, Future } import scala.concurrent.duration._ -import org.scalatest.concurrent.ScalaFutures - import org.apache.pekko import pekko.Done import pekko.testkit.PekkoSpec @@ -25,6 +23,8 @@ import pekko.testkit.TestException import pekko.testkit.TestProbe import pekko.util.Timeout +import org.scalatest.concurrent.ScalaFutures + class StatusReplySpec extends PekkoSpec with ScalaFutures { "StatusReply" should { diff --git a/actor-tests/src/test/scala/org/apache/pekko/routing/BalancingSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/routing/BalancingSpec.scala index 8049e3d60d..518f233e9a 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/routing/BalancingSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/routing/BalancingSpec.scala @@ -21,13 +21,13 @@ import scala.concurrent.duration._ import org.apache.pekko import pekko.actor.{ Actor, ActorLogging, ActorRef, PoisonPill, Props } -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.testkit.TestLatch -import org.scalatest.BeforeAndAfterEach - import pekko.testkit.TestProbe +import org.scalatest.BeforeAndAfterEach + object BalancingSpec { val counter = new AtomicInteger(1) diff --git a/actor-tests/src/test/scala/org/apache/pekko/routing/ConfiguredLocalRoutingSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/routing/ConfiguredLocalRoutingSpec.scala index cbd6b97c89..d12addc319 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/routing/ConfiguredLocalRoutingSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/routing/ConfiguredLocalRoutingSpec.scala @@ -13,13 +13,11 @@ package org.apache.pekko.routing +import scala.annotation.nowarn import scala.collection.immutable import scala.concurrent.Await import scala.concurrent.duration._ -import scala.annotation.nowarn -import com.typesafe.config.Config - import org.apache.pekko import pekko.ConfigurationException import pekko.actor.{ Actor, ActorRef, Deploy, Props } @@ -32,6 +30,8 @@ import pekko.testkit.{ DefaultTimeout, ImplicitSender, PekkoSpec } import pekko.testkit.TestActors.echoActorProps import pekko.testkit.TestProbe +import com.typesafe.config.Config + object ConfiguredLocalRoutingSpec { val config = """ pekko { diff --git a/actor-tests/src/test/scala/org/apache/pekko/routing/ResizerSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/routing/ResizerSpec.scala index 1e7a4ab77b..198b7144cf 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/routing/ResizerSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/routing/ResizerSpec.scala @@ -16,14 +16,14 @@ package org.apache.pekko.routing import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.actor.{ Actor, ActorRef, ActorSystem, Props } import pekko.pattern.ask import pekko.testkit._ import pekko.testkit.TestEvent._ +import com.typesafe.config.{ Config, ConfigFactory } + object ResizerSpec { val config = """ diff --git a/actor-tests/src/test/scala/org/apache/pekko/routing/RoutingSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/routing/RoutingSpec.scala index eed7e6bb81..90ca2eaec1 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/routing/RoutingSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/routing/RoutingSpec.scala @@ -18,14 +18,14 @@ import scala.concurrent.Await import scala.concurrent.ExecutionContextExecutor import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.ConfigurationException import pekko.actor._ import pekko.pattern.{ ask, pipe } import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object RoutingSpec { val config = """ diff --git a/actor-tests/src/test/scala/org/apache/pekko/serialization/AsyncSerializeSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/serialization/AsyncSerializeSpec.scala index 5f503528cd..14f7bd46d8 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/serialization/AsyncSerializeSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/serialization/AsyncSerializeSpec.scala @@ -15,12 +15,15 @@ package org.apache.pekko.serialization import java.util.concurrent.CompletableFuture import java.util.concurrent.CompletionStage + import scala.concurrent.Future -import com.typesafe.config.ConfigFactory + import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.testkit.{ EventFilter, PekkoSpec } +import com.typesafe.config.ConfigFactory + object AsyncSerializeSpec { case class Message1(str: String) diff --git a/actor-tests/src/test/scala/org/apache/pekko/serialization/PrimitivesSerializationSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/serialization/PrimitivesSerializationSpec.scala index baebb5a8fa..0fdbdd44d5 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/serialization/PrimitivesSerializationSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/serialization/PrimitivesSerializationSpec.scala @@ -18,12 +18,12 @@ import java.nio.ByteOrder import scala.util.Random -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.testkit.PekkoSpec import pekko.util.ByteString +import com.typesafe.config.ConfigFactory + object PrimitivesSerializationSpec { val serializationTestOverrides = "" diff --git a/actor-tests/src/test/scala/org/apache/pekko/serialization/SerializationSetupSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/serialization/SerializationSetupSpec.scala index 9b8aac0896..0b4a59bd79 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/serialization/SerializationSetupSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/serialization/SerializationSetupSpec.scala @@ -18,13 +18,13 @@ import java.util.{ Date => SerializableDummy } import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.atomic.AtomicInteger -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ ActorSystem, BootstrapSetup, ExtendedActorSystem } import pekko.actor.setup.ActorSystemSetup import pekko.testkit.{ PekkoSpec, TestKit } +import com.typesafe.config.ConfigFactory + class ConfigurationDummy class ProgrammaticDummy diff --git a/actor-tests/src/test/scala/org/apache/pekko/serialization/SerializeSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/serialization/SerializeSpec.scala index cb379ee854..88e5517033 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/serialization/SerializeSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/serialization/SerializeSpec.scala @@ -22,7 +22,6 @@ import scala.concurrent.Await import scala.concurrent.duration._ import SerializationTests._ -import com.typesafe.config._ import test.org.apache.pekko.serialization.NoVerification import org.apache.pekko @@ -33,6 +32,8 @@ import pekko.testkit.{ EventFilter, PekkoSpec } import pekko.util.{ unused, Timeout } import pekko.util.ByteString +import com.typesafe.config._ + object SerializationTests { val serializeConf = s""" diff --git a/actor-tests/src/test/scala/org/apache/pekko/testkit/CallingThreadDispatcherModelSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/testkit/CallingThreadDispatcherModelSpec.scala index 720c84e267..ef189a231c 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/testkit/CallingThreadDispatcherModelSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/testkit/CallingThreadDispatcherModelSpec.scala @@ -15,14 +15,14 @@ package org.apache.pekko.testkit import java.util.concurrent.atomic.AtomicInteger -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.dispatch.ActorModelSpec import pekko.dispatch.DispatcherPrerequisites import pekko.dispatch.MessageDispatcher import pekko.dispatch.MessageDispatcherConfigurator +import com.typesafe.config.Config + object CallingThreadDispatcherModelSpec { import ActorModelSpec._ diff --git a/actor-tests/src/test/scala/org/apache/pekko/util/BoundedBlockingQueueSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/util/BoundedBlockingQueueSpec.scala index cb7c433992..4045f50b61 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/util/BoundedBlockingQueueSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/util/BoundedBlockingQueueSpec.scala @@ -19,9 +19,15 @@ import java.util.concurrent.locks.{ Condition, LockSupport, ReentrantLock } import scala.collection.mutable import scala.concurrent.{ Await, ExecutionContext, ExecutionContextExecutor, Future } +import scala.jdk.CollectionConverters._ import scala.util.control.Exception import org.scalactic.source.Position + +import org.apache.pekko +import pekko.testkit.TimingTest +import pekko.util.DefaultExecutionContext._ + import org.scalatest.concurrent.{ Signaler, ThreadSignaler } import org.scalatest.exceptions.TestFailedDueToTimeoutException import org.scalatest.matchers.{ MatchResult, Matcher } @@ -30,11 +36,6 @@ import org.scalatest.time.Span import org.scalatest.time.SpanSugar._ import org.scalatest.wordspec.AnyWordSpec -import org.apache.pekko -import pekko.testkit.TimingTest -import pekko.util.DefaultExecutionContext._ -import scala.jdk.CollectionConverters._ - class BoundedBlockingQueueSpec extends AnyWordSpec with Matchers diff --git a/actor-tests/src/test/scala/org/apache/pekko/util/ByteIteratorSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/util/ByteIteratorSpec.scala index 29e430362a..56fc8ca7e5 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/util/ByteIteratorSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/util/ByteIteratorSpec.scala @@ -13,11 +13,11 @@ package org.apache.pekko.util +import org.apache.pekko.util.ByteIterator.ByteArrayIterator + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import org.apache.pekko.util.ByteIterator.ByteArrayIterator - class ByteIteratorSpec extends AnyWordSpec with Matchers { "A ByteIterator" should { diff --git a/actor-tests/src/test/scala/org/apache/pekko/util/ByteStringSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/util/ByteStringSpec.scala index 27ee54ae69..563562a471 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/util/ByteStringSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/util/ByteStringSpec.scala @@ -26,13 +26,14 @@ import scala.collection.mutable.Builder import org.apache.commons.codec.binary.Hex.encodeHex import org.scalacheck.{ Arbitrary, Gen } import org.scalacheck.Arbitrary.arbitrary -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec import org.scalatestplus.scalacheck.Checkers import org.apache.pekko import pekko.util.ByteString.{ ByteString1, ByteString1C, ByteStrings } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class ByteStringSpec extends AnyWordSpec with Matchers with Checkers { implicit val betterGeneratorDrivenConfig: PropertyCheckConfiguration = diff --git a/actor-tests/src/test/scala/org/apache/pekko/util/FrequencyListSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/util/FrequencyListSpec.scala index 3398c6b540..b3dbe1837b 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/util/FrequencyListSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/util/FrequencyListSpec.scala @@ -13,11 +13,11 @@ package org.apache.pekko.util +import scala.concurrent.duration._ + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import scala.concurrent.duration._ - object FrequencyListSpec { // controlled clock for testing recency windows // durations are always in seconds diff --git a/actor-tests/src/test/scala/org/apache/pekko/util/FrequencySketchSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/util/FrequencySketchSpec.scala index 942042feb8..1e6b112884 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/util/FrequencySketchSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/util/FrequencySketchSpec.scala @@ -13,11 +13,11 @@ package org.apache.pekko.util +import scala.collection.mutable + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import scala.collection.mutable - class FrequencySketchSpec extends AnyWordSpec with Matchers { "FrequencySketch" must { diff --git a/actor-tests/src/test/scala/org/apache/pekko/util/IndexSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/util/IndexSpec.scala index 741782e66b..d08c3d6c90 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/util/IndexSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/util/IndexSpec.scala @@ -20,11 +20,11 @@ import scala.concurrent.ExecutionContextExecutor import scala.concurrent.Future import scala.util.Random -import org.scalatest.matchers.should.Matchers - import org.apache.pekko -import pekko.testkit.PekkoSpec import pekko.testkit.DefaultTimeout +import pekko.testkit.PekkoSpec + +import org.scalatest.matchers.should.Matchers class IndexSpec extends PekkoSpec with Matchers with DefaultTimeout { implicit val ec: ExecutionContextExecutor = system.dispatcher diff --git a/actor-tests/src/test/scala/org/apache/pekko/util/MessageBufferSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/util/MessageBufferSpec.scala index fa3404c393..1fdafb5de2 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/util/MessageBufferSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/util/MessageBufferSpec.scala @@ -13,11 +13,11 @@ package org.apache.pekko.util +import org.apache.pekko.actor.{ ActorPath, ActorRef, ActorRefProvider, MinimalActorRef } + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import org.apache.pekko.actor.{ ActorPath, ActorRef, ActorRefProvider, MinimalActorRef } - class MessageBufferSpec extends AnyWordSpec with Matchers { import MessageBufferSpec._ diff --git a/actor-tests/src/test/scala/org/apache/pekko/util/RecencyListSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/util/RecencyListSpec.scala index 0e7eb07153..0e4766f91d 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/util/RecencyListSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/util/RecencyListSpec.scala @@ -13,11 +13,11 @@ package org.apache.pekko.util +import scala.concurrent.duration._ + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import scala.concurrent.duration._ - object RecencyListSpec { // controlled clock for testing recency windows // durations are always in seconds diff --git a/actor-tests/src/test/scala/org/apache/pekko/util/SegmentedRecencyListSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/util/SegmentedRecencyListSpec.scala index ebfe64e5fd..99aaa560dd 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/util/SegmentedRecencyListSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/util/SegmentedRecencyListSpec.scala @@ -13,11 +13,11 @@ package org.apache.pekko.util +import scala.concurrent.duration._ + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import scala.concurrent.duration._ - object SegmentedRecencyListSpec { // controlled clock for testing recency windows // durations are always in seconds diff --git a/actor-typed-tests/src/test/scala-3/docs/org/apache/pekko/typed/InteractionPatterns3Spec.scala b/actor-typed-tests/src/test/scala-3/docs/org/apache/pekko/typed/InteractionPatterns3Spec.scala index bd7f7203be..2fec649576 100644 --- a/actor-typed-tests/src/test/scala-3/docs/org/apache/pekko/typed/InteractionPatterns3Spec.scala +++ b/actor-typed-tests/src/test/scala-3/docs/org/apache/pekko/typed/InteractionPatterns3Spec.scala @@ -19,11 +19,12 @@ import scala.concurrent.Future import scala.concurrent.duration._ import scala.util.Failure import scala.util.Success + import org.apache.pekko import pekko.Done import pekko.NotUsed -import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import pekko.actor.testkit.typed.scaladsl.LogCapturing +import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import pekko.actor.typed.ActorRef import pekko.actor.typed.ActorSystem import pekko.actor.typed.Behavior @@ -31,6 +32,7 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.actor.typed.scaladsl.LoggerOps import pekko.actor.typed.scaladsl.TimerScheduler import pekko.pattern.StatusReply + import org.scalatest.wordspec.AnyWordSpecLike object DummyData3 { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ActorContextSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ActorContextSpec.scala index 8f53e10267..bda008a286 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ActorContextSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ActorContextSpec.scala @@ -17,8 +17,6 @@ import scala.annotation.nowarn import scala.concurrent.duration._ import scala.reflect.ClassTag -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.InvalidMessageException import pekko.actor.testkit.typed.TestException @@ -28,6 +26,8 @@ import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import pekko.actor.testkit.typed.scaladsl.TestProbe import pekko.actor.typed.scaladsl.Behaviors +import org.scalatest.wordspec.AnyWordSpecLike + object ActorSpecMessages { sealed trait Command diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ActorRefIgnoreSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ActorRefIgnoreSpec.scala index ae1376300a..3e4771bfe6 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ActorRefIgnoreSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ActorRefIgnoreSpec.scala @@ -18,9 +18,6 @@ import java.util.concurrent.TimeoutException import scala.concurrent.duration._ import scala.util.{ Failure, Success } -import org.scalatest.concurrent.PatienceConfiguration.{ Timeout => PatienceTimeout } -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.{ ScalaTestWithActorTestKit, TestProbe } import pekko.actor.typed.scaladsl.AskPattern._ @@ -28,6 +25,9 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.actor.typed.scaladsl.adapter._ import pekko.util.Timeout +import org.scalatest.concurrent.PatienceConfiguration.{ Timeout => PatienceTimeout } +import org.scalatest.wordspec.AnyWordSpecLike + class ActorRefIgnoreSpec extends ScalaTestWithActorTestKit() with AnyWordSpecLike { case class Request(replyTo: ActorRef[Int]) diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ActorRefResolverSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ActorRefResolverSpec.scala index fb2dbade39..55653d218e 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ActorRefResolverSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ActorRefResolverSpec.scala @@ -13,10 +13,6 @@ package org.apache.pekko.actor.typed -import org.scalatest.concurrent.ScalaFutures -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.ActorPath import pekko.actor.ActorRefProvider @@ -25,6 +21,10 @@ import pekko.actor.MinimalActorRef import pekko.actor.RootActorPath import pekko.actor.typed.scaladsl.Behaviors +import org.scalatest.concurrent.ScalaFutures +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class ActorRefResolverSpec extends AnyWordSpec with ScalaFutures with Matchers { "ActorRefResolver" should { "not allow serialization of ref originating from other system" in { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ActorSystemSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ActorSystemSpec.scala index cfd411d59b..2cab64f2d8 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ActorSystemSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ActorSystemSpec.scala @@ -17,12 +17,13 @@ package org.apache.pekko.actor.typed -import com.typesafe.config.ConfigFactory +import scala.annotation.nowarn + import org.apache.pekko import pekko.actor.typed.scaladsl.Behaviors import pekko.testkit.PekkoSpec -import scala.annotation.nowarn +import com.typesafe.config.ConfigFactory @nowarn("msg=possible missing interpolator") class ActorSystemSpec extends PekkoSpec { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/AskSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/AskSpec.scala index 0a6b650dd0..a03dee2841 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/AskSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/AskSpec.scala @@ -17,8 +17,9 @@ import scala.concurrent.ExecutionContext import scala.concurrent.Future import scala.concurrent.TimeoutException import scala.concurrent.duration._ +import scala.util.Failure import scala.util.Success -import org.scalatest.wordspec.AnyWordSpecLike + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.LoggingTestKit @@ -32,7 +33,7 @@ import pekko.pattern.StatusReply import pekko.testkit.TestException import pekko.util.Timeout -import scala.util.Failure +import org.scalatest.wordspec.AnyWordSpecLike object AskSpec { sealed trait Msg diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/BehaviorSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/BehaviorSpec.scala index 03980e4ed3..9f9cba1715 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/BehaviorSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/BehaviorSpec.scala @@ -16,9 +16,8 @@ package org.apache.pekko.actor.typed import java.util.function.{ Function => F1 } import scala.annotation.nowarn + import org.scalactic.TypeCheckedTripleEquals -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike import org.apache.pekko import pekko.Done @@ -28,8 +27,11 @@ import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import pekko.actor.typed.javadsl.{ Behaviors => JBehaviors } import pekko.actor.typed.scaladsl.{ AbstractBehavior => SAbstractBehavior } import pekko.actor.typed.scaladsl.{ Behaviors => SBehaviors } -import pekko.japi.pf.PFBuilder import pekko.japi.function.Function +import pekko.japi.pf.PFBuilder + +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike object BehaviorSpec { sealed trait Command { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/DeferredSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/DeferredSpec.scala index ac71495980..6600bdf3f2 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/DeferredSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/DeferredSpec.scala @@ -15,9 +15,6 @@ package org.apache.pekko.actor.typed import scala.util.control.NoStackTrace -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.{ AnyWordSpec, AnyWordSpecLike } - import org.apache.pekko import pekko.actor.ActorInitializationException import pekko.actor.testkit.typed.TestKitSettings @@ -25,6 +22,9 @@ import pekko.actor.testkit.typed.scaladsl._ import pekko.actor.testkit.typed.scaladsl.LoggingTestKit import pekko.actor.typed.scaladsl.Behaviors +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.{ AnyWordSpec, AnyWordSpecLike } + object DeferredSpec { sealed trait Command case object Ping extends Command diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ExtensionsSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ExtensionsSpec.scala index 17bfa5d4ce..8a6eff66fb 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ExtensionsSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/ExtensionsSpec.scala @@ -17,9 +17,6 @@ import java.util.concurrent.atomic.AtomicInteger import scala.concurrent.Future -import com.typesafe.config.{ Config, ConfigFactory } -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.BootstrapSetup import pekko.actor.setup.ActorSystemSetup @@ -29,6 +26,10 @@ import pekko.actor.typed.receptionist.Receptionist import pekko.actor.typed.receptionist.ServiceKey import pekko.actor.typed.scaladsl.Behaviors +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.{ Config, ConfigFactory } + class DummyExtension1 extends Extension object DummyExtension1 extends ExtensionId[DummyExtension1] { def createExtension(system: ActorSystem[_]) = new DummyExtension1 diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/InterceptSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/InterceptSpec.scala index 3f786e36b8..208258315e 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/InterceptSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/InterceptSpec.scala @@ -17,8 +17,6 @@ import java.util.concurrent.atomic.AtomicBoolean import scala.concurrent.duration._ -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.ActorInitializationException import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -29,6 +27,8 @@ import pekko.actor.typed.internal.PoisonPill import pekko.actor.typed.internal.PoisonPillInterceptor import pekko.actor.typed.scaladsl.Behaviors +import org.scalatest.wordspec.AnyWordSpecLike + object InterceptSpec { final case class Msg(hello: String, replyTo: ActorRef[String]) case object MyPoisonPill diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/LocalActorRefProviderLogMessagesSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/LocalActorRefProviderLogMessagesSpec.scala index dd8b9dc05c..c2a05fd6c8 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/LocalActorRefProviderLogMessagesSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/LocalActorRefProviderLogMessagesSpec.scala @@ -16,6 +16,7 @@ package org.apache.pekko.actor.typed import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.{ ActorTestKit, LogCapturing, LoggingTestKit, ScalaTestWithActorTestKit } import pekko.actor.typed.internal.adapter.ActorSystemAdapter + import org.scalatest.wordspec.AnyWordSpecLike object LocalActorRefProviderLogMessagesSpec { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/LogMessagesSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/LogMessagesSpec.scala index 0787193474..f8d865bc1b 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/LogMessagesSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/LogMessagesSpec.scala @@ -13,9 +13,6 @@ package org.apache.pekko.actor.typed -import org.scalatest.wordspec.AnyWordSpecLike -import org.slf4j.event.Level - import org.apache.pekko import pekko.actor import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -24,6 +21,10 @@ import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import pekko.actor.typed.scaladsl.Behaviors import pekko.actor.typed.scaladsl.adapter._ +import org.scalatest.wordspec.AnyWordSpecLike + +import org.slf4j.event.Level + class LogMessagesSpec extends ScalaTestWithActorTestKit(""" pekko.loglevel = DEBUG # test verifies debug """) with AnyWordSpecLike with LogCapturing { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/MailboxSelectorSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/MailboxSelectorSpec.scala index e90eab5909..36a029a634 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/MailboxSelectorSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/MailboxSelectorSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.actor.typed import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.ActorCell import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -31,6 +29,8 @@ import pekko.dispatch.BoundedNodeMessageQueue import pekko.dispatch.MessageQueue import pekko.dispatch.UnboundedMessageQueueSemantics +import org.scalatest.wordspec.AnyWordSpecLike + class MailboxSelectorSpec extends ScalaTestWithActorTestKit(""" specific-mailbox { mailbox-type = "org.apache.pekko.dispatch.NonBlockingBoundedMailbox" diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/MonitorSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/MonitorSpec.scala index 70f37e565f..53cd0297b6 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/MonitorSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/MonitorSpec.scala @@ -13,14 +13,14 @@ package org.apache.pekko.actor.typed -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import pekko.actor.testkit.typed.scaladsl.TestProbe import pekko.actor.typed.scaladsl.Behaviors +import org.scalatest.wordspec.AnyWordSpecLike + class MonitorSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "The monitor behavior" should { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/OrElseSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/OrElseSpec.scala index 3727268d9f..ac46eef74b 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/OrElseSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/OrElseSpec.scala @@ -15,13 +15,13 @@ package org.apache.pekko.actor.typed import scala.annotation.tailrec -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl._ import pekko.actor.typed.scaladsl.Behaviors +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + /** * Background: Originally there was an `OrElseBehavior` that could compose two `Behavior`, but that * wasn't safe when used together with narrow so `OrElseBehavior` was removed. Kept this diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/PropsSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/PropsSpec.scala index 75a88c9351..bf14b2ee60 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/PropsSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/PropsSpec.scala @@ -13,11 +13,11 @@ package org.apache.pekko.actor.typed +import org.apache.pekko.actor.testkit.typed.scaladsl.LogCapturing + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import org.apache.pekko.actor.testkit.typed.scaladsl.LogCapturing - class PropsSpec extends AnyWordSpec with Matchers with LogCapturing { val dispatcherFirst = Props.empty.withDispatcherFromConfig("pool").withDispatcherDefault diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/SpawnProtocolSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/SpawnProtocolSpec.scala index 8732279f45..6038f3eb06 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/SpawnProtocolSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/SpawnProtocolSpec.scala @@ -16,15 +16,15 @@ package org.apache.pekko.actor.typed import scala.concurrent.Future import scala.concurrent.duration._ -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.{ AnyWordSpec, AnyWordSpecLike } - import org.apache.pekko import pekko.actor.testkit.typed.TestKitSettings import pekko.actor.testkit.typed.scaladsl._ import pekko.actor.typed.scaladsl.Behaviors import pekko.util.Timeout +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.{ AnyWordSpec, AnyWordSpecLike } + object SpawnProtocolSpec { sealed trait Message final case class Ping(replyTo: ActorRef[Pong.type]) extends Message diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/SupervisionSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/SupervisionSpec.scala index 9950127d5c..76368df75f 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/SupervisionSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/SupervisionSpec.scala @@ -19,28 +19,30 @@ import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.atomic.AtomicInteger -import org.apache.pekko -import pekko.actor.ActorInitializationException -import pekko.actor.Dropped -import pekko.actor.testkit.typed._ -import pekko.actor.testkit.typed.scaladsl.LoggingTestKit -import pekko.actor.testkit.typed.scaladsl._ -import pekko.actor.typed.SupervisorStrategy.Resume -import pekko.actor.typed.scaladsl.AbstractBehavior -import pekko.actor.typed.scaladsl.ActorContext -import pekko.actor.typed.scaladsl.Behaviors -import pekko.actor.typed.scaladsl.Behaviors._ -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec -import org.scalatest.wordspec.AnyWordSpecLike -import org.slf4j.event.Level - import scala.concurrent.Future import scala.concurrent.duration._ import scala.util.Failure import scala.util.Success import scala.util.control.NoStackTrace +import org.apache.pekko +import pekko.actor.ActorInitializationException +import pekko.actor.Dropped +import pekko.actor.testkit.typed._ +import pekko.actor.testkit.typed.scaladsl._ +import pekko.actor.testkit.typed.scaladsl.LoggingTestKit +import pekko.actor.typed.SupervisorStrategy.Resume +import pekko.actor.typed.scaladsl.AbstractBehavior +import pekko.actor.typed.scaladsl.ActorContext +import pekko.actor.typed.scaladsl.Behaviors +import pekko.actor.typed.scaladsl.Behaviors._ + +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec +import org.scalatest.wordspec.AnyWordSpecLike + +import org.slf4j.event.Level + object SupervisionSpec { sealed trait Command diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/TerminatedSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/TerminatedSpec.scala index 6552d2ccd3..4709337899 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/TerminatedSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/TerminatedSpec.scala @@ -13,13 +13,13 @@ package org.apache.pekko.actor.typed -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.TestInbox +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class TerminatedSpec extends AnyWordSpec with Matchers with LogCapturing { "Child Failed" must { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/TimerSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/TimerSpec.scala index 056db0b9ca..f47e8d69c9 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/TimerSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/TimerSpec.scala @@ -20,8 +20,6 @@ import java.util.concurrent.atomic.AtomicInteger import scala.concurrent.duration._ import scala.util.control.NoStackTrace -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.DeadLetter import pekko.actor.testkit.typed.TestException @@ -31,6 +29,8 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.actor.typed.scaladsl.TimerScheduler import pekko.testkit.TimingTest +import org.scalatest.wordspec.AnyWordSpecLike + class TimerSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { sealed trait Command diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/TransformMessagesSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/TransformMessagesSpec.scala index 290ba148c4..9999d86885 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/TransformMessagesSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/TransformMessagesSpec.scala @@ -17,8 +17,6 @@ import java.util.concurrent.atomic.AtomicInteger import scala.concurrent.duration._ -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor import pekko.actor.ActorInitializationException @@ -29,6 +27,8 @@ import pekko.actor.testkit.typed.scaladsl.TestProbe import pekko.actor.typed.scaladsl.Behaviors import pekko.actor.typed.scaladsl.adapter._ +import org.scalatest.wordspec.AnyWordSpecLike + object TransformMessagesSpec { // this is the sample from the Scaladoc diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/WatchSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/WatchSpec.scala index 5bddfc6da7..ee29aaf85a 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/WatchSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/WatchSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.actor.typed import scala.concurrent._ import scala.concurrent.duration._ -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.Done import pekko.actor @@ -30,6 +28,8 @@ import pekko.actor.typed.scaladsl.AbstractBehavior import pekko.actor.typed.scaladsl.Behaviors import pekko.actor.typed.scaladsl.adapter._ +import org.scalatest.wordspec.AnyWordSpecLike + object WatchSpec { case object Stop diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/coexistence/ClassicSupervisingTypedSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/coexistence/ClassicSupervisingTypedSpec.scala index 3014042166..f647146e77 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/coexistence/ClassicSupervisingTypedSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/coexistence/ClassicSupervisingTypedSpec.scala @@ -12,10 +12,6 @@ */ package org.apache.pekko.actor.typed.coexistence -import com.typesafe.config.ConfigFactory -import org.scalatest.BeforeAndAfterAll -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.{ actor => u } import pekko.actor.Actor @@ -26,6 +22,11 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.actor.typed.scaladsl.adapter._ import pekko.testkit.TestProbe +import org.scalatest.BeforeAndAfterAll +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + object ProbedBehavior { def behavior(probe: u.ActorRef): Behavior[String] = { Behaviors diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/coexistence/TypedSupervisingClassicSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/coexistence/TypedSupervisingClassicSpec.scala index 4989bd0d7e..5edfec293d 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/coexistence/TypedSupervisingClassicSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/coexistence/TypedSupervisingClassicSpec.scala @@ -12,8 +12,6 @@ */ package org.apache.pekko.actor.typed.coexistence -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.{ actor => classic } import pekko.actor.Actor @@ -24,6 +22,8 @@ import pekko.actor.typed.ActorRef import pekko.actor.typed.scaladsl.Behaviors import pekko.actor.typed.scaladsl.adapter._ +import org.scalatest.wordspec.AnyWordSpecLike + object TypedSupervisingClassicSpec { sealed trait Protocol diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ConsumerControllerSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ConsumerControllerSpec.scala index 7fa2245f66..a442ddb282 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ConsumerControllerSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ConsumerControllerSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.actor.typed.delivery import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -25,6 +23,10 @@ import pekko.actor.typed.delivery.internal.ConsumerControllerImpl import pekko.actor.typed.delivery.internal.ProducerControllerImpl import pekko.serialization.SerializationExtension +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + class ConsumerControllerSpec extends ScalaTestWithActorTestKit(ConfigFactory.parseString(""" pekko.reliable-delivery.consumer-controller { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableProducerControllerSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableProducerControllerSpec.scala index 9c8a2047e8..9483a46c4c 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableProducerControllerSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableProducerControllerSpec.scala @@ -17,9 +17,6 @@ import java.util.concurrent.atomic.AtomicReference import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -29,6 +26,10 @@ import pekko.actor.typed.delivery.internal.ChunkedMessage import pekko.actor.typed.delivery.internal.ProducerControllerImpl import pekko.util.ByteString +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + class DurableProducerControllerSpec extends ScalaTestWithActorTestKit( ConfigFactory.parseString(""" diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableProducerQueueSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableProducerQueueSpec.scala index d637b7850b..fee91853d7 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableProducerQueueSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableProducerQueueSpec.scala @@ -13,16 +13,16 @@ package org.apache.pekko.actor.typed.delivery -import org.scalatest.TestSuite -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.typed.delivery.DurableProducerQueue.MessageSent import pekko.actor.typed.delivery.DurableProducerQueue.State import pekko.actor.typed.delivery.internal.ChunkedMessage import pekko.util.ByteString +import org.scalatest.TestSuite +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class DurableProducerQueueSpec extends AnyWordSpec with TestSuite with Matchers { "DurableProducerQueue.State" must { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableWorkPullingSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableWorkPullingSpec.scala index 617e27c9f1..264e4e64eb 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableWorkPullingSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/DurableWorkPullingSpec.scala @@ -18,7 +18,6 @@ import java.util.concurrent.atomic.AtomicReference import scala.concurrent.duration._ import DurableProducerQueue.MessageSent -import org.scalatest.wordspec.AnyWordSpecLike import org.apache.pekko import pekko.Done @@ -29,6 +28,8 @@ import pekko.actor.typed.delivery.internal.ProducerControllerImpl import pekko.actor.typed.receptionist.Receptionist import pekko.actor.typed.receptionist.ServiceKey +import org.scalatest.wordspec.AnyWordSpecLike + class DurableWorkPullingSpec extends ScalaTestWithActorTestKit(""" pekko.reliable-delivery.consumer-controller.flow-control-window = 20 diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ProducerControllerSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ProducerControllerSpec.scala index e62de6ce8d..77fb97e9ff 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ProducerControllerSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ProducerControllerSpec.scala @@ -15,9 +15,6 @@ package org.apache.pekko.actor.typed.delivery import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -25,6 +22,10 @@ import pekko.actor.typed.delivery.ProducerController.MessageWithConfirmation import pekko.actor.typed.delivery.internal.ChunkedMessage import pekko.actor.typed.delivery.internal.ProducerControllerImpl +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + class ProducerControllerSpec extends ScalaTestWithActorTestKit( ConfigFactory.parseString(""" diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliveryRandomSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliveryRandomSpec.scala index 99ec8e49c9..0aa75315c1 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliveryRandomSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliveryRandomSpec.scala @@ -18,10 +18,6 @@ import java.util.concurrent.atomic.AtomicReference import scala.concurrent.duration._ import scala.util.Random -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -32,6 +28,11 @@ import pekko.actor.typed.delivery.internal.ProducerControllerImpl import pekko.actor.typed.scaladsl.Behaviors import pekko.actor.typed.scaladsl.LoggerOps +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object ReliableDeliveryRandomSpec { val config: Config = ConfigFactory.parseString(""" pekko.reliable-delivery.consumer-controller { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliverySpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliverySpec.scala index 616f187890..66f2d57cfd 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliverySpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliverySpec.scala @@ -15,14 +15,15 @@ package org.apache.pekko.actor.typed.delivery import scala.concurrent.duration._ -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object ReliableDeliverySpec { val config: Config = ConfigFactory.parseString(""" pekko.reliable-delivery.consumer-controller.flow-control-window = 20 diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/TestConsumer.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/TestConsumer.scala index fd565d095f..0164d68c66 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/TestConsumer.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/TestConsumer.scala @@ -13,12 +13,13 @@ package org.apache.pekko.actor.typed.delivery +import java.io.NotSerializableException import java.nio.charset.StandardCharsets + +import scala.concurrent.duration._ import scala.concurrent.duration.Duration import scala.concurrent.duration.FiniteDuration -import scala.concurrent.duration._ -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory + import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.actor.typed.Behavior @@ -28,7 +29,8 @@ import pekko.actor.typed.scaladsl.ActorContext import pekko.actor.typed.scaladsl.Behaviors import pekko.serialization.SerializerWithStringManifest -import java.io.NotSerializableException +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory object TestConsumer { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/TestProducerWithAsk.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/TestProducerWithAsk.scala index 0510b66b36..f028d45414 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/TestProducerWithAsk.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/TestProducerWithAsk.scala @@ -13,8 +13,8 @@ package org.apache.pekko.actor.typed.delivery -import scala.concurrent.duration.FiniteDuration import scala.concurrent.duration._ +import scala.concurrent.duration.FiniteDuration import scala.util.Failure import scala.util.Success diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/WorkPullingSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/WorkPullingSpec.scala index 1a29952d87..bf384c439d 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/WorkPullingSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/WorkPullingSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.actor.typed.delivery import scala.concurrent.duration._ -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -26,6 +24,8 @@ import pekko.actor.typed.delivery.internal.ProducerControllerImpl import pekko.actor.typed.receptionist.Receptionist import pekko.actor.typed.receptionist.ServiceKey +import org.scalatest.wordspec.AnyWordSpecLike + class WorkPullingSpec extends ScalaTestWithActorTestKit(""" pekko.reliable-delivery.consumer-controller.flow-control-window = 20 diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/eventstream/EventStreamDocSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/eventstream/EventStreamDocSpec.scala index b47c81769f..2bac08ea45 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/eventstream/EventStreamDocSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/eventstream/EventStreamDocSpec.scala @@ -21,6 +21,7 @@ import org.apache.pekko.actor.{ AllDeadLetters, DeadLetter, Dropped, SuppressedD import org.apache.pekko.actor.testkit.typed.scaladsl.{ LogCapturing, ScalaTestWithActorTestKit } import org.apache.pekko.actor.typed.ActorSystem import org.apache.pekko.actor.typed.scaladsl.Behaviors + import org.scalatest.wordspec.AnyWordSpecLike object EventStreamDocSpec { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/eventstream/EventStreamSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/eventstream/EventStreamSpec.scala index f47998052b..922768cc5d 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/eventstream/EventStreamSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/eventstream/EventStreamSpec.scala @@ -18,14 +18,14 @@ import java.util.concurrent.TimeUnit import scala.concurrent.duration._ -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.DeadLetter import pekko.actor.testkit.typed.scaladsl.{ ScalaTestWithActorTestKit, TestProbe } import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.typed.scaladsl.Behaviors +import org.scalatest.wordspec.AnyWordSpecLike + class EventStreamSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import EventStream._ diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/ActorRefSerializationSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/ActorRefSerializationSpec.scala index c51891668c..0ac9739d46 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/ActorRefSerializationSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/ActorRefSerializationSpec.scala @@ -13,9 +13,6 @@ package org.apache.pekko.actor.typed.internal -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -23,6 +20,10 @@ import pekko.actor.typed.ActorRef import pekko.actor.typed.scaladsl.Behaviors import pekko.serialization.{ JavaSerializer, SerializationExtension } +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + object ActorRefSerializationSpec { def config = ConfigFactory.parseString(""" pekko.actor { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/ActorSystemSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/ActorSystemSpec.scala index 38a181640d..a7f603f845 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/ActorSystemSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/ActorSystemSpec.scala @@ -18,24 +18,24 @@ import scala.concurrent.Future import scala.concurrent.Promise import scala.util.control.NonFatal -import org.scalatest.BeforeAndAfterAll -import org.scalatest.concurrent.Eventually -import org.scalatest.concurrent.ScalaFutures -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.Done -import pekko.actor.dungeon.Dispatch import pekko.actor.{ Address, CoordinatedShutdown, InvalidMessageException } +import pekko.actor.dungeon.Dispatch +import pekko.actor.testkit.typed.TestKitSettings import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.TestInbox import pekko.actor.testkit.typed.scaladsl.TestProbe import pekko.actor.typed.scaladsl.Behaviors -import com.typesafe.config.ConfigFactory -import org.scalatest.time.Span -import pekko.actor.testkit.typed.TestKitSettings +import org.scalatest.BeforeAndAfterAll +import org.scalatest.concurrent.Eventually +import org.scalatest.concurrent.ScalaFutures +import org.scalatest.matchers.should.Matchers +import org.scalatest.time.Span +import org.scalatest.wordspec.AnyWordSpec + +import com.typesafe.config.ConfigFactory class ActorSystemSpec extends AnyWordSpec diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/adpater/PropsAdapterSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/adpater/PropsAdapterSpec.scala index 417e8bc6e2..659fe51e1c 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/adpater/PropsAdapterSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/adpater/PropsAdapterSpec.scala @@ -13,15 +13,15 @@ package org.apache.pekko.actor.typed.internal.adpater -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor import pekko.actor.typed.Props import pekko.actor.typed.internal.adapter.PropsAdapter import pekko.actor.typed.scaladsl.Behaviors +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class PropsAdapterSpec extends AnyWordSpec with Matchers { "PropsAdapter" should { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/receptionist/LocalReceptionistSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/receptionist/LocalReceptionistSpec.scala index d463f23c44..e0a2236d2a 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/receptionist/LocalReceptionistSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/receptionist/LocalReceptionistSpec.scala @@ -15,9 +15,6 @@ package org.apache.pekko.actor.typed.internal.receptionist import scala.concurrent.Future -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.{ AnyWordSpec, AnyWordSpecLike } - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.BehaviorTestKit import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -31,6 +28,9 @@ import pekko.actor.typed.receptionist.ServiceKey import pekko.actor.typed.scaladsl.AskPattern._ import pekko.actor.typed.scaladsl.Behaviors +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.{ AnyWordSpec, AnyWordSpecLike } + object LocalReceptionistSpec { trait ServiceA val ServiceKeyA = ServiceKey[ServiceA]("service-a") diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/receptionist/ServiceKeySerializationSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/receptionist/ServiceKeySerializationSpec.scala index 0409add021..16ba38012b 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/receptionist/ServiceKeySerializationSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/receptionist/ServiceKeySerializationSpec.scala @@ -13,8 +13,6 @@ package org.apache.pekko.actor.typed.internal.receptionist -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -22,6 +20,8 @@ import pekko.actor.typed.internal.ActorRefSerializationSpec import pekko.actor.typed.receptionist.ServiceKey import pekko.serialization.SerializationExtension +import org.scalatest.wordspec.AnyWordSpecLike + class ServiceKeySerializationSpec extends ScalaTestWithActorTestKit(ActorRefSerializationSpec.config) with AnyWordSpecLike diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/routing/PoolRouterSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/routing/PoolRouterSpec.scala index c7ee0aa492..3fde4ee16f 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/routing/PoolRouterSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/routing/PoolRouterSpec.scala @@ -13,13 +13,13 @@ package org.apache.pekko.actor.typed.internal.routing -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.{ LogCapturing, ScalaTestWithActorTestKit } import pekko.actor.typed.{ ActorRef, Behavior, DispatcherSelector } import pekko.actor.typed.scaladsl.{ Behaviors, Routers } +import org.scalatest.wordspec.AnyWordSpecLike + object PoolRouterSpec { object RouteeBehavior { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/routing/RoutingLogicSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/routing/RoutingLogicSpec.scala index 2cc5111b54..fd197c38ad 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/routing/RoutingLogicSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/internal/routing/RoutingLogicSpec.scala @@ -13,9 +13,6 @@ package org.apache.pekko.actor.typed.internal.routing -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.Address import pekko.actor.testkit.typed.scaladsl.{ LogCapturing, ScalaTestWithActorTestKit, TestProbe } @@ -23,6 +20,9 @@ import pekko.actor.typed.{ ActorSystem, Behavior } import pekko.actor.typed.internal.routing.RoutingLogics.ConsistentHashingLogic import pekko.actor.typed.scaladsl.Behaviors +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + class RoutingLogicSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with Matchers with LogCapturing { val emptyMessage: Any = "" diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/javadsl/AdaptationFailureSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/javadsl/AdaptationFailureSpec.scala index 93270fc148..d59ea1cb5f 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/javadsl/AdaptationFailureSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/javadsl/AdaptationFailureSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.actor.typed.javadsl import scala.concurrent.Promise -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.TestException @@ -27,6 +25,8 @@ import pekko.actor.typed.MessageAdaptionFailure import pekko.actor.typed.PreRestart import pekko.actor.typed.Terminated +import org.scalatest.wordspec.AnyWordSpecLike + object AdaptationFailureSpec { def emptyAbstractBehavior: Behavior[Any] = Behaviors.setup(new EmptyAbstractBehavior(_)) class EmptyAbstractBehavior(ctx: ActorContext[Any]) extends AbstractBehavior[Any](ctx) { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/pubsub/LocalPubSubSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/pubsub/LocalPubSubSpec.scala index 08198f23dc..0d658409b2 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/pubsub/LocalPubSubSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/pubsub/LocalPubSubSpec.scala @@ -15,12 +15,12 @@ package org.apache.pekko.actor.typed.pubsub import scala.concurrent.duration._ -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit +import org.scalatest.wordspec.AnyWordSpecLike + class LocalPubSubSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "A pub-sub topic running locally" must { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorContextAskSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorContextAskSpec.scala index 42341dea04..b8e8ab731e 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorContextAskSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorContextAskSpec.scala @@ -13,15 +13,13 @@ package org.apache.pekko.actor.typed.scaladsl -import org.apache.pekko.actor.testkit.typed.TestException - import scala.concurrent.TimeoutException import scala.concurrent.duration._ import scala.reflect.ClassTag import scala.util.{ Failure, Success } -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike + import org.apache.pekko +import org.apache.pekko.actor.testkit.typed.TestException import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.LoggingTestKit import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -29,6 +27,10 @@ import pekko.actor.testkit.typed.scaladsl.TestProbe import pekko.actor.typed.{ ActorRef, PostStop, Props } import pekko.pattern.StatusReply +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + object ActorContextAskSpec { val config = ConfigFactory.parseString(""" ping-pong-dispatcher { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorContextDelegateSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorContextDelegateSpec.scala index 28aa1d6354..7c5a239132 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorContextDelegateSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorContextDelegateSpec.scala @@ -18,6 +18,7 @@ import pekko.actor.UnhandledMessage import pekko.actor.testkit.typed.TestKitSettings import pekko.actor.testkit.typed.scaladsl.{ FishingOutcomes, LogCapturing, ScalaTestWithActorTestKit, TestProbe } import pekko.actor.typed.{ ActorRef, Behavior } + import org.scalatest.wordspec.AnyWordSpecLike object ActorContextDelegateSpec { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorContextPipeToSelfSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorContextPipeToSelfSpec.scala index 1282f63caa..29b21b396c 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorContextPipeToSelfSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorContextPipeToSelfSpec.scala @@ -18,15 +18,16 @@ import scala.concurrent.Promise import scala.util.{ Failure, Success } import scala.util.control.NoStackTrace -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.{ ScalaTestWithActorTestKit, TestProbe } import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.LoggingTestKit import pekko.actor.typed.Props +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + object ActorContextPipeToSelfSpec { val config = ConfigFactory.parseString(""" |pipe-to-self-spec-dispatcher { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorLoggingSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorLoggingSpec.scala index 769855a14c..b8c7d9792d 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorLoggingSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorLoggingSpec.scala @@ -16,12 +16,6 @@ package org.apache.pekko.actor.typed.scaladsl import java.util.concurrent.atomic.AtomicInteger import java.util.concurrent.atomic.AtomicReference -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike -import org.slf4j.LoggerFactory -import org.slf4j.MDC -import org.slf4j.helpers.BasicMarkerFactory - import org.apache.pekko import pekko.actor.ActorPath import pekko.actor.ActorSystem @@ -41,6 +35,14 @@ import pekko.event.Logging.DefaultLogger import pekko.event.slf4j.Slf4jLogger import pekko.event.slf4j.Slf4jLoggingFilter +import org.scalatest.wordspec.AnyWordSpecLike + +import org.slf4j.LoggerFactory +import org.slf4j.MDC +import org.slf4j.helpers.BasicMarkerFactory + +import com.typesafe.config.ConfigFactory + class SomeClass object WhereTheBehaviorIsDefined { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorThreadSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorThreadSpec.scala index f13ddd45f1..8f79e5ff23 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorThreadSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ActorThreadSpec.scala @@ -27,6 +27,7 @@ import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import pekko.actor.typed.ActorRef import pekko.actor.typed.Behavior import pekko.actor.typed.scaladsl.ActorThreadSpec.Echo + import org.scalatest.wordspec.AnyWordSpecLike object ActorThreadSpec { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/AdaptationFailureSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/AdaptationFailureSpec.scala index a9cc64e1e5..2a8aa0c1aa 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/AdaptationFailureSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/AdaptationFailureSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.actor.typed.scaladsl import scala.concurrent.Promise -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.TestException @@ -28,6 +26,8 @@ import pekko.actor.typed.PreRestart import pekko.actor.typed.Signal import pekko.actor.typed.Terminated +import org.scalatest.wordspec.AnyWordSpecLike + object AdaptationFailureSpec { def emptyAbstractBehavior: Behavior[Any] = Behaviors.setup(new EmptyAbstractBehavior(_)) diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/DispatcherSelectorSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/DispatcherSelectorSpec.scala index 62dcd12c5e..9f8160647a 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/DispatcherSelectorSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/DispatcherSelectorSpec.scala @@ -13,10 +13,6 @@ package org.apache.pekko.actor.typed.scaladsl -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.BootstrapSetup import pekko.actor.setup.ActorSystemSetup @@ -30,8 +26,13 @@ import pekko.actor.typed.ActorSystem import pekko.actor.typed.Behavior import pekko.actor.typed.DispatcherSelector import pekko.actor.typed.Props -import pekko.actor.typed.scaladsl.AskPattern._ import pekko.actor.typed.SpawnProtocol +import pekko.actor.typed.scaladsl.AskPattern._ + +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory object DispatcherSelectorSpec { val config = ConfigFactory.parseString(""" diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/GracefulStopSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/GracefulStopSpec.scala index dcbce75095..d3ad36b3c8 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/GracefulStopSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/GracefulStopSpec.scala @@ -14,8 +14,6 @@ package org.apache.pekko.actor.typed package scaladsl -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.Done import pekko.NotUsed @@ -23,6 +21,8 @@ import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import pekko.actor.testkit.typed.scaladsl.TestProbe +import org.scalatest.wordspec.AnyWordSpecLike + final class GracefulStopSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "Graceful stop" must { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/LoggerOpsSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/LoggerOpsSpec.scala index 4bea708d6a..b4775e4f1b 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/LoggerOpsSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/LoggerOpsSpec.scala @@ -13,14 +13,15 @@ package org.apache.pekko.actor.typed.scaladsl -import org.scalatest.wordspec.AnyWordSpecLike -import org.slf4j.LoggerFactory - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.LoggingTestKit import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit +import org.scalatest.wordspec.AnyWordSpecLike + +import org.slf4j.LoggerFactory + object LoggerOpsSpec { case class Value1(i: Int) case class Value2(i: Int) diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/MailboxSelectorSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/MailboxSelectorSpec.scala index 0f9b6a42c7..32f549bc5b 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/MailboxSelectorSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/MailboxSelectorSpec.scala @@ -17,10 +17,6 @@ package org.apache.pekko.actor.typed.scaladsl -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.ActorCell import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -38,6 +34,11 @@ import pekko.dispatch.Dispatchers import pekko.dispatch.MessageQueue import pekko.dispatch.NodeMessageQueue +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object MailboxSelectorSpec { val config = ConfigFactory.parseString( """ diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/MessageAdapterSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/MessageAdapterSpec.scala index a45a03e875..d05d42e02e 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/MessageAdapterSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/MessageAdapterSpec.scala @@ -13,10 +13,6 @@ package org.apache.pekko.actor.typed.scaladsl -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike -import org.slf4j.LoggerFactory - import org.apache.pekko import pekko.actor.DeadLetter import pekko.actor.testkit.typed.TestException @@ -31,6 +27,12 @@ import pekko.actor.typed.PostStop import pekko.actor.typed.Props import pekko.actor.typed.internal.AdaptMessage +import org.scalatest.wordspec.AnyWordSpecLike + +import org.slf4j.LoggerFactory + +import com.typesafe.config.ConfigFactory + object MessageAdapterSpec { val config = ConfigFactory.parseString(""" pekko.log-dead-letters = on diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/OnSignalSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/OnSignalSpec.scala index 570c77491b..6c81d4178a 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/OnSignalSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/OnSignalSpec.scala @@ -14,8 +14,6 @@ package org.apache.pekko.actor.typed package scaladsl -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.scaladsl.ActorTestKit @@ -23,6 +21,8 @@ import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import pekko.actor.testkit.typed.scaladsl.TestProbe +import org.scalatest.wordspec.AnyWordSpecLike + final class OnSignalSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "An Actor.OnSignal behavior" must { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ReceivePartialSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ReceivePartialSpec.scala index 45545ebc12..9553e94f63 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ReceivePartialSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/ReceivePartialSpec.scala @@ -16,13 +16,13 @@ package scaladsl import scala.concurrent.ExecutionContextExecutor -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import pekko.actor.testkit.typed.scaladsl.TestProbe +import org.scalatest.wordspec.AnyWordSpecLike + class ReceivePartialSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { implicit val ec: ExecutionContextExecutor = system.executionContext diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/RoutersSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/RoutersSpec.scala index a332ccf4a6..40f867d5c7 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/RoutersSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/RoutersSpec.scala @@ -13,8 +13,7 @@ package org.apache.pekko.actor.typed.scaladsl import java.util.concurrent.atomic.AtomicInteger -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike + import org.apache.pekko import pekko.actor.{ ActorPath, ActorSystem } import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -28,6 +27,9 @@ import pekko.actor.typed.receptionist.Receptionist import pekko.actor.typed.receptionist.ServiceKey import pekko.actor.typed.scaladsl.adapter._ +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + class RoutersSpec extends ScalaTestWithActorTestKit(""" pekko.loglevel=debug """) with AnyWordSpecLike with Matchers with LogCapturing { diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/StashBufferSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/StashBufferSpec.scala index 9841a09ab6..05e4a597a1 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/StashBufferSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/StashBufferSpec.scala @@ -13,15 +13,15 @@ package org.apache.pekko.actor.typed.scaladsl -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.testkit.typed.internal.StubbedActorContext import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.TestInbox import pekko.actor.typed.Behavior +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class StashBufferSpec extends AnyWordSpec with Matchers with LogCapturing { val context = new StubbedActorContext[String]( diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/StashSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/StashSpec.scala index cfe803dd03..496e4d1f5e 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/StashSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/StashSpec.scala @@ -19,8 +19,6 @@ import java.util.concurrent.TimeUnit import scala.concurrent.duration._ -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.TestException import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -28,6 +26,8 @@ import pekko.actor.testkit.typed.scaladsl.LoggingTestKit import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import pekko.actor.testkit.typed.scaladsl.TestProbe +import org.scalatest.wordspec.AnyWordSpecLike + object AbstractStashSpec { sealed trait Command final case class Msg(s: String) extends Command diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/StopSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/StopSpec.scala index ef73035499..770f1d7164 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/StopSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/StopSpec.scala @@ -13,8 +13,6 @@ package org.apache.pekko.actor.typed.scaladsl -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -25,6 +23,8 @@ import pekko.actor.typed.Behavior import pekko.actor.typed.BehaviorInterceptor import pekko.actor.typed.PostStop +import org.scalatest.wordspec.AnyWordSpecLike + class StopSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import BehaviorInterceptor._ diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/adapter/AdapterSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/adapter/AdapterSpec.scala index 0118fd2aac..8bc0fbb73c 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/adapter/AdapterSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/adapter/AdapterSpec.scala @@ -15,10 +15,6 @@ package org.apache.pekko.actor.typed.scaladsl.adapter import scala.util.control.NoStackTrace -import org.scalatest.BeforeAndAfterAll -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.{ actor => classic } import pekko.Done @@ -37,6 +33,10 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.serialization.SerializationExtension import pekko.testkit._ +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + object AdapterSpec { val classic1: classic.Props = classic.Props(new Classic1) diff --git a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/adapter/GuardianStartupSpec.scala b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/adapter/GuardianStartupSpec.scala index a2a14118ed..294ea4d081 100644 --- a/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/adapter/GuardianStartupSpec.scala +++ b/actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/adapter/GuardianStartupSpec.scala @@ -16,10 +16,6 @@ package org.apache.pekko.actor.typed.scaladsl.adapter import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit -import org.scalatest.concurrent.ScalaFutures -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.ActorSystemImpl import pekko.actor.testkit.typed.scaladsl.ActorTestKit @@ -27,6 +23,10 @@ import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.typed.ActorSystem import pekko.actor.typed.scaladsl.Behaviors +import org.scalatest.concurrent.ScalaFutures +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class GuardianStartupSpec extends AnyWordSpec with Matchers with ScalaFutures with LogCapturing { "The user guardian" must { diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/ActorSystem.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/ActorSystem.scala index d60d91077e..4610e563c0 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/ActorSystem.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/ActorSystem.scala @@ -17,8 +17,6 @@ import java.util.concurrent.{ CompletionStage, ThreadFactory } import scala.concurrent.{ ExecutionContextExecutor, Future } -import com.typesafe.config.{ Config, ConfigFactory } -import org.slf4j.Logger import org.apache.pekko import pekko.{ actor => classic, Done } import pekko.actor.{ Address, BootstrapSetup, ClassicActorSystemProvider } @@ -30,6 +28,10 @@ import pekko.actor.typed.receptionist.Receptionist import pekko.annotation.DoNotInherit import pekko.util.Helpers.{ ConfigOps, Requiring } +import org.slf4j.Logger + +import com.typesafe.config.{ Config, ConfigFactory } + /** * An ActorSystem is home to a hierarchy of Actors. It is created using * [[ActorSystem#apply]] from a [[Behavior]] object that describes the root diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/LogOptions.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/LogOptions.scala index 0534e8d745..b9c0db1d1a 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/LogOptions.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/LogOptions.scala @@ -15,11 +15,11 @@ package org.apache.pekko.actor.typed import java.util.Optional +import org.apache.pekko.annotation.{ DoNotInherit, InternalApi } + import org.slf4j.Logger import org.slf4j.event.Level -import org.apache.pekko.annotation.{ DoNotInherit, InternalApi } - /** * Logging options when using `Behaviors.logMessages`. */ diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/Props.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/Props.scala index 0fd9c10318..45993e2220 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/Props.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/Props.scala @@ -15,13 +15,13 @@ package org.apache.pekko.actor.typed import scala.annotation.tailrec import scala.annotation.varargs +import scala.jdk.CollectionConverters._ import scala.reflect.ClassTag import org.apache.pekko import pekko.actor.typed.internal.PropsImpl._ import pekko.annotation.DoNotInherit import pekko.annotation.InternalApi -import scala.jdk.CollectionConverters._ object Props { diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/SupervisorStrategy.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/SupervisorStrategy.scala index 7ec90c850b..9f6f8d163b 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/SupervisorStrategy.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/SupervisorStrategy.scala @@ -15,13 +15,13 @@ package org.apache.pekko.actor.typed import scala.concurrent.duration.Duration import scala.concurrent.duration.FiniteDuration - -import org.slf4j.event.Level +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.annotation.DoNotInherit import pekko.annotation.InternalApi -import scala.jdk.DurationConverters._ + +import org.slf4j.event.Level object SupervisorStrategy { diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/ConsumerController.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/ConsumerController.scala index 5300b96dc8..94ccc54ed5 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/ConsumerController.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/ConsumerController.scala @@ -16,8 +16,7 @@ package org.apache.pekko.actor.typed.delivery import java.time.{ Duration => JavaDuration } import scala.concurrent.duration._ - -import com.typesafe.config.Config +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.actor.DeadLetterSuppression @@ -33,7 +32,8 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.annotation.ApiMayChange import pekko.annotation.DoNotInherit import pekko.annotation.InternalApi -import scala.jdk.DurationConverters._ + +import com.typesafe.config.Config /** * `ConsumerController` and [[ProducerController]] or [[WorkPullingProducerController]] are used diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/ProducerController.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/ProducerController.scala index 850fa84cf7..d385bd0d8b 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/ProducerController.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/ProducerController.scala @@ -17,10 +17,10 @@ import java.time.{ Duration => JavaDuration } import java.util.Optional import scala.concurrent.duration._ +import scala.jdk.DurationConverters._ +import scala.jdk.OptionConverters._ import scala.reflect.ClassTag -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.actor.typed.ActorSystem @@ -30,10 +30,10 @@ import pekko.actor.typed.delivery.internal.ProducerControllerImpl import pekko.actor.typed.scaladsl.Behaviors import pekko.annotation.ApiMayChange import pekko.annotation.InternalApi -import pekko.util.Helpers.toRootLowerCase import pekko.util.Helpers.Requiring -import scala.jdk.DurationConverters._ -import scala.jdk.OptionConverters._ +import pekko.util.Helpers.toRootLowerCase + +import com.typesafe.config.Config /** * Point-to-point reliable delivery between a single producer actor sending messages and a single consumer diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/WorkPullingProducerController.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/WorkPullingProducerController.scala index 6b6d4126fb..3542f83748 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/WorkPullingProducerController.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/WorkPullingProducerController.scala @@ -16,10 +16,10 @@ package org.apache.pekko.actor.typed.delivery import java.util.Optional import scala.concurrent.duration.FiniteDuration +import scala.jdk.DurationConverters._ +import scala.jdk.OptionConverters._ import scala.reflect.ClassTag -import com.typesafe.config.Config - import org.apache.pekko import pekko.Done import pekko.actor.typed.ActorRef @@ -29,8 +29,8 @@ import pekko.actor.typed.delivery.internal.WorkPullingProducerControllerImpl import pekko.actor.typed.receptionist.ServiceKey import pekko.actor.typed.scaladsl.Behaviors import pekko.annotation.ApiMayChange -import scala.jdk.DurationConverters._ -import scala.jdk.OptionConverters._ + +import com.typesafe.config.Config /** * Work pulling is a pattern where several worker actors pull tasks in their own pace from diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/eventstream/EventStream.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/eventstream/EventStream.scala index 9b39cfd1b9..2772dfb339 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/eventstream/EventStream.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/eventstream/EventStream.scala @@ -14,6 +14,7 @@ package org.apache.pekko.actor.typed.eventstream import scala.reflect.ClassTag + import org.apache.pekko import pekko.actor.InvalidMessageException import pekko.actor.typed.ActorRef diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorContextImpl.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorContextImpl.scala index 1bf8ff5829..3c267d9f0d 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorContextImpl.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorContextImpl.scala @@ -18,25 +18,27 @@ import java.time.Duration import java.util.ArrayList import java.util.Optional import java.util.concurrent.CompletionStage -import scala.concurrent.{ ExecutionContextExecutor, Future } -import scala.reflect.ClassTag -import scala.util.Try + import scala.annotation.{ nowarn, switch } -import org.slf4j.Logger -import org.slf4j.LoggerFactory +import scala.concurrent.{ ExecutionContextExecutor, Future } +import scala.concurrent.ExecutionContext +import scala.jdk.DurationConverters._ +import scala.reflect.ClassTag +import scala.util.Failure +import scala.util.Success +import scala.util.Try + import org.apache.pekko import pekko.actor.Address import pekko.actor.typed.internal.adapter.ActorSystemAdapter import pekko.annotation.InternalApi -import scala.concurrent.ExecutionContext import pekko.pattern.StatusReply import pekko.util.BoxedType -import scala.jdk.DurationConverters._ import pekko.util.OptionVal import pekko.util.Timeout -import scala.util.Failure -import scala.util.Success +import org.slf4j.Logger +import org.slf4j.LoggerFactory /** * INTERNAL API diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorMdc.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorMdc.scala index a89855cb0f..0b9b68cff8 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorMdc.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorMdc.scala @@ -13,10 +13,10 @@ package org.apache.pekko.actor.typed.internal -import org.slf4j.MDC - import org.apache.pekko.annotation.InternalApi +import org.slf4j.MDC + /** * INTERNAL API */ diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/BehaviorImpl.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/BehaviorImpl.scala index 20485d885f..7fa5c7c83d 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/BehaviorImpl.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/BehaviorImpl.scala @@ -14,14 +14,14 @@ package org.apache.pekko.actor.typed package internal +import scala.reflect.ClassTag + import org.apache.pekko -import pekko.actor.typed.scaladsl.{ ActorContext => SAC } import pekko.actor.typed.{ TypedActorContext => AC } +import pekko.actor.typed.scaladsl.{ ActorContext => SAC } import pekko.annotation.InternalApi import pekko.util.{ LineNumbers, OptionVal } -import scala.reflect.ClassTag - /** * INTERNAL API */ diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ExtensionsImpl.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ExtensionsImpl.scala index bdd09534a5..5b2ec2a190 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ExtensionsImpl.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ExtensionsImpl.scala @@ -16,13 +16,13 @@ package org.apache.pekko.actor.typed.internal import java.util.concurrent.{ ConcurrentHashMap, CountDownLatch } import scala.annotation.tailrec +import scala.jdk.CollectionConverters._ import scala.util.{ Failure, Success, Try } import org.apache.pekko import pekko.actor.typed.{ ActorSystem, Extension, ExtensionId, Extensions } import pekko.actor.typed.ExtensionSetup import pekko.annotation.InternalApi -import scala.jdk.CollectionConverters._ /** * INTERNAL API diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/InterceptorImpl.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/InterceptorImpl.scala index 0763b22487..4838105e3c 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/InterceptorImpl.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/InterceptorImpl.scala @@ -15,9 +15,6 @@ package org.apache.pekko.actor.typed.internal import scala.reflect.ClassTag -import org.slf4j.LoggerFactory -import org.slf4j.event.Level - import org.apache.pekko import pekko.actor.typed import pekko.actor.typed._ @@ -26,6 +23,9 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.annotation.InternalApi import pekko.util.LineNumbers +import org.slf4j.LoggerFactory +import org.slf4j.event.Level + /** * Provides the impl of any behavior that could nest another behavior * diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/StashBufferImpl.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/StashBufferImpl.scala index 029c924962..d94480e0dd 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/StashBufferImpl.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/StashBufferImpl.scala @@ -13,8 +13,12 @@ package org.apache.pekko.actor.typed.internal +import java.util.function.{ Function => JFunction } +import java.util.function.Predicate + import scala.annotation.tailrec import scala.util.control.NonFatal + import org.apache.pekko import pekko.actor.DeadLetter import pekko.actor.typed.Behavior @@ -28,9 +32,6 @@ import pekko.japi.function.Procedure import pekko.util.{ unused, ConstantFun } import pekko.util.OptionVal -import java.util.function.{ Function => JFunction } -import java.util.function.Predicate - /** * INTERNAL API */ diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/Supervision.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/Supervision.scala index bbc4366cb2..56e0ca8d57 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/Supervision.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/Supervision.scala @@ -19,9 +19,10 @@ import java.util.concurrent.ThreadLocalRandom import scala.concurrent.duration.Deadline import scala.concurrent.duration.FiniteDuration import scala.reflect.ClassTag +import scala.util.Try import scala.util.control.Exception.Catcher import scala.util.control.NonFatal -import org.slf4j.event.Level + import org.apache.pekko import pekko.actor.DeadLetterSuppression import pekko.actor.Dropped @@ -36,7 +37,7 @@ import pekko.event.Logging import pekko.util.OptionVal import pekko.util.unused -import scala.util.Try +import org.slf4j.event.Level /** * INTERNAL API diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/TimerSchedulerImpl.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/TimerSchedulerImpl.scala index 7724f3cdf8..8672770e2e 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/TimerSchedulerImpl.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/TimerSchedulerImpl.scala @@ -16,15 +16,16 @@ package internal import java.time.Duration +import scala.concurrent.ExecutionContext +import scala.concurrent.duration.FiniteDuration + import org.apache.pekko import pekko.actor.{ Cancellable, NotInfluenceReceiveTimeout } import pekko.actor.typed.scaladsl.{ ActorContext, LoggerOps } import pekko.annotation.InternalApi -import scala.concurrent.ExecutionContext import pekko.util.OptionVal -import org.slf4j.Logger -import scala.concurrent.duration.FiniteDuration +import org.slf4j.Logger /** * INTERNAL API diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/WithMdcBehaviorInterceptor.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/WithMdcBehaviorInterceptor.scala index cf7b371e24..5f1ea08f53 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/WithMdcBehaviorInterceptor.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/WithMdcBehaviorInterceptor.scala @@ -15,12 +15,12 @@ package org.apache.pekko.actor.typed.internal import scala.reflect.ClassTag -import org.slf4j.MDC - import org.apache.pekko import pekko.actor.typed.{ Behavior, BehaviorInterceptor, Signal, TypedActorContext } import pekko.annotation.InternalApi +import org.slf4j.MDC + /** * INTERNAL API */ diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorSystemAdapter.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorSystemAdapter.scala index 708c42e19d..8a1c8965aa 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorSystemAdapter.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorSystemAdapter.scala @@ -16,8 +16,7 @@ package org.apache.pekko.actor.typed.internal.adapter import java.util.concurrent.CompletionStage import scala.concurrent.ExecutionContextExecutor - -import org.slf4j.{ Logger, LoggerFactory } +import scala.jdk.FutureConverters._ import org.apache.pekko import pekko.{ actor => classic } @@ -42,7 +41,8 @@ import pekko.actor.typed.internal.PropsImpl.DispatcherSameAsParent import pekko.actor.typed.internal.SystemMessage import pekko.actor.typed.scaladsl.Behaviors import pekko.annotation.InternalApi -import scala.jdk.FutureConverters._ + +import org.slf4j.{ Logger, LoggerFactory } /** * INTERNAL API. Lightweight wrapper for presenting a classic ActorSystem to a Behavior (via the context). diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/ReceptionistMessages.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/ReceptionistMessages.scala index 3676e528fa..bc7809a580 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/ReceptionistMessages.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/ReceptionistMessages.scala @@ -13,12 +13,13 @@ package org.apache.pekko.actor.typed.internal.receptionist +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.actor.typed.receptionist.{ Receptionist, ServiceKey } import pekko.actor.typed.receptionist.Receptionist.Command import pekko.annotation.InternalApi -import scala.jdk.CollectionConverters._ /** * Internal API diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/routing/PoolRouterImpl.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/routing/PoolRouterImpl.scala index 8789052ad6..a8c016fde5 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/routing/PoolRouterImpl.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/routing/PoolRouterImpl.scala @@ -13,6 +13,9 @@ package org.apache.pekko.actor.typed.internal.routing +import java.util.function +import java.util.function.Predicate + import org.apache.pekko import pekko.actor.typed._ import pekko.actor.typed.javadsl.PoolRouter @@ -20,9 +23,6 @@ import pekko.actor.typed.scaladsl.{ AbstractBehavior, ActorContext, Behaviors } import pekko.annotation.InternalApi import pekko.util.ConstantFun -import java.util.function -import java.util.function.Predicate - /** * INTERNAL API */ diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/ActorContext.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/ActorContext.scala index 7dab2e674f..dac41e86be 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/ActorContext.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/ActorContext.scala @@ -18,13 +18,15 @@ import java.util.Optional import java.util.concurrent.CompletionStage import scala.concurrent.ExecutionContextExecutor -import org.slf4j.Logger + import org.apache.pekko import pekko.actor.ClassicActorContextProvider import pekko.actor.typed._ import pekko.annotation.DoNotInherit import pekko.pattern.StatusReply +import org.slf4j.Logger + /** * An Actor is given by the combination of a [[Behavior]] and a context in * which this behavior is executed. As per the Actor Model an Actor can perform diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/AskPattern.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/AskPattern.scala index e2c1d3fba3..62440e97b2 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/AskPattern.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/AskPattern.scala @@ -17,13 +17,14 @@ package javadsl import java.time.Duration import java.util.concurrent.CompletionStage +import scala.jdk.DurationConverters._ +import scala.jdk.FutureConverters._ + import org.apache.pekko import pekko.actor.typed.Scheduler import pekko.actor.typed.scaladsl.AskPattern._ import pekko.japi.function.{ Function => JFunction } import pekko.pattern.StatusReply -import scala.jdk.FutureConverters._ -import scala.jdk.DurationConverters._ /** * The ask-pattern implements the initiator side of a request–reply protocol. diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/Behaviors.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/Behaviors.scala index 9a754a8e50..0556652034 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/Behaviors.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/Behaviors.scala @@ -16,6 +16,7 @@ package org.apache.pekko.actor.typed.javadsl import java.util.Collections import java.util.function.{ Function => JFunction, Supplier } +import scala.jdk.CollectionConverters._ import scala.reflect.ClassTag import org.apache.pekko @@ -23,7 +24,6 @@ import pekko.actor.typed._ import pekko.actor.typed.internal.{ BehaviorImpl, StashBufferImpl, TimerSchedulerImpl, WithMdcBehaviorInterceptor } import pekko.japi.function.{ Effect, Function2 => JapiFunction2 } import pekko.japi.pf.PFBuilder -import scala.jdk.CollectionConverters._ import pekko.util.unused /** diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/ReceiveBuilder.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/ReceiveBuilder.scala index ec60a85f74..1b72e8cab4 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/ReceiveBuilder.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/ReceiveBuilder.scala @@ -13,14 +13,14 @@ package org.apache.pekko.actor.typed.javadsl +import scala.annotation.tailrec + import org.apache.pekko import pekko.actor.typed.{ Behavior, MessageAdaptionFailure, Signal } import pekko.annotation.InternalApi import pekko.japi.function.{ Creator, Function => JFunction, Predicate => JPredicate } import pekko.util.OptionVal -import scala.annotation.tailrec - /** * Mutable builder used when implementing [[AbstractBehavior]]. * diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/Routers.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/Routers.scala index d7367220c7..0bdbf7e3f0 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/Routers.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/Routers.scala @@ -13,6 +13,8 @@ package org.apache.pekko.actor.typed.javadsl +import java.util.function.Predicate + import org.apache.pekko import pekko.actor.typed.{ Behavior, Props } import pekko.actor.typed.internal.BehaviorImpl.DeferredBehavior @@ -20,8 +22,6 @@ import pekko.actor.typed.internal.routing.{ GroupRouterBuilder, PoolRouterBuilde import pekko.actor.typed.receptionist.ServiceKey import pekko.annotation.DoNotInherit -import java.util.function.Predicate - object Routers { /** diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/StashBuffer.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/StashBuffer.scala index f63d7d5c17..1ddf7f4b81 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/StashBuffer.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/StashBuffer.scala @@ -13,13 +13,13 @@ package org.apache.pekko.actor.typed.javadsl +import java.util.function.{ Function => JFunction, Predicate } + import org.apache.pekko import pekko.actor.typed.{ scaladsl, Behavior } import pekko.annotation.DoNotInherit import pekko.japi.function.Procedure -import java.util.function.{ Function => JFunction, Predicate } - /** * A non thread safe mutable message buffer that can be used to buffer messages inside actors * and then unstash them. diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/receptionist/Receptionist.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/receptionist/Receptionist.scala index d04aaa498e..b6fdb63441 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/receptionist/Receptionist.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/receptionist/Receptionist.scala @@ -13,13 +13,13 @@ package org.apache.pekko.actor.typed.receptionist +import scala.jdk.CollectionConverters._ import scala.reflect.ClassTag import org.apache.pekko import pekko.actor.typed.{ ActorRef, ActorSystem, Extension, ExtensionId, ExtensionSetup } import pekko.actor.typed.internal.receptionist._ import pekko.annotation.DoNotInherit -import scala.jdk.CollectionConverters._ /** * Register and discover actors that implement a service with a protocol defined by a [[ServiceKey]]. diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/ActorContext.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/ActorContext.scala index b8448cc2a7..4e7a9d3328 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/ActorContext.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/ActorContext.scala @@ -17,7 +17,7 @@ import scala.concurrent.{ ExecutionContextExecutor, Future } import scala.concurrent.duration.FiniteDuration import scala.reflect.ClassTag import scala.util.Try -import org.slf4j.Logger + import org.apache.pekko import pekko.actor.ClassicActorContextProvider import pekko.actor.typed._ @@ -26,6 +26,8 @@ import pekko.annotation.InternalApi import pekko.pattern.StatusReply import pekko.util.Timeout +import org.slf4j.Logger + /** * An Actor is given by the combination of a [[Behavior]] and a context in * which this behavior is executed. As per the Actor Model an Actor can perform diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/AskPattern.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/AskPattern.scala index 709d7a730f..c1e5993a37 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/AskPattern.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/AskPattern.scala @@ -15,8 +15,9 @@ package org.apache.pekko.actor.typed.scaladsl import java.util.concurrent.TimeoutException -import scala.concurrent.Future import scala.annotation.nowarn +import scala.concurrent.Future + import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.actor.typed.ActorSystem diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/Behaviors.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/Behaviors.scala index 93c71616c7..0d224f499d 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/Behaviors.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/Behaviors.scala @@ -15,8 +15,9 @@ package org.apache.pekko.actor.typed package scaladsl import scala.reflect.ClassTag + import org.apache.pekko -import org.apache.pekko.actor.typed.SuperviseBehavior +import pekko.actor.typed.SuperviseBehavior import pekko.actor.typed.internal._ import pekko.annotation.{ DoNotInherit, InternalApi } diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/TimerScheduler.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/TimerScheduler.scala index f121810e2e..95e4e4ea00 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/TimerScheduler.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/TimerScheduler.scala @@ -13,10 +13,10 @@ package org.apache.pekko.actor.typed.scaladsl -import org.apache.pekko.annotation.DoNotInherit - import scala.concurrent.duration.FiniteDuration +import org.apache.pekko.annotation.DoNotInherit + /** * Support for scheduled `self` messages in an actor. * It is used with `Behaviors.withTimers`. diff --git a/actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala b/actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala index 412ae84c09..ae56c30df0 100644 --- a/actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala +++ b/actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala @@ -14,14 +14,15 @@ package org.apache.pekko.util import java.nio.{ ByteBuffer, ByteOrder } + +import scala.annotation.nowarn import scala.annotation.tailrec import scala.collection.BufferedIterator import scala.collection.LinearSeq import scala.collection.mutable.ListBuffer import scala.reflect.ClassTag -import org.apache.pekko.util.Collections.EmptyImmutableSeq -import scala.annotation.nowarn +import org.apache.pekko.util.Collections.EmptyImmutableSeq object ByteIterator { object ByteArrayIterator { diff --git a/actor/src/main/scala-2.13/org/apache/pekko/util/ByteString.scala b/actor/src/main/scala-2.13/org/apache/pekko/util/ByteString.scala index 5db8d7e45c..277960a4b5 100644 --- a/actor/src/main/scala-2.13/org/apache/pekko/util/ByteString.scala +++ b/actor/src/main/scala-2.13/org/apache/pekko/util/ByteString.scala @@ -18,6 +18,7 @@ import java.lang.{ Iterable => JIterable } import java.nio.{ ByteBuffer, ByteOrder } import java.nio.charset.{ Charset, StandardCharsets } import java.util.Base64 + import scala.annotation.{ nowarn, tailrec, varargs } import scala.collection.{ immutable, mutable } import scala.collection.immutable.{ IndexedSeq, IndexedSeqOps, StrictOptimizedSeqOps, VectorBuilder } diff --git a/actor/src/main/scala/org/apache/pekko/actor/AbstractFSM.scala b/actor/src/main/scala/org/apache/pekko/actor/AbstractFSM.scala index b252005c92..60d7b46424 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/AbstractFSM.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/AbstractFSM.scala @@ -14,10 +14,10 @@ package org.apache.pekko.actor import scala.concurrent.duration.FiniteDuration +import scala.jdk.DurationConverters._ import org.apache.pekko import org.apache.pekko.japi.function.{ Effect, Function2, Predicate, Predicate2, Procedure, Procedure2, Procedure3 } -import scala.jdk.DurationConverters._ /** * Java API: compatible with lambda expressions diff --git a/actor/src/main/scala/org/apache/pekko/actor/AbstractProps.scala b/actor/src/main/scala/org/apache/pekko/actor/AbstractProps.scala index ae3e955982..4fa0d2dbe1 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/AbstractProps.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/AbstractProps.scala @@ -13,8 +13,8 @@ package org.apache.pekko.actor -import java.lang.reflect.Modifier import java.lang.reflect.Constructor +import java.lang.reflect.Modifier import scala.annotation.tailrec import scala.annotation.varargs diff --git a/actor/src/main/scala/org/apache/pekko/actor/ActorPath.scala b/actor/src/main/scala/org/apache/pekko/actor/ActorPath.scala index 21cb084168..fe22af4a6c 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/ActorPath.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/ActorPath.scala @@ -15,13 +15,12 @@ package org.apache.pekko.actor import java.lang.{ StringBuilder => JStringBuilder } import java.net.MalformedURLException +import scala.annotation.nowarn import scala.annotation.tailrec import scala.collection.immutable - -import scala.annotation.nowarn +import scala.jdk.CollectionConverters._ import org.apache.pekko -import scala.jdk.CollectionConverters._ /** * Java API diff --git a/actor/src/main/scala/org/apache/pekko/actor/ActorSelection.scala b/actor/src/main/scala/org/apache/pekko/actor/ActorSelection.scala index df49ea903e..0cc578f23a 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/ActorSelection.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/ActorSelection.scala @@ -16,18 +16,17 @@ package org.apache.pekko.actor import java.util.concurrent.CompletionStage import java.util.regex.Pattern +import scala.annotation.nowarn import scala.annotation.tailrec import scala.collection.immutable +import scala.concurrent.ExecutionContext import scala.concurrent.Future import scala.concurrent.Promise import scala.concurrent.duration._ import scala.language.implicitConversions import scala.util.Success -import scala.annotation.nowarn - import org.apache.pekko -import scala.concurrent.ExecutionContext import pekko.pattern.ask import pekko.routing.MurmurHash import pekko.util.{ Helpers, Timeout } @@ -105,8 +104,8 @@ abstract class ActorSelection extends Serializable { * supplied `timeout`. */ def resolveOne(timeout: java.time.Duration): CompletionStage[ActorRef] = { - import scala.jdk.FutureConverters._ import scala.jdk.DurationConverters._ + import scala.jdk.FutureConverters._ resolveOne(timeout.toScala).asJava } diff --git a/actor/src/main/scala/org/apache/pekko/actor/ActorSystem.scala b/actor/src/main/scala/org/apache/pekko/actor/ActorSystem.scala index 5f02c3d9c4..d114981732 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/ActorSystem.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/ActorSystem.scala @@ -23,11 +23,12 @@ import scala.collection.immutable import scala.concurrent.{ ExecutionContext, ExecutionContextExecutor, Future, Promise } import scala.concurrent.blocking import scala.concurrent.duration.Duration +import scala.jdk.CollectionConverters._ +import scala.jdk.FutureConverters._ +import scala.jdk.OptionConverters._ import scala.util.{ Failure, Success, Try } import scala.util.control.{ ControlThrowable, NonFatal } -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.ConfigurationException import pekko.actor.dungeon.ChildrenContainer @@ -40,10 +41,9 @@ import pekko.event.Logging.DefaultLogger import pekko.japi.Util.immutableSeq import pekko.serialization.SerializationExtension import pekko.util._ -import scala.jdk.FutureConverters._ -import scala.jdk.OptionConverters._ import pekko.util.Helpers.toRootLowerCase -import scala.jdk.CollectionConverters._ + +import com.typesafe.config.{ Config, ConfigFactory } object BootstrapSetup { diff --git a/actor/src/main/scala/org/apache/pekko/actor/Address.scala b/actor/src/main/scala/org/apache/pekko/actor/Address.scala index c38c44c3a1..e13cb96bac 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/Address.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/Address.scala @@ -20,10 +20,10 @@ import java.util.Optional import scala.annotation.tailrec import scala.collection.immutable +import scala.jdk.OptionConverters._ import org.apache.pekko import pekko.annotation.InternalApi -import scala.jdk.OptionConverters._ /** * The address specifies the physical location under which an Actor can be diff --git a/actor/src/main/scala/org/apache/pekko/actor/CoordinatedShutdown.scala b/actor/src/main/scala/org/apache/pekko/actor/CoordinatedShutdown.scala index 80976cf646..8491f64bd2 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/CoordinatedShutdown.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/CoordinatedShutdown.scala @@ -23,20 +23,20 @@ import scala.annotation.tailrec import scala.concurrent.{ Await, ExecutionContext, Future, Promise } import scala.concurrent.duration._ import scala.concurrent.duration.FiniteDuration +import scala.jdk.FutureConverters._ +import scala.jdk.OptionConverters._ import scala.util.Try import scala.util.control.NonFatal -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.Done import pekko.annotation.InternalApi import pekko.event.Logging import pekko.pattern.after -import scala.jdk.OptionConverters._ import pekko.util.OptionVal -import scala.jdk.FutureConverters._ + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory object CoordinatedShutdown extends ExtensionId[CoordinatedShutdown] with ExtensionIdProvider { diff --git a/actor/src/main/scala/org/apache/pekko/actor/Deployer.scala b/actor/src/main/scala/org/apache/pekko/actor/Deployer.scala index 7b04e25d7c..ebbc9d79b3 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/Deployer.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/Deployer.scala @@ -15,16 +15,16 @@ package org.apache.pekko.actor import java.util.concurrent.atomic.AtomicReference -import scala.annotation.tailrec - import scala.annotation.nowarn -import com.typesafe.config._ +import scala.annotation.tailrec import org.apache.pekko import pekko.annotation.InternalApi import pekko.routing._ import pekko.util.WildcardIndex +import com.typesafe.config._ + object Deploy { final val NoDispatcherGiven = "" final val NoMailboxGiven = "" diff --git a/actor/src/main/scala/org/apache/pekko/actor/FaultHandling.scala b/actor/src/main/scala/org/apache/pekko/actor/FaultHandling.scala index 5fa527de8e..01c5f92a2f 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/FaultHandling.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/FaultHandling.scala @@ -13,21 +13,22 @@ package org.apache.pekko.actor +import java.lang.{ Iterable => JIterable } +import java.lang.reflect.InvocationTargetException +import java.util.concurrent.TimeUnit + +import scala.collection.immutable +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.duration.Duration +import scala.jdk.DurationConverters._ +import scala.language.implicitConversions +import scala.util.control.NonFatal + import org.apache.pekko import pekko.annotation.InternalApi import pekko.event.Logging import pekko.event.Logging.{ Error, LogEvent, LogLevel } import pekko.japi.Util.immutableSeq -import scala.jdk.DurationConverters._ - -import java.lang.reflect.InvocationTargetException -import java.lang.{ Iterable => JIterable } -import java.util.concurrent.TimeUnit -import scala.collection.immutable -import scala.collection.mutable.ArrayBuffer -import scala.concurrent.duration.Duration -import scala.language.implicitConversions -import scala.util.control.NonFatal /** * INTERNAL API diff --git a/actor/src/main/scala/org/apache/pekko/actor/IndirectActorProducer.scala b/actor/src/main/scala/org/apache/pekko/actor/IndirectActorProducer.scala index 48dad83575..0094a1d7ab 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/IndirectActorProducer.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/IndirectActorProducer.scala @@ -13,9 +13,8 @@ package org.apache.pekko.actor -import scala.collection.immutable - import scala.annotation.nowarn +import scala.collection.immutable import org.apache.pekko import pekko.japi.function.Creator diff --git a/actor/src/main/scala/org/apache/pekko/actor/LightArrayRevolverScheduler.scala b/actor/src/main/scala/org/apache/pekko/actor/LightArrayRevolverScheduler.scala index 912ef5512c..a818dc5d50 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/LightArrayRevolverScheduler.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/LightArrayRevolverScheduler.scala @@ -24,13 +24,14 @@ import scala.concurrent.{ Await, ExecutionContext, Future, Promise } import scala.concurrent.duration._ import scala.util.control.NonFatal -import com.typesafe.config.Config import org.apache.pekko import pekko.actor.Scheduler.AtomicCancellable import pekko.dispatch.AbstractNodeQueue import pekko.event.LoggingAdapter import pekko.util.Helpers +import com.typesafe.config.Config + /** * This scheduler implementation is based on a revolving wheel of buckets, * like Netty’s HashedWheelTimer, which it advances at a fixed tick rate and diff --git a/actor/src/main/scala/org/apache/pekko/actor/RepointableActorRef.scala b/actor/src/main/scala/org/apache/pekko/actor/RepointableActorRef.scala index 96e821812d..122cce4d33 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/RepointableActorRef.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/RepointableActorRef.scala @@ -16,12 +16,11 @@ package org.apache.pekko.actor import java.util.{ LinkedList => JLinkedList } import java.util.concurrent.locks.ReentrantLock +import scala.annotation.nowarn import scala.annotation.tailrec import scala.collection.immutable import scala.util.control.NonFatal -import scala.annotation.nowarn - import org.apache.pekko import pekko.actor.dungeon.ChildrenContainer import pekko.dispatch._ diff --git a/actor/src/main/scala/org/apache/pekko/actor/Timers.scala b/actor/src/main/scala/org/apache/pekko/actor/Timers.scala index 20d92f019d..5b264ba4ac 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/Timers.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/Timers.scala @@ -14,11 +14,11 @@ package org.apache.pekko.actor import scala.concurrent.duration.FiniteDuration +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.annotation.DoNotInherit import pekko.dispatch.Envelope -import scala.jdk.DurationConverters._ import pekko.util.OptionVal /** diff --git a/actor/src/main/scala/org/apache/pekko/actor/dungeon/Children.scala b/actor/src/main/scala/org/apache/pekko/actor/dungeon/Children.scala index adcbecc8c3..b450ce5fe6 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/dungeon/Children.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/dungeon/Children.scala @@ -15,10 +15,11 @@ package org.apache.pekko.actor.dungeon import java.util.Optional +import scala.annotation.nowarn import scala.annotation.tailrec import scala.collection.immutable import scala.util.control.NonFatal -import scala.annotation.nowarn + import org.apache.pekko import pekko.actor._ import pekko.annotation.InternalStableApi diff --git a/actor/src/main/scala/org/apache/pekko/actor/dungeon/Dispatch.scala b/actor/src/main/scala/org/apache/pekko/actor/dungeon/Dispatch.scala index 1d07d3d0be..99ef72718d 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/dungeon/Dispatch.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/dungeon/Dispatch.scala @@ -13,12 +13,11 @@ package org.apache.pekko.actor.dungeon +import scala.annotation.nowarn import scala.annotation.tailrec import scala.util.control.{ NoStackTrace, NonFatal } import scala.util.control.Exception.Catcher -import scala.annotation.nowarn - import org.apache.pekko import pekko.PekkoException import pekko.actor._ diff --git a/actor/src/main/scala/org/apache/pekko/actor/setup/ActorSystemSetup.scala b/actor/src/main/scala/org/apache/pekko/actor/setup/ActorSystemSetup.scala index c3ac3ffbcb..152688220a 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/setup/ActorSystemSetup.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/setup/ActorSystemSetup.scala @@ -16,11 +16,11 @@ package org.apache.pekko.actor.setup import java.util.Optional import scala.annotation.varargs +import scala.jdk.OptionConverters._ import scala.reflect.ClassTag import org.apache.pekko import pekko.annotation.InternalApi -import scala.jdk.OptionConverters._ /** * Marker supertype for a setup part that can be put inside [[pekko.actor.setup.ActorSystemSetup]], if a specific concrete setup diff --git a/actor/src/main/scala/org/apache/pekko/dispatch/BatchingExecutor.scala b/actor/src/main/scala/org/apache/pekko/dispatch/BatchingExecutor.scala index 6b2ccea821..d0f0ec0fa1 100644 --- a/actor/src/main/scala/org/apache/pekko/dispatch/BatchingExecutor.scala +++ b/actor/src/main/scala/org/apache/pekko/dispatch/BatchingExecutor.scala @@ -13,13 +13,14 @@ package org.apache.pekko.dispatch -import org.apache.pekko -import pekko.annotation.InternalApi - import java.util.concurrent.Executor + import scala.annotation.tailrec import scala.concurrent._ +import org.apache.pekko +import pekko.annotation.InternalApi + /** * INTERNAL API * diff --git a/actor/src/main/scala/org/apache/pekko/dispatch/CompletionStages.scala b/actor/src/main/scala/org/apache/pekko/dispatch/CompletionStages.scala index 073c2d1a16..c46edde915 100644 --- a/actor/src/main/scala/org/apache/pekko/dispatch/CompletionStages.scala +++ b/actor/src/main/scala/org/apache/pekko/dispatch/CompletionStages.scala @@ -17,14 +17,15 @@ package org.apache.pekko.dispatch -import org.apache.pekko - import java.util.Optional -import java.util.concurrent.atomic.AtomicReference import java.util.concurrent.{ CompletableFuture, CompletionStage, Executor } +import java.util.concurrent.atomic.AtomicReference import java.util.function.{ BiConsumer, BiFunction } + import scala.annotation.nowarn +import org.apache.pekko + /** * CompletionStages provides utilities for working with `CompletionStage`s. */ diff --git a/actor/src/main/scala/org/apache/pekko/dispatch/Dispatcher.scala b/actor/src/main/scala/org/apache/pekko/dispatch/Dispatcher.scala index 96b82f9a5c..951cd75d21 100644 --- a/actor/src/main/scala/org/apache/pekko/dispatch/Dispatcher.scala +++ b/actor/src/main/scala/org/apache/pekko/dispatch/Dispatcher.scala @@ -16,11 +16,10 @@ package org.apache.pekko.dispatch import java.util.concurrent.{ ExecutorService, RejectedExecutionException } import java.util.concurrent.atomic.AtomicReferenceFieldUpdater +import scala.annotation.nowarn import scala.concurrent.duration.Duration import scala.concurrent.duration.FiniteDuration -import scala.annotation.nowarn - import org.apache.pekko import pekko.actor.ActorCell import pekko.dispatch.sysmsg.SystemMessage diff --git a/actor/src/main/scala/org/apache/pekko/dispatch/Dispatchers.scala b/actor/src/main/scala/org/apache/pekko/dispatch/Dispatchers.scala index f38b6f3cb8..52ad8f08e4 100644 --- a/actor/src/main/scala/org/apache/pekko/dispatch/Dispatchers.scala +++ b/actor/src/main/scala/org/apache/pekko/dispatch/Dispatchers.scala @@ -14,10 +14,10 @@ package org.apache.pekko.dispatch import java.util.concurrent.{ ConcurrentHashMap, ThreadFactory } + import scala.annotation.{ nowarn, tailrec } import scala.concurrent.ExecutionContext -import com.typesafe.config.{ Config, ConfigFactory, ConfigValueType } import org.apache.pekko import pekko.ConfigurationException import pekko.actor.{ ActorSystem, DynamicAccess, Scheduler } @@ -26,6 +26,8 @@ import pekko.event.{ EventStream, LoggingAdapter } import pekko.event.Logging.Warning import pekko.util.Helpers.ConfigOps +import com.typesafe.config.{ Config, ConfigFactory, ConfigValueType } + /** * DispatcherPrerequisites represents useful contextual pieces when constructing a MessageDispatcher */ diff --git a/actor/src/main/scala/org/apache/pekko/dispatch/ForkJoinExecutorConfigurator.scala b/actor/src/main/scala/org/apache/pekko/dispatch/ForkJoinExecutorConfigurator.scala index 15aef6536b..7aa1aeabdd 100644 --- a/actor/src/main/scala/org/apache/pekko/dispatch/ForkJoinExecutorConfigurator.scala +++ b/actor/src/main/scala/org/apache/pekko/dispatch/ForkJoinExecutorConfigurator.scala @@ -13,11 +13,12 @@ package org.apache.pekko.dispatch -import com.typesafe.config.Config +import java.util.concurrent.{ ExecutorService, ForkJoinPool, ForkJoinTask, ThreadFactory, TimeUnit } + import org.apache.pekko import pekko.util.JavaVersion -import java.util.concurrent.{ ExecutorService, ForkJoinPool, ForkJoinTask, ThreadFactory, TimeUnit } +import com.typesafe.config.Config object ForkJoinExecutorConfigurator { diff --git a/actor/src/main/scala/org/apache/pekko/dispatch/Mailbox.scala b/actor/src/main/scala/org/apache/pekko/dispatch/Mailbox.scala index e2b0e97959..8114dd3cda 100644 --- a/actor/src/main/scala/org/apache/pekko/dispatch/Mailbox.scala +++ b/actor/src/main/scala/org/apache/pekko/dispatch/Mailbox.scala @@ -17,10 +17,11 @@ import java.util.{ Comparator, Deque, PriorityQueue, Queue } import java.util.concurrent._ import java.util.concurrent.atomic.AtomicInteger import java.util.concurrent.locks.ReentrantLock + import scala.annotation.tailrec import scala.concurrent.duration.{ Duration, FiniteDuration } import scala.util.control.NonFatal -import com.typesafe.config.Config + import org.apache.pekko import pekko.actor.{ ActorCell, ActorRef, ActorSystem, DeadLetter, InternalActorRef } import pekko.annotation.InternalStableApi @@ -29,6 +30,8 @@ import pekko.event.Logging.Error import pekko.util.{ BoundedBlockingQueue, StablePriorityBlockingQueue, StablePriorityQueue } import pekko.util.Helpers.ConfigOps +import com.typesafe.config.Config + /** * INTERNAL API */ diff --git a/actor/src/main/scala/org/apache/pekko/dispatch/Mailboxes.scala b/actor/src/main/scala/org/apache/pekko/dispatch/Mailboxes.scala index 9058cfba84..e525f6f703 100644 --- a/actor/src/main/scala/org/apache/pekko/dispatch/Mailboxes.scala +++ b/actor/src/main/scala/org/apache/pekko/dispatch/Mailboxes.scala @@ -21,8 +21,6 @@ import scala.annotation.tailrec import scala.concurrent.duration.Duration import scala.util.control.NonFatal -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.ConfigurationException import pekko.actor.{ Actor, ActorRef, ActorSystem, DeadLetter, Deploy, DynamicAccess, Props } @@ -37,6 +35,8 @@ import pekko.event.EventStream import pekko.event.Logging.Warning import pekko.util.Reflect +import com.typesafe.config.{ Config, ConfigFactory } + object Mailboxes { final val DefaultMailboxId = "pekko.actor.default-mailbox" final val NoMailboxRequirement = "" diff --git a/actor/src/main/scala/org/apache/pekko/dispatch/ThreadPoolBuilder.scala b/actor/src/main/scala/org/apache/pekko/dispatch/ThreadPoolBuilder.scala index de6c1377f4..093c5645f1 100644 --- a/actor/src/main/scala/org/apache/pekko/dispatch/ThreadPoolBuilder.scala +++ b/actor/src/main/scala/org/apache/pekko/dispatch/ThreadPoolBuilder.scala @@ -13,10 +13,6 @@ package org.apache.pekko.dispatch -import org.apache.pekko -import pekko.annotation.InternalApi -import pekko.dispatch.VirtualThreadSupport.newVirtualThreadFactory - import java.util.Collection import java.util.concurrent.{ ArrayBlockingQueue, @@ -35,9 +31,14 @@ import java.util.concurrent.{ TimeUnit } import java.util.concurrent.atomic.{ AtomicLong, AtomicReference } + import scala.concurrent.{ BlockContext, CanAwait } import scala.concurrent.duration.Duration +import org.apache.pekko +import pekko.annotation.InternalApi +import pekko.dispatch.VirtualThreadSupport.newVirtualThreadFactory + object ThreadPoolConfig { type QueueFactory = () => BlockingQueue[Runnable] diff --git a/actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupport.scala b/actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupport.scala index 0396aad36e..6b3532ba99 100644 --- a/actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupport.scala +++ b/actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupport.scala @@ -17,14 +17,15 @@ package org.apache.pekko.dispatch +import java.lang.invoke.{ MethodHandles, MethodType } +import java.util.concurrent.{ ExecutorService, ForkJoinPool, ForkJoinWorkerThread, ThreadFactory } + +import scala.util.control.NonFatal + import org.apache.pekko import pekko.annotation.InternalApi import pekko.util.JavaVersion -import java.lang.invoke.{ MethodHandles, MethodType } -import java.util.concurrent.{ ExecutorService, ForkJoinPool, ForkJoinWorkerThread, ThreadFactory } -import scala.util.control.NonFatal - @InternalApi private[dispatch] object VirtualThreadSupport { val zero = java.lang.Long.valueOf(0L) diff --git a/actor/src/main/scala/org/apache/pekko/dispatch/VirtualizedExecutorService.scala b/actor/src/main/scala/org/apache/pekko/dispatch/VirtualizedExecutorService.scala index cefd5ab063..5a6a80a38d 100644 --- a/actor/src/main/scala/org/apache/pekko/dispatch/VirtualizedExecutorService.scala +++ b/actor/src/main/scala/org/apache/pekko/dispatch/VirtualizedExecutorService.scala @@ -17,11 +17,11 @@ package org.apache.pekko.dispatch -import org.apache.pekko.annotation.InternalApi - import java.util import java.util.concurrent.{ Callable, Executor, ExecutorService, Future, ThreadFactory, TimeUnit } +import org.apache.pekko.annotation.InternalApi + /** * A virtualized executor service that creates a new virtual thread for each task. * Will shut down the underlying executor service when this executor is being shutdown. diff --git a/actor/src/main/scala/org/apache/pekko/dispatch/affinity/AffinityPool.scala b/actor/src/main/scala/org/apache/pekko/dispatch/affinity/AffinityPool.scala index 21644fe05e..35d10b36ca 100644 --- a/actor/src/main/scala/org/apache/pekko/dispatch/affinity/AffinityPool.scala +++ b/actor/src/main/scala/org/apache/pekko/dispatch/affinity/AffinityPool.scala @@ -19,17 +19,18 @@ import java.util.concurrent._ import java.util.concurrent.TimeUnit.MICROSECONDS import java.util.concurrent.atomic.AtomicReference import java.util.concurrent.locks.{ LockSupport, ReentrantLock } + import scala.annotation.{ switch, tailrec } import scala.collection.{ immutable, mutable } -import com.typesafe.config.Config - import org.apache.pekko import pekko.annotation.{ ApiMayChange, InternalApi } import pekko.dispatch._ import pekko.event.Logging -import pekko.util.ImmutableIntMap import pekko.util.Helpers.Requiring +import pekko.util.ImmutableIntMap + +import com.typesafe.config.Config @InternalApi @ApiMayChange diff --git a/actor/src/main/scala/org/apache/pekko/event/LoggerMailbox.scala b/actor/src/main/scala/org/apache/pekko/event/LoggerMailbox.scala index d8dbcc5c95..e9f85a8f56 100644 --- a/actor/src/main/scala/org/apache/pekko/event/LoggerMailbox.scala +++ b/actor/src/main/scala/org/apache/pekko/event/LoggerMailbox.scala @@ -13,8 +13,6 @@ package org.apache.pekko.event -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ActorSystem @@ -25,6 +23,8 @@ import pekko.dispatch.UnboundedMailbox import pekko.event.Logging.LogEvent import pekko.util.unused +import com.typesafe.config.Config + trait LoggerMessageQueueSemantics /** diff --git a/actor/src/main/scala/org/apache/pekko/event/Logging.scala b/actor/src/main/scala/org/apache/pekko/event/Logging.scala index 968c72f0a3..c5e08081e3 100644 --- a/actor/src/main/scala/org/apache/pekko/event/Logging.scala +++ b/actor/src/main/scala/org/apache/pekko/event/Logging.scala @@ -15,15 +15,15 @@ package org.apache.pekko.event import java.util.concurrent.TimeoutException import java.util.concurrent.atomic.AtomicInteger +import java.util.concurrent.locks.ReentrantLock import scala.annotation.implicitNotFound +import scala.annotation.nowarn import scala.collection.immutable import scala.concurrent.Await import scala.language.existentials import scala.util.control.{ NoStackTrace, NonFatal } -import scala.annotation.nowarn - import org.apache.pekko import pekko.{ ConfigurationException, PekkoException } import pekko.actor._ @@ -35,8 +35,6 @@ import pekko.util.Helpers import pekko.util.Timeout import pekko.util.unused -import java.util.concurrent.locks.ReentrantLock - /** * This trait brings log level handling to the EventStream: it reads the log * levels for the initial logging (StandardOutLogger) and the loggers & level @@ -1638,10 +1636,10 @@ trait DiagnosticLoggingAdapter extends LoggingAdapter { import java.{ util => ju } - import Logging._ - import scala.jdk.CollectionConverters._ + import Logging._ + private var _mdc = emptyMDC /** diff --git a/actor/src/main/scala/org/apache/pekko/io/Dns.scala b/actor/src/main/scala/org/apache/pekko/io/Dns.scala index c112540bcc..1915c1e58d 100644 --- a/actor/src/main/scala/org/apache/pekko/io/Dns.scala +++ b/actor/src/main/scala/org/apache/pekko/io/Dns.scala @@ -18,7 +18,6 @@ import java.util.concurrent.ConcurrentHashMap import java.util.function.{ Function => JFunction } import scala.annotation.nowarn -import com.typesafe.config.Config import org.apache.pekko import pekko.actor._ @@ -28,6 +27,8 @@ import pekko.event.Logging import pekko.io.dns.DnsProtocol import pekko.util.unused +import com.typesafe.config.Config + /** * Not for user extension. * diff --git a/actor/src/main/scala/org/apache/pekko/io/InetAddressDnsResolver.scala b/actor/src/main/scala/org/apache/pekko/io/InetAddressDnsResolver.scala index 7e74dbfd7e..f6102e2832 100644 --- a/actor/src/main/scala/org/apache/pekko/io/InetAddressDnsResolver.scala +++ b/actor/src/main/scala/org/apache/pekko/io/InetAddressDnsResolver.scala @@ -23,8 +23,6 @@ import scala.collection.immutable import scala.concurrent.duration._ import scala.util.{ Failure, Success, Try } -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.{ Actor, ActorLogging } import pekko.actor.Status @@ -38,6 +36,8 @@ import pekko.io.dns.DnsProtocol.Srv import pekko.io.dns.ResourceRecord import pekko.util.Helpers.Requiring +import com.typesafe.config.Config + /** * INTERNAL API * diff --git a/actor/src/main/scala/org/apache/pekko/io/SelectionHandler.scala b/actor/src/main/scala/org/apache/pekko/io/SelectionHandler.scala index f6dfdd5833..db0bd4ace6 100644 --- a/actor/src/main/scala/org/apache/pekko/io/SelectionHandler.scala +++ b/actor/src/main/scala/org/apache/pekko/io/SelectionHandler.scala @@ -25,8 +25,6 @@ import scala.concurrent.ExecutionContext import scala.util.Try import scala.util.control.NonFatal -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor._ import pekko.dispatch.{ RequiresMessageQueue, UnboundedMessageQueueSemantics } @@ -36,6 +34,8 @@ import pekko.routing.RandomPool import pekko.util.Helpers.Requiring import pekko.util.SerializedSuspendableExecutionContext +import com.typesafe.config.Config + abstract class SelectionHandlerSettings(config: Config) { import config._ diff --git a/actor/src/main/scala/org/apache/pekko/io/SimpleDnsManager.scala b/actor/src/main/scala/org/apache/pekko/io/SimpleDnsManager.scala index f7692278b8..62a2481846 100644 --- a/actor/src/main/scala/org/apache/pekko/io/SimpleDnsManager.scala +++ b/actor/src/main/scala/org/apache/pekko/io/SimpleDnsManager.scala @@ -14,7 +14,9 @@ package org.apache.pekko.io import java.util.concurrent.TimeUnit + import scala.concurrent.duration.Duration + import org.apache.pekko import pekko.actor.{ Actor, ActorLogging, Deploy, Props } import pekko.dispatch.{ RequiresMessageQueue, UnboundedMessageQueueSemantics } diff --git a/actor/src/main/scala/org/apache/pekko/io/Tcp.scala b/actor/src/main/scala/org/apache/pekko/io/Tcp.scala index 6c84bcadcc..38ec52095f 100644 --- a/actor/src/main/scala/org/apache/pekko/io/Tcp.scala +++ b/actor/src/main/scala/org/apache/pekko/io/Tcp.scala @@ -18,11 +18,11 @@ import java.net.InetSocketAddress import java.net.Socket import java.nio.file.{ Path, Paths } +import scala.annotation.nowarn import scala.collection.immutable import scala.concurrent.duration._ - -import scala.annotation.nowarn -import com.typesafe.config.Config +import scala.jdk.CollectionConverters._ +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.actor._ @@ -30,8 +30,8 @@ import pekko.annotation.InternalApi import pekko.io.Inet._ import pekko.util.{ ByteString, Helpers } import pekko.util.Helpers.Requiring -import scala.jdk.DurationConverters._ -import scala.jdk.CollectionConverters._ + +import com.typesafe.config.Config /** * TCP Extension for Akka’s IO layer. diff --git a/actor/src/main/scala/org/apache/pekko/io/TcpConnection.scala b/actor/src/main/scala/org/apache/pekko/io/TcpConnection.scala index 7b66d5a951..ae0c535a55 100644 --- a/actor/src/main/scala/org/apache/pekko/io/TcpConnection.scala +++ b/actor/src/main/scala/org/apache/pekko/io/TcpConnection.scala @@ -20,13 +20,12 @@ import java.nio.channels.{ FileChannel, SocketChannel } import java.nio.channels.SelectionKey._ import java.nio.file.Path +import scala.annotation.nowarn import scala.annotation.tailrec import scala.collection.immutable import scala.concurrent.duration._ import scala.util.control.{ NoStackTrace, NonFatal } -import scala.annotation.nowarn - import org.apache.pekko import pekko.actor._ import pekko.dispatch.{ RequiresMessageQueue, UnboundedMessageQueueSemantics } diff --git a/actor/src/main/scala/org/apache/pekko/io/TcpIncomingConnection.scala b/actor/src/main/scala/org/apache/pekko/io/TcpIncomingConnection.scala index 21e96314c4..5adb59024a 100644 --- a/actor/src/main/scala/org/apache/pekko/io/TcpIncomingConnection.scala +++ b/actor/src/main/scala/org/apache/pekko/io/TcpIncomingConnection.scala @@ -15,9 +15,8 @@ package org.apache.pekko.io import java.nio.channels.SocketChannel -import scala.collection.immutable - import scala.annotation.nowarn +import scala.collection.immutable import org.apache.pekko import pekko.actor.ActorRef diff --git a/actor/src/main/scala/org/apache/pekko/io/Udp.scala b/actor/src/main/scala/org/apache/pekko/io/Udp.scala index d19a0f230b..f2cb936ee0 100644 --- a/actor/src/main/scala/org/apache/pekko/io/Udp.scala +++ b/actor/src/main/scala/org/apache/pekko/io/Udp.scala @@ -16,10 +16,8 @@ package org.apache.pekko.io import java.net.DatagramSocket import java.net.InetSocketAddress -import scala.collection.immutable - import scala.annotation.nowarn -import com.typesafe.config.Config +import scala.collection.immutable import org.apache.pekko import pekko.actor._ @@ -27,6 +25,8 @@ import pekko.io.Inet.{ SoJavaFactories, SocketOption } import pekko.util.ByteString import pekko.util.Helpers.Requiring +import com.typesafe.config.Config + /** * UDP Extension for Akka’s IO layer. * @@ -255,10 +255,10 @@ class UdpExt(system: ExtendedActorSystem) extends IO.Extension { object UdpMessage { import java.lang.{ Iterable => JIterable } - import Udp._ - import scala.jdk.CollectionConverters._ + import Udp._ + /** * Each [[Udp.Send]] can optionally request a positive acknowledgment to be sent * to the commanding actor. If such notification is not desired the [[Udp.Send#ack]] diff --git a/actor/src/main/scala/org/apache/pekko/io/UdpConnected.scala b/actor/src/main/scala/org/apache/pekko/io/UdpConnected.scala index 91464ce448..cb670dbc38 100644 --- a/actor/src/main/scala/org/apache/pekko/io/UdpConnected.scala +++ b/actor/src/main/scala/org/apache/pekko/io/UdpConnected.scala @@ -16,9 +16,8 @@ package org.apache.pekko.io import java.lang.{ Iterable => JIterable } import java.net.InetSocketAddress -import scala.collection.immutable - import scala.annotation.nowarn +import scala.collection.immutable import org.apache.pekko import pekko.actor._ diff --git a/actor/src/main/scala/org/apache/pekko/io/UdpSender.scala b/actor/src/main/scala/org/apache/pekko/io/UdpSender.scala index 6049a120a5..bdc3d36fa6 100644 --- a/actor/src/main/scala/org/apache/pekko/io/UdpSender.scala +++ b/actor/src/main/scala/org/apache/pekko/io/UdpSender.scala @@ -13,6 +13,7 @@ package org.apache.pekko.io +import scala.annotation.nowarn import scala.collection.immutable import scala.util.control.NonFatal @@ -21,7 +22,6 @@ import pekko.actor._ import pekko.dispatch.{ RequiresMessageQueue, UnboundedMessageQueueSemantics } import pekko.io.Inet.{ DatagramChannelCreator, SocketOption } import pekko.io.Udp._ -import scala.annotation.nowarn /** * INTERNAL API diff --git a/actor/src/main/scala/org/apache/pekko/io/dns/CachePolicy.scala b/actor/src/main/scala/org/apache/pekko/io/dns/CachePolicy.scala index ec3dadbfb7..803192fe2d 100644 --- a/actor/src/main/scala/org/apache/pekko/io/dns/CachePolicy.scala +++ b/actor/src/main/scala/org/apache/pekko/io/dns/CachePolicy.scala @@ -14,10 +14,10 @@ package org.apache.pekko.io.dns import scala.concurrent.duration.{ Duration, FiniteDuration, _ } +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.annotation.InternalApi -import scala.jdk.DurationConverters._ object CachePolicy { diff --git a/actor/src/main/scala/org/apache/pekko/io/dns/DnsProtocol.scala b/actor/src/main/scala/org/apache/pekko/io/dns/DnsProtocol.scala index d83f3e1a88..b73240afcf 100644 --- a/actor/src/main/scala/org/apache/pekko/io/dns/DnsProtocol.scala +++ b/actor/src/main/scala/org/apache/pekko/io/dns/DnsProtocol.scala @@ -20,12 +20,12 @@ import java.net.UnknownHostException import java.util import scala.collection.{ immutable => im } +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.actor.NoSerializationVerificationNeeded import pekko.io.IpVersionSelector import pekko.routing.ConsistentHashingRouter.ConsistentHashable -import scala.jdk.CollectionConverters._ /** * Supersedes [[pekko.io.Dns]] protocol. diff --git a/actor/src/main/scala/org/apache/pekko/io/dns/DnsSettings.scala b/actor/src/main/scala/org/apache/pekko/io/dns/DnsSettings.scala index b46fd8529f..273d2f1596 100644 --- a/actor/src/main/scala/org/apache/pekko/io/dns/DnsSettings.scala +++ b/actor/src/main/scala/org/apache/pekko/io/dns/DnsSettings.scala @@ -35,10 +35,10 @@ import java.util import scala.collection.immutable import scala.concurrent.duration.FiniteDuration +import scala.jdk.CollectionConverters._ +import scala.jdk.DurationConverters._ import scala.util.{ Failure, Success, Try } -import com.typesafe.config.{ Config, ConfigValueType } - import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.annotation.InternalApi @@ -48,8 +48,8 @@ import pekko.io.dns.IdGenerator.Policy import pekko.io.dns.internal.{ ResolvConf, ResolvConfParser } import pekko.util.Helpers import pekko.util.Helpers.Requiring -import scala.jdk.DurationConverters._ -import scala.jdk.CollectionConverters._ + +import com.typesafe.config.{ Config, ConfigValueType } /** INTERNAL API */ @InternalApi diff --git a/actor/src/main/scala/org/apache/pekko/io/dns/IdGenerator.scala b/actor/src/main/scala/org/apache/pekko/io/dns/IdGenerator.scala index 68856aa40b..598d41dafa 100644 --- a/actor/src/main/scala/org/apache/pekko/io/dns/IdGenerator.scala +++ b/actor/src/main/scala/org/apache/pekko/io/dns/IdGenerator.scala @@ -17,12 +17,12 @@ package org.apache.pekko.io.dns -import org.apache.pekko.annotation.InternalApi - import java.security.SecureRandom import java.util.Random import java.util.concurrent.ThreadLocalRandom +import org.apache.pekko.annotation.InternalApi + /** * INTERNAL API * diff --git a/actor/src/main/scala/org/apache/pekko/io/dns/internal/AsyncDnsManager.scala b/actor/src/main/scala/org/apache/pekko/io/dns/internal/AsyncDnsManager.scala index e016eba314..28e904b508 100644 --- a/actor/src/main/scala/org/apache/pekko/io/dns/internal/AsyncDnsManager.scala +++ b/actor/src/main/scala/org/apache/pekko/io/dns/internal/AsyncDnsManager.scala @@ -19,8 +19,6 @@ import java.util.concurrent.TimeUnit import scala.concurrent.ExecutionContextExecutor import scala.concurrent.duration.Duration -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.{ Actor, ActorLogging, ActorRefFactory, Deploy, ExtendedActorSystem, Props, Timers } import pekko.annotation.InternalApi @@ -32,6 +30,8 @@ import pekko.io.dns.internal.AsyncDnsManager.CacheCleanup import pekko.routing.FromConfig import pekko.util.Timeout +import com.typesafe.config.Config + /** * INTERNAL API */ diff --git a/actor/src/main/scala/org/apache/pekko/io/dns/internal/AsyncDnsResolver.scala b/actor/src/main/scala/org/apache/pekko/io/dns/internal/AsyncDnsResolver.scala index 853980be88..aced67214c 100644 --- a/actor/src/main/scala/org/apache/pekko/io/dns/internal/AsyncDnsResolver.scala +++ b/actor/src/main/scala/org/apache/pekko/io/dns/internal/AsyncDnsResolver.scala @@ -18,9 +18,9 @@ import java.net.{ Inet4Address, Inet6Address, InetAddress, InetSocketAddress } import scala.collection.immutable import scala.concurrent.ExecutionContextExecutor import scala.concurrent.Future -import scala.util.Try -import scala.util.Success import scala.util.Failure +import scala.util.Success +import scala.util.Try import scala.util.control.NonFatal import org.apache.pekko diff --git a/actor/src/main/scala/org/apache/pekko/io/dns/internal/DnsClient.scala b/actor/src/main/scala/org/apache/pekko/io/dns/internal/DnsClient.scala index 07566dff92..07290c8d6a 100644 --- a/actor/src/main/scala/org/apache/pekko/io/dns/internal/DnsClient.scala +++ b/actor/src/main/scala/org/apache/pekko/io/dns/internal/DnsClient.scala @@ -14,10 +14,12 @@ package org.apache.pekko.io.dns.internal import java.net.{ InetAddress, InetSocketAddress } + +import scala.annotation.{ nowarn, tailrec } import scala.collection.{ immutable => im } import scala.concurrent.duration._ import scala.util.Try -import scala.annotation.{ nowarn, tailrec } + import org.apache.pekko import pekko.actor.{ Actor, ActorLogging, ActorRef, NoSerializationVerificationNeeded, Props, Stash } import pekko.actor.Status.Failure diff --git a/actor/src/main/scala/org/apache/pekko/io/dns/internal/DnsMessage.scala b/actor/src/main/scala/org/apache/pekko/io/dns/internal/DnsMessage.scala index 1e176f898a..a94f0d621c 100644 --- a/actor/src/main/scala/org/apache/pekko/io/dns/internal/DnsMessage.scala +++ b/actor/src/main/scala/org/apache/pekko/io/dns/internal/DnsMessage.scala @@ -13,12 +13,11 @@ package org.apache.pekko.io.dns.internal +import scala.annotation.nowarn import scala.collection.GenTraversableOnce import scala.collection.immutable.Seq import scala.util.{ Failure, Success, Try } -import scala.annotation.nowarn - import org.apache.pekko import pekko.annotation.InternalApi import pekko.io.dns.ResourceRecord diff --git a/actor/src/main/scala/org/apache/pekko/io/dns/internal/ResolvConfParser.scala b/actor/src/main/scala/org/apache/pekko/io/dns/internal/ResolvConfParser.scala index 06bd049ce0..7678af8537 100644 --- a/actor/src/main/scala/org/apache/pekko/io/dns/internal/ResolvConfParser.scala +++ b/actor/src/main/scala/org/apache/pekko/io/dns/internal/ResolvConfParser.scala @@ -16,9 +16,8 @@ package org.apache.pekko.io.dns.internal import java.io.File import java.nio.file.Files -import scala.util.Try - import scala.jdk.CollectionConverters._ +import scala.util.Try private[dns] case class ResolvConf(search: List[String], ndots: Int) diff --git a/actor/src/main/scala/org/apache/pekko/io/dns/internal/TcpDnsClient.scala b/actor/src/main/scala/org/apache/pekko/io/dns/internal/TcpDnsClient.scala index 07fa1ad948..6d32da28c8 100644 --- a/actor/src/main/scala/org/apache/pekko/io/dns/internal/TcpDnsClient.scala +++ b/actor/src/main/scala/org/apache/pekko/io/dns/internal/TcpDnsClient.scala @@ -14,6 +14,7 @@ package org.apache.pekko.io.dns.internal import java.net.InetSocketAddress + import org.apache.pekko import pekko.PekkoException import pekko.actor.{ Actor, ActorLogging, ActorRef, Stash, Terminated } diff --git a/actor/src/main/scala/org/apache/pekko/japi/function/Function.scala b/actor/src/main/scala/org/apache/pekko/japi/function/Function.scala index 669e634800..1a5c03ad40 100644 --- a/actor/src/main/scala/org/apache/pekko/japi/function/Function.scala +++ b/actor/src/main/scala/org/apache/pekko/japi/function/Function.scala @@ -13,10 +13,10 @@ package org.apache.pekko.japi.function -import org.apache.pekko.util.ConstantFun - import scala.annotation.nowarn +import org.apache.pekko.util.ConstantFun + /** * A Function interface. Used to create first-class-functions is Java. * `Serializable` is needed to be able to grab line number for Java 8 lambdas. diff --git a/actor/src/main/scala/org/apache/pekko/pattern/AskSupport.scala b/actor/src/main/scala/org/apache/pekko/pattern/AskSupport.scala index 515461f475..2cdc45ba22 100644 --- a/actor/src/main/scala/org/apache/pekko/pattern/AskSupport.scala +++ b/actor/src/main/scala/org/apache/pekko/pattern/AskSupport.scala @@ -19,6 +19,7 @@ import java.util.concurrent.TimeoutException import scala.annotation.{ nowarn, tailrec } import scala.collection.immutable import scala.concurrent.{ Future, Promise } +import scala.concurrent.ExecutionContext import scala.language.implicitConversions import scala.util.{ Failure, Success } import scala.util.control.NoStackTrace @@ -26,7 +27,6 @@ import scala.util.control.NoStackTrace import org.apache.pekko import pekko.actor._ import pekko.annotation.{ InternalApi, InternalStableApi } -import scala.concurrent.ExecutionContext import pekko.dispatch.sysmsg._ import pekko.util.{ unused, ByteString, Timeout } diff --git a/actor/src/main/scala/org/apache/pekko/pattern/BackoffOptions.scala b/actor/src/main/scala/org/apache/pekko/pattern/BackoffOptions.scala index 1abbd1a7b6..5c00b5df8d 100644 --- a/actor/src/main/scala/org/apache/pekko/pattern/BackoffOptions.scala +++ b/actor/src/main/scala/org/apache/pekko/pattern/BackoffOptions.scala @@ -13,13 +13,13 @@ package org.apache.pekko.pattern +import scala.concurrent.duration.{ Duration, FiniteDuration } +import scala.jdk.DurationConverters._ + import org.apache.pekko import pekko.actor.{ ActorRef, OneForOneStrategy, Props, SupervisorStrategy } import pekko.annotation.{ DoNotInherit, InternalApi } import pekko.pattern.internal.{ BackoffOnRestartSupervisor, BackoffOnStopSupervisor } -import scala.jdk.DurationConverters._ - -import scala.concurrent.duration.{ Duration, FiniteDuration } /** * Backoff options allow to specify a number of properties for backoff supervisors. diff --git a/actor/src/main/scala/org/apache/pekko/pattern/CircuitBreaker.scala b/actor/src/main/scala/org/apache/pekko/pattern/CircuitBreaker.scala index 198ad113f8..f74a0c2ee4 100644 --- a/actor/src/main/scala/org/apache/pekko/pattern/CircuitBreaker.scala +++ b/actor/src/main/scala/org/apache/pekko/pattern/CircuitBreaker.scala @@ -18,21 +18,23 @@ import java.util.concurrent.{ Callable, CompletionException, CompletionStage, Co import java.util.concurrent.atomic.{ AtomicBoolean, AtomicInteger, AtomicLong } import java.util.function.BiFunction import java.util.function.Consumer + import scala.annotation.nowarn import scala.concurrent.{ Await, ExecutionContext, Future, Promise } +import scala.concurrent.ExecutionContext.parasitic import scala.concurrent.TimeoutException import scala.concurrent.duration._ +import scala.jdk.DurationConverters._ +import scala.jdk.FutureConverters._ import scala.util.{ Failure, Success, Try } import scala.util.control.NoStackTrace import scala.util.control.NonFatal + import org.apache.pekko import pekko.PekkoException import pekko.actor.{ ExtendedActorSystem, Scheduler } -import scala.concurrent.ExecutionContext.parasitic -import pekko.pattern.internal.{ CircuitBreakerNoopTelemetry, CircuitBreakerTelemetry } import pekko.annotation.InternalApi -import scala.jdk.FutureConverters._ -import scala.jdk.DurationConverters._ +import pekko.pattern.internal.{ CircuitBreakerNoopTelemetry, CircuitBreakerTelemetry } /** * Companion object providing factory methods for Circuit Breaker which runs callbacks in caller's thread diff --git a/actor/src/main/scala/org/apache/pekko/pattern/CircuitBreakersRegistry.scala b/actor/src/main/scala/org/apache/pekko/pattern/CircuitBreakersRegistry.scala index 3724892789..c3694e0b0d 100644 --- a/actor/src/main/scala/org/apache/pekko/pattern/CircuitBreakersRegistry.scala +++ b/actor/src/main/scala/org/apache/pekko/pattern/CircuitBreakersRegistry.scala @@ -14,7 +14,10 @@ package org.apache.pekko.pattern import java.util.concurrent.ConcurrentHashMap + import scala.concurrent.duration.{ DurationLong, MILLISECONDS } +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.actor.{ ActorSystem, @@ -25,7 +28,6 @@ import pekko.actor.{ ExtensionIdProvider } import pekko.pattern.internal.CircuitBreakerTelemetryProvider -import scala.jdk.CollectionConverters._ /** * Companion object providing factory methods for Circuit Breaker which runs callbacks in caller's thread diff --git a/actor/src/main/scala/org/apache/pekko/pattern/GracefulStopSupport.scala b/actor/src/main/scala/org/apache/pekko/pattern/GracefulStopSupport.scala index e7dfcf7f09..04204448df 100644 --- a/actor/src/main/scala/org/apache/pekko/pattern/GracefulStopSupport.scala +++ b/actor/src/main/scala/org/apache/pekko/pattern/GracefulStopSupport.scala @@ -13,12 +13,12 @@ package org.apache.pekko.pattern +import scala.concurrent.ExecutionContext import scala.concurrent.Future import scala.concurrent.duration.FiniteDuration import org.apache.pekko import pekko.actor._ -import scala.concurrent.ExecutionContext import pekko.dispatch.sysmsg.{ Unwatch, Watch } import pekko.util.Timeout diff --git a/actor/src/main/scala/org/apache/pekko/pattern/Patterns.scala b/actor/src/main/scala/org/apache/pekko/pattern/Patterns.scala index 1e866618f7..d39c5862b8 100644 --- a/actor/src/main/scala/org/apache/pekko/pattern/Patterns.scala +++ b/actor/src/main/scala/org/apache/pekko/pattern/Patterns.scala @@ -17,14 +17,13 @@ import java.util.Optional import java.util.concurrent.{ Callable, CompletionStage, TimeUnit } import java.util.function.IntFunction +import scala.annotation.nowarn import scala.concurrent.ExecutionContext +import scala.jdk.DurationConverters._ +import scala.jdk.FutureConverters._ import org.apache.pekko import pekko.actor.{ ActorSelection, ClassicActorSystemProvider, Scheduler } -import scala.jdk.FutureConverters._ -import scala.jdk.DurationConverters._ - -import scala.annotation.nowarn /** * Java API: for Pekko patterns such as `ask`, `pipe` and others which work with [[java.util.concurrent.CompletionStage]]. diff --git a/actor/src/main/scala/org/apache/pekko/pattern/RetrySupport.scala b/actor/src/main/scala/org/apache/pekko/pattern/RetrySupport.scala index 5582d360cd..0884b71f8e 100644 --- a/actor/src/main/scala/org/apache/pekko/pattern/RetrySupport.scala +++ b/actor/src/main/scala/org/apache/pekko/pattern/RetrySupport.scala @@ -13,6 +13,8 @@ package org.apache.pekko.pattern +import java.util.concurrent.ThreadLocalRandom + import scala.concurrent.{ ExecutionContext, Future } import scala.concurrent.duration.{ Duration, FiniteDuration } import scala.util.{ Failure, Success, Try } @@ -22,8 +24,6 @@ import org.apache.pekko import pekko.actor.Scheduler import pekko.util.ConstantFun -import java.util.concurrent.ThreadLocalRandom - /** * This trait provides the retry utility function */ diff --git a/actor/src/main/scala/org/apache/pekko/pattern/StatusReply.scala b/actor/src/main/scala/org/apache/pekko/pattern/StatusReply.scala index 6a2aa767a2..636313b971 100644 --- a/actor/src/main/scala/org/apache/pekko/pattern/StatusReply.scala +++ b/actor/src/main/scala/org/apache/pekko/pattern/StatusReply.scala @@ -13,16 +13,17 @@ package org.apache.pekko.pattern +import scala.concurrent.ExecutionContext import scala.concurrent.Future import scala.util.{ Failure => ScalaFailure } import scala.util.{ Success => ScalaSuccess } import scala.util.Try import scala.util.control.NoStackTrace + import org.apache.pekko import pekko.Done import pekko.actor.InvalidMessageException import pekko.annotation.InternalApi -import scala.concurrent.ExecutionContext /** * Generic top-level message type for replies that signal failure or success. Convenient to use together with the diff --git a/actor/src/main/scala/org/apache/pekko/pattern/internal/CircuitBreakerTelemetry.scala b/actor/src/main/scala/org/apache/pekko/pattern/internal/CircuitBreakerTelemetry.scala index 9bd2aa16ac..691134b10a 100644 --- a/actor/src/main/scala/org/apache/pekko/pattern/internal/CircuitBreakerTelemetry.scala +++ b/actor/src/main/scala/org/apache/pekko/pattern/internal/CircuitBreakerTelemetry.scala @@ -15,10 +15,11 @@ package org.apache.pekko.pattern.internal import java.util.{ List => JList } +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.annotation.{ InternalApi, InternalStableApi } -import scala.jdk.CollectionConverters._ /** * Service Provider Interface (SPI) for collecting metrics from Circuit Breaker. diff --git a/actor/src/main/scala/org/apache/pekko/routing/Balancing.scala b/actor/src/main/scala/org/apache/pekko/routing/Balancing.scala index 286c96177e..f87a0e40d0 100644 --- a/actor/src/main/scala/org/apache/pekko/routing/Balancing.scala +++ b/actor/src/main/scala/org/apache/pekko/routing/Balancing.scala @@ -13,11 +13,8 @@ package org.apache.pekko.routing -import scala.collection.immutable - import scala.annotation.nowarn -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory +import scala.collection.immutable import org.apache.pekko import pekko.actor.ActorContext @@ -27,6 +24,9 @@ import pekko.actor.SupervisorStrategy import pekko.dispatch.BalancingDispatcherConfigurator import pekko.dispatch.Dispatchers +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + /** * INTERNAL API */ diff --git a/actor/src/main/scala/org/apache/pekko/routing/Broadcast.scala b/actor/src/main/scala/org/apache/pekko/routing/Broadcast.scala index b1f61cbfe8..b94496205a 100644 --- a/actor/src/main/scala/org/apache/pekko/routing/Broadcast.scala +++ b/actor/src/main/scala/org/apache/pekko/routing/Broadcast.scala @@ -13,10 +13,8 @@ package org.apache.pekko.routing -import scala.collection.immutable - import scala.annotation.nowarn -import com.typesafe.config.Config +import scala.collection.immutable import org.apache.pekko import pekko.actor.ActorSystem @@ -24,6 +22,8 @@ import pekko.actor.SupervisorStrategy import pekko.dispatch.Dispatchers import pekko.japi.Util.immutableSeq +import com.typesafe.config.Config + object BroadcastRoutingLogic { def apply(): BroadcastRoutingLogic = new BroadcastRoutingLogic } diff --git a/actor/src/main/scala/org/apache/pekko/routing/ConsistentHashing.scala b/actor/src/main/scala/org/apache/pekko/routing/ConsistentHashing.scala index c207a5c579..f4d50b527f 100644 --- a/actor/src/main/scala/org/apache/pekko/routing/ConsistentHashing.scala +++ b/actor/src/main/scala/org/apache/pekko/routing/ConsistentHashing.scala @@ -18,8 +18,6 @@ import java.util.concurrent.atomic.AtomicReference import scala.collection.immutable import scala.util.control.NonFatal -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.ActorPath import pekko.actor.ActorSystem @@ -33,6 +31,8 @@ import pekko.event.Logging import pekko.japi.Util.immutableSeq import pekko.serialization.SerializationExtension +import com.typesafe.config.Config + object ConsistentHashingRouter { /** diff --git a/actor/src/main/scala/org/apache/pekko/routing/OptimalSizeExploringResizer.scala b/actor/src/main/scala/org/apache/pekko/routing/OptimalSizeExploringResizer.scala index 7df960b1f2..de1e5bf192 100644 --- a/actor/src/main/scala/org/apache/pekko/routing/OptimalSizeExploringResizer.scala +++ b/actor/src/main/scala/org/apache/pekko/routing/OptimalSizeExploringResizer.scala @@ -18,14 +18,15 @@ import java.util.concurrent.ThreadLocalRandom import scala.collection.immutable import scala.concurrent.duration._ +import scala.jdk.DurationConverters._ import OptimalSizeExploringResizer._ -import com.typesafe.config.Config import org.apache.pekko import pekko.actor._ import pekko.annotation.InternalApi -import scala.jdk.DurationConverters._ + +import com.typesafe.config.Config trait OptimalSizeExploringResizer extends Resizer { diff --git a/actor/src/main/scala/org/apache/pekko/routing/Random.scala b/actor/src/main/scala/org/apache/pekko/routing/Random.scala index 9da3b228d0..4603f09584 100644 --- a/actor/src/main/scala/org/apache/pekko/routing/Random.scala +++ b/actor/src/main/scala/org/apache/pekko/routing/Random.scala @@ -15,10 +15,8 @@ package org.apache.pekko.routing import java.util.concurrent.ThreadLocalRandom -import scala.collection.immutable - import scala.annotation.nowarn -import com.typesafe.config.Config +import scala.collection.immutable import org.apache.pekko import pekko.actor.ActorSystem @@ -26,6 +24,8 @@ import pekko.actor.SupervisorStrategy import pekko.dispatch.Dispatchers import pekko.japi.Util.immutableSeq +import com.typesafe.config.Config + object RandomRoutingLogic { def apply(): RandomRoutingLogic = new RandomRoutingLogic } diff --git a/actor/src/main/scala/org/apache/pekko/routing/Resizer.scala b/actor/src/main/scala/org/apache/pekko/routing/Resizer.scala index d055b59a4d..0addb8c6d8 100644 --- a/actor/src/main/scala/org/apache/pekko/routing/Resizer.scala +++ b/actor/src/main/scala/org/apache/pekko/routing/Resizer.scala @@ -18,8 +18,6 @@ import java.util.concurrent.atomic.AtomicLong import scala.collection.immutable -import com.typesafe.config.Config - import org.apache.pekko import pekko.PekkoException import pekko.actor.Actor @@ -33,6 +31,8 @@ import pekko.actor.SupervisorStrategy import pekko.dispatch.Envelope import pekko.dispatch.MessageDispatcher +import com.typesafe.config.Config + /** * [[Pool]] routers with dynamically resizable number of routees are implemented by providing a Resizer * implementation in the [[pekko.routing.Pool]] configuration. diff --git a/actor/src/main/scala/org/apache/pekko/routing/RoundRobin.scala b/actor/src/main/scala/org/apache/pekko/routing/RoundRobin.scala index ddf279a69b..df967371fd 100644 --- a/actor/src/main/scala/org/apache/pekko/routing/RoundRobin.scala +++ b/actor/src/main/scala/org/apache/pekko/routing/RoundRobin.scala @@ -15,10 +15,8 @@ package org.apache.pekko.routing import java.util.concurrent.atomic.AtomicLong -import scala.collection.immutable - import scala.annotation.nowarn -import com.typesafe.config.Config +import scala.collection.immutable import org.apache.pekko import pekko.actor.ActorSystem @@ -26,6 +24,8 @@ import pekko.actor.SupervisorStrategy import pekko.dispatch.Dispatchers import pekko.japi.Util.immutableSeq +import com.typesafe.config.Config + object RoundRobinRoutingLogic { def apply(): RoundRobinRoutingLogic = new RoundRobinRoutingLogic } diff --git a/actor/src/main/scala/org/apache/pekko/routing/RouterConfig.scala b/actor/src/main/scala/org/apache/pekko/routing/RouterConfig.scala index 959d79bf21..052cb81527 100644 --- a/actor/src/main/scala/org/apache/pekko/routing/RouterConfig.scala +++ b/actor/src/main/scala/org/apache/pekko/routing/RouterConfig.scala @@ -13,9 +13,8 @@ package org.apache.pekko.routing -import scala.collection.immutable - import scala.annotation.nowarn +import scala.collection.immutable import org.apache.pekko import pekko.ConfigurationException diff --git a/actor/src/main/scala/org/apache/pekko/routing/ScatterGatherFirstCompleted.scala b/actor/src/main/scala/org/apache/pekko/routing/ScatterGatherFirstCompleted.scala index d58b802bd8..a82323e474 100644 --- a/actor/src/main/scala/org/apache/pekko/routing/ScatterGatherFirstCompleted.scala +++ b/actor/src/main/scala/org/apache/pekko/routing/ScatterGatherFirstCompleted.scala @@ -16,25 +16,25 @@ package org.apache.pekko.routing import java.util.concurrent.TimeoutException import scala.collection.immutable +import scala.concurrent.ExecutionContext import scala.concurrent.Future import scala.concurrent.Promise import scala.concurrent.duration.FiniteDuration - -import com.typesafe.config.Config +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ActorSystem import pekko.actor.SupervisorStrategy import pekko.dispatch.Dispatchers -import scala.concurrent.ExecutionContext import pekko.japi.Util.immutableSeq import pekko.pattern.ask import pekko.pattern.pipe import pekko.util.Helpers.ConfigOps -import scala.jdk.DurationConverters._ import pekko.util.Timeout +import com.typesafe.config.Config + /** * Broadcasts the message to all routees, and replies with the first response. * diff --git a/actor/src/main/scala/org/apache/pekko/routing/SmallestMailbox.scala b/actor/src/main/scala/org/apache/pekko/routing/SmallestMailbox.scala index a549d66bd5..60f50940e1 100644 --- a/actor/src/main/scala/org/apache/pekko/routing/SmallestMailbox.scala +++ b/actor/src/main/scala/org/apache/pekko/routing/SmallestMailbox.scala @@ -15,12 +15,10 @@ package org.apache.pekko.routing import java.util.concurrent.ThreadLocalRandom +import scala.annotation.nowarn import scala.annotation.tailrec import scala.collection.immutable -import scala.annotation.nowarn -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.ActorCell import pekko.actor.ActorRefWithCell @@ -28,6 +26,8 @@ import pekko.actor.ActorSystem import pekko.actor.SupervisorStrategy import pekko.dispatch.Dispatchers +import com.typesafe.config.Config + object SmallestMailboxRoutingLogic { def apply(): SmallestMailboxRoutingLogic = new SmallestMailboxRoutingLogic } diff --git a/actor/src/main/scala/org/apache/pekko/routing/TailChopping.scala b/actor/src/main/scala/org/apache/pekko/routing/TailChopping.scala index 00a47c727b..7c6fbe38d7 100644 --- a/actor/src/main/scala/org/apache/pekko/routing/TailChopping.scala +++ b/actor/src/main/scala/org/apache/pekko/routing/TailChopping.scala @@ -18,19 +18,19 @@ import java.util.concurrent.atomic.AtomicInteger import scala.collection.immutable import scala.concurrent.{ ExecutionContext, Promise } import scala.concurrent.duration._ +import scala.jdk.DurationConverters._ import scala.util.Random -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor._ import pekko.dispatch.Dispatchers import pekko.japi.Util.immutableSeq import pekko.pattern.{ ask, pipe, AskTimeoutException } import pekko.util.Helpers.ConfigOps -import scala.jdk.DurationConverters._ import pekko.util.Timeout +import com.typesafe.config.Config + /** * As each message is sent to the router, the routees are randomly ordered. The message is sent to the * first routee. If no response is received before the `interval` has passed, the same message is sent diff --git a/actor/src/main/scala/org/apache/pekko/serialization/Serialization.scala b/actor/src/main/scala/org/apache/pekko/serialization/Serialization.scala index 5d8e4369c3..72e9c98062 100644 --- a/actor/src/main/scala/org/apache/pekko/serialization/Serialization.scala +++ b/actor/src/main/scala/org/apache/pekko/serialization/Serialization.scala @@ -26,13 +26,13 @@ import scala.util.{ DynamicVariable, Failure, Try } import scala.util.Success import scala.util.control.NonFatal -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor._ import pekko.annotation.InternalApi import pekko.event.{ LogMarker, Logging, LoggingAdapter } +import com.typesafe.config.Config + object Serialization { /** diff --git a/actor/src/main/scala/org/apache/pekko/serialization/SerializationSetup.scala b/actor/src/main/scala/org/apache/pekko/serialization/SerializationSetup.scala index 3d3501293e..a6f942a8a3 100644 --- a/actor/src/main/scala/org/apache/pekko/serialization/SerializationSetup.scala +++ b/actor/src/main/scala/org/apache/pekko/serialization/SerializationSetup.scala @@ -14,11 +14,11 @@ package org.apache.pekko.serialization import scala.collection.immutable +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.actor.setup.Setup -import scala.jdk.CollectionConverters._ object SerializationSetup { diff --git a/actor/src/main/scala/org/apache/pekko/util/ConstantFun.scala b/actor/src/main/scala/org/apache/pekko/util/ConstantFun.scala index cf5007f090..0a686df677 100644 --- a/actor/src/main/scala/org/apache/pekko/util/ConstantFun.scala +++ b/actor/src/main/scala/org/apache/pekko/util/ConstantFun.scala @@ -13,13 +13,13 @@ package org.apache.pekko.util +import java.lang + import org.apache.pekko import pekko.annotation.InternalApi import pekko.japi.{ Pair => JPair } import pekko.japi.function.{ Function => JFun, Function2 => JFun2 } -import java.lang - /** * INTERNAL API */ diff --git a/actor/src/main/scala/org/apache/pekko/util/DoubleLinkedList.scala b/actor/src/main/scala/org/apache/pekko/util/DoubleLinkedList.scala index 7ada6789a1..bf2c79b22c 100644 --- a/actor/src/main/scala/org/apache/pekko/util/DoubleLinkedList.scala +++ b/actor/src/main/scala/org/apache/pekko/util/DoubleLinkedList.scala @@ -13,10 +13,10 @@ package org.apache.pekko.util -import org.apache.pekko.annotation.InternalApi - import scala.collection.AbstractIterator +import org.apache.pekko.annotation.InternalApi + /** * INTERNAL API * diff --git a/actor/src/main/scala/org/apache/pekko/util/FrequencyList.scala b/actor/src/main/scala/org/apache/pekko/util/FrequencyList.scala index f6718cd7ff..9f66fc9e59 100644 --- a/actor/src/main/scala/org/apache/pekko/util/FrequencyList.scala +++ b/actor/src/main/scala/org/apache/pekko/util/FrequencyList.scala @@ -13,11 +13,11 @@ package org.apache.pekko.util -import org.apache.pekko.annotation.InternalApi - import scala.collection.{ immutable, mutable } import scala.concurrent.duration.FiniteDuration +import org.apache.pekko.annotation.InternalApi + /** * INTERNAL API */ diff --git a/actor/src/main/scala/org/apache/pekko/util/FrequencySketch.scala b/actor/src/main/scala/org/apache/pekko/util/FrequencySketch.scala index e54cf1a0b5..5351de7db7 100644 --- a/actor/src/main/scala/org/apache/pekko/util/FrequencySketch.scala +++ b/actor/src/main/scala/org/apache/pekko/util/FrequencySketch.scala @@ -29,10 +29,10 @@ package org.apache.pekko.util -import org.apache.pekko.annotation.InternalApi - import scala.util.hashing.MurmurHash3 +import org.apache.pekko.annotation.InternalApi + /** * INTERNAL API * diff --git a/actor/src/main/scala/org/apache/pekko/util/FunctionConverters.scala b/actor/src/main/scala/org/apache/pekko/util/FunctionConverters.scala index 681e150fae..a5ce72ea9c 100644 --- a/actor/src/main/scala/org/apache/pekko/util/FunctionConverters.scala +++ b/actor/src/main/scala/org/apache/pekko/util/FunctionConverters.scala @@ -17,10 +17,10 @@ package org.apache.pekko.util -import org.apache.pekko.annotation.InternalStableApi - import scala.jdk.Priority0FunctionExtensions +import org.apache.pekko.annotation.InternalStableApi + /** * INTERNAL API * diff --git a/actor/src/main/scala/org/apache/pekko/util/Helpers.scala b/actor/src/main/scala/org/apache/pekko/util/Helpers.scala index 8b93060302..1c7bc59758 100644 --- a/actor/src/main/scala/org/apache/pekko/util/Helpers.scala +++ b/actor/src/main/scala/org/apache/pekko/util/Helpers.scala @@ -31,8 +31,10 @@ import java.time.format.DateTimeFormatter import java.util.{ Comparator, Locale } import java.util.concurrent.TimeUnit import java.util.regex.Pattern + import scala.annotation.tailrec import scala.concurrent.duration.{ Duration, FiniteDuration } + import com.typesafe.config.{ Config, ConfigRenderOptions } object Helpers { diff --git a/actor/src/main/scala/org/apache/pekko/util/Index.scala b/actor/src/main/scala/org/apache/pekko/util/Index.scala index cb1d06f84f..4c333c6346 100644 --- a/actor/src/main/scala/org/apache/pekko/util/Index.scala +++ b/actor/src/main/scala/org/apache/pekko/util/Index.scala @@ -17,7 +17,6 @@ import java.util.Comparator import java.util.concurrent.{ ConcurrentHashMap, ConcurrentSkipListSet } import scala.annotation.tailrec - import scala.jdk.CollectionConverters._ /** diff --git a/actor/src/main/scala/org/apache/pekko/util/ManifestInfo.scala b/actor/src/main/scala/org/apache/pekko/util/ManifestInfo.scala index b77b46bfad..1692c0c630 100644 --- a/actor/src/main/scala/org/apache/pekko/util/ManifestInfo.scala +++ b/actor/src/main/scala/org/apache/pekko/util/ManifestInfo.scala @@ -17,9 +17,8 @@ import java.io.IOException import java.util.jar.Attributes import java.util.jar.Manifest -import scala.collection.immutable - import scala.annotation.nowarn +import scala.collection.immutable import org.apache.pekko import pekko.actor.ActorSystem diff --git a/actor/src/main/scala/org/apache/pekko/util/RecencyList.scala b/actor/src/main/scala/org/apache/pekko/util/RecencyList.scala index 9087349ba5..c7708d50e2 100644 --- a/actor/src/main/scala/org/apache/pekko/util/RecencyList.scala +++ b/actor/src/main/scala/org/apache/pekko/util/RecencyList.scala @@ -13,11 +13,11 @@ package org.apache.pekko.util -import org.apache.pekko.annotation.InternalApi - import scala.collection.{ immutable, mutable } import scala.concurrent.duration.FiniteDuration +import org.apache.pekko.annotation.InternalApi + /** * INTERNAL API */ diff --git a/actor/src/main/scala/org/apache/pekko/util/SegmentedRecencyList.scala b/actor/src/main/scala/org/apache/pekko/util/SegmentedRecencyList.scala index c3fc143d01..0e5320720b 100644 --- a/actor/src/main/scala/org/apache/pekko/util/SegmentedRecencyList.scala +++ b/actor/src/main/scala/org/apache/pekko/util/SegmentedRecencyList.scala @@ -13,11 +13,11 @@ package org.apache.pekko.util -import org.apache.pekko.annotation.InternalApi - import scala.collection.{ immutable, mutable } import scala.concurrent.duration.FiniteDuration +import org.apache.pekko.annotation.InternalApi + /** * INTERNAL API */ diff --git a/bench-jmh/src/main/scala/org/apache/pekko/actor/ActorBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/actor/ActorBenchmark.scala index d6348d83b2..8d3e9a74d5 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/actor/ActorBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/actor/ActorBenchmark.scala @@ -19,9 +19,10 @@ import scala.concurrent.Await import scala.concurrent.duration._ import BenchmarkActors._ -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ +import com.typesafe.config.ConfigFactory + object ActorBenchmark { // Constants because they are used in annotations final val threads = 8 // update according to cpu diff --git a/bench-jmh/src/main/scala/org/apache/pekko/actor/AffinityPoolComparativeBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/actor/AffinityPoolComparativeBenchmark.scala index b69f7ac504..af04cf6a76 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/actor/AffinityPoolComparativeBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/actor/AffinityPoolComparativeBenchmark.scala @@ -15,13 +15,14 @@ package org.apache.pekko.actor import java.util.concurrent.TimeUnit -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko import pekko.actor.BenchmarkActors._ import pekko.actor.ForkJoinActorBenchmark.cores +import com.typesafe.config.ConfigFactory + @State(Scope.Benchmark) @BenchmarkMode(Array(Mode.Throughput)) @Fork(1) diff --git a/bench-jmh/src/main/scala/org/apache/pekko/actor/AffinityPoolIdleCPULevelBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/actor/AffinityPoolIdleCPULevelBenchmark.scala index c0b2d94d50..4d3c3b7dfc 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/actor/AffinityPoolIdleCPULevelBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/actor/AffinityPoolIdleCPULevelBenchmark.scala @@ -15,11 +15,12 @@ package org.apache.pekko.actor import java.util.concurrent.TimeUnit -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko.actor.BenchmarkActors._ +import com.typesafe.config.ConfigFactory + @State(Scope.Benchmark) @BenchmarkMode(Array(Mode.Throughput)) @Fork(1) diff --git a/bench-jmh/src/main/scala/org/apache/pekko/actor/AffinityPoolRequestResponseBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/actor/AffinityPoolRequestResponseBenchmark.scala index d5c51a3e6c..76c6c5d95c 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/actor/AffinityPoolRequestResponseBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/actor/AffinityPoolRequestResponseBenchmark.scala @@ -15,13 +15,14 @@ package org.apache.pekko.actor import java.util.concurrent.{ CountDownLatch, TimeUnit } -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko import pekko.actor.BenchmarkActors._ import pekko.actor.ForkJoinActorBenchmark.cores +import com.typesafe.config.ConfigFactory + @State(Scope.Benchmark) @BenchmarkMode(Array(Mode.Throughput)) @Fork(1) diff --git a/bench-jmh/src/main/scala/org/apache/pekko/actor/ForkJoinActorBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/actor/ForkJoinActorBenchmark.scala index 16ec75c1fe..1d0d398c05 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/actor/ForkJoinActorBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/actor/ForkJoinActorBenchmark.scala @@ -20,11 +20,12 @@ import scala.concurrent.Await import scala.concurrent.duration._ import BenchmarkActors._ -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko.testkit.TestProbe +import com.typesafe.config.ConfigFactory + @State(Scope.Benchmark) @BenchmarkMode(Array(Mode.Throughput)) @Fork(1) diff --git a/bench-jmh/src/main/scala/org/apache/pekko/actor/JCToolsMailbox.scala b/bench-jmh/src/main/scala/org/apache/pekko/actor/JCToolsMailbox.scala index 2e48e72050..86718f21f7 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/actor/JCToolsMailbox.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/actor/JCToolsMailbox.scala @@ -16,7 +16,6 @@ package org.apache.pekko.actor import scala.annotation.tailrec import scala.concurrent.duration.Duration -import com.typesafe.config.Config import org.jctools.queues.MpscGrowableArrayQueue import org.apache.pekko @@ -27,6 +26,8 @@ import pekko.dispatch.MailboxType import pekko.dispatch.MessageQueue import pekko.dispatch.ProducesMessageQueue +import com.typesafe.config.Config + case class JCToolsMailbox(val capacity: Int) extends MailboxType with ProducesMessageQueue[BoundedNodeMessageQueue] { def this(settings: ActorSystem.Settings, config: Config) = this(config.getInt("mailbox-capacity")) diff --git a/bench-jmh/src/main/scala/org/apache/pekko/actor/ManyToOneArrayMailbox.scala b/bench-jmh/src/main/scala/org/apache/pekko/actor/ManyToOneArrayMailbox.scala index dba7df6c60..7e29323635 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/actor/ManyToOneArrayMailbox.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/actor/ManyToOneArrayMailbox.scala @@ -16,7 +16,6 @@ package org.apache.pekko.actor import scala.annotation.tailrec import scala.concurrent.duration.Duration -import com.typesafe.config.Config import org.agrona.concurrent.ManyToOneConcurrentArrayQueue import org.apache.pekko @@ -27,6 +26,8 @@ import pekko.dispatch.MailboxType import pekko.dispatch.MessageQueue import pekko.dispatch.ProducesMessageQueue +import com.typesafe.config.Config + /** * ManyToOneArrayMailbox is a high-performance, multiple-producer single-consumer, bounded MailboxType, * Noteworthy is that it discards overflow as DeadLetters. diff --git a/bench-jmh/src/main/scala/org/apache/pekko/actor/StashCreationBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/actor/StashCreationBenchmark.scala index 683c6b90ed..ee477beb04 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/actor/StashCreationBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/actor/StashCreationBenchmark.scala @@ -18,11 +18,12 @@ import java.util.concurrent.TimeUnit import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko.testkit.TestProbe +import com.typesafe.config.ConfigFactory + object StashCreationBenchmark { class StashingActor extends Actor with Stash { def receive = { diff --git a/bench-jmh/src/main/scala/org/apache/pekko/actor/TellOnlyBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/actor/TellOnlyBenchmark.scala index 7cc0480779..722fcbf8de 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/actor/TellOnlyBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/actor/TellOnlyBenchmark.scala @@ -18,7 +18,6 @@ import java.util.concurrent.TimeUnit import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigFactory } import org.openjdk.jmh.annotations._ import org.apache.pekko @@ -26,6 +25,8 @@ import pekko.dispatch._ import pekko.testkit.TestProbe import pekko.util.Helpers.ConfigOps +import com.typesafe.config.{ Config, ConfigFactory } + @State(Scope.Benchmark) @BenchmarkMode(Array(Mode.SingleShotTime)) @Fork(5) diff --git a/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/TypedActorBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/TypedActorBenchmark.scala index 56049bc876..1760a013e5 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/TypedActorBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/TypedActorBenchmark.scala @@ -18,12 +18,13 @@ import java.util.concurrent.TimeUnit import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko import pekko.actor.typed.scaladsl.AskPattern._ +import com.typesafe.config.ConfigFactory + object TypedActorBenchmark { // Constants because they are used in annotations final val threads = 8 // update according to cpu diff --git a/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/TypedForkJoinActorBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/TypedForkJoinActorBenchmark.scala index f0b7854ee2..b986a355ea 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/TypedForkJoinActorBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/TypedForkJoinActorBenchmark.scala @@ -19,7 +19,6 @@ import scala.concurrent.Await import scala.concurrent.Future import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations.Benchmark import org.openjdk.jmh.annotations.BenchmarkMode import org.openjdk.jmh.annotations.Fork @@ -38,6 +37,8 @@ import org.openjdk.jmh.annotations.Warmup import org.apache.pekko import pekko.actor.typed.scaladsl.AskPattern._ +import com.typesafe.config.ConfigFactory + @State(Scope.Benchmark) @BenchmarkMode(Array(Mode.Throughput)) @Fork(1) diff --git a/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliveryBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliveryBenchmark.scala index 0651949efb..d8704548d7 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliveryBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/actor/typed/delivery/ReliableDeliveryBenchmark.scala @@ -21,7 +21,6 @@ import scala.concurrent.duration._ import scala.util.Failure import scala.util.Success -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko @@ -34,6 +33,8 @@ import pekko.actor.typed.receptionist.ServiceKey import pekko.actor.typed.scaladsl.AskPattern._ import pekko.actor.typed.scaladsl.Behaviors +import com.typesafe.config.ConfigFactory + object Producer { trait Command diff --git a/bench-jmh/src/main/scala/org/apache/pekko/cluster/ddata/ORSetSerializationBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/cluster/ddata/ORSetSerializationBenchmark.scala index 9d8c898f6a..f2e1569fc2 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/cluster/ddata/ORSetSerializationBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/cluster/ddata/ORSetSerializationBenchmark.scala @@ -18,7 +18,6 @@ import java.util.concurrent.TimeUnit import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations.{ Scope => JmhScope } import org.openjdk.jmh.annotations.Benchmark import org.openjdk.jmh.annotations.BenchmarkMode @@ -38,6 +37,8 @@ import pekko.cluster.Cluster import pekko.serialization.SerializationExtension import pekko.serialization.Serializers +import com.typesafe.config.ConfigFactory + @Fork(2) @State(JmhScope.Benchmark) @BenchmarkMode(Array(Mode.Throughput)) diff --git a/bench-jmh/src/main/scala/org/apache/pekko/dispatch/CachingConfigBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/dispatch/CachingConfigBenchmark.scala index 0275cc49f5..bd2ea0261e 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/dispatch/CachingConfigBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/dispatch/CachingConfigBenchmark.scala @@ -15,9 +15,10 @@ package org.apache.pekko.dispatch import java.util.concurrent.TimeUnit -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ +import com.typesafe.config.ConfigFactory + @State(Scope.Benchmark) @BenchmarkMode(Array(Mode.Throughput)) @Fork(2) diff --git a/bench-jmh/src/main/scala/org/apache/pekko/dispatch/NodeQueueBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/dispatch/NodeQueueBenchmark.scala index b08ddbe34b..bf80a0cf67 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/dispatch/NodeQueueBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/dispatch/NodeQueueBenchmark.scala @@ -18,13 +18,14 @@ import java.util.concurrent.TimeUnit import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko import pekko.actor._ import pekko.testkit.TestProbe +import com.typesafe.config.ConfigFactory + object NodeQueueBenchmark { final val burst = 100000 case object Stop diff --git a/bench-jmh/src/main/scala/org/apache/pekko/io/dns/IdGeneratorBanchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/io/dns/IdGeneratorBanchmark.scala index e6980417c7..a6fcf21457 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/io/dns/IdGeneratorBanchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/io/dns/IdGeneratorBanchmark.scala @@ -17,6 +17,9 @@ package org.apache.pekko.io.dns +import java.security.SecureRandom +import java.util.concurrent.{ ThreadLocalRandom, TimeUnit } + import org.openjdk.jmh.annotations.{ Benchmark, BenchmarkMode, @@ -30,9 +33,6 @@ import org.openjdk.jmh.annotations.{ Warmup } -import java.util.concurrent.{ ThreadLocalRandom, TimeUnit } -import java.security.SecureRandom - @BenchmarkMode(Array(Mode.Throughput)) @OutputTimeUnit(TimeUnit.NANOSECONDS) @Warmup(iterations = 3, time = 5, timeUnit = TimeUnit.SECONDS) diff --git a/bench-jmh/src/main/scala/org/apache/pekko/persistence/LevelDbBatchingBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/persistence/LevelDbBatchingBenchmark.scala index 551d9ea660..e129d0f5a1 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/persistence/LevelDbBatchingBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/persistence/LevelDbBatchingBenchmark.scala @@ -15,18 +15,20 @@ package org.apache.pekko.persistence import java.io.File import java.util.concurrent.TimeUnit + +import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.duration._ + import org.apache.commons.io.FileUtils import org.openjdk.jmh.annotations._ + import org.apache.pekko import pekko.actor._ import pekko.persistence.journal.AsyncWriteTarget._ import pekko.persistence.journal.leveldb.{ SharedLeveldbJournal, SharedLeveldbStore } import pekko.testkit.TestProbe -import scala.annotation.nowarn - /* # OS: OSX 10.9.3 # CPU: Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz diff --git a/bench-jmh/src/main/scala/org/apache/pekko/remote/artery/CodecBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/remote/artery/CodecBenchmark.scala index a1cb3a8561..d60f1dafc1 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/remote/artery/CodecBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/remote/artery/CodecBenchmark.scala @@ -19,13 +19,12 @@ import java.nio.ByteOrder import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit +import scala.annotation.nowarn import scala.annotation.tailrec import scala.concurrent.Await import scala.concurrent.Future import scala.concurrent.duration._ -import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko @@ -42,6 +41,8 @@ import pekko.stream.SystemMaterializer import pekko.stream.scaladsl._ import pekko.util.OptionVal +import com.typesafe.config.ConfigFactory + @State(Scope.Benchmark) @OutputTimeUnit(TimeUnit.MILLISECONDS) @BenchmarkMode(Array(Mode.Throughput)) diff --git a/bench-jmh/src/main/scala/org/apache/pekko/remote/artery/SendQueueBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/remote/artery/SendQueueBenchmark.scala index 9bf95b8350..e1b904017e 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/remote/artery/SendQueueBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/remote/artery/SendQueueBenchmark.scala @@ -20,7 +20,6 @@ import java.util.concurrent.TimeUnit import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import org.agrona.concurrent.ManyToOneConcurrentArrayQueue import org.openjdk.jmh.annotations._ @@ -31,6 +30,8 @@ import pekko.stream.OverflowStrategy import pekko.stream.SystemMaterializer import pekko.stream.scaladsl._ +import com.typesafe.config.ConfigFactory + @State(Scope.Benchmark) @OutputTimeUnit(TimeUnit.MILLISECONDS) @BenchmarkMode(Array(Mode.Throughput)) diff --git a/bench-jmh/src/main/scala/org/apache/pekko/remote/artery/compress/SerializationFormatCacheBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/remote/artery/compress/SerializationFormatCacheBenchmark.scala index 15ce77c23a..6ad899dbbc 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/remote/artery/compress/SerializationFormatCacheBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/remote/artery/compress/SerializationFormatCacheBenchmark.scala @@ -13,15 +13,9 @@ package org.apache.pekko.remote.artery.compress -import org.apache.pekko -import pekko.actor.Actor -import pekko.actor.ActorRef -import pekko.actor.ActorSystem -import pekko.actor.ExtendedActorSystem -import pekko.actor.Props -import pekko.pattern.PromiseActorRef -import pekko.remote.artery.SerializationFormatCache -import pekko.serialization.Serialization +import scala.annotation.nowarn +import scala.concurrent.Promise + import org.openjdk.jmh.annotations.Benchmark import org.openjdk.jmh.annotations.Fork import org.openjdk.jmh.annotations.Level @@ -33,8 +27,15 @@ import org.openjdk.jmh.annotations.State import org.openjdk.jmh.annotations.TearDown import org.openjdk.jmh.infra.Blackhole -import scala.annotation.nowarn -import scala.concurrent.Promise +import org.apache.pekko +import pekko.actor.Actor +import pekko.actor.ActorRef +import pekko.actor.ActorSystem +import pekko.actor.ExtendedActorSystem +import pekko.actor.Props +import pekko.pattern.PromiseActorRef +import pekko.remote.artery.SerializationFormatCache +import pekko.serialization.Serialization /** * Actually more like specific benchmarks for the few concrete LRU cache usages diff --git a/bench-jmh/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializationBench.scala b/bench-jmh/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializationBench.scala index 939cbad12c..b4a3719d1f 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializationBench.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializationBench.scala @@ -19,11 +19,10 @@ import java.time.LocalDateTime import java.util import java.util.concurrent.TimeUnit +import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.duration._ -import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko @@ -32,6 +31,8 @@ import pekko.serialization.Serialization import pekko.serialization.SerializationExtension import pekko.serialization.SerializerWithStringManifest +import com.typesafe.config.ConfigFactory + object JacksonSerializationBench { trait TestMessage diff --git a/bench-jmh/src/main/scala/org/apache/pekko/stream/AskBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/stream/AskBenchmark.scala index 0b00795323..33e9c379ee 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/stream/AskBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/stream/AskBenchmark.scala @@ -19,7 +19,6 @@ import java.util.concurrent.TimeUnit import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko @@ -34,6 +33,8 @@ import pekko.stream.scaladsl._ import pekko.stream.testkit.scaladsl.StreamTestKit import pekko.util.Timeout +import com.typesafe.config.ConfigFactory + object AskBenchmark { final val OperationsPerInvocation = 100000 } diff --git a/bench-jmh/src/main/scala/org/apache/pekko/stream/CollectBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/stream/CollectBenchmark.scala index 4cc2113b64..a6722c3424 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/stream/CollectBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/stream/CollectBenchmark.scala @@ -13,9 +13,16 @@ package org.apache.pekko.stream -import com.typesafe.config.ConfigFactory -import org.apache.pekko +import java.util.concurrent.TimeUnit + +import scala.annotation.nowarn +import scala.concurrent._ +import scala.concurrent.duration._ +import scala.util.control.NonFatal + import org.openjdk.jmh.annotations._ + +import org.apache.pekko import pekko.actor.ActorSystem import pekko.stream.ActorAttributes.SupervisionStrategy import pekko.stream.Attributes.SourceLocation @@ -25,11 +32,7 @@ import pekko.stream.impl.fusing.Collect.NotApplied import pekko.stream.scaladsl._ import pekko.stream.stage.{ GraphStage, GraphStageLogic, InHandler, OutHandler } -import java.util.concurrent.TimeUnit -import scala.annotation.nowarn -import scala.concurrent._ -import scala.concurrent.duration._ -import scala.util.control.NonFatal +import com.typesafe.config.ConfigFactory object CollectBenchmark { final val OperationsPerInvocation = 10000000 diff --git a/bench-jmh/src/main/scala/org/apache/pekko/stream/FlatMapConcatBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/stream/FlatMapConcatBenchmark.scala index f8c0d49d5d..83723c9305 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/stream/FlatMapConcatBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/stream/FlatMapConcatBenchmark.scala @@ -19,7 +19,6 @@ import java.util.concurrent.TimeUnit import scala.concurrent.{ Await, Future } import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko @@ -31,6 +30,8 @@ import pekko.stream.impl.fusing.GraphStages import pekko.stream.scaladsl._ import pekko.stream.testkit.scaladsl.StreamTestKit +import com.typesafe.config.ConfigFactory + object FlatMapConcatBenchmark { final val OperationsPerInvocation = 100000 } diff --git a/bench-jmh/src/main/scala/org/apache/pekko/stream/FlowMapBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/stream/FlowMapBenchmark.scala index 5ab9a14c9f..f689aa2095 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/stream/FlowMapBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/stream/FlowMapBenchmark.scala @@ -20,7 +20,6 @@ import scala.concurrent.Await import scala.concurrent.duration._ import scala.util.Success -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko @@ -30,6 +29,8 @@ import pekko.remote.artery.BenchTestSource import pekko.stream.impl.fusing.GraphStages import pekko.stream.scaladsl._ +import com.typesafe.config.ConfigFactory + @State(Scope.Benchmark) @OutputTimeUnit(TimeUnit.SECONDS) @BenchmarkMode(Array(Mode.Throughput)) diff --git a/bench-jmh/src/main/scala/org/apache/pekko/stream/FramingBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/stream/FramingBenchmark.scala index 269b120dbe..5c05601f5c 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/stream/FramingBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/stream/FramingBenchmark.scala @@ -20,8 +20,6 @@ import scala.concurrent.Await import scala.concurrent.duration._ import scala.util.Random -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko @@ -33,6 +31,9 @@ import pekko.stream.scaladsl.Sink import pekko.stream.scaladsl.Source import pekko.util.ByteString +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + @State(Scope.Benchmark) @OutputTimeUnit(TimeUnit.SECONDS) @BenchmarkMode(Array(Mode.Throughput)) diff --git a/bench-jmh/src/main/scala/org/apache/pekko/stream/FusedGraphsBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/stream/FusedGraphsBenchmark.scala index 1b0dd9d0bd..fd7425525f 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/stream/FusedGraphsBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/stream/FusedGraphsBenchmark.scala @@ -19,7 +19,6 @@ import java.util.concurrent.TimeUnit import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.openjdk.jmh.annotations.OperationsPerInvocation @@ -29,6 +28,8 @@ import pekko.actor.ActorSystem import pekko.stream.scaladsl._ import pekko.stream.stage._ +import com.typesafe.config.ConfigFactory + object FusedGraphsBenchmark { val ElementCount = 100 * 1000 diff --git a/bench-jmh/src/main/scala/org/apache/pekko/stream/InterpreterBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/stream/InterpreterBenchmark.scala index 2f66fcd84b..30724ab775 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/stream/InterpreterBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/stream/InterpreterBenchmark.scala @@ -19,8 +19,8 @@ import org.openjdk.jmh.annotations._ import org.apache.pekko import pekko.event._ -import pekko.stream.impl.fusing.GraphInterpreterSpecKit import pekko.stream.impl.fusing.GraphInterpreter.{ DownstreamBoundaryStageLogic, UpstreamBoundaryStageLogic } +import pekko.stream.impl.fusing.GraphInterpreterSpecKit import pekko.stream.impl.fusing.GraphStages import pekko.stream.stage._ diff --git a/bench-jmh/src/main/scala/org/apache/pekko/stream/LazyFutureSourceBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/stream/LazyFutureSourceBenchmark.scala index 390dfa3bca..21f8f7e2ef 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/stream/LazyFutureSourceBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/stream/LazyFutureSourceBenchmark.scala @@ -22,7 +22,6 @@ import java.util.concurrent.TimeUnit import scala.concurrent._ import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko @@ -30,6 +29,8 @@ import pekko.NotUsed import pekko.actor.ActorSystem import pekko.stream.scaladsl._ +import com.typesafe.config.ConfigFactory + object LazyFutureSourceBenchmark { final val OperationsPerInvocation = 100000 } diff --git a/bench-jmh/src/main/scala/org/apache/pekko/stream/MapAsyncBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/stream/MapAsyncBenchmark.scala index 88f59d606d..3442b2a426 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/stream/MapAsyncBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/stream/MapAsyncBenchmark.scala @@ -20,7 +20,6 @@ import scala.concurrent.Await import scala.concurrent.Future import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko @@ -31,6 +30,8 @@ import pekko.remote.artery.LatchSink import pekko.stream.scaladsl._ import pekko.stream.testkit.scaladsl.StreamTestKit +import com.typesafe.config.ConfigFactory + object MapAsyncBenchmark { final val OperationsPerInvocation = 100000 } diff --git a/bench-jmh/src/main/scala/org/apache/pekko/stream/PartitionHubBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/stream/PartitionHubBenchmark.scala index 40d25b51cc..40be60fe91 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/stream/PartitionHubBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/stream/PartitionHubBenchmark.scala @@ -19,7 +19,6 @@ import java.util.concurrent.TimeUnit import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko @@ -32,6 +31,8 @@ import pekko.stream.scaladsl._ import pekko.stream.scaladsl.PartitionHub import pekko.stream.testkit.scaladsl.StreamTestKit +import com.typesafe.config.ConfigFactory + object PartitionHubBenchmark { final val OperationsPerInvocation = 100000 } diff --git a/bench-jmh/src/main/scala/org/apache/pekko/stream/SourceRefBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/stream/SourceRefBenchmark.scala index 87d69bce58..218751f575 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/stream/SourceRefBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/stream/SourceRefBenchmark.scala @@ -20,7 +20,6 @@ import scala.concurrent.Await import scala.concurrent.duration._ import scala.util.Success -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko @@ -28,6 +27,8 @@ import pekko.actor.ActorSystem import pekko.remote.artery.BenchTestSource import pekko.stream.scaladsl._ +import com.typesafe.config.ConfigFactory + /* Just a brief reference run (3.1 GHz Intel Core i7, MacBook Pro late 2017): [info] SourceRefBenchmark.source_ref_100k_elements thrpt 10 724650.336 ± 233643.256 ops/s diff --git a/bench-jmh/src/main/scala/org/apache/pekko/stream/ZipWithIndexBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/stream/ZipWithIndexBenchmark.scala index 061c975998..9c1dde4c6e 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/stream/ZipWithIndexBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/stream/ZipWithIndexBenchmark.scala @@ -19,18 +19,18 @@ package org.apache.pekko.stream import java.util.concurrent.TimeUnit +import scala.annotation.nowarn import scala.collection.immutable import scala.concurrent._ import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import org.openjdk.jmh.annotations._ import org.apache.pekko import pekko.actor.ActorSystem import pekko.stream.scaladsl._ -import scala.annotation.nowarn +import com.typesafe.config.ConfigFactory object ZipWithIndexBenchmark { final val OperationsPerInvocation = 100000 diff --git a/bench-jmh/src/main/scala/org/apache/pekko/util/ArrayCopyOf_Benchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/util/ArrayCopyOf_Benchmark.scala index af2467a588..d8cd0c60f8 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/util/ArrayCopyOf_Benchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/util/ArrayCopyOf_Benchmark.scala @@ -17,10 +17,10 @@ package org.apache.pekko.util -import org.openjdk.jmh.annotations._ - import java.util.concurrent.TimeUnit +import org.openjdk.jmh.annotations._ + @State(Scope.Benchmark) @Measurement(timeUnit = TimeUnit.MILLISECONDS) class ArrayCopyOf_Benchmark { diff --git a/bench-jmh/src/main/scala/org/apache/pekko/util/FastFrequencySketchBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/util/FastFrequencySketchBenchmark.scala index c7dac61721..3dd27b0a6c 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/util/FastFrequencySketchBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/util/FastFrequencySketchBenchmark.scala @@ -13,6 +13,8 @@ package org.apache.pekko.util +import java.util.concurrent.TimeUnit + import org.openjdk.jmh.annotations.Benchmark import org.openjdk.jmh.annotations.Fork import org.openjdk.jmh.annotations.Measurement @@ -21,8 +23,6 @@ import org.openjdk.jmh.annotations.Setup import org.openjdk.jmh.annotations.State import org.openjdk.jmh.annotations.Warmup -import java.util.concurrent.TimeUnit - @State(Scope.Benchmark) @Fork(1) @Warmup(iterations = 3, time = 20, timeUnit = TimeUnit.SECONDS) diff --git a/bench-jmh/src/main/scala/org/apache/pekko/util/FrequencySketchBenchmark.scala b/bench-jmh/src/main/scala/org/apache/pekko/util/FrequencySketchBenchmark.scala index a5dd5d39e0..a92b0defdd 100644 --- a/bench-jmh/src/main/scala/org/apache/pekko/util/FrequencySketchBenchmark.scala +++ b/bench-jmh/src/main/scala/org/apache/pekko/util/FrequencySketchBenchmark.scala @@ -13,6 +13,8 @@ package org.apache.pekko.util +import java.util.concurrent.TimeUnit + import org.openjdk.jmh.annotations.Benchmark import org.openjdk.jmh.annotations.Fork import org.openjdk.jmh.annotations.Measurement @@ -21,8 +23,6 @@ import org.openjdk.jmh.annotations.Setup import org.openjdk.jmh.annotations.State import org.openjdk.jmh.annotations.Warmup -import java.util.concurrent.TimeUnit - @State(Scope.Benchmark) @Fork(1) @Warmup(iterations = 3, time = 20, timeUnit = TimeUnit.SECONDS) diff --git a/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsCollector.scala b/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsCollector.scala index 9787fddd0b..f20fa74f22 100644 --- a/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsCollector.scala +++ b/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsCollector.scala @@ -15,9 +15,8 @@ package org.apache.pekko.cluster.metrics import java.util.concurrent.ThreadLocalRandom -import scala.collection.immutable - import scala.annotation.nowarn +import scala.collection.immutable import org.apache.pekko import pekko.actor.Actor diff --git a/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsExtension.scala b/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsExtension.scala index 785266d0ba..0150118bd2 100644 --- a/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsExtension.scala +++ b/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsExtension.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.metrics import scala.collection.immutable -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ActorSystem @@ -31,6 +29,8 @@ import pekko.actor.SupervisorStrategy import pekko.event.Logging import pekko.event.LoggingAdapter +import com.typesafe.config.Config + /** * Cluster metrics extension. * diff --git a/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsRouting.scala b/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsRouting.scala index 2d6712cae4..a5ba07243c 100644 --- a/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsRouting.scala +++ b/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsRouting.scala @@ -17,12 +17,10 @@ import java.util.Arrays import java.util.concurrent.ThreadLocalRandom import java.util.concurrent.atomic.AtomicReference +import scala.annotation.nowarn import scala.annotation.tailrec import scala.collection.immutable -import scala.annotation.nowarn -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorSystem @@ -37,6 +35,8 @@ import pekko.dispatch.Dispatchers import pekko.japi.Util.immutableSeq import pekko.routing._ +import com.typesafe.config.Config + /** * Load balancing of messages to cluster nodes based on cluster metric data. * diff --git a/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsSettings.scala b/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsSettings.scala index 53fbd8f190..91b5903405 100644 --- a/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsSettings.scala +++ b/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsSettings.scala @@ -16,12 +16,12 @@ package org.apache.pekko.cluster.metrics import scala.concurrent.duration.Duration import scala.concurrent.duration.FiniteDuration -import com.typesafe.config.Config - import org.apache.pekko import pekko.util.Helpers.ConfigOps import pekko.util.Helpers.Requiring +import com.typesafe.config.Config + /** * Metrics extension settings. Documented in: `src/main/resources/reference.conf`. */ diff --git a/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsStrategy.scala b/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsStrategy.scala index 8a713a5355..fc926af640 100644 --- a/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsStrategy.scala +++ b/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsStrategy.scala @@ -13,12 +13,12 @@ package org.apache.pekko.cluster.metrics -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.OneForOneStrategy import pekko.util.Helpers.ConfigOps +import com.typesafe.config.Config + /** * Default [[ClusterMetricsSupervisor]] strategy: * A configurable [[pekko.actor.OneForOneStrategy]] with restart-on-throwable decider. diff --git a/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/Metric.scala b/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/Metric.scala index defa534527..df7ee5d67e 100644 --- a/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/Metric.scala +++ b/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/Metric.scala @@ -13,12 +13,11 @@ package org.apache.pekko.cluster.metrics +import scala.annotation.nowarn import scala.util.Failure import scala.util.Success import scala.util.Try -import scala.annotation.nowarn - import org.apache.pekko import pekko.actor.Address diff --git a/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/MessageSerializer.scala b/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/MessageSerializer.scala index cdf4706ae9..b658576754 100644 --- a/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/MessageSerializer.scala +++ b/cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/MessageSerializer.scala @@ -17,8 +17,11 @@ import java.{ lang => jl } import java.io.{ ByteArrayInputStream, ByteArrayOutputStream, ObjectOutputStream } import java.io.NotSerializableException import java.util.zip.{ GZIPInputStream, GZIPOutputStream } + import scala.annotation.tailrec import scala.collection.immutable +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.actor.{ Address, ExtendedActorSystem } import pekko.cluster.metrics._ @@ -27,7 +30,6 @@ import pekko.dispatch.Dispatchers import pekko.protobufv3.internal.MessageLite import pekko.remote.ByteStringUtils import pekko.serialization.{ BaseSerializer, SerializationExtension, SerializerWithStringManifest, Serializers } -import scala.jdk.CollectionConverters._ /** * Protobuf serializer for [[pekko.cluster.metrics.ClusterMetricsMessage]] types. diff --git a/cluster-metrics/src/multi-jvm/scala/org/apache/pekko/cluster/metrics/ClusterMetricsExtensionSpec.scala b/cluster-metrics/src/multi-jvm/scala/org/apache/pekko/cluster/metrics/ClusterMetricsExtensionSpec.scala index ec417fa8a8..f7a32b1396 100644 --- a/cluster-metrics/src/multi-jvm/scala/org/apache/pekko/cluster/metrics/ClusterMetricsExtensionSpec.scala +++ b/cluster-metrics/src/multi-jvm/scala/org/apache/pekko/cluster/metrics/ClusterMetricsExtensionSpec.scala @@ -15,13 +15,13 @@ package org.apache.pekko.cluster.metrics import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.cluster.MemberStatus import pekko.cluster.MultiNodeClusterSpec import pekko.remote.testkit.MultiNodeConfig +import com.typesafe.config.ConfigFactory + trait ClusterMetricsCommonConfig extends MultiNodeConfig { import ConfigFactory._ diff --git a/cluster-metrics/src/multi-jvm/scala/org/apache/pekko/cluster/metrics/ClusterMetricsRoutingSpec.scala b/cluster-metrics/src/multi-jvm/scala/org/apache/pekko/cluster/metrics/ClusterMetricsRoutingSpec.scala index 41417bcd14..093a328a90 100644 --- a/cluster-metrics/src/multi-jvm/scala/org/apache/pekko/cluster/metrics/ClusterMetricsRoutingSpec.scala +++ b/cluster-metrics/src/multi-jvm/scala/org/apache/pekko/cluster/metrics/ClusterMetricsRoutingSpec.scala @@ -19,9 +19,6 @@ import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.cluster.Cluster @@ -35,10 +32,13 @@ import pekko.routing.FromConfig import pekko.routing.GetRoutees import pekko.routing.Routees import pekko.serialization.jackson.CborSerializable -import pekko.testkit.GHExcludeTest import pekko.testkit.{ DefaultTimeout, ImplicitSender, LongRunningTest } +import pekko.testkit.GHExcludeTest import pekko.util.unused +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object AdaptiveLoadBalancingRouterConfig extends MultiNodeConfig { class Echo extends Actor { diff --git a/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/ClusterMetricsRoutingSpec.scala b/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/ClusterMetricsRoutingSpec.scala index 3a317f1691..347fb8ff4d 100644 --- a/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/ClusterMetricsRoutingSpec.scala +++ b/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/ClusterMetricsRoutingSpec.scala @@ -13,13 +13,13 @@ package org.apache.pekko.cluster.metrics -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.Address import pekko.cluster.metrics.StandardMetrics._ +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class MetricsSelectorSpec extends AnyWordSpec with Matchers { val factor = 0.3 // TODO read from reference.conf diff --git a/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/ClusterMetricsSettingsSpec.scala b/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/ClusterMetricsSettingsSpec.scala index 2336a7dd4d..329ef2944b 100644 --- a/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/ClusterMetricsSettingsSpec.scala +++ b/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/ClusterMetricsSettingsSpec.scala @@ -15,12 +15,12 @@ package org.apache.pekko.cluster.metrics import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.dispatch.Dispatchers import pekko.testkit.PekkoSpec +import com.typesafe.config.ConfigFactory + class ClusterMetricsSettingsSpec extends PekkoSpec { "ClusterMetricsSettings" must { diff --git a/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/EWMASpec.scala b/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/EWMASpec.scala index 3513f577fa..4f04fc77ee 100644 --- a/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/EWMASpec.scala +++ b/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/EWMASpec.scala @@ -15,9 +15,8 @@ package org.apache.pekko.cluster.metrics import java.util.concurrent.ThreadLocalRandom -import scala.concurrent.duration._ - import scala.annotation.nowarn +import scala.concurrent.duration._ import org.apache.pekko.testkit.{ LongRunningTest, PekkoSpec } diff --git a/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/MetricSpec.scala b/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/MetricSpec.scala index d0ddc108ef..e8cc708979 100644 --- a/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/MetricSpec.scala +++ b/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/MetricSpec.scala @@ -15,17 +15,17 @@ package org.apache.pekko.cluster.metrics import java.lang.System.{ currentTimeMillis => newTimestamp } -import scala.util.Failure - import scala.annotation.nowarn -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec +import scala.util.Failure import org.apache.pekko import pekko.actor.Address import pekko.cluster.metrics.StandardMetrics._ -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec + +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec @nowarn class MetricNumericConverterSpec extends AnyWordSpec with Matchers with MetricNumericConverter { diff --git a/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/MetricsCollectorSpec.scala b/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/MetricsCollectorSpec.scala index 42b512085c..a08e4b5e9c 100644 --- a/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/MetricsCollectorSpec.scala +++ b/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/MetricsCollectorSpec.scala @@ -13,11 +13,10 @@ package org.apache.pekko.cluster.metrics +import scala.annotation.nowarn import scala.concurrent.duration._ import scala.util.Try -import scala.annotation.nowarn - import org.apache.pekko import pekko.cluster.metrics.StandardMetrics._ import pekko.testkit._ diff --git a/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/TestUtil.scala b/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/TestUtil.scala index a3adf58d24..893bde2550 100644 --- a/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/TestUtil.scala +++ b/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/TestUtil.scala @@ -17,7 +17,6 @@ import java.io.Closeable import java.util.logging.LogManager import org.scalatestplus.mockito.MockitoSugar -import org.slf4j.bridge.SLF4JBridgeHandler import org.apache.pekko import pekko.actor.Actor @@ -35,6 +34,8 @@ import pekko.dispatch.UnboundedMessageQueueSemantics import pekko.remote.RARP import pekko.testkit.PekkoSpec +import org.slf4j.bridge.SLF4JBridgeHandler + /** * Redirect different logging sources to SLF4J. */ diff --git a/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/WeightedRouteesSpec.scala b/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/WeightedRouteesSpec.scala index 9f3d37071e..af0b6a61f8 100644 --- a/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/WeightedRouteesSpec.scala +++ b/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/WeightedRouteesSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.metrics import scala.Vector -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Address import pekko.actor.RootActorPath @@ -25,6 +23,8 @@ import pekko.routing.ActorRefRoutee import pekko.routing.ActorSelectionRoutee import pekko.testkit.PekkoSpec +import com.typesafe.config.ConfigFactory + class WeightedRouteesSpec extends PekkoSpec(ConfigFactory.parseString(""" pekko.actor.provider = "cluster" pekko.remote.classic.netty.tcp.port = 0 diff --git a/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/protobuf/NumberInputStreamSpec.scala b/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/protobuf/NumberInputStreamSpec.scala index 07014b01fa..a9fb3028ee 100644 --- a/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/protobuf/NumberInputStreamSpec.scala +++ b/cluster-metrics/src/test/scala/org/apache/pekko/cluster/metrics/protobuf/NumberInputStreamSpec.scala @@ -19,6 +19,7 @@ package org.apache.pekko.cluster.metrics.protobuf import java.io.{ ByteArrayInputStream, ByteArrayOutputStream, ObjectOutputStream } import java.math.BigInteger + import scala.math.BigInt import org.scalatest.matchers.should.Matchers diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingQuery.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingQuery.scala index 137149bb8a..4349ddf328 100644 --- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingQuery.scala +++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingQuery.scala @@ -14,13 +14,13 @@ package org.apache.pekko.cluster.sharding.typed import scala.concurrent.duration.FiniteDuration +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.cluster.sharding.ShardRegion.ClusterShardingStats import pekko.cluster.sharding.ShardRegion.CurrentShardRegionState import pekko.cluster.sharding.typed.scaladsl.EntityTypeKey -import scala.jdk.DurationConverters._ /** * Protocol for querying sharding state e.g. A ShardRegion's state diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingSettings.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingSettings.scala index a076806088..6a8fa9abde 100644 --- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingSettings.scala +++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingSettings.scala @@ -15,8 +15,7 @@ package org.apache.pekko.cluster.sharding.typed import scala.collection.immutable import scala.concurrent.duration._ - -import com.typesafe.config.Config +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.actor.typed.ActorSystem @@ -28,7 +27,8 @@ import pekko.cluster.typed.Cluster import pekko.cluster.typed.ClusterSingletonManagerSettings import pekko.coordination.lease.LeaseUsageSettings import pekko.japi.Util.immutableSeq -import scala.jdk.DurationConverters._ + +import com.typesafe.config.Config object ClusterShardingSettings { diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedEntityProvider.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedEntityProvider.scala index ef931a23a5..4edad5b75d 100644 --- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedEntityProvider.scala +++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedEntityProvider.scala @@ -13,19 +13,19 @@ package org.apache.pekko.cluster.sharding.typed -import org.apache.pekko -import pekko.cluster.sharding.typed.scaladsl.Entity -import pekko.cluster.sharding.typed.scaladsl.EntityTypeKey -import pekko.cluster.sharding.typed.javadsl.{ Entity => JEntity, EntityTypeKey => JEntityTypeKey } -import pekko.persistence.typed.ReplicaId - -import scala.collection.immutable -import scala.reflect.ClassTag -import scala.jdk.CollectionConverters._ import java.util.{ Set => JSet } +import scala.collection.immutable +import scala.jdk.CollectionConverters._ +import scala.reflect.ClassTag + +import org.apache.pekko import pekko.actor.typed.Behavior import pekko.cluster.sharding.typed.internal.EntityTypeKeyImpl +import pekko.cluster.sharding.typed.javadsl.{ Entity => JEntity, EntityTypeKey => JEntityTypeKey } +import pekko.cluster.sharding.typed.scaladsl.Entity +import pekko.cluster.sharding.typed.scaladsl.EntityTypeKey +import pekko.persistence.typed.ReplicaId import pekko.persistence.typed.ReplicationId import pekko.persistence.typed.ReplicationId.Separator diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingExtension.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingExtension.scala index 9a21c89079..7340770f78 100644 --- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingExtension.scala +++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingExtension.scala @@ -13,6 +13,8 @@ package org.apache.pekko.cluster.sharding.typed +import java.util.{ Map => JMap } + import org.apache.pekko import pekko.actor.typed.ActorSystem import pekko.actor.typed.Extension @@ -21,7 +23,6 @@ import pekko.annotation.DoNotInherit import pekko.cluster.sharding.typed.internal.ReplicatedShardingExtensionImpl import pekko.cluster.sharding.typed.scaladsl.EntityRef import pekko.persistence.typed.ReplicaId -import java.util.{ Map => JMap } /** * Extension for running Replicated Event Sourcing in sharding by starting one separate instance of sharding per replica. diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ShardedDaemonProcessSettings.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ShardedDaemonProcessSettings.scala index 05d27d48f2..39820a5f5e 100644 --- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ShardedDaemonProcessSettings.scala +++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ShardedDaemonProcessSettings.scala @@ -16,13 +16,13 @@ package org.apache.pekko.cluster.sharding.typed import java.time.Duration import scala.concurrent.duration.FiniteDuration - -import com.typesafe.config.Config +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.actor.typed.ActorSystem import pekko.annotation.InternalApi -import scala.jdk.DurationConverters._ + +import com.typesafe.config.Config object ShardedDaemonProcessSettings { diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/ShardingConsumerController.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/ShardingConsumerController.scala index 1e58675bc0..ab29606f75 100644 --- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/ShardingConsumerController.scala +++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/ShardingConsumerController.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.sharding.typed.delivery import java.util.function.{ Function => JFunction } -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.actor.typed.ActorSystem @@ -26,6 +24,8 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.annotation.ApiMayChange import pekko.cluster.sharding.typed.delivery.internal.ShardingConsumerControllerImpl +import com.typesafe.config.Config + /** * `ShardingConsumerController` is used together with [[ShardingProducerController]]. See the description * in that class or the Pekko reference documentation for how they are intended to be used. diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/ShardingProducerController.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/ShardingProducerController.scala index 168d6cb25f..2a4e1d5884 100644 --- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/ShardingProducerController.scala +++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/ShardingProducerController.scala @@ -16,10 +16,10 @@ package org.apache.pekko.cluster.sharding.typed.delivery import java.util.Optional import scala.concurrent.duration.FiniteDuration +import scala.jdk.DurationConverters._ +import scala.jdk.OptionConverters._ import scala.reflect.ClassTag -import com.typesafe.config.Config - import org.apache.pekko import pekko.Done import pekko.actor.typed.ActorRef @@ -32,8 +32,8 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.annotation.ApiMayChange import pekko.cluster.sharding.typed.ShardingEnvelope import pekko.cluster.sharding.typed.delivery.internal.ShardingProducerControllerImpl -import scala.jdk.DurationConverters._ -import scala.jdk.OptionConverters._ + +import com.typesafe.config.Config /** * Reliable delivery between a producer actor sending messages to sharded consumer diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ClusterShardingImpl.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ClusterShardingImpl.scala index 798d1d1d9b..9be9afd359 100644 --- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ClusterShardingImpl.scala +++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ClusterShardingImpl.scala @@ -20,6 +20,8 @@ import java.util.concurrent.CompletionStage import java.util.concurrent.ConcurrentHashMap import scala.concurrent.Future +import scala.jdk.DurationConverters._ +import scala.jdk.FutureConverters._ import org.apache.pekko import pekko.actor.ActorRefProvider @@ -50,8 +52,6 @@ import pekko.pattern.AskTimeoutException import pekko.pattern.PromiseActorRef import pekko.pattern.StatusReply import pekko.util.{ unused, ByteString, Timeout } -import scala.jdk.FutureConverters._ -import scala.jdk.DurationConverters._ /** * INTERNAL API diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/JoinConfigCompatCheckerClusterSharding.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/JoinConfigCompatCheckerClusterSharding.scala index 0037bee6ab..60f1ea91f8 100644 --- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/JoinConfigCompatCheckerClusterSharding.scala +++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/JoinConfigCompatCheckerClusterSharding.scala @@ -15,12 +15,12 @@ package org.apache.pekko.cluster.sharding.typed.internal import scala.collection.{ immutable => im } -import com.typesafe.config.Config - import org.apache.pekko import pekko.annotation.InternalApi import pekko.cluster.{ ConfigValidation, JoinConfigCompatChecker, Valid } +import com.typesafe.config.Config + /** * INTERNAL API */ diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ReplicatedShardingExtensionImpl.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ReplicatedShardingExtensionImpl.scala index f28802633b..4d792134d0 100644 --- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ReplicatedShardingExtensionImpl.scala +++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ReplicatedShardingExtensionImpl.scala @@ -13,25 +13,27 @@ package org.apache.pekko.cluster.sharding.typed.internal -import java.util.concurrent.atomic.AtomicLong import java.util.{ Map => JMap } +import java.util.concurrent.atomic.AtomicLong + +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.actor.typed.ActorSystem +import pekko.actor.typed.scaladsl.LoggerOps import pekko.annotation.InternalApi -import pekko.cluster.sharding.typed.ReplicatedShardingExtension -import pekko.cluster.sharding.typed.ReplicatedSharding +import pekko.cluster.ClusterSettings.DataCenter import pekko.cluster.sharding.typed.ReplicatedEntityProvider +import pekko.cluster.sharding.typed.ReplicatedSharding +import pekko.cluster.sharding.typed.ReplicatedShardingExtension +import pekko.cluster.sharding.typed.ShardingDirectReplication import pekko.cluster.sharding.typed.scaladsl.ClusterSharding import pekko.cluster.sharding.typed.scaladsl.EntityRef import pekko.cluster.sharding.typed.scaladsl.EntityTypeKey import pekko.persistence.typed.ReplicaId -import org.slf4j.LoggerFactory -import pekko.actor.typed.scaladsl.LoggerOps -import pekko.cluster.ClusterSettings.DataCenter -import pekko.cluster.sharding.typed.ShardingDirectReplication import pekko.persistence.typed.ReplicationId -import scala.jdk.CollectionConverters._ + +import org.slf4j.LoggerFactory /** * INTERNAL API diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardedDaemonProcessImpl.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardedDaemonProcessImpl.scala index 28081cae29..e0ac66530e 100644 --- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardedDaemonProcessImpl.scala +++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardedDaemonProcessImpl.scala @@ -13,10 +13,12 @@ package org.apache.pekko.cluster.sharding.typed.internal -import java.util.function.IntFunction import java.util.Optional +import java.util.function.IntFunction +import scala.jdk.OptionConverters._ import scala.reflect.ClassTag + import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.actor.typed.ActorSystem @@ -40,7 +42,6 @@ import pekko.cluster.sharding.typed.scaladsl.StartEntity import pekko.cluster.typed.Cluster import pekko.cluster.typed.SelfUp import pekko.cluster.typed.Subscribe -import scala.jdk.OptionConverters._ import pekko.util.PrettyDuration /** diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardingSerializer.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardingSerializer.scala index 3d064b94d2..7fd5eff092 100644 --- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardingSerializer.scala +++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ShardingSerializer.scala @@ -14,6 +14,8 @@ package org.apache.pekko.cluster.sharding.typed.internal import java.io.NotSerializableException +import java.nio.ByteBuffer + import org.apache.pekko import pekko.annotation.InternalApi import pekko.cluster.sharding.typed.ShardingEnvelope @@ -24,8 +26,6 @@ import pekko.serialization.BaseSerializer import pekko.serialization.ByteBufferSerializer import pekko.serialization.SerializerWithStringManifest -import java.nio.ByteBuffer - /** * INTERNAL API */ diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/testkit/TestEntityRefImpl.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/testkit/TestEntityRefImpl.scala index d092d9a386..1ec48423c5 100644 --- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/testkit/TestEntityRefImpl.scala +++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/testkit/TestEntityRefImpl.scala @@ -17,6 +17,9 @@ import java.time.Duration import java.util.concurrent.CompletionStage import scala.concurrent.Future +import scala.jdk.DurationConverters._ +import scala.jdk.FutureConverters._ + import org.apache.pekko import pekko.actor.ActorRefProvider import pekko.actor.typed.ActorRef @@ -28,8 +31,6 @@ import pekko.cluster.sharding.typed.javadsl.EntityRef import pekko.cluster.sharding.typed.scaladsl import pekko.japi.function.{ Function => JFunction } import pekko.pattern.StatusReply -import scala.jdk.FutureConverters._ -import scala.jdk.DurationConverters._ import pekko.util.Timeout /** diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ClusterSharding.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ClusterSharding.scala index e0b0343864..53eb355d8d 100644 --- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ClusterSharding.scala +++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ClusterSharding.scala @@ -19,6 +19,8 @@ import java.util.Optional import java.util.concurrent.CompletionStage import scala.annotation.nowarn +import scala.jdk.OptionConverters._ + import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.actor.typed.ActorSystem @@ -32,7 +34,6 @@ import pekko.cluster.sharding.ShardCoordinator.ShardAllocationStrategy import pekko.cluster.sharding.typed.internal.EntityTypeKeyImpl import pekko.japi.function.{ Function => JFunction } import pekko.pattern.StatusReply -import scala.jdk.OptionConverters._ @FunctionalInterface trait EntityFactory[M] { diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ShardedDaemonProcess.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ShardedDaemonProcess.scala index 8389e1c5c3..4644666ca3 100644 --- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ShardedDaemonProcess.scala +++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/javadsl/ShardedDaemonProcess.scala @@ -13,8 +13,8 @@ package org.apache.pekko.cluster.sharding.typed.javadsl -import java.util.function.IntFunction import java.util.Optional +import java.util.function.IntFunction import org.apache.pekko import pekko.actor.typed.ActorSystem diff --git a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterSharding.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterSharding.scala index ed1908bd7e..b701597da9 100644 --- a/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterSharding.scala +++ b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterSharding.scala @@ -16,6 +16,7 @@ package scaladsl import scala.concurrent.Future import scala.reflect.ClassTag + import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.actor.typed.ActorSystem diff --git a/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingRememberEntitiesPerfSpec.scala b/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingRememberEntitiesPerfSpec.scala index d979a93fae..d89b330ee5 100644 --- a/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingRememberEntitiesPerfSpec.scala +++ b/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingRememberEntitiesPerfSpec.scala @@ -17,15 +17,17 @@ import java.nio.file.Paths import java.util.concurrent.TimeUnit.NANOSECONDS import java.util.concurrent.atomic.AtomicInteger +import scala.concurrent.duration._ + +import org.HdrHistogram.Histogram + import org.apache.pekko import pekko.actor._ import pekko.cluster.MemberStatus import pekko.cluster.sharding.ShardRegion.{ CurrentShardRegionState, GetShardRegionState, Passivate } import pekko.testkit._ -import com.typesafe.config.ConfigFactory -import org.HdrHistogram.Histogram -import scala.concurrent.duration._ +import com.typesafe.config.ConfigFactory object ClusterShardingRememberEntitiesPerfSpec { val NrRegions = 6 diff --git a/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingPreparingForShutdownSpec.scala b/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingPreparingForShutdownSpec.scala index 50c9456c3b..fdbb55e811 100644 --- a/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingPreparingForShutdownSpec.scala +++ b/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingPreparingForShutdownSpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.cluster.sharding.typed +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.TestProbe import pekko.actor.typed.ActorRef @@ -30,9 +32,8 @@ import pekko.cluster.typed.PrepareForFullClusterShutdown import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec import pekko.serialization.jackson.CborSerializable -import com.typesafe.config.ConfigFactory -import scala.concurrent.duration._ +import com.typesafe.config.ConfigFactory object ClusterShardingPreparingForShutdownSpec extends MultiNodeConfig { val first = role("first") diff --git a/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingStatsSpec.scala b/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingStatsSpec.scala index 28980233f5..7973f78954 100644 --- a/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingStatsSpec.scala +++ b/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingStatsSpec.scala @@ -13,9 +13,6 @@ package org.apache.pekko.cluster.sharding.typed -import com.typesafe.config.ConfigFactory -import org.scalatest.concurrent.ScalaFutures - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.TestProbe import pekko.actor.typed.ActorRef @@ -31,6 +28,10 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec import pekko.serialization.jackson.CborSerializable +import org.scalatest.concurrent.ScalaFutures + +import com.typesafe.config.ConfigFactory + object ClusterShardingStatsSpecConfig extends MultiNodeConfig { val first = role("first") diff --git a/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/MultiDcClusterShardingSpec.scala b/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/MultiDcClusterShardingSpec.scala index 565cdf6ea1..22d544f1f6 100644 --- a/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/MultiDcClusterShardingSpec.scala +++ b/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/MultiDcClusterShardingSpec.scala @@ -14,8 +14,7 @@ package org.apache.pekko.cluster.sharding.typed import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.concurrent.ScalaFutures + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.TestProbe import pekko.actor.typed.ActorRef @@ -27,6 +26,10 @@ import pekko.cluster.typed.{ MultiDcPinger, MultiNodeTypedClusterSpec } import pekko.remote.testkit.{ MultiNodeConfig, MultiNodeSpec } import pekko.util.Timeout +import org.scalatest.concurrent.ScalaFutures + +import com.typesafe.config.ConfigFactory + object MultiDcClusterShardingSpecConfig extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingSpec.scala b/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingSpec.scala index 0a670b05aa..95831d243a 100644 --- a/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingSpec.scala +++ b/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingSpec.scala @@ -14,12 +14,12 @@ package org.apache.pekko.cluster.sharding.typed import org.apache.pekko -import pekko.actor.typed.scaladsl.LoggerOps import pekko.Done import pekko.actor.testkit.typed.scaladsl.TestProbe import pekko.actor.typed.ActorRef import pekko.actor.typed.scaladsl.ActorContext import pekko.actor.typed.scaladsl.Behaviors +import pekko.actor.typed.scaladsl.LoggerOps import pekko.cluster.MultiNodeClusterSpec import pekko.cluster.sharding.typed.ReplicatedShardingSpec.TestRES.GetState import pekko.cluster.sharding.typed.ReplicatedShardingSpec.TestRES.State @@ -30,17 +30,19 @@ import pekko.persistence.journal.PersistencePluginProxy import pekko.persistence.testkit.query.scaladsl.PersistenceTestKitReadJournal import pekko.persistence.typed.ReplicaId import pekko.persistence.typed.ReplicationId -import pekko.persistence.typed.scaladsl.ReplicatedEventSourcing import pekko.persistence.typed.scaladsl.Effect import pekko.persistence.typed.scaladsl.EventSourcedBehavior +import pekko.persistence.typed.scaladsl.ReplicatedEventSourcing import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec import pekko.serialization.jackson.CborSerializable -import com.typesafe.config.ConfigFactory + import org.scalatest.concurrent.Eventually import org.scalatest.concurrent.ScalaFutures import org.scalatest.time.Span +import com.typesafe.config.ConfigFactory + object ReplicatedShardingSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/ShardedDaemonProcessSpec.scala b/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/ShardedDaemonProcessSpec.scala index 6556c807de..af0fb05aa9 100644 --- a/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/ShardedDaemonProcessSpec.scala +++ b/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/ShardedDaemonProcessSpec.scala @@ -15,9 +15,6 @@ package org.apache.pekko.cluster.sharding.typed import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.concurrent.ScalaFutures - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.TestProbe import pekko.actor.typed.Behavior @@ -32,6 +29,10 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec import pekko.serialization.jackson.CborSerializable +import org.scalatest.concurrent.ScalaFutures + +import com.typesafe.config.ConfigFactory + object ShardedDaemonProcessSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/delivery/DeliveryThroughputSpec.scala b/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/delivery/DeliveryThroughputSpec.scala index 2a744558a3..0fa92bd494 100644 --- a/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/delivery/DeliveryThroughputSpec.scala +++ b/cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/delivery/DeliveryThroughputSpec.scala @@ -18,8 +18,6 @@ import java.util.concurrent.TimeUnit.NANOSECONDS import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.TestProbe import pekko.actor.typed.ActorRef @@ -45,6 +43,8 @@ import pekko.remote.testkit.MultiNodeSpec import pekko.remote.testkit.PerfFlamesSupport import pekko.serialization.jackson.CborSerializable +import com.typesafe.config.ConfigFactory + object DeliveryThroughputSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/JoinConfigCompatCheckerClusterShardingSpec.scala b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/JoinConfigCompatCheckerClusterShardingSpec.scala index b2b8183ec7..9430c300a1 100644 --- a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/JoinConfigCompatCheckerClusterShardingSpec.scala +++ b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/JoinConfigCompatCheckerClusterShardingSpec.scala @@ -16,10 +16,6 @@ package org.apache.pekko.cluster.sharding.typed import scala.collection.{ immutable => im } import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigFactory } -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.CoordinatedShutdown import pekko.actor.testkit.typed.scaladsl.{ ActorTestKit, LogCapturing, ScalaTestWithActorTestKit } @@ -27,6 +23,11 @@ import pekko.actor.typed.ActorSystem import pekko.cluster.{ Cluster => ClassicCluster } import pekko.testkit.LongRunningTest +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.{ Config, ConfigFactory } + object JoinConfigCompatCheckerClusterShardingSpec { val Shards = 2 diff --git a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingDirectReplicationSpec.scala b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingDirectReplicationSpec.scala index b011d7ca7d..5187664168 100644 --- a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingDirectReplicationSpec.scala +++ b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingDirectReplicationSpec.scala @@ -13,7 +13,6 @@ package org.apache.pekko.cluster.sharding.typed -import org.scalatest.wordspec.AnyWordSpecLike import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -22,9 +21,11 @@ import pekko.actor.typed.eventstream.EventStream import pekko.persistence.typed import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.PublishedEvent -import pekko.persistence.typed.internal.{ PublishedEventImpl, ReplicatedPublishedEventMetaData, VersionVector } import pekko.persistence.typed.ReplicaId import pekko.persistence.typed.ReplicationId +import pekko.persistence.typed.internal.{ PublishedEventImpl, ReplicatedPublishedEventMetaData, VersionVector } + +import org.scalatest.wordspec.AnyWordSpecLike class ReplicatedShardingDirectReplicationSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { diff --git a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingSpec.scala b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingSpec.scala index 741106c1c0..a722c65175 100644 --- a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingSpec.scala +++ b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingSpec.scala @@ -14,14 +14,18 @@ package org.apache.pekko.cluster.sharding.typed import java.util.concurrent.ThreadLocalRandom + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.{ ActorTestKit, LogCapturing, ScalaTestWithActorTestKit } import pekko.actor.typed.ActorRef import pekko.actor.typed.ActorSystem import pekko.actor.typed.Behavior import pekko.actor.typed.scaladsl.Behaviors +import pekko.actor.typed.scaladsl.LoggerOps import pekko.cluster.MemberStatus import pekko.cluster.sharding.typed.ReplicatedShardingSpec.DataCenter +import pekko.cluster.sharding.typed.ReplicatedShardingSpec.MyReplicatedIntSet +import pekko.cluster.sharding.typed.ReplicatedShardingSpec.MyReplicatedStringSet import pekko.cluster.sharding.typed.ReplicatedShardingSpec.Normal import pekko.cluster.sharding.typed.ReplicatedShardingSpec.ReplicationType import pekko.cluster.sharding.typed.ReplicatedShardingSpec.Role @@ -31,18 +35,17 @@ import pekko.cluster.typed.Join import pekko.persistence.testkit.PersistenceTestKitPlugin import pekko.persistence.testkit.query.scaladsl.PersistenceTestKitReadJournal import pekko.persistence.typed.ReplicaId -import pekko.persistence.typed.scaladsl.ReplicatedEventSourcing +import pekko.persistence.typed.ReplicationId import pekko.persistence.typed.scaladsl.Effect import pekko.persistence.typed.scaladsl.EventSourcedBehavior +import pekko.persistence.typed.scaladsl.ReplicatedEventSourcing import pekko.serialization.jackson.CborSerializable -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike -import pekko.actor.typed.scaladsl.LoggerOps -import pekko.cluster.sharding.typed.ReplicatedShardingSpec.MyReplicatedIntSet -import pekko.cluster.sharding.typed.ReplicatedShardingSpec.MyReplicatedStringSet -import pekko.persistence.typed.ReplicationId -import com.typesafe.config.Config + import org.scalatest.time.Span +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory object ReplicatedShardingSpec { def commonConfig = ConfigFactory.parseString(""" diff --git a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/ShardingSerializerSpec.scala b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/ShardingSerializerSpec.scala index 4d52cd50bb..003a6d9190 100644 --- a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/ShardingSerializerSpec.scala +++ b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/ShardingSerializerSpec.scala @@ -13,7 +13,9 @@ package org.apache.pekko.cluster.sharding.typed -import org.scalatest.wordspec.AnyWordSpecLike +import java.nio.ByteBuffer +import java.nio.ByteOrder + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -21,8 +23,7 @@ import pekko.actor.typed.internal.adapter.ActorSystemAdapter import pekko.cluster.sharding.typed.internal.ShardingSerializer import pekko.serialization.SerializationExtension -import java.nio.ByteBuffer -import java.nio.ByteOrder +import org.scalatest.wordspec.AnyWordSpecLike class ShardingSerializerSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { diff --git a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/delivery/DurableShardingSpec.scala b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/delivery/DurableShardingSpec.scala index 42331cb730..48bd8b5962 100644 --- a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/delivery/DurableShardingSpec.scala +++ b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/delivery/DurableShardingSpec.scala @@ -17,9 +17,6 @@ import java.util.UUID import scala.concurrent.duration._ -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -42,6 +39,11 @@ import pekko.persistence.journal.inmem.InmemJournal import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.delivery.EventSourcedProducerQueue +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object DurableShardingSpec { def conf: Config = ConfigFactory.parseString(s""" diff --git a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/delivery/ReliableDeliveryShardingSpec.scala b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/delivery/ReliableDeliveryShardingSpec.scala index 1127e78a85..d0365f2986 100644 --- a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/delivery/ReliableDeliveryShardingSpec.scala +++ b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/delivery/ReliableDeliveryShardingSpec.scala @@ -17,9 +17,6 @@ import java.util.concurrent.atomic.AtomicInteger import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -40,6 +37,10 @@ import pekko.cluster.sharding.typed.scaladsl.EntityTypeKey import pekko.cluster.typed.Cluster import pekko.cluster.typed.Join +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + object ReliableDeliveryShardingSpec { val config = ConfigFactory.parseString(""" pekko.actor.provider = cluster diff --git a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/internal/Murmur2Spec.scala b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/internal/Murmur2Spec.scala index 6db786ec01..f8a7204a0f 100644 --- a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/internal/Murmur2Spec.scala +++ b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/internal/Murmur2Spec.scala @@ -13,11 +13,11 @@ package org.apache.pekko.cluster.sharding.typed.internal +import java.nio.charset.StandardCharsets.UTF_8 + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpecLike -import java.nio.charset.StandardCharsets.UTF_8 - class Murmur2Spec extends AnyWordSpecLike with Matchers { "The Murmur2 hashing" must { // expected correct hash values from the kafka murmur2 impl diff --git a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala index 7f8cd73197..a44a4412e7 100644 --- a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala +++ b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala @@ -22,9 +22,6 @@ import scala.concurrent.Future import scala.concurrent.Promise import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -47,6 +44,10 @@ import pekko.persistence.typed.RecoveryCompleted import pekko.persistence.typed.scaladsl.Effect import pekko.persistence.typed.scaladsl.EventSourcedBehavior +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + object ClusterShardingPersistenceSpec { val config = ConfigFactory.parseString(""" pekko.loglevel = INFO diff --git a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala index b65a0a3a05..aa5eaf3497 100644 --- a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala +++ b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala @@ -17,9 +17,6 @@ import scala.concurrent.duration._ import scala.util.Failure import scala.util.Success -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.ActorTestKit import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -40,6 +37,10 @@ import pekko.pattern.AskTimeoutException import pekko.serialization.jackson.CborSerializable import pekko.util.Timeout +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + object ClusterShardingSpec { val config = ConfigFactory.parseString(s""" pekko.actor.provider = cluster diff --git a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingStateSpec.scala b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingStateSpec.scala index 3848dfe6bd..37487af650 100644 --- a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingStateSpec.scala +++ b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingStateSpec.scala @@ -13,8 +13,6 @@ package org.apache.pekko.cluster.sharding.typed.scaladsl -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.{ ScalaTestWithActorTestKit, TestProbe } import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -24,6 +22,8 @@ import pekko.cluster.sharding.typed.{ GetShardRegionState, ShardingMessageExtrac import pekko.cluster.sharding.typed.scaladsl.ClusterShardingSpec._ import pekko.cluster.typed.{ Cluster, Join } +import org.scalatest.wordspec.AnyWordSpecLike + class ClusterShardingStateSpec extends ScalaTestWithActorTestKit(ClusterShardingSpec.config) with AnyWordSpecLike diff --git a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingStatsSpec.scala b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingStatsSpec.scala index c00cc208a7..e414ccd032 100644 --- a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingStatsSpec.scala +++ b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingStatsSpec.scala @@ -13,8 +13,6 @@ package org.apache.pekko.cluster.sharding.typed.scaladsl -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -28,6 +26,8 @@ import pekko.cluster.typed.Cluster import pekko.cluster.typed.Join import pekko.cluster.typed.SelfUp +import org.scalatest.wordspec.AnyWordSpecLike + class ClusterShardingStatsSpec extends ScalaTestWithActorTestKit(ClusterShardingSpec.config) with AnyWordSpecLike diff --git a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ShardedDaemonProcessSpec.scala b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ShardedDaemonProcessSpec.scala index 89ee775e73..cf58630c75 100644 --- a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ShardedDaemonProcessSpec.scala +++ b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ShardedDaemonProcessSpec.scala @@ -15,9 +15,6 @@ package org.apache.pekko.cluster.sharding.typed.scaladsl import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -29,6 +26,10 @@ import pekko.cluster.sharding.typed.ShardedDaemonProcessSettings import pekko.cluster.typed.Cluster import pekko.cluster.typed.Join +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + object ShardedDaemonProcessSpec { // single node cluster config def config = ConfigFactory.parseString(""" diff --git a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/testkit/scaladsl/TestEntityRefSpec.scala b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/testkit/scaladsl/TestEntityRefSpec.scala index 8ae65d4a5f..e5adea23a0 100644 --- a/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/testkit/scaladsl/TestEntityRefSpec.scala +++ b/cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/testkit/scaladsl/TestEntityRefSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.sharding.typed.testkit.scaladsl import scala.concurrent.Future -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -33,6 +31,8 @@ import pekko.cluster.sharding.typed.scaladsl.Entity import pekko.cluster.sharding.typed.scaladsl.EntityRef import pekko.cluster.sharding.typed.scaladsl.EntityTypeKey +import org.scalatest.wordspec.AnyWordSpecLike + object TestEntityRefSpec { final case class AskReq(s: String, replyTo: ActorRef[Done]) diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterSharding.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterSharding.scala index 6c587870bd..7ad8bb5133 100755 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterSharding.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterSharding.scala @@ -19,6 +19,7 @@ import java.util.concurrent.ConcurrentHashMap import scala.collection.immutable import scala.concurrent.Await +import scala.jdk.CollectionConverters._ import scala.util.control.NonFatal import org.apache.pekko @@ -50,7 +51,6 @@ import pekko.event.Logging import pekko.pattern.BackoffOpts import pekko.pattern.ask import pekko.util.ByteString -import scala.jdk.CollectionConverters._ /** * This extension provides sharding functionality of actors in a cluster. diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterShardingHealthCheck.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterShardingHealthCheck.scala index b078ee54c8..7b444887ca 100644 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterShardingHealthCheck.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterShardingHealthCheck.scala @@ -13,21 +13,22 @@ package org.apache.pekko.cluster.sharding +import scala.concurrent.ExecutionContext +import scala.concurrent.Future +import scala.concurrent.duration.FiniteDuration +import scala.jdk.CollectionConverters._ +import scala.jdk.DurationConverters._ + import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ActorSystem import pekko.annotation.ApiMayChange +import pekko.annotation.InternalApi import pekko.event.Logging +import pekko.pattern.AskTimeoutException import pekko.pattern.ask import pekko.util.Timeout -import pekko.annotation.InternalApi -import pekko.pattern.AskTimeoutException -import scala.jdk.CollectionConverters._ -import scala.jdk.DurationConverters._ -import scala.concurrent.ExecutionContext -import scala.concurrent.Future -import scala.concurrent.duration.FiniteDuration import com.typesafe.config.Config /** diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterShardingSettings.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterShardingSettings.scala index 14431679e2..2efbf1d551 100644 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterShardingSettings.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterShardingSettings.scala @@ -13,6 +13,10 @@ package org.apache.pekko.cluster.sharding +import scala.collection.immutable +import scala.concurrent.duration._ +import scala.jdk.DurationConverters._ + import org.apache.pekko import pekko.actor.ActorSystem import pekko.actor.NoSerializationVerificationNeeded @@ -22,11 +26,8 @@ import pekko.cluster.singleton.ClusterSingletonManagerSettings import pekko.coordination.lease.LeaseUsageSettings import pekko.japi.Util.immutableSeq import pekko.util.Helpers.toRootLowerCase -import scala.jdk.DurationConverters._ -import com.typesafe.config.Config -import scala.collection.immutable -import scala.concurrent.duration._ +import com.typesafe.config.Config object ClusterShardingSettings { diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/JoinConfigCompatCheckSharding.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/JoinConfigCompatCheckSharding.scala index 767e7d69b6..208f2a7612 100644 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/JoinConfigCompatCheckSharding.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/JoinConfigCompatCheckSharding.scala @@ -15,12 +15,12 @@ package org.apache.pekko.cluster.sharding import scala.collection.{ immutable => im } -import com.typesafe.config.Config - import org.apache.pekko import pekko.annotation.InternalApi import pekko.cluster.{ ConfigValidation, JoinConfigCompatChecker } +import com.typesafe.config.Config + /** * INTERNAL API */ diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/RemoveInternalClusterShardingData.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/RemoveInternalClusterShardingData.scala index 9f52a161f7..4b4d5273a5 100644 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/RemoveInternalClusterShardingData.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/RemoveInternalClusterShardingData.scala @@ -13,11 +13,13 @@ package org.apache.pekko.cluster.sharding +import scala.annotation.nowarn import scala.concurrent.Future import scala.concurrent.Promise import scala.util.Failure import scala.util.Success import scala.util.Try + import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorLogging @@ -30,8 +32,6 @@ import pekko.persistence._ import pekko.persistence.journal.leveldb.SharedLeveldbJournal import pekko.persistence.journal.leveldb.SharedLeveldbStore -import scala.annotation.nowarn - /** * Utility program that removes the internal data stored with Pekko Persistence * by the Cluster `ShardCoordinator`. The data contains the locations of the diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/Shard.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/Shard.scala index faf48e346d..96bf7733bc 100644 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/Shard.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/Shard.scala @@ -15,6 +15,10 @@ package org.apache.pekko.cluster.sharding import java.net.URLEncoder import java.util + +import scala.collection.immutable.Set +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorLogging @@ -35,9 +39,9 @@ import pekko.cluster.ClusterEvent.MemberPreparingForShutdown import pekko.cluster.ClusterEvent.MemberReadyForShutdown import pekko.cluster.sharding.ShardRegion.ShardsUpdated import pekko.cluster.sharding.internal.EntityPassivationStrategy +import pekko.cluster.sharding.internal.RememberEntitiesProvider import pekko.cluster.sharding.internal.RememberEntitiesShardStore import pekko.cluster.sharding.internal.RememberEntitiesShardStore.GetEntities -import pekko.cluster.sharding.internal.RememberEntitiesProvider import pekko.cluster.sharding.internal.RememberEntityStarter import pekko.coordination.lease.scaladsl.Lease import pekko.coordination.lease.scaladsl.LeaseProvider @@ -48,9 +52,6 @@ import pekko.util.OptionVal import pekko.util.PrettyDuration._ import pekko.util.unused -import scala.collection.immutable.Set -import scala.concurrent.duration._ - /** * INTERNAL API * diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala index 2bb3fe7f1b..1cebbffc1b 100644 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala @@ -13,16 +13,18 @@ package org.apache.pekko.cluster.sharding +import scala.annotation.nowarn import scala.collection.immutable +import scala.concurrent.ExecutionContext import scala.concurrent.Future import scala.concurrent.duration._ import scala.util.Success -import scala.annotation.nowarn + import org.apache.pekko import pekko.actor._ import pekko.actor.DeadLetterSuppression -import pekko.annotation.DoNotInherit import pekko.annotation.{ InternalApi, InternalStableApi } +import pekko.annotation.DoNotInherit import pekko.cluster.Cluster import pekko.cluster.ClusterEvent import pekko.cluster.ClusterEvent._ @@ -31,15 +33,14 @@ import pekko.cluster.ddata.LWWRegisterKey import pekko.cluster.ddata.Replicator._ import pekko.cluster.ddata.SelfUniqueAddress import pekko.cluster.sharding.ShardRegion.ShardId -import pekko.cluster.sharding.internal.AbstractLeastShardAllocationStrategy -import pekko.cluster.sharding.internal.AbstractLeastShardAllocationStrategy.RegionEntry -import pekko.cluster.sharding.internal.EventSourcedRememberEntitiesCoordinatorStore.MigrationMarker import pekko.cluster.sharding.internal.{ EventSourcedRememberEntitiesCoordinatorStore, RememberEntitiesCoordinatorStore, RememberEntitiesProvider } -import scala.concurrent.ExecutionContext +import pekko.cluster.sharding.internal.AbstractLeastShardAllocationStrategy +import pekko.cluster.sharding.internal.AbstractLeastShardAllocationStrategy.RegionEntry +import pekko.cluster.sharding.internal.EventSourcedRememberEntitiesCoordinatorStore.MigrationMarker import pekko.event.{ BusLogging, Logging } import pekko.pattern.{ pipe, AskTimeoutException } import pekko.persistence._ diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala index ab0c842285..63eb189ca8 100644 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala @@ -14,6 +14,7 @@ package org.apache.pekko.cluster.sharding import java.net.URLEncoder + import scala.annotation.tailrec import scala.collection.immutable import scala.concurrent.{ Future, Promise } @@ -21,11 +22,12 @@ import scala.concurrent.duration._ import scala.reflect.ClassTag import scala.runtime.AbstractFunction1 import scala.util.{ Failure, Success } + import org.apache.pekko import pekko.Done import pekko.actor._ -import pekko.annotation.ApiMayChange import pekko.annotation.{ InternalApi, InternalStableApi } +import pekko.annotation.ApiMayChange import pekko.cluster.Cluster import pekko.cluster.ClusterEvent._ import pekko.cluster.ClusterSettings diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/external/ExternalShardAllocationStrategy.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/external/ExternalShardAllocationStrategy.scala index dab9fe9b15..5c1333cca4 100644 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/external/ExternalShardAllocationStrategy.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/external/ExternalShardAllocationStrategy.scala @@ -16,6 +16,7 @@ package org.apache.pekko.cluster.sharding.external import scala.collection.immutable import scala.concurrent.Future import scala.concurrent.duration._ +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.actor.Actor @@ -39,7 +40,6 @@ import pekko.cluster.sharding.ShardRegion.ShardId import pekko.event.Logging import pekko.pattern.AskTimeoutException import pekko.util.Timeout -import scala.jdk.DurationConverters._ object ExternalShardAllocationStrategy { diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/external/ShardLocations.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/external/ShardLocations.scala index 8d7520ae6a..5ce23eb3fe 100644 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/external/ShardLocations.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/external/ShardLocations.scala @@ -13,10 +13,11 @@ package org.apache.pekko.cluster.sharding.external +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.cluster.sharding.ShardRegion.ShardId import pekko.cluster.sharding.external.ExternalShardAllocationStrategy.ShardLocation -import scala.jdk.CollectionConverters._ final class ShardLocations(val locations: Map[ShardId, ShardLocation]) { diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/external/internal/ExternalShardAllocationClientImpl.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/external/internal/ExternalShardAllocationClientImpl.scala index 3370d4e3cd..2bec405869 100644 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/external/internal/ExternalShardAllocationClientImpl.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/external/internal/ExternalShardAllocationClientImpl.scala @@ -16,6 +16,9 @@ package org.apache.pekko.cluster.sharding.external.internal import java.util.concurrent.CompletionStage import scala.concurrent.Future +import scala.jdk.CollectionConverters._ +import scala.jdk.DurationConverters._ +import scala.jdk.FutureConverters._ import org.apache.pekko import pekko.Done @@ -44,11 +47,8 @@ import pekko.cluster.sharding.external.ShardLocations import pekko.dispatch.MessageDispatcher import pekko.event.Logging import pekko.pattern.ask -import scala.jdk.FutureConverters._ -import scala.jdk.DurationConverters._ import pekko.util.PrettyDuration._ import pekko.util.Timeout -import scala.jdk.CollectionConverters._ /** * INTERNAL API diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/AbstractLeastShardAllocationStrategy.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/AbstractLeastShardAllocationStrategy.scala index 29a1ece365..433bbbd49a 100644 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/AbstractLeastShardAllocationStrategy.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/AbstractLeastShardAllocationStrategy.scala @@ -15,6 +15,10 @@ package org.apache.pekko.cluster.sharding.internal import java.lang.{ Boolean => JBoolean, Integer => JInteger } +import scala.collection.immutable +import scala.concurrent.Future +import scala.concurrent.duration.DurationInt + import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ActorSystem @@ -28,10 +32,6 @@ import pekko.cluster.sharding.ShardCoordinator.ActorSystemDependentAllocationStr import pekko.cluster.sharding.ShardRegion.ShardId import pekko.pattern.after -import scala.collection.immutable -import scala.concurrent.Future -import scala.concurrent.duration.DurationInt - /** * Common logic for the least shard allocation strategy implementations * diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/DDataRememberEntitiesShardStore.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/DDataRememberEntitiesShardStore.scala index 5d7c4475b9..afcdaf6c3c 100644 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/DDataRememberEntitiesShardStore.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/DDataRememberEntitiesShardStore.scala @@ -13,6 +13,8 @@ package org.apache.pekko.cluster.sharding.internal +import scala.concurrent.ExecutionContext + import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorLogging @@ -42,8 +44,6 @@ import pekko.cluster.sharding.ShardRegion.EntityId import pekko.cluster.sharding.ShardRegion.ShardId import pekko.util.PrettyDuration._ -import scala.concurrent.ExecutionContext - /** * INTERNAL API */ diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/EntityPassivationStrategy.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/EntityPassivationStrategy.scala index f51df8aa4d..e057331506 100644 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/EntityPassivationStrategy.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/EntityPassivationStrategy.scala @@ -13,17 +13,17 @@ package org.apache.pekko.cluster.sharding.internal +import scala.collection.immutable +import scala.concurrent.duration.FiniteDuration + import org.apache.pekko import pekko.annotation.InternalApi import pekko.cluster.sharding.ClusterShardingSettings import pekko.cluster.sharding.ShardRegion.EntityId +import pekko.util.{ FrequencyList, RecencyList, SegmentedRecencyList } import pekko.util.FastFrequencySketch import pekko.util.FrequencySketch import pekko.util.OptionVal -import pekko.util.{ FrequencyList, RecencyList, SegmentedRecencyList } - -import scala.collection.immutable -import scala.concurrent.duration.FiniteDuration /** * INTERNAL API diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/EventSourcedRememberEntitiesCoordinatorStore.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/EventSourcedRememberEntitiesCoordinatorStore.scala index 495e7c696b..59318768c8 100644 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/EventSourcedRememberEntitiesCoordinatorStore.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/EventSourcedRememberEntitiesCoordinatorStore.scala @@ -13,18 +13,18 @@ package org.apache.pekko.cluster.sharding.internal +import scala.collection.mutable + import org.apache.pekko import pekko.actor.ActorLogging import pekko.actor.Props import pekko.annotation.InternalApi -import pekko.cluster.sharding.ShardCoordinator.Internal -import pekko.cluster.sharding.ShardRegion.ShardId import pekko.cluster.sharding.ClusterShardingSerializable import pekko.cluster.sharding.ClusterShardingSettings +import pekko.cluster.sharding.ShardCoordinator.Internal +import pekko.cluster.sharding.ShardRegion.ShardId import pekko.persistence._ -import scala.collection.mutable - /** * INTERNAL API */ diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/LeastShardAllocationStrategy.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/LeastShardAllocationStrategy.scala index f4519aea8d..1f93b89023 100644 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/LeastShardAllocationStrategy.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/LeastShardAllocationStrategy.scala @@ -15,6 +15,7 @@ package org.apache.pekko.cluster.sharding.internal import scala.collection.immutable import scala.concurrent.Future + import org.apache.pekko import pekko.actor.ActorRef import pekko.annotation.InternalApi diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/RememberEntityStarter.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/RememberEntityStarter.scala index 22069dddde..984b82f970 100644 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/RememberEntityStarter.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/RememberEntityStarter.scala @@ -13,6 +13,9 @@ package org.apache.pekko.cluster.sharding.internal +import scala.collection.immutable.Set +import scala.concurrent.ExecutionContext + import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorLogging @@ -27,9 +30,6 @@ import pekko.cluster.sharding.ShardRegion import pekko.cluster.sharding.ShardRegion.EntityId import pekko.cluster.sharding.ShardRegion.ShardId -import scala.collection.immutable.Set -import scala.concurrent.ExecutionContext - /** * INTERNAL API */ diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/jfr/Events.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/jfr/Events.scala index 57fbb189eb..8403161e81 100644 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/jfr/Events.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/jfr/Events.scala @@ -13,9 +13,10 @@ package org.apache.pekko.cluster.sharding.internal.jfr -import org.apache.pekko.annotation.InternalApi import jdk.jfr.{ Category, Event, Label, StackTrace, Timespan } +import org.apache.pekko.annotation.InternalApi + // requires jdk9+ to compile // for editing these in IntelliJ, open module settings, change JDK dependency to 11 for only this module diff --git a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/protobuf/ClusterShardingMessageSerializer.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/protobuf/ClusterShardingMessageSerializer.scala index 9b0481bf9a..cec6c3a9d1 100644 --- a/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/protobuf/ClusterShardingMessageSerializer.scala +++ b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/protobuf/ClusterShardingMessageSerializer.scala @@ -21,6 +21,7 @@ import java.util.zip.GZIPOutputStream import scala.annotation.tailrec import scala.collection.immutable import scala.concurrent.duration._ +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.actor.ActorRef @@ -29,19 +30,18 @@ import pekko.actor.ExtendedActorSystem import pekko.cluster.sharding.Shard import pekko.cluster.sharding.ShardCoordinator import pekko.cluster.sharding.ShardRegion._ -import pekko.cluster.sharding.protobuf.msg.{ ClusterShardingMessages => sm } -import pekko.cluster.sharding.protobuf.msg.ClusterShardingMessages import pekko.cluster.sharding.internal.EventSourcedRememberEntitiesCoordinatorStore.{ MigrationMarker, State => RememberShardsState } -import pekko.cluster.sharding.internal.EventSourcedRememberEntitiesShardStore.{ State => EntityState } import pekko.cluster.sharding.internal.EventSourcedRememberEntitiesShardStore.{ EntitiesStarted, EntitiesStopped } +import pekko.cluster.sharding.internal.EventSourcedRememberEntitiesShardStore.{ State => EntityState } +import pekko.cluster.sharding.protobuf.msg.{ ClusterShardingMessages => sm } +import pekko.cluster.sharding.protobuf.msg.ClusterShardingMessages import pekko.protobufv3.internal.MessageLite import pekko.serialization.BaseSerializer import pekko.serialization.Serialization import pekko.serialization.SerializerWithStringManifest -import scala.jdk.CollectionConverters._ /** * INTERNAL API: Protobuf serializer of ClusterSharding messages. diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/GremlinController.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/GremlinController.scala index 4ea4860f74..2c30e0647a 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/GremlinController.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/GremlinController.scala @@ -39,9 +39,8 @@ object GremlinController { } class GremlinController extends Actor with ActorLogging { - import context.dispatcher - import GremlinController._ + import context.dispatcher val transport = context.system.asInstanceOf[ExtendedActorSystem].provider.asInstanceOf[RemoteActorRefProvider].transport val selfAddress = Cluster(context.system).selfAddress diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/RandomizedBrainResolverIntegrationSpec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/RandomizedBrainResolverIntegrationSpec.scala index 39ca53bb23..395ec70356 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/RandomizedBrainResolverIntegrationSpec.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/RandomizedBrainResolverIntegrationSpec.scala @@ -17,10 +17,6 @@ import scala.concurrent.Await import scala.concurrent.duration._ import scala.util.Random -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import org.scalatest.BeforeAndAfterEach - import org.apache.pekko import pekko.actor._ import pekko.cluster.Cluster @@ -40,6 +36,11 @@ import pekko.testkit.TestKit import pekko.testkit.TestProbe import pekko.util.Timeout +import org.scalatest.BeforeAndAfterEach + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + /* * Depends on Pekko private classes so needs to be in this package */ diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/SplitBrainResolverIntegrationSpec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/SplitBrainResolverIntegrationSpec.scala index 9bd9bba49f..986ca2b969 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/SplitBrainResolverIntegrationSpec.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/SplitBrainResolverIntegrationSpec.scala @@ -16,11 +16,6 @@ package org.apache.pekko.cluster.sbr import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import com.typesafe.config.ConfigValueFactory -import org.scalatest.BeforeAndAfterEach - import org.apache.pekko import pekko.actor._ import pekko.cluster.Cluster @@ -43,6 +38,12 @@ import pekko.testkit.TestKit import pekko.testkit.TestProbe import pekko.util.Timeout +import org.scalatest.BeforeAndAfterEach + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory +import com.typesafe.config.ConfigValueFactory + /* * Depends on Pekko private classes so needs to be in this package */ diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardCoordinatorDowning2Spec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardCoordinatorDowning2Spec.scala index 72bcf5bbaf..2da7b6d4e7 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardCoordinatorDowning2Spec.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardCoordinatorDowning2Spec.scala @@ -90,9 +90,8 @@ class DDataClusterShardCoordinatorDowning2MultiJvmNode2 extends DDataClusterShar abstract class ClusterShardCoordinatorDowning2Spec(multiNodeConfig: ClusterShardCoordinatorDowning2SpecConfig) extends MultiNodeClusterShardingSpec(multiNodeConfig) with ImplicitSender { - import multiNodeConfig._ - import ClusterShardCoordinatorDowning2Spec._ + import multiNodeConfig._ def startSharding(): Unit = { startSharding( diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardCoordinatorDowningSpec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardCoordinatorDowningSpec.scala index 7d1b954c4b..6c19bb2c2b 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardCoordinatorDowningSpec.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardCoordinatorDowningSpec.scala @@ -93,9 +93,8 @@ class DDataClusterShardCoordinatorDowningMultiJvmNode3 extends DDataClusterShard abstract class ClusterShardCoordinatorDowningSpec(multiNodeConfig: ClusterShardCoordinatorDowningSpecConfig) extends MultiNodeClusterShardingSpec(multiNodeConfig) with ImplicitSender { - import multiNodeConfig._ - import ClusterShardCoordinatorDowningSpec._ + import multiNodeConfig._ def startSharding(): Unit = { startSharding( diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingGetStateSpec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingGetStateSpec.scala index edc4d7649e..b6d1e23ae0 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingGetStateSpec.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingGetStateSpec.scala @@ -15,14 +15,14 @@ package org.apache.pekko.cluster.sharding import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.cluster.Cluster import pekko.cluster.ClusterEvent.CurrentClusterState import pekko.testkit.TestProbe +import com.typesafe.config.ConfigFactory + object ClusterShardingGetStateSpec { import MultiNodeClusterShardingSpec.PingPongActor diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingGetStatsSpec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingGetStatsSpec.scala index ba7cb5cea5..5702b2cdd0 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingGetStatsSpec.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingGetStatsSpec.scala @@ -21,6 +21,7 @@ import pekko.cluster.Cluster import pekko.cluster.MemberStatus import pekko.testkit.TestDuration import pekko.testkit.TestProbe + import com.typesafe.config.ConfigFactory object ClusterShardingGetStatsSpec { diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingGracefulShutdownOldestSpec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingGracefulShutdownOldestSpec.scala index c1bf753a37..67308ed37a 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingGracefulShutdownOldestSpec.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingGracefulShutdownOldestSpec.scala @@ -13,15 +13,15 @@ package org.apache.pekko.cluster.sharding +import scala.concurrent.Await import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor._ import pekko.cluster.sharding.ShardCoordinator.ShardAllocationStrategy import pekko.remote.testconductor.RoleName import pekko.testkit._ -import scala.concurrent.Await - abstract class ClusterShardingGracefulShutdownOldestSpecConfig(mode: String) extends MultiNodeClusterShardingConfig( mode, diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingGracefulShutdownSpec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingGracefulShutdownSpec.scala index b86fb8c125..651910cc89 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingGracefulShutdownSpec.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingGracefulShutdownSpec.scala @@ -13,18 +13,17 @@ package org.apache.pekko.cluster.sharding -import org.apache.pekko.Done - +import scala.concurrent.Future import scala.concurrent.duration._ + import org.apache.pekko +import org.apache.pekko.Done import pekko.actor._ import pekko.cluster.sharding.ShardCoordinator.ShardAllocationStrategy import pekko.cluster.sharding.ShardRegion.{ CurrentRegions, GracefulShutdown } import pekko.remote.testconductor.RoleName import pekko.testkit._ -import scala.concurrent.Future - abstract class ClusterShardingGracefulShutdownSpecConfig(mode: String) extends MultiNodeClusterShardingConfig( mode, diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingQueriesSpec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingQueriesSpec.scala index 79d89177c4..7fb37f33ba 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingQueriesSpec.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingQueriesSpec.scala @@ -15,12 +15,14 @@ package org.apache.pekko.cluster.sharding import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.concurrent.ScalaFutures import org.apache.pekko import pekko.actor.Props import pekko.testkit.TestProbe +import org.scalatest.concurrent.ScalaFutures + +import com.typesafe.config.ConfigFactory + object ClusterShardingQueriesSpec { import MultiNodeClusterShardingSpec.PingPongActor diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingRememberEntitiesNewExtractorSpec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingRememberEntitiesNewExtractorSpec.scala index 1614d40145..53d344a0d9 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingRememberEntitiesNewExtractorSpec.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingRememberEntitiesNewExtractorSpec.scala @@ -15,14 +15,14 @@ package org.apache.pekko.cluster.sharding import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.cluster.{ Cluster, MemberStatus } import pekko.persistence.journal.leveldb.SharedLeveldbJournal import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object ClusterShardingRememberEntitiesNewExtractorSpec { final case class Started(ref: ActorRef) diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingRememberEntitiesSpec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingRememberEntitiesSpec.scala index 368214fec1..8d46a92911 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingRememberEntitiesSpec.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingRememberEntitiesSpec.scala @@ -15,13 +15,13 @@ package org.apache.pekko.cluster.sharding import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.cluster.{ Cluster, MemberStatus } -import pekko.testkit._ import pekko.remote.testkit.MultiNodeSpec +import pekko.testkit._ + +import com.typesafe.config.ConfigFactory object ClusterShardingRememberEntitiesSpec { diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingRolePartitioningSpec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingRolePartitioningSpec.scala index b8eff24c85..65e16bd4dc 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingRolePartitioningSpec.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingRolePartitioningSpec.scala @@ -15,12 +15,12 @@ package org.apache.pekko.cluster.sharding import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.cluster.sharding.ShardRegion.{ ClusterShardingStats, GetClusterShardingStats } import pekko.testkit._ +import com.typesafe.config.{ Config, ConfigFactory } + // Tests the case where cluster roles are used with cluster.min-nr-of-members, no per role min set // with 5 node cluster, 2 roles: 3 nodes role R1, 2 nodes role R2 // See https://github.com/akka/akka/issues/28177#issuecomment-555013145 diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingSpec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingSpec.scala index a8731aa384..b939a1b4c9 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingSpec.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ClusterShardingSpec.scala @@ -13,8 +13,9 @@ package org.apache.pekko.cluster.sharding +import scala.annotation.nowarn import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory + import org.apache.pekko import pekko.actor._ import pekko.cluster.Cluster @@ -25,13 +26,13 @@ import pekko.cluster.sharding.ShardRegion.{ CurrentRegions, GetCurrentRegions, P import pekko.cluster.sharding.internal.{ DDataRememberEntitiesProvider, EventSourcedRememberEntitiesProvider } import pekko.cluster.singleton.{ ClusterSingletonManager, ClusterSingletonManagerSettings } import pekko.pattern.BackoffOpts -import pekko.persistence.journal.leveldb.{ SharedLeveldbJournal, SharedLeveldbStore } import pekko.persistence.{ Persistence, PersistentActor } +import pekko.persistence.journal.leveldb.{ SharedLeveldbJournal, SharedLeveldbStore } import pekko.remote.testconductor.RoleName import pekko.testkit._ import pekko.testkit.TestEvent.Mute -import scala.annotation.nowarn +import com.typesafe.config.ConfigFactory object ClusterShardingSpec { // #counter-actor diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ExternalShardAllocationSpec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ExternalShardAllocationSpec.scala index 571edb5f36..6413c82223 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ExternalShardAllocationSpec.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/ExternalShardAllocationSpec.scala @@ -15,9 +15,6 @@ package org.apache.pekko.cluster.sharding import scala.concurrent.duration._ -import org.scalatest.concurrent.ScalaFutures -import org.scalatest.time.Span - import org.apache.pekko import pekko.actor.{ Actor, ActorLogging, Address, Props } import pekko.cluster.Cluster @@ -26,6 +23,9 @@ import pekko.cluster.sharding.external.{ ExternalShardAllocation, ExternalShardA import pekko.serialization.jackson.CborSerializable import pekko.testkit.{ ImplicitSender, TestProbe } +import org.scalatest.concurrent.ScalaFutures +import org.scalatest.time.Span + object ExternalShardAllocationSpecConfig extends MultiNodeClusterShardingConfig(additionalConfig = """ pekko.cluster.sharding { diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiDcClusterShardingSpec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiDcClusterShardingSpec.scala index d180ab0538..fca967bbcb 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiDcClusterShardingSpec.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiDcClusterShardingSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.sharding import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ Actor, ActorRef, Address, Props } import pekko.cluster.{ Cluster, MemberStatus } @@ -25,6 +23,8 @@ import pekko.remote.testconductor.RoleName import pekko.serialization.jackson.CborSerializable import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object MultiDcClusterShardingSpec { sealed trait EntityMsg extends CborSerializable { def id: String diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiNodeClusterShardingConfig.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiNodeClusterShardingConfig.scala index e49a149dd4..2abb0202a5 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiNodeClusterShardingConfig.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiNodeClusterShardingConfig.scala @@ -15,13 +15,13 @@ package org.apache.pekko.cluster.sharding import java.lang.reflect.Modifier -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.cluster.MultiNodeClusterSpec import pekko.persistence.journal.leveldb.SharedLeveldbJournal import pekko.remote.testkit.MultiNodeConfig +import com.typesafe.config.{ Config, ConfigFactory } + object MultiNodeClusterShardingConfig { private[sharding] def testNameFromCallStack(classToStartFrom: Class[_]): String = { diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiNodeClusterShardingSpec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiNodeClusterShardingSpec.scala index 8d50340cf9..8b12b62fd8 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiNodeClusterShardingSpec.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiNodeClusterShardingSpec.scala @@ -14,8 +14,12 @@ package org.apache.pekko.cluster.sharding import java.io.File + +import scala.annotation.nowarn import scala.concurrent.duration._ + import org.apache.commons.io.FileUtils + import org.apache.pekko import pekko.actor.{ Actor, ActorIdentity, ActorLogging, ActorRef, ActorSystem, Identify, PoisonPill, Props } import pekko.cluster.MultiNodeClusterSpec @@ -26,8 +30,6 @@ import pekko.remote.testconductor.RoleName import pekko.serialization.jackson.CborSerializable import pekko.testkit.{ TestActors, TestProbe } -import scala.annotation.nowarn - object MultiNodeClusterShardingSpec { object EntityActor { diff --git a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/RollingUpdateShardAllocationSpec.scala b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/RollingUpdateShardAllocationSpec.scala index 06cc32fb4a..6333b70a1a 100644 --- a/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/RollingUpdateShardAllocationSpec.scala +++ b/cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/RollingUpdateShardAllocationSpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.cluster.sharding +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorLogging @@ -22,8 +24,8 @@ import pekko.cluster.Cluster import pekko.cluster.MemberStatus.Up import pekko.serialization.jackson.CborSerializable import pekko.testkit.ImplicitSender + import com.typesafe.config.ConfigFactory -import scala.concurrent.duration._ object RollingUpdateShardAllocationSpecConfig extends MultiNodeClusterShardingConfig( @@ -94,8 +96,8 @@ abstract class RollingUpdateShardAllocationSpec extends MultiNodeClusterShardingSpec(RollingUpdateShardAllocationSpecConfig) with ImplicitSender { - import RollingUpdateShardAllocationSpecConfig._ import RollingUpdateShardAllocationSpec._ + import RollingUpdateShardAllocationSpecConfig._ val typeName = "home" diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ClusterShardingHealthCheckSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ClusterShardingHealthCheckSpec.scala index ce188dd0ce..56cf7aca0e 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ClusterShardingHealthCheckSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ClusterShardingHealthCheckSpec.scala @@ -13,14 +13,16 @@ package org.apache.pekko.cluster.sharding +import scala.concurrent.duration._ + import org.apache.pekko import pekko.testkit.PekkoSpec import pekko.testkit.TestProbe import pekko.testkit.WithLogCapturing -import com.typesafe.config.ConfigFactory + import org.scalatest.concurrent.ScalaFutures -import scala.concurrent.duration._ +import com.typesafe.config.ConfigFactory object ClusterShardingHealthCheckSpec { val config = ConfigFactory.parseString(""" diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ClusterShardingInternalsSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ClusterShardingInternalsSpec.scala index 749d75e56f..7a56163758 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ClusterShardingInternalsSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ClusterShardingInternalsSpec.scala @@ -21,8 +21,8 @@ import pekko.cluster.ClusterSettings.DataCenter import pekko.cluster.sharding.ShardCoordinator.Internal.ShardStopped import pekko.cluster.sharding.ShardCoordinator.ShardAllocationStrategy import pekko.cluster.sharding.ShardRegion.{ ExtractEntityId, ExtractShardId, HandOffStopper, Msg } -import pekko.testkit.WithLogCapturing import pekko.testkit.{ PekkoSpec, TestProbe } +import pekko.testkit.WithLogCapturing object ClusterShardingInternalsSpec { case class HandOffStopMessage() extends NoSerializationVerificationNeeded diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ClusterShardingLeaseSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ClusterShardingLeaseSpec.scala index de1642d0a5..659b870974 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ClusterShardingLeaseSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ClusterShardingLeaseSpec.scala @@ -16,16 +16,18 @@ import scala.concurrent.Future import scala.concurrent.duration._ import scala.util.Success import scala.util.control.NoStackTrace -import com.typesafe.config.{ Config, ConfigFactory } + import org.apache.pekko import pekko.actor.Props -import pekko.cluster.sharding.ShardRegion.StartEntity import pekko.cluster.{ Cluster, MemberStatus } +import pekko.cluster.sharding.ShardRegion.StartEntity import pekko.coordination.lease.TestLease import pekko.coordination.lease.TestLeaseExt import pekko.testkit.{ ImplicitSender, PekkoSpec, WithLogCapturing } import pekko.testkit.TestActors.EchoActor +import com.typesafe.config.{ Config, ConfigFactory } + object ClusterShardingLeaseSpec { val config = ConfigFactory.parseString(""" pekko.loglevel = DEBUG diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ClusterShardingSettingsSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ClusterShardingSettingsSpec.scala index 43055355ff..56fecd542e 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ClusterShardingSettingsSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ClusterShardingSettingsSpec.scala @@ -13,14 +13,16 @@ package org.apache.pekko.cluster.sharding +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.ActorSystem import pekko.testkit.{ PekkoSpec, TestKit } -import com.typesafe.config.ConfigFactory + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import scala.concurrent.duration._ +import com.typesafe.config.ConfigFactory class ClusterShardingSettingsSpec extends AnyWordSpec with Matchers { diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ConcurrentStartupShardingSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ConcurrentStartupShardingSpec.scala index 0858585d6e..37463335bc 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ConcurrentStartupShardingSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ConcurrentStartupShardingSpec.scala @@ -14,14 +14,15 @@ package org.apache.pekko.cluster.sharding import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef import pekko.actor.Props import pekko.cluster.Cluster import pekko.cluster.MemberStatus -import pekko.testkit.PekkoSpec import pekko.testkit.DeadLettersFilter +import pekko.testkit.PekkoSpec import pekko.testkit.TestEvent.Mute import pekko.testkit.WithLogCapturing diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/DeprecatedLeastShardAllocationStrategySpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/DeprecatedLeastShardAllocationStrategySpec.scala index a51b7ab3da..7b1a09c9d6 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/DeprecatedLeastShardAllocationStrategySpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/DeprecatedLeastShardAllocationStrategySpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.cluster.sharding +import scala.collection.immutable.SortedSet + import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.Address @@ -26,8 +28,6 @@ import pekko.cluster.sharding.internal.AbstractLeastShardAllocationStrategy.Regi import pekko.testkit.PekkoSpec import pekko.util.Version -import scala.collection.immutable.SortedSet - class DeprecatedLeastShardAllocationStrategySpec extends PekkoSpec { import LeastShardAllocationStrategySpec._ diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/EntitiesSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/EntitiesSpec.scala index 263e9ff4be..964b4cdf35 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/EntitiesSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/EntitiesSpec.scala @@ -23,6 +23,7 @@ import pekko.cluster.sharding.Shard.RememberingStart import pekko.cluster.sharding.Shard.RememberingStop import pekko.event.NoLogging import pekko.util.OptionVal + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/EntityTerminationSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/EntityTerminationSpec.scala index 15cf865702..d9c4588674 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/EntityTerminationSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/EntityTerminationSpec.scala @@ -13,17 +13,18 @@ package org.apache.pekko.cluster.sharding +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.Actor import pekko.actor.Props import pekko.cluster.Cluster import pekko.cluster.MemberStatus -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.testkit.WithLogCapturing -import com.typesafe.config.ConfigFactory -import scala.concurrent.duration._ +import com.typesafe.config.ConfigFactory /** * Verifies that the automatic restart on terminate/crash that is in place for remember entities does not apply diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/JoinConfigCompatCheckShardingSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/JoinConfigCompatCheckShardingSpec.scala index 7010278bff..d0f22bac41 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/JoinConfigCompatCheckShardingSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/JoinConfigCompatCheckShardingSpec.scala @@ -16,13 +16,13 @@ package org.apache.pekko.cluster.sharding import scala.collection.{ immutable => im } import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.actor.ActorSystem import pekko.cluster.{ Cluster, ClusterReadView } -import pekko.testkit.WithLogCapturing import pekko.testkit.{ LongRunningTest, PekkoSpec } +import pekko.testkit.WithLogCapturing + +import com.typesafe.config.{ Config, ConfigFactory } class JoinConfigCompatCheckShardingSpec extends PekkoSpec() with WithLogCapturing { diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/LeastShardAllocationStrategyRandomizedSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/LeastShardAllocationStrategyRandomizedSpec.scala index a72f964f4d..68e398318a 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/LeastShardAllocationStrategyRandomizedSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/LeastShardAllocationStrategyRandomizedSpec.scala @@ -15,7 +15,9 @@ package org.apache.pekko.cluster.sharding import scala.annotation.tailrec import scala.collection.immutable +import scala.collection.immutable.SortedSet import scala.util.Random + import org.apache.pekko import pekko.actor.ActorRef import pekko.cluster.ClusterEvent @@ -26,8 +28,6 @@ import pekko.cluster.sharding.ShardRegion.ShardId import pekko.cluster.sharding.internal.LeastShardAllocationStrategy import pekko.testkit.PekkoSpec -import scala.collection.immutable.SortedSet - class LeastShardAllocationStrategyRandomizedSpec extends PekkoSpec("pekko.loglevel = INFO") { import LeastShardAllocationStrategySpec.{ afterRebalance, diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/LeastShardAllocationStrategySpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/LeastShardAllocationStrategySpec.scala index 1763588699..44da6b3fa4 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/LeastShardAllocationStrategySpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/LeastShardAllocationStrategySpec.scala @@ -14,6 +14,8 @@ package org.apache.pekko.cluster.sharding import scala.collection.immutable +import scala.collection.immutable.SortedSet + import org.apache.pekko import pekko.actor.ActorPath import pekko.actor.ActorRef @@ -35,8 +37,6 @@ import pekko.cluster.sharding.internal.LeastShardAllocationStrategy import pekko.testkit.PekkoSpec import pekko.util.Version -import scala.collection.immutable.SortedSet - object LeastShardAllocationStrategySpec { private object DummyActorRef extends MinimalActorRef { diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/PersistentShardingMigrationSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/PersistentShardingMigrationSpec.scala index 2c20e1cf3c..abe10c610a 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/PersistentShardingMigrationSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/PersistentShardingMigrationSpec.scala @@ -14,17 +14,18 @@ package org.apache.pekko.cluster.sharding import java.util.UUID -import org.apache.pekko -import pekko.actor.{ ActorRef, ActorSystem, Props } -import pekko.cluster.sharding.ShardRegion.CurrentRegions -import pekko.cluster.{ Cluster, MemberStatus } -import pekko.persistence.PersistentActor -import pekko.testkit.{ ImplicitSender, PekkoSpec, TestProbe } -import com.typesafe.config.{ Config, ConfigFactory } - import scala.concurrent.Await import scala.concurrent.duration._ +import org.apache.pekko +import pekko.actor.{ ActorRef, ActorSystem, Props } +import pekko.cluster.{ Cluster, MemberStatus } +import pekko.cluster.sharding.ShardRegion.CurrentRegions +import pekko.persistence.PersistentActor +import pekko.testkit.{ ImplicitSender, PekkoSpec, TestProbe } + +import com.typesafe.config.{ Config, ConfigFactory } + /** * Test migration from old persistent shard coordinator with remembered * entities to using a ddatabacked shard coordinator with an event sourced diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesAndStartEntitySpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesAndStartEntitySpec.scala index 3509d28a1f..2163074c52 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesAndStartEntitySpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesAndStartEntitySpec.scala @@ -13,9 +13,6 @@ package org.apache.pekko.cluster.sharding -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef @@ -27,10 +24,14 @@ import pekko.cluster.sharding.Shard.GetShardStats import pekko.cluster.sharding.Shard.ShardStats import pekko.cluster.sharding.ShardRegion.StartEntity import pekko.cluster.sharding.ShardRegion.StartEntityAck -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.testkit.WithLogCapturing +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + object RememberEntitiesAndStartEntitySpec { class EntityActor extends Actor { override def receive: Receive = { diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesBatchedUpdatesSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesBatchedUpdatesSpec.scala index b98d21da6a..9cf7d65077 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesBatchedUpdatesSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesBatchedUpdatesSpec.scala @@ -17,9 +17,11 @@ import org.apache.pekko import pekko.actor.{ Actor, ActorLogging, ActorRef, Props } import pekko.cluster.{ Cluster, MemberStatus } import pekko.testkit.{ ImplicitSender, PekkoSpec, TestProbe } -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike +import com.typesafe.config.ConfigFactory + object RememberEntitiesBatchedUpdatesSpec { case class EntityEnvelope(id: Int, msg: Any) diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesFailureSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesFailureSpec.scala index f4a07fc5b4..336d666d3c 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesFailureSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesFailureSpec.scala @@ -13,26 +13,28 @@ package org.apache.pekko.cluster.sharding +import scala.annotation.nowarn +import scala.concurrent.ExecutionContext +import scala.concurrent.duration._ + import org.apache.pekko +import org.apache.pekko.cluster.sharding.ShardCoordinator.ShardAllocationStrategy import pekko.Done import pekko.actor.{ Actor, ActorLogging, ActorRef, Props, Timers } import pekko.cluster.Cluster import pekko.cluster.MemberStatus import pekko.cluster.sharding.ShardRegion.ShardId import pekko.cluster.sharding.internal.RememberEntitiesCoordinatorStore -import pekko.cluster.sharding.internal.RememberEntitiesShardStore import pekko.cluster.sharding.internal.RememberEntitiesProvider +import pekko.cluster.sharding.internal.RememberEntitiesShardStore import pekko.testkit.PekkoSpec import pekko.testkit.TestException import pekko.testkit.TestProbe import pekko.testkit.WithLogCapturing -import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike -import scala.concurrent.duration._ -import scala.concurrent.ExecutionContext -import org.apache.pekko.cluster.sharding.ShardCoordinator.ShardAllocationStrategy +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory object RememberEntitiesFailureSpec { val config = ConfigFactory.parseString(s""" diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesShardIdExtractorChangeSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesShardIdExtractorChangeSpec.scala index 45dbacf151..f73a0e1a4a 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesShardIdExtractorChangeSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesShardIdExtractorChangeSpec.scala @@ -15,6 +15,9 @@ package org.apache.pekko.cluster.sharding import java.util.UUID +import scala.concurrent.Await +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ActorSystem @@ -22,13 +25,11 @@ import pekko.actor.Props import pekko.cluster.Cluster import pekko.cluster.sharding.ShardRegion.CurrentRegions import pekko.persistence.PersistentActor -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.testkit.TestProbe -import com.typesafe.config.ConfigFactory -import scala.concurrent.Await -import scala.concurrent.duration._ +import com.typesafe.config.ConfigFactory /** * Covers that remembered entities is correctly migrated when used and the shard id extractor diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RemoveInternalClusterShardingDataSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RemoveInternalClusterShardingDataSpec.scala index 15435c2670..3f28df0261 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RemoveInternalClusterShardingDataSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RemoveInternalClusterShardingDataSpec.scala @@ -32,8 +32,8 @@ import pekko.persistence.Recovery import pekko.persistence.RecoveryCompleted import pekko.persistence.SnapshotOffer import pekko.persistence.SnapshotSelectionCriteria -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.testkit.TestActors.EchoActor import pekko.testkit.WithLogCapturing diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ShardRegionSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ShardRegionSpec.scala index 95a7df4296..93fde80e90 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ShardRegionSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ShardRegionSpec.scala @@ -15,19 +15,21 @@ package org.apache.pekko.cluster.sharding import java.io.File -import com.typesafe.config.ConfigFactory +import scala.concurrent.{ ExecutionContext, Future } + import org.apache.commons.io.FileUtils + import org.apache.pekko +import pekko.Done import pekko.actor.{ Actor, ActorLogging, ActorRef, ActorSystem, PoisonPill, Props } import pekko.cluster.{ Cluster, MemberStatus } import pekko.cluster.ClusterEvent.CurrentClusterState import pekko.cluster.sharding.ShardRegion.MessageExtractor -import pekko.Done import pekko.stream.scaladsl.{ Sink, Source } import pekko.testkit.{ DeadLettersFilter, PekkoSpec, TestProbe, WithLogCapturing } import pekko.testkit.TestEvent.Mute -import scala.concurrent.{ ExecutionContext, Future } +import com.typesafe.config.ConfigFactory object ShardRegionSpec { val host = "127.0.0.1" diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ShardWithLeaseSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ShardWithLeaseSpec.scala index 57c751afc6..800d1ffcf9 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ShardWithLeaseSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ShardWithLeaseSpec.scala @@ -13,6 +13,11 @@ package org.apache.pekko.cluster.sharding +import scala.concurrent.Future +import scala.concurrent.duration._ +import scala.util.Success +import scala.util.control.NoStackTrace + import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorLogging @@ -21,16 +26,11 @@ import pekko.cluster.Cluster import pekko.cluster.MemberStatus import pekko.cluster.sharding.ShardRegion.ShardId import pekko.coordination.lease.{ LeaseUsageSettings, TestLeaseExt } -import pekko.testkit.PekkoSpec import pekko.testkit.EventFilter +import pekko.testkit.PekkoSpec import pekko.testkit.TestProbe import pekko.testkit.WithLogCapturing -import scala.concurrent.Future -import scala.concurrent.duration._ -import scala.util.Success -import scala.util.control.NoStackTrace - // FIXME this looks like it is the same test as ClusterShardingLeaseSpec is there any difference? object ShardWithLeaseSpec { val config = diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/StartEntitySpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/StartEntitySpec.scala index 4d0e0e8965..96684ff6b1 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/StartEntitySpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/StartEntitySpec.scala @@ -13,17 +13,19 @@ package org.apache.pekko.cluster.sharding +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef import pekko.actor.Props import pekko.cluster.Cluster import pekko.cluster.MemberStatus -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.testkit.WithLogCapturing + import com.typesafe.config.ConfigFactory -import scala.concurrent.duration._ /** * Covers some corner cases around sending triggering an entity with StartEntity diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/SupervisionSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/SupervisionSpec.scala index 1075cfae03..f51ff09da7 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/SupervisionSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/SupervisionSpec.scala @@ -14,15 +14,17 @@ package org.apache.pekko.cluster.sharding import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory + import org.apache.pekko import pekko.actor.{ Actor, ActorLogging, ActorRef, PoisonPill, Props } import pekko.cluster.Cluster import pekko.cluster.sharding.ShardRegion.Passivate import pekko.pattern.{ BackoffOpts, BackoffSupervisor } +import pekko.testkit.{ ImplicitSender, PekkoSpec } import pekko.testkit.EventFilter import pekko.testkit.WithLogCapturing -import pekko.testkit.{ ImplicitSender, PekkoSpec } + +import com.typesafe.config.ConfigFactory object SupervisionSpec { val config = diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/internal/RememberEntitiesShardStoreSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/internal/RememberEntitiesShardStoreSpec.scala index 744c31e5d2..a1c0237449 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/internal/RememberEntitiesShardStoreSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/internal/RememberEntitiesShardStoreSpec.scala @@ -17,14 +17,16 @@ import java.util.UUID import org.apache.pekko import pekko.actor.Props +import pekko.cluster.{ Cluster, MemberStatus } import pekko.cluster.ddata.{ Replicator, ReplicatorSettings } import pekko.cluster.sharding.ClusterShardingSettings import pekko.cluster.sharding.ShardRegion.ShardId -import pekko.cluster.{ Cluster, MemberStatus } import pekko.testkit.{ ImplicitSender, PekkoSpec, WithLogCapturing } -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike +import com.typesafe.config.ConfigFactory + /** * Covers the interaction between the shard and the remember entities store */ diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/internal/RememberEntitiesStarterSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/internal/RememberEntitiesStarterSpec.scala index 1d67644938..18921dcfb4 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/internal/RememberEntitiesStarterSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/internal/RememberEntitiesStarterSpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.cluster.sharding.internal +import scala.concurrent.duration._ + import org.apache.pekko import pekko.cluster.sharding.ClusterShardingSettings import pekko.cluster.sharding.Shard @@ -20,9 +22,8 @@ import pekko.cluster.sharding.ShardRegion import pekko.cluster.sharding.ShardRegion.ShardId import pekko.testkit.PekkoSpec import pekko.testkit.TestProbe -import com.typesafe.config.ConfigFactory -import scala.concurrent.duration._ +import com.typesafe.config.ConfigFactory class RememberEntitiesStarterSpec extends PekkoSpec { diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/CompositeSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/CompositeSpec.scala index 096ba2430b..29590a1e8a 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/CompositeSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/CompositeSpec.scala @@ -13,12 +13,13 @@ package org.apache.pekko.cluster.sharding.passivation +import scala.concurrent.duration._ + import org.apache.pekko.cluster.sharding.ShardRegion + import com.typesafe.config.Config import com.typesafe.config.ConfigFactory -import scala.concurrent.duration._ - object CompositeSpec { val admissionWindowAndFilterConfig: Config = ConfigFactory.parseString(""" diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/EntityPassivationSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/EntityPassivationSpec.scala index 7080bc6406..a2e77c3a61 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/EntityPassivationSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/EntityPassivationSpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.cluster.sharding.passivation +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef @@ -21,14 +23,14 @@ import pekko.cluster.Cluster import pekko.cluster.sharding.ClusterSharding import pekko.cluster.sharding.ClusterShardingSettings import pekko.cluster.sharding.ShardRegion -import pekko.testkit.WithLogCapturing import pekko.testkit.PekkoSpec import pekko.testkit.TestProbe -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory +import pekko.testkit.WithLogCapturing + import org.scalatest.concurrent.Eventually -import scala.concurrent.duration._ +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory object EntityPassivationSpec { diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/HillClimbingAdmissionOptimizerSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/HillClimbingAdmissionOptimizerSpec.scala index 71ce5c00f3..bc203bf094 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/HillClimbingAdmissionOptimizerSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/HillClimbingAdmissionOptimizerSpec.scala @@ -14,6 +14,7 @@ package org.apache.pekko.cluster.sharding.passivation import org.apache.pekko.cluster.sharding.internal.HillClimbingAdmissionOptimizer + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/IdleSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/IdleSpec.scala index caf55ffd4b..158fb21d85 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/IdleSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/IdleSpec.scala @@ -13,11 +13,11 @@ package org.apache.pekko.cluster.sharding.passivation +import scala.concurrent.duration._ + import com.typesafe.config.Config import com.typesafe.config.ConfigFactory -import scala.concurrent.duration._ - object IdleSpec { val config: Config = ConfigFactory.parseString(""" pekko.cluster.sharding { diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/LeastFrequentlyUsedSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/LeastFrequentlyUsedSpec.scala index d8d08803e5..3b52bdb04e 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/LeastFrequentlyUsedSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/LeastFrequentlyUsedSpec.scala @@ -13,12 +13,13 @@ package org.apache.pekko.cluster.sharding.passivation +import scala.concurrent.duration._ + import org.apache.pekko.cluster.sharding.ShardRegion + import com.typesafe.config.Config import com.typesafe.config.ConfigFactory -import scala.concurrent.duration._ - object LeastFrequentlyUsedSpec { val config: Config = ConfigFactory.parseString(""" diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/LeastRecentlyUsedSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/LeastRecentlyUsedSpec.scala index 49dbd789b8..66164a3fec 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/LeastRecentlyUsedSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/LeastRecentlyUsedSpec.scala @@ -13,12 +13,13 @@ package org.apache.pekko.cluster.sharding.passivation +import scala.concurrent.duration._ + import org.apache.pekko.cluster.sharding.ShardRegion + import com.typesafe.config.Config import com.typesafe.config.ConfigFactory -import scala.concurrent.duration._ - object LeastRecentlyUsedSpec { val config: Config = ConfigFactory.parseString(""" diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/MostRecentlyUsedSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/MostRecentlyUsedSpec.scala index c9203a4049..259bf8d881 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/MostRecentlyUsedSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/MostRecentlyUsedSpec.scala @@ -13,12 +13,13 @@ package org.apache.pekko.cluster.sharding.passivation +import scala.concurrent.duration._ + import org.apache.pekko.cluster.sharding.ShardRegion + import com.typesafe.config.Config import com.typesafe.config.ConfigFactory -import scala.concurrent.duration._ - object MostRecentlyUsedSpec { val config: Config = ConfigFactory.parseString(""" diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/simulator/AccessPattern.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/simulator/AccessPattern.scala index 1842e8a590..621f854b59 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/simulator/AccessPattern.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/simulator/AccessPattern.scala @@ -13,14 +13,14 @@ package org.apache.pekko.cluster.sharding.passivation.simulator +import java.nio.file.Paths + import org.apache.pekko import pekko.NotUsed import pekko.cluster.sharding.ShardRegion.EntityId import pekko.stream.scaladsl._ import pekko.util.ByteString -import java.nio.file.Paths - trait AccessPattern { def isSynthetic: Boolean def entityIds: Source[EntityId, NotUsed] diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/simulator/Simulator.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/simulator/Simulator.scala index 82a7122ef3..e4a0137395 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/simulator/Simulator.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/simulator/Simulator.scala @@ -13,6 +13,13 @@ package org.apache.pekko.cluster.sharding.passivation.simulator +import scala.collection.immutable +import scala.collection.mutable +import scala.concurrent.ExecutionContext +import scala.concurrent.Future +import scala.util.Failure +import scala.util.Success + import org.apache.pekko import pekko.NotUsed import pekko.actor.ActorSystem @@ -38,14 +45,8 @@ import pekko.cluster.sharding.internal.SegmentedLeastRecentlyUsedReplacementPoli import pekko.stream.scaladsl.Flow import pekko.stream.scaladsl.Source import pekko.util.OptionVal -import com.typesafe.config.ConfigFactory -import scala.collection.immutable -import scala.collection.mutable -import scala.concurrent.ExecutionContext -import scala.concurrent.Future -import scala.util.Failure -import scala.util.Success +import com.typesafe.config.ConfigFactory /** * Simulator for testing the efficiency of passivation strategies. diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/simulator/SimulatorSettings.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/simulator/SimulatorSettings.scala index a8bfecc83d..1b82c22618 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/simulator/SimulatorSettings.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/simulator/SimulatorSettings.scala @@ -13,13 +13,15 @@ package org.apache.pekko.cluster.sharding.passivation.simulator +import java.util.Locale + +import scala.collection.immutable +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.japi.Util.immutableSeq -import scala.jdk.CollectionConverters._ -import com.typesafe.config.Config -import java.util.Locale -import scala.collection.immutable +import com.typesafe.config.Config final case class SimulatorSettings(runs: immutable.Seq[SimulatorSettings.RunSettings], printDetailedStats: Boolean) diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/simulator/SimulatorStats.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/simulator/SimulatorStats.scala index 4950841a6b..3ae69d0811 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/simulator/SimulatorStats.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/passivation/simulator/SimulatorStats.scala @@ -13,10 +13,10 @@ package org.apache.pekko.cluster.sharding.passivation.simulator -import org.apache.pekko.stream.scaladsl.Sink - import scala.concurrent.Future +import org.apache.pekko.stream.scaladsl.Sink + object SimulatorStats { def apply(): Sink[Simulator.Event, Future[ShardingStats]] = Sink.fold(ShardingStats()) { diff --git a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/protobuf/ClusterShardingMessageSerializerSpec.scala b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/protobuf/ClusterShardingMessageSerializerSpec.scala index 97dc6867d7..63a70b65a2 100644 --- a/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/protobuf/ClusterShardingMessageSerializerSpec.scala +++ b/cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/protobuf/ClusterShardingMessageSerializerSpec.scala @@ -14,6 +14,7 @@ package org.apache.pekko.cluster.sharding.protobuf import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.Address import pekko.actor.ExtendedActorSystem diff --git a/cluster-tools/src/main/scala/org/apache/pekko/cluster/client/ClusterClient.scala b/cluster-tools/src/main/scala/org/apache/pekko/cluster/client/ClusterClient.scala index 4a9059d755..4b02ab2da6 100644 --- a/cluster-tools/src/main/scala/org/apache/pekko/cluster/client/ClusterClient.scala +++ b/cluster-tools/src/main/scala/org/apache/pekko/cluster/client/ClusterClient.scala @@ -18,8 +18,7 @@ import java.net.URLEncoder import scala.collection.immutable import scala.collection.immutable.{ HashMap, HashSet } import scala.concurrent.duration._ - -import com.typesafe.config.Config +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.actor.Actor @@ -51,7 +50,8 @@ import pekko.remote.DeadlineFailureDetector import pekko.routing.ConsistentHash import pekko.routing.MurmurHash import pekko.util.MessageBuffer -import scala.jdk.CollectionConverters._ + +import com.typesafe.config.Config @deprecated( "Use Pekko gRPC instead, see https://pekko.apache.org/docs/pekko/current/cluster-client.html#migration-to-pekko-grpc", diff --git a/cluster-tools/src/main/scala/org/apache/pekko/cluster/client/protobuf/ClusterClientMessageSerializer.scala b/cluster-tools/src/main/scala/org/apache/pekko/cluster/client/protobuf/ClusterClientMessageSerializer.scala index 13f81f6a83..8babe630ad 100644 --- a/cluster-tools/src/main/scala/org/apache/pekko/cluster/client/protobuf/ClusterClientMessageSerializer.scala +++ b/cluster-tools/src/main/scala/org/apache/pekko/cluster/client/protobuf/ClusterClientMessageSerializer.scala @@ -16,6 +16,7 @@ package org.apache.pekko.cluster.client.protobuf import java.io.NotSerializableException import scala.annotation.nowarn +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.actor.ExtendedActorSystem @@ -23,7 +24,6 @@ import pekko.cluster.client.ClusterReceptionist import pekko.cluster.client.protobuf.msg.{ ClusterClientMessages => cm } import pekko.serialization.BaseSerializer import pekko.serialization.SerializerWithStringManifest -import scala.jdk.CollectionConverters._ /** * INTERNAL API: Serializer of ClusterClient messages. diff --git a/cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediator.scala b/cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediator.scala index 95d9ddd04c..47339e5e28 100644 --- a/cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediator.scala +++ b/cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediator.scala @@ -22,8 +22,6 @@ import scala.collection.immutable.Set import scala.collection.immutable.TreeMap import scala.concurrent.duration._ -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor._ import pekko.annotation.DoNotInherit @@ -41,6 +39,8 @@ import pekko.routing.Router import pekko.routing.RouterEnvelope import pekko.routing.RoutingLogic +import com.typesafe.config.Config + object DistributedPubSubSettings { /** diff --git a/cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/protobuf/DistributedPubSubMessageSerializer.scala b/cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/protobuf/DistributedPubSubMessageSerializer.scala index bf8832ba63..a17b3a7f37 100644 --- a/cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/protobuf/DistributedPubSubMessageSerializer.scala +++ b/cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/protobuf/DistributedPubSubMessageSerializer.scala @@ -17,8 +17,11 @@ import java.io.{ ByteArrayInputStream, ByteArrayOutputStream } import java.io.NotSerializableException import java.util.zip.GZIPInputStream import java.util.zip.GZIPOutputStream + import scala.annotation.tailrec import scala.collection.immutable.TreeMap +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.actor.{ Address, ExtendedActorSystem } import pekko.actor.ActorRef @@ -28,7 +31,6 @@ import pekko.cluster.pubsub.protobuf.msg.{ DistributedPubSubMessages => dm } import pekko.protobufv3.internal.{ ByteString, MessageLite } import pekko.remote.ByteStringUtils import pekko.serialization._ -import scala.jdk.CollectionConverters._ /** * INTERNAL API: Protobuf serializer of DistributedPubSubMediator messages. diff --git a/cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManager.scala b/cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManager.scala index f60ae4fc49..a0b71960d9 100644 --- a/cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManager.scala +++ b/cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManager.scala @@ -17,11 +17,12 @@ import scala.collection.immutable import scala.concurrent.Future import scala.concurrent.Promise import scala.concurrent.duration._ +import scala.jdk.DurationConverters._ import scala.util.control.NonFatal -import com.typesafe.config.Config + import org.apache.pekko -import pekko.PekkoException import pekko.Done +import pekko.PekkoException import pekko.actor.Actor import pekko.actor.ActorRef import pekko.actor.ActorSelection @@ -47,9 +48,10 @@ import pekko.event.Logging import pekko.event.MarkerLoggingAdapter import pekko.pattern.ask import pekko.pattern.pipe -import scala.jdk.DurationConverters._ import pekko.util.Timeout +import com.typesafe.config.Config + object ClusterSingletonManagerSettings { /** diff --git a/cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonProxy.scala b/cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonProxy.scala index 97db57c9bb..9c973798e6 100644 --- a/cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonProxy.scala +++ b/cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonProxy.scala @@ -16,8 +16,6 @@ package org.apache.pekko.cluster.singleton import scala.collection.immutable import scala.concurrent.duration._ -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor._ import pekko.actor.NoSerializationVerificationNeeded @@ -34,6 +32,8 @@ import pekko.dispatch.Dispatchers import pekko.event.Logging import pekko.util.MessageBuffer +import com.typesafe.config.Config + object ClusterSingletonProxySettings { /** diff --git a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/client/ClusterClientHandoverSpec.scala b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/client/ClusterClientHandoverSpec.scala index 7057f7df9d..35de79f37e 100644 --- a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/client/ClusterClientHandoverSpec.scala +++ b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/client/ClusterClientHandoverSpec.scala @@ -13,10 +13,8 @@ package org.apache.pekko.cluster.client -import scala.concurrent.duration._ - import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory +import scala.concurrent.duration._ import org.apache.pekko import pekko.actor.{ ActorPath, ActorRef } @@ -25,6 +23,8 @@ import pekko.remote.testconductor.RoleName import pekko.remote.testkit.{ MultiNodeConfig, STMultiNodeSpec } import pekko.testkit.{ ImplicitSender, TestActors } +import com.typesafe.config.ConfigFactory + object ClusterClientHandoverSpec extends MultiNodeConfig { val client = role("client") val first = role("first") diff --git a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/client/ClusterClientSpec.scala b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/client/ClusterClientSpec.scala index d5b1be40d8..3304caa81a 100644 --- a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/client/ClusterClientSpec.scala +++ b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/client/ClusterClientSpec.scala @@ -17,8 +17,6 @@ import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorPath @@ -39,6 +37,8 @@ import pekko.testkit._ import pekko.util.Timeout import pekko.util.unused +import com.typesafe.config.ConfigFactory + object ClusterClientSpec extends MultiNodeConfig { val client = role("client") val first = role("first") diff --git a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/client/ClusterClientStopSpec.scala b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/client/ClusterClientStopSpec.scala index 6af92d89a7..ccba3d8763 100644 --- a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/client/ClusterClientStopSpec.scala +++ b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/client/ClusterClientStopSpec.scala @@ -13,12 +13,10 @@ package org.apache.pekko.cluster.client +import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.duration._ -import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ Actor, Props } import pekko.cluster.Cluster @@ -27,6 +25,8 @@ import pekko.remote.testconductor.RoleName import pekko.remote.testkit.{ MultiNodeConfig, MultiNodeSpec, STMultiNodeSpec } import pekko.testkit.{ EventFilter, ImplicitSender } +import com.typesafe.config.ConfigFactory + object ClusterClientStopSpec extends MultiNodeConfig { val client = role("client") val first = role("first") diff --git a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediatorSpec.scala b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediatorSpec.scala index 599aed999b..4c07ccdc12 100644 --- a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediatorSpec.scala +++ b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediatorSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.pubsub import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorLogging @@ -32,6 +30,8 @@ import pekko.remote.testkit.MultiNodeSpec import pekko.remote.testkit.STMultiNodeSpec import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object DistributedPubSubMediatorSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubRestartSpec.scala b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubRestartSpec.scala index fa1b084624..edebf5cc5a 100644 --- a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubRestartSpec.scala +++ b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubRestartSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.cluster.pubsub import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorIdentity @@ -33,6 +31,8 @@ import pekko.remote.testkit.MultiNodeSpec import pekko.remote.testkit.STMultiNodeSpec import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object DistributedPubSubRestartSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerChaosSpec.scala b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerChaosSpec.scala index e2b58be7f7..2c28cf8b67 100644 --- a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerChaosSpec.scala +++ b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerChaosSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.singleton import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef @@ -33,6 +31,8 @@ import pekko.remote.testkit.STMultiNodeSpec import pekko.testkit._ import pekko.testkit.TestEvent._ +import com.typesafe.config.ConfigFactory + object ClusterSingletonManagerChaosSpec extends MultiNodeConfig { val controller = role("controller") val first = role("first") diff --git a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerDownedSpec.scala b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerDownedSpec.scala index c3bbb8754a..db0bfd6760 100644 --- a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerDownedSpec.scala +++ b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerDownedSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.singleton import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef @@ -31,6 +29,8 @@ import pekko.remote.testkit.STMultiNodeSpec import pekko.remote.transport.ThrottlerTransportAdapter import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object ClusterSingletonManagerDownedSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerLeaseSpec.scala b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerLeaseSpec.scala index 1107bd90a9..386b88f984 100644 --- a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerLeaseSpec.scala +++ b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerLeaseSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.singleton import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ Actor, ActorIdentity, ActorLogging, ActorRef, Address, Identify, PoisonPill, Props } import pekko.cluster._ @@ -28,6 +26,8 @@ import pekko.coordination.lease.TestLeaseActorClientExt import pekko.remote.testkit.{ MultiNodeConfig, STMultiNodeSpec } import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object ClusterSingletonManagerLeaseSpec extends MultiNodeConfig { val controller = role("controller") val first = role("first") diff --git a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerLeave2Spec.scala b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerLeave2Spec.scala index 3740745cf1..580d36ce89 100644 --- a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerLeave2Spec.scala +++ b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerLeave2Spec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.singleton import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorIdentity @@ -33,6 +31,8 @@ import pekko.remote.testkit.MultiNodeSpec import pekko.remote.testkit.STMultiNodeSpec import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object ClusterSingletonManagerLeave2Spec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerLeaveSpec.scala b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerLeaveSpec.scala index 8c624802b9..f77bd3cc6b 100644 --- a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerLeaveSpec.scala +++ b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerLeaveSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.singleton import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef @@ -29,6 +27,8 @@ import pekko.remote.testkit.MultiNodeSpec import pekko.remote.testkit.STMultiNodeSpec import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object ClusterSingletonManagerLeaveSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerPreparingForShutdownSpec.scala b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerPreparingForShutdownSpec.scala index efcf08ad29..b0e8a8dcbc 100644 --- a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerPreparingForShutdownSpec.scala +++ b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerPreparingForShutdownSpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.cluster.singleton +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorLogging @@ -25,9 +27,8 @@ import pekko.cluster.MultiNodeClusterSpec import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.STMultiNodeSpec import pekko.testkit._ -import com.typesafe.config.ConfigFactory -import scala.concurrent.duration._ +import com.typesafe.config.ConfigFactory object ClusterSingletonManagerPreparingForShutdownSpec extends MultiNodeConfig { val first = role("first") diff --git a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerSpec.scala b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerSpec.scala index 08bc389b2f..0969b573ea 100644 --- a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerSpec.scala +++ b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.singleton import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorIdentity @@ -36,6 +34,8 @@ import pekko.serialization.jackson.CborSerializable import pekko.testkit._ import pekko.testkit.TestEvent._ +import com.typesafe.config.ConfigFactory + object ClusterSingletonManagerSpec extends MultiNodeConfig { val controller = role("controller") val observer = role("observer") diff --git a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerStartupSpec.scala b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerStartupSpec.scala index 15a78fa913..9ca8b6f2fd 100644 --- a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerStartupSpec.scala +++ b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerStartupSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.singleton import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef @@ -30,6 +28,8 @@ import pekko.remote.testkit.MultiNodeSpec import pekko.remote.testkit.STMultiNodeSpec import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object ClusterSingletonManagerStartupSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/MultiDcSingletonManagerSpec.scala b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/MultiDcSingletonManagerSpec.scala index ac62250763..0b2806cd60 100644 --- a/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/MultiDcSingletonManagerSpec.scala +++ b/cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/MultiDcSingletonManagerSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.singleton import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ Actor, ActorLogging, Address, PoisonPill, Props } import pekko.cluster.Cluster @@ -25,6 +23,8 @@ import pekko.remote.testkit.{ MultiNodeConfig, MultiNodeSpec, STMultiNodeSpec } import pekko.serialization.jackson.CborSerializable import pekko.testkit.ImplicitSender +import com.typesafe.config.ConfigFactory + object MultiDcSingletonManagerSpec extends MultiNodeConfig { val controller = role("controller") val first = role("first") diff --git a/cluster-tools/src/test/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediatorRouterSpec.scala b/cluster-tools/src/test/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediatorRouterSpec.scala index 12d5561adc..36fd000327 100644 --- a/cluster-tools/src/test/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediatorRouterSpec.scala +++ b/cluster-tools/src/test/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediatorRouterSpec.scala @@ -13,14 +13,15 @@ package org.apache.pekko.cluster.pubsub -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.ActorRef import pekko.routing.{ ConsistentHashingRoutingLogic, RouterEnvelope } import pekko.testkit._ +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + case class WrappedMessage(msg: String) extends RouterEnvelope { override def message = msg } diff --git a/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonLeaseSpec.scala b/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonLeaseSpec.scala index 8873fd5107..c0eafdfa64 100644 --- a/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonLeaseSpec.scala +++ b/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonLeaseSpec.scala @@ -19,8 +19,6 @@ import scala.concurrent.Promise import scala.concurrent.duration._ import scala.util.Success -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorLogging @@ -36,6 +34,8 @@ import pekko.testkit.PekkoSpec import pekko.testkit.TestException import pekko.testkit.TestProbe +import com.typesafe.config.ConfigFactory + class ImportantSingleton(lifeCycleProbe: ActorRef) extends Actor with ActorLogging { override def preStart(): Unit = { diff --git a/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonLeavingSpeedSpec.scala b/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonLeavingSpeedSpec.scala index 75b3e971d9..82a19e606d 100644 --- a/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonLeavingSpeedSpec.scala +++ b/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonLeavingSpeedSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.singleton import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef @@ -30,6 +28,8 @@ import pekko.cluster.singleton.ClusterSingletonLeavingSpeedSpec.TheSingleton import pekko.testkit.PekkoSpec import pekko.testkit.TestProbe +import com.typesafe.config.ConfigFactory + object ClusterSingletonLeavingSpeedSpec { object TheSingleton { diff --git a/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonProxySpec.scala b/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonProxySpec.scala index 8ddbe58759..97da3bc9e0 100644 --- a/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonProxySpec.scala +++ b/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonProxySpec.scala @@ -15,16 +15,17 @@ package org.apache.pekko.cluster.singleton import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.BeforeAndAfterAll -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor._ import pekko.cluster.Cluster import pekko.testkit.{ TestKit, TestProbe } +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + class ClusterSingletonProxySpec extends AnyWordSpecLike with Matchers with BeforeAndAfterAll { import ClusterSingletonProxySpec._ diff --git a/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonRestart2Spec.scala b/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonRestart2Spec.scala index ce10330e5f..9e213c2a32 100644 --- a/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonRestart2Spec.scala +++ b/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonRestart2Spec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.singleton import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorSystem @@ -28,6 +26,8 @@ import pekko.cluster.UniqueAddress import pekko.testkit.PekkoSpec import pekko.testkit.TestProbe +import com.typesafe.config.ConfigFactory + object ClusterSingletonRestart2Spec { def singletonActorProps: Props = Props(new Singleton) diff --git a/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonRestartSpec.scala b/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonRestartSpec.scala index 5ab67e494a..2804d36c71 100644 --- a/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonRestartSpec.scala +++ b/cluster-tools/src/test/scala/org/apache/pekko/cluster/singleton/ClusterSingletonRestartSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.singleton import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.ActorSystem import pekko.actor.PoisonPill @@ -26,6 +24,8 @@ import pekko.testkit.PekkoSpec import pekko.testkit.TestActors import pekko.testkit.TestProbe +import com.typesafe.config.ConfigFactory + class ClusterSingletonRestartSpec extends PekkoSpec(""" pekko.loglevel = INFO diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/internal/ReplicatorBehavior.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/internal/ReplicatorBehavior.scala index 8292b3994a..a363add871 100644 --- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/internal/ReplicatorBehavior.scala +++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/internal/ReplicatorBehavior.scala @@ -14,6 +14,7 @@ package org.apache.pekko.cluster.ddata.typed.internal import scala.concurrent.duration._ +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.actor.typed.ActorRef @@ -25,7 +26,6 @@ import pekko.annotation.InternalApi import pekko.cluster.{ ddata => dd } import pekko.cluster.ddata.ReplicatedData import pekko.pattern.ask -import scala.jdk.DurationConverters._ import pekko.util.Timeout /** diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/DistributedData.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/DistributedData.scala index 097dc36222..622bbc45e2 100644 --- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/DistributedData.scala +++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/DistributedData.scala @@ -15,6 +15,8 @@ package org.apache.pekko.cluster.ddata.typed.javadsl import java.util.function.{ Function => JFunction } +import scala.jdk.DurationConverters._ + import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.actor.typed.ActorSystem @@ -27,7 +29,6 @@ import pekko.annotation.DoNotInherit import pekko.annotation.InternalApi import pekko.cluster.ddata.ReplicatedData import pekko.cluster.ddata.SelfUniqueAddress -import scala.jdk.DurationConverters._ object DistributedData extends ExtensionId[DistributedData] { def get(system: ActorSystem[_]): DistributedData = apply(system) diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/Replicator.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/Replicator.scala index 6f8fa07079..bf391d57ac 100644 --- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/Replicator.scala +++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/Replicator.scala @@ -16,6 +16,8 @@ package org.apache.pekko.cluster.ddata.typed.javadsl import java.time.Duration import java.util.function.{ Function => JFunction } +import scala.jdk.DurationConverters._ + import org.apache.pekko import pekko.actor.DeadLetterSuppression import pekko.actor.NoSerializationVerificationNeeded @@ -27,7 +29,6 @@ import pekko.cluster.{ ddata => dd } import pekko.cluster.ddata.Key import pekko.cluster.ddata.ReplicatedData import pekko.cluster.ddata.typed.internal.ReplicatorBehavior -import scala.jdk.DurationConverters._ /** * @see [[pekko.cluster.ddata.Replicator]]. diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorMessageAdapter.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorMessageAdapter.scala index fffe6a91d0..3910c3b088 100644 --- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorMessageAdapter.scala +++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorMessageAdapter.scala @@ -16,17 +16,16 @@ package org.apache.pekko.cluster.ddata.typed.javadsl import java.time.Duration import java.util.function.{ Function => JFunction } +import scala.annotation.nowarn +import scala.jdk.DurationConverters._ import scala.util.Failure import scala.util.Success -import scala.annotation.nowarn - import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.actor.typed.javadsl.ActorContext import pekko.cluster.ddata.Key import pekko.cluster.ddata.ReplicatedData -import scala.jdk.DurationConverters._ import pekko.util.Timeout /** diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorSettings.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorSettings.scala index 4370d15087..4b2ca8ceea 100644 --- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorSettings.scala +++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorSettings.scala @@ -13,13 +13,13 @@ package org.apache.pekko.cluster.ddata.typed.javadsl -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.typed.ActorSystem import pekko.actor.typed.scaladsl.adapter._ import pekko.cluster.{ ddata => dd } +import com.typesafe.config.Config + object ReplicatorSettings { /** diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/DistributedData.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/DistributedData.scala index cf8df3870d..b0b63f73ce 100644 --- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/DistributedData.scala +++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/DistributedData.scala @@ -14,8 +14,7 @@ package org.apache.pekko.cluster.ddata.typed.scaladsl import scala.concurrent.duration.FiniteDuration - -import org.slf4j.LoggerFactory +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.actor.ExtendedActorSystem @@ -28,7 +27,8 @@ import pekko.cluster.{ ddata => dd } import pekko.cluster.Cluster import pekko.cluster.ddata.ReplicatedData import pekko.cluster.ddata.SelfUniqueAddress -import scala.jdk.DurationConverters._ + +import org.slf4j.LoggerFactory object DistributedData extends ExtensionId[DistributedData] { def get(system: ActorSystem[_]): DistributedData = apply(system) diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/ReplicatorSettings.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/ReplicatorSettings.scala index aa0449d9db..6931ce3ff5 100644 --- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/ReplicatorSettings.scala +++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/ReplicatorSettings.scala @@ -13,14 +13,14 @@ package org.apache.pekko.cluster.ddata.typed.scaladsl -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.typed.ActorSystem import pekko.actor.typed.scaladsl.adapter._ import pekko.annotation.InternalApi import pekko.cluster.{ ddata => dd } +import com.typesafe.config.Config + /** * @see [[pekko.cluster.ddata.ReplicatorSettings]]. */ diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/ClusterSingleton.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/ClusterSingleton.scala index 2ca2a039f9..a4bd03fb27 100644 --- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/ClusterSingleton.scala +++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/ClusterSingleton.scala @@ -14,6 +14,7 @@ package org.apache.pekko.cluster.typed import scala.concurrent.duration.{ Duration, FiniteDuration, _ } +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.actor.typed._ @@ -25,7 +26,7 @@ import pekko.cluster.singleton.{ } import pekko.cluster.typed.internal.AdaptedClusterSingletonImpl import pekko.coordination.lease.LeaseUsageSettings -import scala.jdk.DurationConverters._ + import com.typesafe.config.Config object ClusterSingletonSettings { diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/AdaptedClusterImpl.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/AdaptedClusterImpl.scala index a506921438..e0eefc354c 100644 --- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/AdaptedClusterImpl.scala +++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/AdaptedClusterImpl.scala @@ -24,8 +24,8 @@ import pekko.actor.typed.scaladsl.adapter._ import pekko.annotation.InternalApi import pekko.cluster.{ ClusterEvent, Member, MemberStatus } import pekko.cluster.ClusterEvent.MemberEvent -import pekko.cluster.typed.PrepareForFullClusterShutdown import pekko.cluster.typed._ +import pekko.cluster.typed.PrepareForFullClusterShutdown /** * INTERNAL API: diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializer.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializer.scala index 7966a603a0..52833bab61 100644 --- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializer.scala +++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializer.scala @@ -14,6 +14,9 @@ package org.apache.pekko.cluster.typed.internal.delivery import java.io.NotSerializableException + +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.actor.typed.ActorRefResolver import pekko.actor.typed.delivery.ConsumerController @@ -25,14 +28,13 @@ import pekko.actor.typed.scaladsl.adapter._ import pekko.annotation.InternalApi import pekko.cluster.typed.internal.protobuf.ReliableDelivery import pekko.cluster.typed.internal.protobuf.ReliableDelivery.Confirmed +import pekko.protobufv3.internal.ByteString +import pekko.remote.ByteStringUtils import pekko.remote.ContainerFormats import pekko.remote.ContainerFormats.Payload import pekko.remote.serialization.WrappedPayloadSupport import pekko.serialization.BaseSerializer import pekko.serialization.SerializerWithStringManifest -import scala.jdk.CollectionConverters._ -import pekko.protobufv3.internal.ByteString -import pekko.remote.ByteStringUtils /** * INTERNAL API diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistConfigCompatChecker.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistConfigCompatChecker.scala index 9c0aae8906..e2475e1f5d 100644 --- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistConfigCompatChecker.scala +++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistConfigCompatChecker.scala @@ -13,12 +13,12 @@ package org.apache.pekko.cluster.typed.internal.receptionist -import com.typesafe.config.Config - import org.apache.pekko import pekko.annotation.InternalApi import pekko.cluster.{ ConfigValidation, JoinConfigCompatChecker, Valid } +import com.typesafe.config.Config + /** * INTERNAL API * diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistSettings.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistSettings.scala index 76a8231a7d..b0f41a38a7 100644 --- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistSettings.scala +++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistSettings.scala @@ -15,7 +15,7 @@ package org.apache.pekko.cluster.typed.internal.receptionist import scala.concurrent.duration._ import scala.concurrent.duration.{ FiniteDuration, MILLISECONDS } -import com.typesafe.config.Config + import org.apache.pekko import pekko.actor.typed.ActorSystem import pekko.annotation.InternalApi @@ -25,6 +25,8 @@ import pekko.cluster.ddata.Replicator.WriteConsistency import pekko.cluster.ddata.ReplicatorSettings import pekko.util.Helpers.toRootLowerCase +import com.typesafe.config.Config + /** * Internal API */ diff --git a/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/ChunkLargeMessageSpec.scala b/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/ChunkLargeMessageSpec.scala index a1e080680b..4567555a23 100644 --- a/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/ChunkLargeMessageSpec.scala +++ b/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/ChunkLargeMessageSpec.scala @@ -16,7 +16,6 @@ package org.apache.pekko.cluster.typed import scala.concurrent.duration._ import scala.util.Random -import com.typesafe.config.ConfigFactory import org.HdrHistogram.Histogram import org.apache.pekko @@ -32,6 +31,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec import pekko.serialization.jackson.CborSerializable +import com.typesafe.config.ConfigFactory + object ChunkLargeMessageSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/MultiDcClusterSingletonSpec.scala b/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/MultiDcClusterSingletonSpec.scala index 4c0c3c2ffe..4637f1fe95 100644 --- a/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/MultiDcClusterSingletonSpec.scala +++ b/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/MultiDcClusterSingletonSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.typed import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.TestProbe import pekko.actor.typed.scaladsl.adapter._ @@ -24,6 +22,8 @@ import pekko.cluster.{ MemberStatus, MultiNodeClusterSpec } import pekko.remote.testconductor.RoleName import pekko.remote.testkit.{ MultiNodeConfig, MultiNodeSpec } +import com.typesafe.config.ConfigFactory + object MultiDcClusterSingletonSpecConfig extends MultiNodeConfig { val first: RoleName = role("first") val second = role("second") diff --git a/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/MultiNodeTypedClusterSpec.scala b/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/MultiNodeTypedClusterSpec.scala index 57b2f7b5fb..d65f925e88 100644 --- a/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/MultiNodeTypedClusterSpec.scala +++ b/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/MultiNodeTypedClusterSpec.scala @@ -20,11 +20,11 @@ import scala.concurrent.Future import scala.concurrent.duration._ import scala.language.implicitConversions -import org.scalatest.Suite -import org.scalatest.matchers.should.Matchers - import org.apache.pekko import pekko.actor.ActorIdentity +import pekko.actor.Address +import pekko.actor.Identify +import pekko.actor.Scheduler import pekko.actor.typed.ActorRef import pekko.actor.typed.ActorSystem import pekko.actor.typed.Behavior @@ -32,9 +32,6 @@ import pekko.actor.typed.Props import pekko.actor.typed.SpawnProtocol import pekko.actor.typed.scaladsl.AskPattern._ import pekko.actor.typed.scaladsl.adapter._ -import pekko.actor.Address -import pekko.actor.Identify -import pekko.actor.Scheduler import pekko.cluster.ClusterEvent import pekko.cluster.MemberStatus import pekko.remote.testconductor.RoleName @@ -43,6 +40,9 @@ import pekko.remote.testkit.STMultiNodeSpec import pekko.testkit.WatchedByCoroner import pekko.util.Timeout +import org.scalatest.Suite +import org.scalatest.matchers.should.Matchers + trait MultiNodeTypedClusterSpec extends Suite with STMultiNodeSpec with WatchedByCoroner with Matchers { self: MultiNodeSpec => diff --git a/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/PubSubSpec.scala b/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/PubSubSpec.scala index ececf0dd45..d3459fdebe 100644 --- a/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/PubSubSpec.scala +++ b/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/PubSubSpec.scala @@ -13,8 +13,6 @@ package org.apache.pekko.cluster.typed -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.TestProbe import pekko.actor.typed.ActorRef @@ -26,6 +24,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec import pekko.serialization.jackson.CborSerializable +import com.typesafe.config.ConfigFactory + object PubSubSpecConfig extends MultiNodeConfig { val first: RoleName = role("first") val second = role("second") diff --git a/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/internal/ClusterReceptionistUnreachabilitySpec.scala b/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/internal/ClusterReceptionistUnreachabilitySpec.scala index b48972186d..3ea3eb1401 100644 --- a/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/internal/ClusterReceptionistUnreachabilitySpec.scala +++ b/cluster-typed/src/multi-jvm/scala/org/apache/pekko/cluster/typed/internal/ClusterReceptionistUnreachabilitySpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.typed.internal import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.TestProbe import pekko.actor.typed.receptionist.Receptionist @@ -31,6 +29,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec import pekko.remote.transport.ThrottlerTransportAdapter.Direction +import com.typesafe.config.ConfigFactory + object ClusterReceptionistUnreachabilitySpecConfig extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster-typed/src/test/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/ReplicatorSpec.scala b/cluster-typed/src/test/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/ReplicatorSpec.scala index f43c4002b4..2bdf781b53 100644 --- a/cluster-typed/src/test/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/ReplicatorSpec.scala +++ b/cluster-typed/src/test/scala/org/apache/pekko/cluster/ddata/typed/scaladsl/ReplicatorSpec.scala @@ -13,12 +13,12 @@ package org.apache.pekko.cluster.ddata.typed.scaladsl -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit +import org.scalatest.wordspec.AnyWordSpecLike + class ReplicatorSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "Replicator" must { "have the prefixed replicator name" in { diff --git a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ActorRefIgnoreSerializationSpec.scala b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ActorRefIgnoreSerializationSpec.scala index aca789802b..72df6731f5 100644 --- a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ActorRefIgnoreSerializationSpec.scala +++ b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ActorRefIgnoreSerializationSpec.scala @@ -13,12 +13,6 @@ package org.apache.pekko.cluster.typed -import com.typesafe.config.ConfigFactory -import org.scalatest.BeforeAndAfterAll -import org.scalatest.concurrent.ScalaFutures -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.{ actor => classic } import pekko.actor.{ ExtendedActorSystem, IgnoreActorRef } @@ -26,6 +20,13 @@ import pekko.actor.typed.{ ActorRef, ActorRefResolver, ActorSystem } import pekko.actor.typed.scaladsl.Behaviors import pekko.actor.typed.scaladsl.adapter._ +import org.scalatest.BeforeAndAfterAll +import org.scalatest.concurrent.ScalaFutures +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + +import com.typesafe.config.ConfigFactory + class ActorRefIgnoreSerializationSpec extends AnyWordSpec with ScalaFutures with Matchers with BeforeAndAfterAll { private var system1: ActorSystem[String] = _ diff --git a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ActorSystemSpec.scala b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ActorSystemSpec.scala index bd97dd7bdf..ae5e9d66da 100644 --- a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ActorSystemSpec.scala +++ b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ActorSystemSpec.scala @@ -19,14 +19,6 @@ import scala.concurrent.Future import scala.concurrent.Promise import scala.util.control.NonFatal -import com.typesafe.config.ConfigFactory -import org.scalatest._ -import org.scalatest.concurrent.Eventually -import org.scalatest.concurrent.ScalaFutures -import org.scalatest.matchers.should.Matchers -import org.scalatest.time.Span -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.Done import pekko.actor.CoordinatedShutdown @@ -44,6 +36,15 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.actor.typed.scaladsl.adapter._ import pekko.serialization.SerializerWithStringManifest +import org.scalatest._ +import org.scalatest.concurrent.Eventually +import org.scalatest.concurrent.ScalaFutures +import org.scalatest.matchers.should.Matchers +import org.scalatest.time.Span +import org.scalatest.wordspec.AnyWordSpec + +import com.typesafe.config.ConfigFactory + object ActorSystemSpec { class TestSerializer(system: ExtendedActorSystem) extends SerializerWithStringManifest { diff --git a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterActorLoggingSpec.scala b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterActorLoggingSpec.scala index f32d43e194..be00ec6198 100644 --- a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterActorLoggingSpec.scala +++ b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterActorLoggingSpec.scala @@ -13,10 +13,6 @@ package org.apache.pekko.cluster.typed -import com.typesafe.config.ConfigFactory -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -25,6 +21,11 @@ import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import pekko.actor.typed.internal.ActorMdc import pekko.actor.typed.scaladsl.Behaviors +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + object ClusterActorLoggingSpec { def config = ConfigFactory.parseString(""" pekko.actor.provider = cluster diff --git a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterApiSpec.scala b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterApiSpec.scala index 619fbfaebe..1fa3167452 100644 --- a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterApiSpec.scala +++ b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterApiSpec.scala @@ -13,9 +13,6 @@ package org.apache.pekko.cluster.typed -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.Address import pekko.actor.testkit.typed.TestKitSettings @@ -27,6 +24,10 @@ import pekko.actor.typed.scaladsl.adapter._ import pekko.cluster.ClusterEvent._ import pekko.cluster.MemberStatus +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + object ClusterApiSpec { val config = ConfigFactory.parseString(""" diff --git a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterDispatcherSelectorSpec.scala b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterDispatcherSelectorSpec.scala index 240830526e..4da500475b 100644 --- a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterDispatcherSelectorSpec.scala +++ b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterDispatcherSelectorSpec.scala @@ -13,10 +13,10 @@ package org.apache.pekko.cluster.typed -import com.typesafe.config.ConfigFactory - import org.apache.pekko.actor.typed.scaladsl.DispatcherSelectorSpec +import com.typesafe.config.ConfigFactory + class ClusterDispatcherSelectorSpec extends DispatcherSelectorSpec(ConfigFactory.parseString(""" pekko.actor.provider = cluster diff --git a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterSingletonApiSpec.scala b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterSingletonApiSpec.scala index 11e60b17d0..d094c6ee28 100644 --- a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterSingletonApiSpec.scala +++ b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterSingletonApiSpec.scala @@ -16,9 +16,6 @@ package org.apache.pekko.cluster.typed import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.TestKitSettings import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -29,6 +26,10 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.actor.typed.scaladsl.adapter._ import pekko.serialization.jackson.CborSerializable +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + object ClusterSingletonApiSpec { val config = ConfigFactory.parseString(s""" diff --git a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterSingletonPoisonPillSpec.scala b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterSingletonPoisonPillSpec.scala index 09b4451029..be93a5e84e 100644 --- a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterSingletonPoisonPillSpec.scala +++ b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/ClusterSingletonPoisonPillSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.typed import scala.concurrent.duration._ -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.TestKitSettings import pekko.actor.testkit.typed.scaladsl.{ ScalaTestWithActorTestKit, TestProbe } @@ -27,6 +25,8 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.actor.typed.scaladsl.adapter._ import pekko.cluster.typed.ClusterSingletonPoisonPillSpec.GetSelf +import org.scalatest.wordspec.AnyWordSpecLike + object ClusterSingletonPoisonPillSpec { final case class GetSelf(replyTo: ActorRef[ActorRef[Any]]) diff --git a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/GroupRouterSpec.scala b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/GroupRouterSpec.scala index 449489f2c5..9c64b80618 100644 --- a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/GroupRouterSpec.scala +++ b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/GroupRouterSpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.cluster.typed +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -25,10 +27,10 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.actor.typed.scaladsl.GroupRouter import pekko.actor.typed.scaladsl.Routers import pekko.serialization.jackson.CborSerializable -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike -import scala.concurrent.duration._ +import com.typesafe.config.ConfigFactory object GroupRouterSpec { def config = ConfigFactory.parseString(s""" diff --git a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/RemoteContextAskSpec.scala b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/RemoteContextAskSpec.scala index 9b1255d572..f978b6e8bb 100644 --- a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/RemoteContextAskSpec.scala +++ b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/RemoteContextAskSpec.scala @@ -17,9 +17,6 @@ import scala.concurrent.duration._ import scala.util.Failure import scala.util.Success -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -33,6 +30,10 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.serialization.jackson.CborSerializable import pekko.util.Timeout +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + object RemoteContextAskSpec { def config = ConfigFactory.parseString(s""" pekko { diff --git a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/RemoteDeployNotAllowedSpec.scala b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/RemoteDeployNotAllowedSpec.scala index ed0d7d8e3f..b58083968a 100644 --- a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/RemoteDeployNotAllowedSpec.scala +++ b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/RemoteDeployNotAllowedSpec.scala @@ -13,9 +13,6 @@ package org.apache.pekko.cluster.typed -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.ActorTestKit import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -24,6 +21,10 @@ import pekko.actor.testkit.typed.scaladsl.TestProbe import pekko.actor.typed.ActorSystem import pekko.actor.typed.scaladsl.Behaviors +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + object RemoteDeployNotAllowedSpec { def config = ConfigFactory.parseString(s""" pekko { diff --git a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/RemoteMessageSpec.scala b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/RemoteMessageSpec.scala index fb802f2b01..69d5205d69 100644 --- a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/RemoteMessageSpec.scala +++ b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/RemoteMessageSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.typed import scala.concurrent.Promise -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.Done import pekko.actor.{ ActorSystem => ClassicActorSystem } @@ -27,6 +25,8 @@ import pekko.actor.typed.scaladsl.adapter._ import pekko.serialization.jackson.CborSerializable import pekko.testkit.PekkoSpec +import com.typesafe.config.ConfigFactory + object RemoteMessageSpec { def config = ConfigFactory.parseString(s""" pekko { diff --git a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/PekkoClusterTypedSerializerSpec.scala b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/PekkoClusterTypedSerializerSpec.scala index 8b53bcbbf7..9c16d3fb43 100644 --- a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/PekkoClusterTypedSerializerSpec.scala +++ b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/PekkoClusterTypedSerializerSpec.scala @@ -13,8 +13,6 @@ package org.apache.pekko.cluster.typed.internal -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -24,6 +22,8 @@ import pekko.actor.typed.scaladsl.adapter._ import pekko.cluster.typed.internal.receptionist.ClusterReceptionist import pekko.serialization.SerializationExtension +import org.scalatest.wordspec.AnyWordSpecLike + class PekkoClusterTypedSerializerSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { val ref = spawn(Behaviors.empty[String]) diff --git a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializerSpec.scala b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializerSpec.scala index 23b645c4f7..341f993f68 100644 --- a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializerSpec.scala +++ b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializerSpec.scala @@ -13,8 +13,6 @@ package org.apache.pekko.cluster.typed.internal.delivery -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -29,6 +27,8 @@ import pekko.actor.typed.scaladsl.adapter._ import pekko.serialization.SerializationExtension import pekko.util.ByteString +import org.scalatest.wordspec.AnyWordSpecLike + class ReliableDeliverySerializerSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { private val classicSystem = system.toClassic diff --git a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistSpec.scala b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistSpec.scala index 03f1ab3952..15408b56ee 100644 --- a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistSpec.scala +++ b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistSpec.scala @@ -18,10 +18,6 @@ import java.util.concurrent.ThreadLocalRandom import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.RootActorPath import pekko.actor.testkit.typed.FishingOutcome @@ -40,10 +36,14 @@ import pekko.cluster.typed.Join import pekko.cluster.typed.JoinSeedNodes import pekko.cluster.typed.Leave import pekko.serialization.jackson.CborSerializable -import pekko.testkit.LongRunningTest -import org.scalatest.concurrent.ScalaFutures - import pekko.testkit.GHExcludeAeronTest +import pekko.testkit.LongRunningTest + +import org.scalatest.concurrent.ScalaFutures +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + +import com.typesafe.config.ConfigFactory object ClusterReceptionistSpec { val config = ConfigFactory.parseString(s""" diff --git a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistStateSpec.scala b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistStateSpec.scala index 843d72056b..dd74819361 100644 --- a/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistStateSpec.scala +++ b/cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistStateSpec.scala @@ -16,9 +16,6 @@ package org.apache.pekko.cluster.typed.internal.receptionist import scala.concurrent.duration._ import scala.concurrent.duration.Deadline -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.Address import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -28,6 +25,9 @@ import pekko.cluster.UniqueAddress import pekko.cluster.typed.internal.receptionist.ClusterReceptionistProtocol.SubscriptionsKV import pekko.util.TypedMultiMap +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + class ClusterReceptionistStateSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with Matchers { val SomeService = ServiceKey[Int]("boy-oh-boy!") diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/Cluster.scala b/cluster/src/main/scala/org/apache/pekko/cluster/Cluster.scala index dc0c5e6e25..b778252232 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/Cluster.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/Cluster.scala @@ -23,8 +23,6 @@ import scala.concurrent.{ Await, ExecutionContext } import scala.concurrent.duration._ import scala.util.control.NonFatal -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.ConfigurationException import pekko.actor._ @@ -39,6 +37,8 @@ import pekko.japi.Util import pekko.pattern._ import pekko.remote.{ UniqueAddress => _, _ } +import com.typesafe.config.{ Config, ConfigFactory } + /** * Cluster Extension Id and factory for creating Cluster extension. */ diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/ClusterActorRefProvider.scala b/cluster/src/main/scala/org/apache/pekko/cluster/ClusterActorRefProvider.scala index 1884bfc4d9..63d746c51e 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/ClusterActorRefProvider.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/ClusterActorRefProvider.scala @@ -14,8 +14,6 @@ package org.apache.pekko.cluster import scala.annotation.nowarn -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory import org.apache.pekko import pekko.ConfigurationException @@ -40,6 +38,9 @@ import pekko.remote.routing.RemoteRouterConfig import pekko.routing.Group import pekko.routing.Pool +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + /** * INTERNAL API * diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala b/cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala index 4f04cb1f90..da0a73d8bd 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala @@ -20,8 +20,6 @@ import scala.concurrent.Promise import scala.concurrent.duration._ import scala.util.control.NonFatal -import com.typesafe.config.Config - import org.apache.pekko import pekko.Done import pekko.actor._ @@ -36,6 +34,8 @@ import pekko.remote.{ QuarantinedEvent => ClassicQuarantinedEvent, RemoteSetting import pekko.remote.artery.QuarantinedEvent import pekko.util.{ Timeout, Version } +import com.typesafe.config.Config + /** * Base trait for all cluster messages. All ClusterMessage's are serializable. */ diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/ClusterEvent.scala b/cluster/src/main/scala/org/apache/pekko/cluster/ClusterEvent.scala index bda548d96d..5387845abb 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/ClusterEvent.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/ClusterEvent.scala @@ -16,6 +16,7 @@ package org.apache.pekko.cluster import scala.annotation.nowarn import scala.collection.immutable import scala.collection.immutable.{ SortedSet, VectorBuilder } +import scala.jdk.CollectionConverters._ import scala.runtime.AbstractFunction5 import org.apache.pekko @@ -27,7 +28,6 @@ import pekko.cluster.ClusterSettings.DataCenter import pekko.cluster.MemberStatus._ import pekko.dispatch.{ RequiresMessageQueue, UnboundedMessageQueueSemantics } import pekko.event.EventStream -import scala.jdk.CollectionConverters._ /** * Domain events published to the event bus. diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/ClusterRemoteWatcher.scala b/cluster/src/main/scala/org/apache/pekko/cluster/ClusterRemoteWatcher.scala index 7e6696b348..a5b5bc0d75 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/ClusterRemoteWatcher.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/ClusterRemoteWatcher.scala @@ -14,6 +14,7 @@ package org.apache.pekko.cluster import scala.concurrent.duration.FiniteDuration + import org.apache.pekko import pekko.actor._ import pekko.cluster.ClusterEvent.CurrentClusterState diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/ClusterSettings.scala b/cluster/src/main/scala/org/apache/pekko/cluster/ClusterSettings.scala index ffe8520122..ac38a911fc 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/ClusterSettings.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/ClusterSettings.scala @@ -15,9 +15,7 @@ package org.apache.pekko.cluster import scala.collection.immutable import scala.concurrent.duration._ - -import com.typesafe.config.Config -import com.typesafe.config.ConfigObject +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.actor.Address @@ -25,7 +23,9 @@ import pekko.actor.AddressFromURIString import pekko.annotation.InternalApi import pekko.util.Helpers.{ toRootLowerCase, ConfigOps, Requiring } import pekko.util.Version -import scala.jdk.CollectionConverters._ + +import com.typesafe.config.Config +import com.typesafe.config.ConfigObject object ClusterSettings { type DataCenter = String diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/ConfigUtil.scala b/cluster/src/main/scala/org/apache/pekko/cluster/ConfigUtil.scala index d3742c2f42..9f1cd95a60 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/ConfigUtil.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/ConfigUtil.scala @@ -17,11 +17,11 @@ package org.apache.pekko.cluster -import com.typesafe.config.{ Config, ConfigValue, ConfigValueFactory, ConfigValueType } - import org.apache.pekko import pekko.annotation.InternalApi +import com.typesafe.config.{ Config, ConfigValue, ConfigValueFactory, ConfigValueType } + @InternalApi private[cluster] object ConfigUtil { diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/Gossip.scala b/cluster/src/main/scala/org/apache/pekko/cluster/Gossip.scala index 1f5ff051da..3c58ddbdba 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/Gossip.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/Gossip.scala @@ -21,6 +21,7 @@ import scala.concurrent.duration.Deadline import ClusterSettings.DataCenter import MemberStatus._ + import org.apache.pekko.annotation.InternalApi /** diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/JoinConfigCompatCheckCluster.scala b/cluster/src/main/scala/org/apache/pekko/cluster/JoinConfigCompatCheckCluster.scala index 2946f2c1aa..97f55b65ac 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/JoinConfigCompatCheckCluster.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/JoinConfigCompatCheckCluster.scala @@ -15,11 +15,11 @@ package org.apache.pekko.cluster import scala.collection.{ immutable => im } -import com.typesafe.config.Config - import org.apache.pekko import pekko.annotation.InternalApi +import com.typesafe.config.Config + /** * INTERNAL API */ diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/JoinConfigCompatChecker.scala b/cluster/src/main/scala/org/apache/pekko/cluster/JoinConfigCompatChecker.scala index 8280b2a438..5e5f354e5d 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/JoinConfigCompatChecker.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/JoinConfigCompatChecker.scala @@ -14,13 +14,13 @@ package org.apache.pekko.cluster import scala.collection.{ immutable => im } - -import com.typesafe.config.{ Config, ConfigFactory, ConfigValue } +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.annotation.{ DoNotInherit, InternalApi } -import scala.jdk.CollectionConverters._ + +import com.typesafe.config.{ Config, ConfigFactory, ConfigValue } abstract class JoinConfigCompatChecker { diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/Member.scala b/cluster/src/main/scala/org/apache/pekko/cluster/Member.scala index 46c84b1796..a741f89fbe 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/Member.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/Member.scala @@ -13,9 +13,8 @@ package org.apache.pekko.cluster -import scala.runtime.AbstractFunction2 - import scala.annotation.nowarn +import scala.runtime.AbstractFunction2 import org.apache.pekko import pekko.actor.Address diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializer.scala b/cluster/src/main/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializer.scala index 941854f7b7..299211886a 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializer.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializer.scala @@ -15,10 +15,12 @@ package org.apache.pekko.cluster.protobuf import java.io.{ ByteArrayInputStream, ByteArrayOutputStream } import java.util.zip.{ GZIPInputStream, GZIPOutputStream } + import scala.annotation.tailrec import scala.collection.immutable import scala.concurrent.duration.Deadline -import com.typesafe.config.{ Config, ConfigFactory, ConfigRenderOptions } +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.actor.{ Address, ExtendedActorSystem } import pekko.annotation.InternalApi @@ -31,7 +33,8 @@ import pekko.remote.ByteStringUtils import pekko.routing.Pool import pekko.serialization._ import pekko.util.Version -import scala.jdk.CollectionConverters._ + +import com.typesafe.config.{ Config, ConfigFactory, ConfigRenderOptions } /** * INTERNAL API diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/routing/ClusterRouterConfig.scala b/cluster/src/main/scala/org/apache/pekko/cluster/routing/ClusterRouterConfig.scala index c3225322bb..3a32055a05 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/routing/ClusterRouterConfig.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/routing/ClusterRouterConfig.scala @@ -14,10 +14,11 @@ package org.apache.pekko.cluster.routing import java.util.concurrent.atomic.AtomicInteger + import scala.annotation.{ tailrec, varargs } import scala.collection.immutable -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.actor._ import pekko.cluster.Cluster @@ -38,7 +39,9 @@ import pekko.routing.RouterConfig import pekko.routing.RouterPoolActor import pekko.routing.RoutingLogic import pekko.util.HashCode -import scala.jdk.CollectionConverters._ + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory object ClusterRouterGroupSettings { diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/sbr/DowningStrategy.scala b/cluster/src/main/scala/org/apache/pekko/cluster/sbr/DowningStrategy.scala index 6269a6fa3a..4de96915bf 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/sbr/DowningStrategy.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/sbr/DowningStrategy.scala @@ -16,6 +16,7 @@ package org.apache.pekko.cluster.sbr import scala.collection.immutable import scala.concurrent.duration.Duration import scala.concurrent.duration.FiniteDuration + import org.apache.pekko import pekko.actor.Address import pekko.annotation.InternalApi diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/sbr/SplitBrainResolver.scala b/cluster/src/main/scala/org/apache/pekko/cluster/sbr/SplitBrainResolver.scala index 7c5f039583..ce1e9f21d4 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/sbr/SplitBrainResolver.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/sbr/SplitBrainResolver.scala @@ -151,8 +151,8 @@ import pekko.remote.artery.ThisActorSystemQuarantinedEvent with Timers { import DowningStrategy._ - import SplitBrainResolver.ReleaseLeaseCondition.NoLease import SplitBrainResolver._ + import SplitBrainResolver.ReleaseLeaseCondition.NoLease val log: DiagnosticMarkerBusLoggingAdapter = Logging.withMarker(this) diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/sbr/SplitBrainResolverSettings.scala b/cluster/src/main/scala/org/apache/pekko/cluster/sbr/SplitBrainResolverSettings.scala index 0cea354ffd..fa988b28aa 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/sbr/SplitBrainResolverSettings.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/sbr/SplitBrainResolverSettings.scala @@ -18,14 +18,14 @@ import java.util.concurrent.TimeUnit import scala.concurrent.duration._ -import com.typesafe.config.Config - import org.apache.pekko import pekko.ConfigurationException import pekko.annotation.InternalApi import pekko.util.Helpers import pekko.util.Helpers.Requiring +import com.typesafe.config.Config + /** * INTERNAL API */ diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterAccrualFailureDetectorSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterAccrualFailureDetectorSpec.scala index 32f6f53514..695ee51342 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterAccrualFailureDetectorSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterAccrualFailureDetectorSpec.scala @@ -15,13 +15,13 @@ package org.apache.pekko.cluster import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.remote.testkit.MultiNodeConfig import pekko.remote.transport.ThrottlerTransportAdapter.Direction import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object ClusterAccrualFailureDetectorMultiJvmSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterDeathWatchSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterDeathWatchSpec.scala index f72df20774..c69e026b6a 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterDeathWatchSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterDeathWatchSpec.scala @@ -18,9 +18,6 @@ import java.util.concurrent.TimeoutException import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.concurrent.ScalaFutures - import org.apache.pekko import pekko.actor._ import pekko.cluster.MultiNodeClusterSpec.EndActor @@ -30,6 +27,10 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ import pekko.testkit.TestEvent._ +import org.scalatest.concurrent.ScalaFutures + +import com.typesafe.config.ConfigFactory + object ClusterDeathWatchMultiJvmSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterShutdownSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterShutdownSpec.scala index 2cf9333643..a2193c1c9e 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterShutdownSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterShutdownSpec.scala @@ -13,12 +13,13 @@ package org.apache.pekko.cluster +import scala.concurrent.duration._ + import org.apache.pekko import pekko.cluster.MemberStatus.Removed import pekko.remote.testkit.MultiNodeConfig -import org.scalatest.concurrent.Eventually -import scala.concurrent.duration._ +import org.scalatest.concurrent.Eventually object ClusterShutdownSpec extends MultiNodeConfig { val first = role("first") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterWatcherNoClusterWatcheeSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterWatcherNoClusterWatcheeSpec.scala index 4a25a476f6..20209e6d26 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterWatcherNoClusterWatcheeSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ClusterWatcherNoClusterWatcheeSpec.scala @@ -15,9 +15,6 @@ package org.apache.pekko.cluster import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.concurrent.ScalaFutures - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorIdentity @@ -33,6 +30,10 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.testkit.ImplicitSender import pekko.testkit.TestProbe +import org.scalatest.concurrent.ScalaFutures + +import com.typesafe.config.ConfigFactory + class ClusterWatcherNoClusterWatcheeConfig(val useUnsafe: Boolean, artery: Boolean) extends MultiNodeConfig { val clustered = role("clustered") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ConvergenceSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ConvergenceSpec.scala index e9060669b8..79aff6f062 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ConvergenceSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/ConvergenceSpec.scala @@ -15,13 +15,13 @@ package org.apache.pekko.cluster import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Address import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + final case class ConvergenceMultiNodeConfig(failureDetectorPuppet: Boolean) extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/DeterministicOldestWhenJoiningSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/DeterministicOldestWhenJoiningSpec.scala index 40e5c09584..9feb834144 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/DeterministicOldestWhenJoiningSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/DeterministicOldestWhenJoiningSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.cluster import scala.collection.immutable import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Address import pekko.cluster.ClusterEvent.CurrentClusterState @@ -25,6 +23,8 @@ import pekko.cluster.ClusterEvent.MemberUp import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object DeterministicOldestWhenJoiningMultiJvmSpec extends MultiNodeConfig { val seed1 = role("seed1") val seed2 = role("seed2") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/DowningWhenOtherHasQuarantinedThisActorSystemSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/DowningWhenOtherHasQuarantinedThisActorSystemSpec.scala index 1ad6e5ba77..0e882f2bd9 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/DowningWhenOtherHasQuarantinedThisActorSystemSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/DowningWhenOtherHasQuarantinedThisActorSystemSpec.scala @@ -14,6 +14,7 @@ package org.apache.pekko.cluster import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.Identify @@ -23,6 +24,7 @@ import pekko.remote.artery.ThisActorSystemQuarantinedEvent import pekko.remote.testkit.MultiNodeConfig import pekko.remote.transport.ThrottlerTransportAdapter import pekko.testkit.LongRunningTest + import com.typesafe.config.ConfigFactory object DowningWhenOtherHasQuarantinedThisActorSystemSpec extends MultiNodeConfig { diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/InitialHeartbeatSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/InitialHeartbeatSpec.scala index 7ab6aa253b..3a315c524d 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/InitialHeartbeatSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/InitialHeartbeatSpec.scala @@ -15,14 +15,14 @@ package org.apache.pekko.cluster import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.cluster.ClusterEvent.CurrentClusterState import pekko.remote.testkit.MultiNodeConfig import pekko.remote.transport.ThrottlerTransportAdapter.Direction import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object InitialHeartbeatMultiJvmSpec extends MultiNodeConfig { val controller = role("controller") val first = role("first") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/InitialMembersOfNewDcSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/InitialMembersOfNewDcSpec.scala index b9b4288ea1..3a27cbc54c 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/InitialMembersOfNewDcSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/InitialMembersOfNewDcSpec.scala @@ -15,12 +15,12 @@ package org.apache.pekko.cluster import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.remote.testkit._ import pekko.testkit.ImplicitSender +import com.typesafe.config.ConfigFactory + object InitialMembersOfNewDcSpec extends MultiNodeConfig { commonConfig(ConfigFactory.parseString(s""" pekko.actor.provider = cluster diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/JoinInProgressSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/JoinInProgressSpec.scala index 55bcd1eba6..f3fe52a6b3 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/JoinInProgressSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/JoinInProgressSpec.scala @@ -15,12 +15,12 @@ package org.apache.pekko.cluster import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object JoinInProgressMultiJvmSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/JoinSeedNodeSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/JoinSeedNodeSpec.scala index ee36e3bb53..d4cc583baa 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/JoinSeedNodeSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/JoinSeedNodeSpec.scala @@ -15,14 +15,14 @@ package org.apache.pekko.cluster import scala.collection.immutable -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Address import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ import pekko.util.Version +import com.typesafe.config.ConfigFactory + object JoinSeedNodeMultiJvmSpec extends MultiNodeConfig { val seed1 = role("seed1") val seed2 = role("seed2") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LargeMessageClusterSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LargeMessageClusterSpec.scala index 812d5f1bf1..5f24f4bf2f 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LargeMessageClusterSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LargeMessageClusterSpec.scala @@ -18,7 +18,6 @@ import java.nio.charset.StandardCharsets import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import org.apache.pekko import pekko.actor.ActorIdentity import pekko.actor.ActorRef @@ -33,6 +32,8 @@ import pekko.serialization.SerializerWithStringManifest import pekko.testkit._ import pekko.util.unused +import com.typesafe.config.ConfigFactory + object LargeMessageClusterMultiJvmSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LeaderDowningAllOtherNodesSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LeaderDowningAllOtherNodesSpec.scala index 95cdf8c460..3f051422b4 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LeaderDowningAllOtherNodesSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LeaderDowningAllOtherNodesSpec.scala @@ -15,12 +15,12 @@ package org.apache.pekko.cluster import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object LeaderDowningAllOtherNodesMultiJvmSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LeaderDowningNodeThatIsUnreachableSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LeaderDowningNodeThatIsUnreachableSpec.scala index bec2420c20..717875de82 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LeaderDowningNodeThatIsUnreachableSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LeaderDowningNodeThatIsUnreachableSpec.scala @@ -15,12 +15,12 @@ package org.apache.pekko.cluster import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + final case class LeaderDowningNodeThatIsUnreachableMultiNodeConfig(failureDetectorPuppet: Boolean) extends MultiNodeConfig { val first = role("first") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LeaderLeavingSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LeaderLeavingSpec.scala index 854efbeceb..73cccc0afb 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LeaderLeavingSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/LeaderLeavingSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.Deploy @@ -25,6 +23,8 @@ import pekko.cluster.MemberStatus._ import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object LeaderLeavingMultiJvmSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MBeanSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MBeanSpec.scala index fcdcc7a5eb..51f485ba9f 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MBeanSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MBeanSpec.scala @@ -14,17 +14,17 @@ package org.apache.pekko.cluster import java.lang.management.ManagementFactory - -import scala.concurrent.duration._ - -import com.typesafe.config.ConfigFactory import javax.management.InstanceNotFoundException import javax.management.ObjectName +import scala.concurrent.duration._ + import org.apache.pekko import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object MBeanMultiJvmSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MemberWeaklyUpSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MemberWeaklyUpSpec.scala index ee83181da9..49f8f5ecef 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MemberWeaklyUpSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MemberWeaklyUpSpec.scala @@ -15,14 +15,14 @@ package org.apache.pekko.cluster import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.cluster.MemberStatus.WeaklyUp import pekko.remote.testkit.MultiNodeConfig import pekko.remote.transport.ThrottlerTransportAdapter.Direction import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object MemberWeaklyUpSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MinMembersBeforeUpSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MinMembersBeforeUpSpec.scala index e2c84eb121..9a57467f42 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MinMembersBeforeUpSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MinMembersBeforeUpSpec.scala @@ -13,14 +13,14 @@ package org.apache.pekko.cluster -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.cluster.MemberStatus._ import pekko.remote.testconductor.RoleName import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object MinMembersBeforeUpMultiJvmSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcClusterSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcClusterSpec.scala index 86312fcc28..63fe5c1257 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcClusterSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcClusterSpec.scala @@ -15,13 +15,13 @@ package org.apache.pekko.cluster import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.cluster.MemberStatus.Up import pekko.remote.testkit.MultiNodeConfig import pekko.remote.transport.ThrottlerTransportAdapter.Direction +import com.typesafe.config.ConfigFactory + class MultiDcSpecConfig(crossDcConnections: Int = 5) extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcHeartbeatTakingOverSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcHeartbeatTakingOverSpec.scala index 5d800bb6e6..3a61ef4643 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcHeartbeatTakingOverSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcHeartbeatTakingOverSpec.scala @@ -17,8 +17,6 @@ import scala.collection.immutable import scala.collection.immutable.SortedSet import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ActorSelection @@ -27,6 +25,8 @@ import pekko.remote.testconductor.RoleName import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object MultiDcHeartbeatTakingOverSpecMultiJvmSpec extends MultiNodeConfig { val first = role("first") // alpha val second = role("second") // alpha diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcJoin2Spec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcJoin2Spec.scala index ad20ee816e..91f7328155 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcJoin2Spec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcJoin2Spec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Address import pekko.cluster.ClusterEvent.InitialStateAsEvents @@ -24,6 +22,8 @@ import pekko.cluster.ClusterEvent.MemberUp import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + // Similar to MultiDcJoinSpec, but slightly different scenario object MultiDcJoin2MultiJvmSpec extends MultiNodeConfig { val first = role("first") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcJoinSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcJoinSpec.scala index a0316c44d6..19042e401a 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcJoinSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcJoinSpec.scala @@ -15,14 +15,14 @@ package org.apache.pekko.cluster import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.cluster.ClusterEvent.InitialStateAsEvents import pekko.cluster.ClusterEvent.MemberUp import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + // reproducer for issue #29280 object MultiDcJoinMultiJvmSpec extends MultiNodeConfig { val first = role("first") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcLastNodeSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcLastNodeSpec.scala index 7e99aa757e..cb1da91ee8 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcLastNodeSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcLastNodeSpec.scala @@ -15,10 +15,10 @@ package org.apache.pekko.cluster import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko.remote.testkit.MultiNodeConfig +import com.typesafe.config.ConfigFactory + object MultiDcLastNodeSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcSplitBrainSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcSplitBrainSpec.scala index 95c38aa013..1eaa7c10e5 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcSplitBrainSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcSplitBrainSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.cluster import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.ActorSystem import pekko.cluster.ClusterEvent._ @@ -26,6 +24,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.transport.ThrottlerTransportAdapter.Direction import pekko.testkit.TestProbe +import com.typesafe.config.ConfigFactory + object MultiDcSplitBrainMultiJvmSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcSunnyWeatherSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcSunnyWeatherSpec.scala index a144f07eb9..223bc66a7a 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcSunnyWeatherSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiDcSunnyWeatherSpec.scala @@ -17,8 +17,6 @@ import scala.collection.immutable import scala.collection.immutable.SortedSet import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.ActorRef import pekko.annotation.InternalApi @@ -26,6 +24,8 @@ import pekko.remote.testconductor.RoleName import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object MultiDcSunnyWeatherMultiJvmSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiNodeClusterSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiNodeClusterSpec.scala index a8edcf9ae9..353206fd5c 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiNodeClusterSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiNodeClusterSpec.scala @@ -20,22 +20,23 @@ import scala.concurrent.Await import scala.concurrent.duration._ import scala.language.implicitConversions -import com.typesafe.config.{ Config, ConfigFactory } -import org.scalatest.{ Canceled, Outcome, Suite } -import org.scalatest.exceptions.TestCanceledException - import org.apache.pekko import pekko.actor.{ Actor, ActorRef, ActorSystem, Address, Deploy, PoisonPill, Props, RootActorPath } import pekko.cluster.ClusterEvent.{ MemberEvent, MemberRemoved } import pekko.event.Logging.ErrorLevel import pekko.remote.DefaultFailureDetectorRegistry import pekko.remote.testconductor.RoleName -import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.{ MultiNodeSpec, STMultiNodeSpec } +import pekko.remote.testkit.MultiNodeConfig import pekko.serialization.jackson.CborSerializable import pekko.testkit._ import pekko.testkit.TestEvent._ +import org.scalatest.{ Canceled, Outcome, Suite } +import org.scalatest.exceptions.TestCanceledException + +import com.typesafe.config.{ Config, ConfigFactory } + object MultiNodeClusterSpec { def clusterConfigWithFailureDetectorPuppet: Config = diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/NodeChurnSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/NodeChurnSpec.scala index be2416303a..6b5c83c31d 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/NodeChurnSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/NodeChurnSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.cluster import scala.collection.immutable import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.event.Logging.Info @@ -26,6 +24,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ import pekko.testkit.TestKit +import com.typesafe.config.ConfigFactory + object NodeChurnMultiJvmSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/NodeDowningAndBeingRemovedSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/NodeDowningAndBeingRemovedSpec.scala index 79613664ab..061961a58f 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/NodeDowningAndBeingRemovedSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/NodeDowningAndBeingRemovedSpec.scala @@ -15,12 +15,12 @@ package org.apache.pekko.cluster import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object NodeDowningAndBeingRemovedMultiJvmSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/QuickRestartSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/QuickRestartSpec.scala index 0ee7e4bbb0..a3ef92b040 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/QuickRestartSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/QuickRestartSpec.scala @@ -18,13 +18,13 @@ import java.util.concurrent.ThreadLocalRandom import scala.collection.immutable import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ ActorSystem, Address } import pekko.remote.testkit.{ MultiNodeConfig, MultiNodeSpec } import pekko.testkit._ +import com.typesafe.config.ConfigFactory + // This test was a reproducer for issue #20639 object QuickRestartMultiJvmSpec extends MultiNodeConfig { val first = role("first") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RemoteFeaturesWithClusterSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RemoteFeaturesWithClusterSpec.scala index 6e0d89b5b9..e5066528f1 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RemoteFeaturesWithClusterSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RemoteFeaturesWithClusterSpec.scala @@ -13,9 +13,6 @@ package org.apache.pekko.cluster -import com.typesafe.config.ConfigFactory -import org.scalatest.concurrent.ScalaFutures - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef @@ -31,6 +28,10 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec import pekko.testkit.ImplicitSender +import org.scalatest.concurrent.ScalaFutures + +import com.typesafe.config.ConfigFactory + class ClusterRemoteFeaturesConfig(artery: Boolean) extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RestartFirstSeedNodeSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RestartFirstSeedNodeSpec.scala index a9264b8384..f503a1f605 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RestartFirstSeedNodeSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RestartFirstSeedNodeSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.cluster import scala.collection.immutable import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorSystem @@ -30,6 +28,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object RestartFirstSeedNodeMultiJvmSpec extends MultiNodeConfig { val seed1 = role("seed1") val seed2 = role("seed2") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RestartNode2Spec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RestartNode2Spec.scala index c7e2be84ba..3f5a54d24e 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RestartNode2Spec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RestartNode2Spec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.cluster import scala.collection.immutable import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorSystem @@ -30,6 +28,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object RestartNode2SpecMultiJvmSpec extends MultiNodeConfig { val seed1 = role("seed1") val seed2 = role("seed2") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RestartNode3Spec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RestartNode3Spec.scala index 5c19d769f9..cd910f0e9c 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RestartNode3Spec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RestartNode3Spec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.cluster import scala.collection.immutable import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorSystem @@ -31,6 +29,8 @@ import pekko.remote.testkit.MultiNodeSpec import pekko.remote.transport.ThrottlerTransportAdapter.Direction import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object RestartNode3MultiJvmSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RestartNodeSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RestartNodeSpec.scala index 734418c83e..d2add1125c 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RestartNodeSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/RestartNodeSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.cluster import scala.collection.immutable import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.Done import pekko.actor.Actor @@ -35,6 +33,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object RestartNodeMultiJvmSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SharedMediaDriverSupport.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SharedMediaDriverSupport.scala index 5450717b7d..d4c89fa51a 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SharedMediaDriverSupport.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SharedMediaDriverSupport.scala @@ -20,7 +20,6 @@ import java.util.function.Consumer import scala.annotation.tailrec import scala.util.control.NonFatal -import com.typesafe.config.ConfigFactory import io.aeron.CommonContext import io.aeron.driver.MediaDriver import io.aeron.driver.ThreadingMode @@ -34,6 +33,8 @@ import pekko.remote.artery.aeron.TaskRunner import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec +import com.typesafe.config.ConfigFactory + object SharedMediaDriverSupport { private val mediaDriver = new AtomicReference[Option[MediaDriver]](None) diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SingletonClusterSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SingletonClusterSpec.scala index 70505f300f..514a82ba75 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SingletonClusterSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SingletonClusterSpec.scala @@ -16,13 +16,13 @@ package org.apache.pekko.cluster import scala.collection.immutable import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Address import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + final case class SingletonClusterMultiNodeConfig(failureDetectorPuppet: Boolean) extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SplitBrainQuarantineSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SplitBrainQuarantineSpec.scala index 3a75d77775..8a83c680c5 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SplitBrainQuarantineSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SplitBrainQuarantineSpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.cluster +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.Identify @@ -21,9 +23,8 @@ import pekko.remote.artery.ArterySettings import pekko.remote.testkit.MultiNodeConfig import pekko.remote.transport.ThrottlerTransportAdapter import pekko.testkit.LongRunningTest -import com.typesafe.config.ConfigFactory -import scala.concurrent.duration._ +import com.typesafe.config.ConfigFactory object SplitBrainQuarantineSpec extends MultiNodeConfig { val first = role("first") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SplitBrainSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SplitBrainSpec.scala index a7cbf70c9a..8d2ea41cd9 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SplitBrainSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SplitBrainSpec.scala @@ -15,13 +15,13 @@ package org.apache.pekko.cluster import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.remote.testkit.MultiNodeConfig import pekko.remote.transport.ThrottlerTransportAdapter.Direction import pekko.testkit._ +import com.typesafe.config.ConfigFactory + final case class SplitBrainMultiNodeConfig(failureDetectorPuppet: Boolean) extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/StreamRefSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/StreamRefSpec.scala index ed8ac4ceb2..6e0b611443 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/StreamRefSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/StreamRefSpec.scala @@ -15,11 +15,10 @@ package org.apache.pekko.cluster import scala.concurrent.Future import scala.concurrent.duration._ +import scala.jdk.DurationConverters._ import scala.util.Failure import scala.util.Success -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.Done import pekko.actor.{ Actor, ActorIdentity, ActorLogging, ActorRef, Identify, Props } @@ -37,7 +36,8 @@ import pekko.stream.scaladsl.StreamRefs import pekko.stream.testkit.TestSubscriber import pekko.stream.testkit.scaladsl.TestSink import pekko.testkit._ -import scala.jdk.DurationConverters._ + +import com.typesafe.config.ConfigFactory object StreamRefSpec extends MultiNodeConfig { val first = role("first") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/StressSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/StressSpec.scala index b5890af45b..3dd7555e8e 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/StressSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/StressSpec.scala @@ -19,10 +19,6 @@ import scala.annotation.tailrec import scala.collection.immutable import scala.concurrent.duration._ -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import org.scalatest.BeforeAndAfterEach - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorIdentity @@ -47,11 +43,16 @@ import pekko.remote.artery.ArterySettings.AeronUpd import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec import pekko.remote.transport.ThrottlerTransportAdapter -import pekko.testkit.TestEvent._ import pekko.testkit._ +import pekko.testkit.TestEvent._ import pekko.util.Helpers.ConfigOps import pekko.util.Helpers.Requiring +import org.scalatest.BeforeAndAfterEach + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + /** * This test is intended to be used as long running stress test * of cluster membership features. Number of nodes and duration of diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SunnyWeatherSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SunnyWeatherSpec.scala index d818c87c72..635fb3a007 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SunnyWeatherSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SunnyWeatherSpec.scala @@ -17,14 +17,14 @@ import java.util.concurrent.atomic.AtomicReference import scala.collection.immutable.SortedSet -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.Props import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object SunnyWeatherMultiJvmSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SurviveNetworkInstabilitySpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SurviveNetworkInstabilitySpec.scala index 62f170e235..980985de8e 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SurviveNetworkInstabilitySpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SurviveNetworkInstabilitySpec.scala @@ -13,12 +13,10 @@ package org.apache.pekko.cluster +import scala.annotation.nowarn import scala.concurrent.duration._ import scala.util.control.NoStackTrace -import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef @@ -34,6 +32,8 @@ import pekko.remote.transport.ThrottlerTransportAdapter.Direction import pekko.serialization.jackson.CborSerializable import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object SurviveNetworkInstabilityMultiJvmSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/TransitionSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/TransitionSpec.scala index 81163068a9..eb5da1690a 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/TransitionSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/TransitionSpec.scala @@ -15,7 +15,6 @@ package org.apache.pekko.cluster import InternalClusterAction._ import MemberStatus._ -import com.typesafe.config.ConfigFactory import language.implicitConversions import org.apache.pekko @@ -24,6 +23,8 @@ import pekko.remote.testconductor.RoleName import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object TransitionMultiJvmSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/UnreachableNodeJoinsAgainSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/UnreachableNodeJoinsAgainSpec.scala index 75c93abb0d..f793536238 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/UnreachableNodeJoinsAgainSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/UnreachableNodeJoinsAgainSpec.scala @@ -17,8 +17,6 @@ import scala.collection.immutable import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.ActorSystem import pekko.actor.ExtendedActorSystem @@ -30,6 +28,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.transport.ThrottlerTransportAdapter.Direction import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object UnreachableNodeJoinsAgainMultiNodeConfig extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/routing/ClusterConsistentHashingRouterSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/routing/ClusterConsistentHashingRouterSpec.scala index 506be433a3..a11f317de4 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/routing/ClusterConsistentHashingRouterSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/routing/ClusterConsistentHashingRouterSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.routing import scala.concurrent.Await -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef @@ -34,6 +32,8 @@ import pekko.routing.GetRoutees import pekko.routing.Routees import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object ClusterConsistentHashingRouterMultiJvmSpec extends MultiNodeConfig { class Echo extends Actor { diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/routing/ClusterRoundRobinSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/routing/ClusterRoundRobinSpec.scala index a88e0b9f3b..347c629ae2 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/routing/ClusterRoundRobinSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/routing/ClusterRoundRobinSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.cluster.routing import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef @@ -37,6 +35,8 @@ import pekko.routing.RoutedActorRef import pekko.routing.Routees import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object ClusterRoundRobinMultiJvmSpec extends MultiNodeConfig { class SomeActor(routeeType: RouteeType) extends Actor { diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/routing/UseRoleIgnoredSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/routing/UseRoleIgnoredSpec.scala index ed60042e03..4f2e0dd1d2 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/routing/UseRoleIgnoredSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/routing/UseRoleIgnoredSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.cluster.routing import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.cluster.MultiNodeClusterSpec @@ -31,6 +29,8 @@ import pekko.testkit._ import pekko.testkit.DefaultTimeout import pekko.testkit.ImplicitSender +import com.typesafe.config.ConfigFactory + object UseRoleIgnoredMultiJvmSpec extends MultiNodeConfig { class SomeActor(routeeType: RouteeType) extends Actor with ActorLogging { diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/DownAllIndirectlyConnected5NodeSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/DownAllIndirectlyConnected5NodeSpec.scala index 3080c4676a..6933a74571 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/DownAllIndirectlyConnected5NodeSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/DownAllIndirectlyConnected5NodeSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.sbr import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.cluster.Cluster import pekko.cluster.MemberStatus @@ -24,6 +22,8 @@ import pekko.cluster.MultiNodeClusterSpec import pekko.remote.testkit.MultiNodeConfig import pekko.remote.transport.ThrottlerTransportAdapter +import com.typesafe.config.ConfigFactory + object DownAllIndirectlyConnected5NodeSpec extends MultiNodeConfig { val node1 = role("node1") val node2 = role("node2") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/DownAllUnstable5NodeSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/DownAllUnstable5NodeSpec.scala index f7db6ad718..4bc82800cc 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/DownAllUnstable5NodeSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/DownAllUnstable5NodeSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.sbr import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.cluster.Cluster import pekko.cluster.MemberStatus @@ -24,6 +22,8 @@ import pekko.cluster.MultiNodeClusterSpec import pekko.remote.testkit.MultiNodeConfig import pekko.remote.transport.ThrottlerTransportAdapter +import com.typesafe.config.ConfigFactory + object DownAllUnstable5NodeSpec extends MultiNodeConfig { val node1 = role("node1") val node2 = role("node2") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/IndirectlyConnected3NodeSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/IndirectlyConnected3NodeSpec.scala index 9fcef4f41a..0e99cecaa2 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/IndirectlyConnected3NodeSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/IndirectlyConnected3NodeSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.sbr import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.cluster.Cluster import pekko.cluster.MemberStatus @@ -24,6 +22,8 @@ import pekko.cluster.MultiNodeClusterSpec import pekko.remote.testkit.MultiNodeConfig import pekko.remote.transport.ThrottlerTransportAdapter +import com.typesafe.config.ConfigFactory + object IndirectlyConnected3NodeSpec extends MultiNodeConfig { val node1 = role("node1") val node2 = role("node2") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/IndirectlyConnected5NodeSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/IndirectlyConnected5NodeSpec.scala index f566116f67..6369e11f4d 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/IndirectlyConnected5NodeSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/IndirectlyConnected5NodeSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.sbr import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.cluster.Cluster import pekko.cluster.MemberStatus @@ -24,6 +22,8 @@ import pekko.cluster.MultiNodeClusterSpec import pekko.remote.testkit.MultiNodeConfig import pekko.remote.transport.ThrottlerTransportAdapter +import com.typesafe.config.ConfigFactory + object IndirectlyConnected5NodeSpec extends MultiNodeConfig { val node1 = role("node1") val node2 = role("node2") diff --git a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/LeaseMajority5NodeSpec.scala b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/LeaseMajority5NodeSpec.scala index ef44ce5948..a06a205d2f 100644 --- a/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/LeaseMajority5NodeSpec.scala +++ b/cluster/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/LeaseMajority5NodeSpec.scala @@ -18,14 +18,14 @@ import scala.concurrent.duration._ import org.apache.pekko import pekko.cluster.MemberStatus -import pekko.remote.testconductor.RoleName -import pekko.remote.testkit.MultiNodeConfig -import pekko.remote.transport.ThrottlerTransportAdapter -import com.typesafe.config.ConfigFactory - import pekko.cluster.MultiNodeClusterSpec import pekko.coordination.lease.TestLease import pekko.coordination.lease.TestLeaseExt +import pekko.remote.testconductor.RoleName +import pekko.remote.testkit.MultiNodeConfig +import pekko.remote.transport.ThrottlerTransportAdapter + +import com.typesafe.config.ConfigFactory object LeaseMajority5NodeSpec extends MultiNodeConfig { val node1 = role("node1") diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterConfigSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterConfigSpec.scala index 64e617155b..e19c65361c 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterConfigSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterConfigSpec.scala @@ -13,10 +13,8 @@ package org.apache.pekko.cluster -import scala.concurrent.duration._ - import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory +import scala.concurrent.duration._ import org.apache.pekko import pekko.actor.Address @@ -26,6 +24,8 @@ import pekko.testkit.PekkoSpec import pekko.util.Helpers.ConfigOps import pekko.util.Version +import com.typesafe.config.ConfigFactory + @nowarn class ClusterConfigSpec extends PekkoSpec { diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterDeathWatchNotificationSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterDeathWatchNotificationSpec.scala index 397ab77a14..0d2b86f2e6 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterDeathWatchNotificationSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterDeathWatchNotificationSpec.scala @@ -17,11 +17,11 @@ import scala.concurrent.duration._ import org.apache.pekko import pekko.actor._ -import pekko.testkit._ -import com.typesafe.config.ConfigFactory - import pekko.remote.artery.ArteryMultiNodeSpec import pekko.remote.artery.ArterySpecSupport +import pekko.testkit._ + +import com.typesafe.config.ConfigFactory object ClusterDeathWatchNotificationSpec { diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterDeployerSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterDeployerSpec.scala index a94aa8d56f..b86a4650a3 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterDeployerSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterDeployerSpec.scala @@ -13,8 +13,6 @@ package org.apache.pekko.cluster -import com.typesafe.config._ - import org.apache.pekko import pekko.actor._ import pekko.cluster.routing.ClusterRouterGroup @@ -24,6 +22,8 @@ import pekko.cluster.routing.ClusterRouterPoolSettings import pekko.routing._ import pekko.testkit._ +import com.typesafe.config._ + object ClusterDeployerSpec { val deployerConf = ConfigFactory.parseString( """ diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterDomainEventPublisherSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterDomainEventPublisherSpec.scala index 87c52511a9..ca3955727f 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterDomainEventPublisherSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterDomainEventPublisherSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster import scala.collection.immutable.SortedSet -import org.scalatest.BeforeAndAfterEach - import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.Address @@ -27,10 +25,12 @@ import pekko.cluster.ClusterSettings.DefaultDataCenter import pekko.cluster.InternalClusterAction._ import pekko.cluster.MemberStatus._ import pekko.remote.RARP -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.testkit.TestProbe +import org.scalatest.BeforeAndAfterEach + object ClusterDomainEventPublisherSpec { val config = """ pekko.actor.provider = "cluster" diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterDomainEventSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterDomainEventSpec.scala index b2cb1308d8..17dcca2b87 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterDomainEventSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterDomainEventSpec.scala @@ -14,10 +14,12 @@ package org.apache.pekko.cluster import scala.collection.immutable.SortedSet + +import org.apache.pekko.actor.Address + +import org.scalatest.BeforeAndAfterAll import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import org.apache.pekko.actor.Address -import org.scalatest.BeforeAndAfterAll class ClusterDomainEventSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll { diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterHeartbeatSenderStateSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterHeartbeatSenderStateSpec.scala index 936ed35358..d949181f79 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterHeartbeatSenderStateSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterHeartbeatSenderStateSpec.scala @@ -15,14 +15,14 @@ package org.apache.pekko.cluster import java.util.concurrent.ThreadLocalRandom -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.Address import pekko.remote.DefaultFailureDetectorRegistry import pekko.remote.FailureDetector +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + object ClusterHeartbeatSenderStateSpec { class FailureDetectorStub extends FailureDetector { diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterLogSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterLogSpec.scala index a1c5bdb896..2c39281488 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterLogSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterLogSpec.scala @@ -13,12 +13,12 @@ package org.apache.pekko.cluster -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.actor.{ Address, ExtendedActorSystem } import pekko.testkit.{ EventFilter, ImplicitSender, PekkoSpec } +import com.typesafe.config.{ Config, ConfigFactory } + object ClusterLogSpec { val config = """ pekko.cluster { diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterSpec.scala index 8dd0cdf01e..7f67537809 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterSpec.scala @@ -14,13 +14,11 @@ package org.apache.pekko.cluster import java.lang.management.ManagementFactory - import javax.management.ObjectName + import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.ActorSystem import pekko.actor.Address @@ -34,11 +32,13 @@ import pekko.stream.Materializer import pekko.stream.scaladsl.Sink import pekko.stream.scaladsl.Source import pekko.stream.scaladsl.StreamRefs -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.testkit.TestProbe import pekko.util.Version +import com.typesafe.config.ConfigFactory + object ClusterSpec { val config = """ pekko.cluster { diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterTestKit.scala b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterTestKit.scala index 2c50171229..b5903cf314 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/ClusterTestKit.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/ClusterTestKit.scala @@ -16,12 +16,12 @@ package org.apache.pekko.cluster import scala.concurrent.duration._ import scala.util.Random -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.actor.ActorSystem import pekko.testkit.{ PekkoSpec, TestKitBase } +import com.typesafe.config.{ Config, ConfigFactory } + /** * Builds on TestKitBase to provide some extra utilities to run cluster test. * diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/ConfigUtilSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/ConfigUtilSpec.scala index 04c1f4b0d4..c756f45898 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/ConfigUtilSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/ConfigUtilSpec.scala @@ -17,11 +17,11 @@ package org.apache.pekko.cluster -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.testkit.PekkoSpec +import com.typesafe.config.ConfigFactory + class ConfigUtilSpec extends PekkoSpec { val pekkoSbrClass = "org.apache.pekko.cluster.sbr.SplitBrainResolverProvider" diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/CrossDcHeartbeatSenderSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/CrossDcHeartbeatSenderSpec.scala index 7b2fff218b..415ab83832 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/CrossDcHeartbeatSenderSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/CrossDcHeartbeatSenderSpec.scala @@ -23,8 +23,8 @@ import pekko.cluster.ClusterEvent.CurrentClusterState import pekko.cluster.ClusterHeartbeatSender.Heartbeat import pekko.cluster.CrossDcHeartbeatSender.ReportStatus import pekko.cluster.CrossDcHeartbeatSenderSpec.TestCrossDcHeartbeatSender -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.testkit.TestProbe import pekko.util.Version diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/DowningProviderSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/DowningProviderSpec.scala index 3619fb2488..7cb64b96ef 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/DowningProviderSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/DowningProviderSpec.scala @@ -14,10 +14,10 @@ package org.apache.pekko.cluster import java.util.concurrent.atomic.AtomicBoolean + import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec +import scala.util.control.NonFatal + import org.apache.pekko import pekko.ConfigurationException import pekko.actor.ActorSystem @@ -26,7 +26,10 @@ import pekko.testkit.TestKit.awaitCond import pekko.testkit.TestKit.shutdownActorSystem import pekko.util.unused -import scala.util.control.NonFatal +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + +import com.typesafe.config.ConfigFactory class FailingDowningProvider(@unused system: ActorSystem) extends DowningProvider { override val downRemovalMargin: FiniteDuration = 20.seconds diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/FailureDetectorPuppet.scala b/cluster/src/test/scala/org/apache/pekko/cluster/FailureDetectorPuppet.scala index 26b5f65fb8..99f2385a66 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/FailureDetectorPuppet.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/FailureDetectorPuppet.scala @@ -15,13 +15,13 @@ package org.apache.pekko.cluster import java.util.concurrent.atomic.AtomicReference -import com.typesafe.config.Config - import org.apache.pekko import pekko.event.EventStream import pekko.remote.FailureDetector import pekko.util.unused +import com.typesafe.config.Config + /** * User controllable "puppet" failure detector. */ diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/GossipSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/GossipSpec.scala index 4085d4a478..7dd03d942c 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/GossipSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/GossipSpec.scala @@ -15,14 +15,14 @@ package org.apache.pekko.cluster import scala.collection.immutable.SortedSet -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.Address import pekko.cluster.ClusterSettings.DefaultDataCenter import pekko.cluster.Gossip.vclockName +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class GossipSpec extends AnyWordSpec with Matchers { import MemberStatus._ diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/GossipTargetSelectorSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/GossipTargetSelectorSpec.scala index 6bbb29969a..85ebf1210e 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/GossipTargetSelectorSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/GossipTargetSelectorSpec.scala @@ -15,14 +15,14 @@ package org.apache.pekko.cluster import scala.collection.immutable.SortedSet -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.Address import pekko.cluster.ClusterSettings.DataCenter import pekko.cluster.MemberStatus.Up +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class GossipTargetSelectorSpec extends AnyWordSpec with Matchers { val aDc1 = TestMember(Address("pekko", "sys", "a", 7355), Up, Set.empty, dataCenter = "dc1") diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/HeartbeatNodeRingPerfSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/HeartbeatNodeRingPerfSpec.scala index 57f46129c1..4f0f6e0343 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/HeartbeatNodeRingPerfSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/HeartbeatNodeRingPerfSpec.scala @@ -13,11 +13,11 @@ package org.apache.pekko.cluster +import org.apache.pekko.actor.Address + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import org.apache.pekko.actor.Address - class HeartbeatNodeRingPerfSpec extends AnyWordSpec with Matchers { val nodesSize = sys.props.get("org.apache.pekko.cluster.HeartbeatNodeRingPerfSpec.nodesSize").getOrElse("250").toInt diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/HeartbeatNodeRingSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/HeartbeatNodeRingSpec.scala index dc2e4fc333..5f7ae82cf3 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/HeartbeatNodeRingSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/HeartbeatNodeRingSpec.scala @@ -13,11 +13,11 @@ package org.apache.pekko.cluster +import org.apache.pekko.actor.Address + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import org.apache.pekko.actor.Address - class HeartbeatNodeRingSpec extends AnyWordSpec with Matchers { val aa = UniqueAddress(Address("pekko", "sys", "aa", 7355), 1L) diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatCheckClusterSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatCheckClusterSpec.scala index d84c646708..3c33283ec9 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatCheckClusterSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatCheckClusterSpec.scala @@ -13,13 +13,13 @@ package org.apache.pekko.cluster -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.testkit.PekkoSpec +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + class JoinConfigCompatCheckClusterSpec extends PekkoSpec { private val extSystem = system.asInstanceOf[ExtendedActorSystem] diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatCheckerRollingUpdateSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatCheckerRollingUpdateSpec.scala index 67e62ae1ac..1338df82ae 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatCheckerRollingUpdateSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatCheckerRollingUpdateSpec.scala @@ -16,12 +16,12 @@ package org.apache.pekko.cluster import scala.collection.{ immutable => im } import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.testkit.GHExcludeAeronTest import pekko.testkit.LongRunningTest +import com.typesafe.config.{ Config, ConfigFactory } + object JoinConfigCompatCheckerRollingUpdateSpec { val baseConfig = ConfigFactory.parseString(s""" diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatCheckerSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatCheckerSpec.scala index 3fdff1a557..d141074590 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatCheckerSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatCheckerSpec.scala @@ -16,10 +16,10 @@ package org.apache.pekko.cluster import scala.collection.{ immutable => im } import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko.testkit.{ LongRunningTest, PekkoSpec } +import com.typesafe.config.{ Config, ConfigFactory } + object JoinConfigCompatCheckerSpec { val baseConfig: Config = diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatPreDefinedChecksSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatPreDefinedChecksSpec.scala index b66bf5f602..767014f20d 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatPreDefinedChecksSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/JoinConfigCompatPreDefinedChecksSpec.scala @@ -15,10 +15,11 @@ package org.apache.pekko.cluster import scala.collection.{ immutable => im } -import com.typesafe.config.{ Config, ConfigFactory } import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec +import com.typesafe.config.{ Config, ConfigFactory } + class JoinConfigCompatPreDefinedChecksSpec extends AnyWordSpec with Matchers { // Test for some of the pre-build helpers we offer diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/MemberOrderingSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/MemberOrderingSpec.scala index 7c1d882932..ca370cf6d7 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/MemberOrderingSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/MemberOrderingSpec.scala @@ -16,14 +16,14 @@ package org.apache.pekko.cluster import scala.collection.immutable.SortedSet import scala.util.Random -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.Address import pekko.actor.AddressFromURIString import pekko.util.Version +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class MemberOrderingSpec extends AnyWordSpec with Matchers { import Member.addressOrdering import Member.ordering diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/MembershipStateSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/MembershipStateSpec.scala index 1047ce6fc8..578fafecc9 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/MembershipStateSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/MembershipStateSpec.scala @@ -15,13 +15,13 @@ package org.apache.pekko.cluster import scala.collection.immutable.SortedSet -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.Address import pekko.cluster.MemberStatus.Up +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class MembershipStateSpec extends AnyWordSpec with Matchers { // DC-a is in reverse age order val a1 = TestMember(Address("pekko", "sys", "a4", 7355), Up, 1, "dc-a") diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/MixedProtocolClusterSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/MixedProtocolClusterSpec.scala index bbf9712651..fc74fc7dbd 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/MixedProtocolClusterSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/MixedProtocolClusterSpec.scala @@ -17,11 +17,11 @@ package org.apache.pekko.cluster -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.testkit.{ LongRunningTest, PekkoSpec } +import com.typesafe.config.{ Config, ConfigFactory } + object MixedProtocolClusterSpec { import PekkoSpec._ diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/ReachabilityPerfSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/ReachabilityPerfSpec.scala index f8f096c314..0bd65653b2 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/ReachabilityPerfSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/ReachabilityPerfSpec.scala @@ -14,11 +14,12 @@ package org.apache.pekko.cluster import scala.annotation.nowarn -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec import org.apache.pekko.actor.Address +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class ReachabilityPerfSpec extends AnyWordSpec with Matchers { val nodesSize = sys.props.get("org.apache.pekko.cluster.ReachabilityPerfSpec.nodesSize").getOrElse("250").toInt diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/ReachabilitySpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/ReachabilitySpec.scala index 2162124da8..dbff559c66 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/ReachabilitySpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/ReachabilitySpec.scala @@ -13,11 +13,11 @@ package org.apache.pekko.cluster +import org.apache.pekko.actor.Address + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import org.apache.pekko.actor.Address - class ReachabilitySpec extends AnyWordSpec with Matchers { import Reachability.{ Reachable, Record, Terminated, Unreachable } diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/StartupWithOneThreadSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/StartupWithOneThreadSpec.scala index fc68d1564d..398f0c6d6c 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/StartupWithOneThreadSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/StartupWithOneThreadSpec.scala @@ -20,8 +20,8 @@ import pekko.actor.Actor import pekko.actor.ActorLogging import pekko.actor.Address import pekko.actor.Props -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec object StartupWithOneThreadSpec { val config = """ diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializerSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializerSpec.scala index 7615de9585..2e9f695295 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializerSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializerSpec.scala @@ -13,10 +13,9 @@ package org.apache.pekko.cluster.protobuf -import collection.immutable.SortedSet - import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory + +import collection.immutable.SortedSet import org.apache.pekko import pekko.actor.{ Address, ExtendedActorSystem } @@ -27,6 +26,8 @@ import pekko.routing.RoundRobinPool import pekko.testkit.PekkoSpec import pekko.util.Version +import com.typesafe.config.ConfigFactory + @nowarn class ClusterMessageSerializerSpec extends PekkoSpec("pekko.actor.provider = cluster") { diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/sbr/LeaseMajoritySpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/sbr/LeaseMajoritySpec.scala index 59283001e0..1aa8cce1c4 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/sbr/LeaseMajoritySpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/sbr/LeaseMajoritySpec.scala @@ -14,9 +14,11 @@ package org.apache.pekko.cluster.sbr import org.apache.pekko.testkit.PekkoSpec -import com.typesafe.config.ConfigFactory + import org.scalatest.concurrent.Eventually +import com.typesafe.config.ConfigFactory + class LeaseMajoritySpec extends PekkoSpec() with Eventually { val default = ConfigFactory diff --git a/cluster/src/test/scala/org/apache/pekko/cluster/sbr/SplitBrainResolverSpec.scala b/cluster/src/test/scala/org/apache/pekko/cluster/sbr/SplitBrainResolverSpec.scala index 93a1c5344d..360bfb3028 100644 --- a/cluster/src/test/scala/org/apache/pekko/cluster/sbr/SplitBrainResolverSpec.scala +++ b/cluster/src/test/scala/org/apache/pekko/cluster/sbr/SplitBrainResolverSpec.scala @@ -16,14 +16,12 @@ package org.apache.pekko.cluster.sbr import scala.concurrent.Future import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.concurrent.Eventually - import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.Address import pekko.actor.ExtendedActorSystem import pekko.actor.Props +import pekko.cluster._ import pekko.cluster.ClusterEvent.LeaderChanged import pekko.cluster.ClusterEvent.MemberExited import pekko.cluster.ClusterEvent.MemberRemoved @@ -36,12 +34,15 @@ import pekko.cluster.ClusterEvent.UnreachableDataCenter import pekko.cluster.ClusterEvent.UnreachableMember import pekko.cluster.ClusterSettings.DataCenter import pekko.cluster.MemberStatus._ -import pekko.cluster._ import pekko.coordination.lease.LeaseSettings import pekko.coordination.lease.TestLease import pekko.coordination.lease.TimeoutSettings -import pekko.testkit.PekkoSpec import pekko.testkit.EventFilter +import pekko.testkit.PekkoSpec + +import org.scalatest.concurrent.Eventually + +import com.typesafe.config.ConfigFactory object SplitBrainResolverSpec { diff --git a/coordination/src/main/scala/org/apache/pekko/coordination/lease/LeaseUsageSettings.scala b/coordination/src/main/scala/org/apache/pekko/coordination/lease/LeaseUsageSettings.scala index db3f3b7df0..8fbae9a8eb 100644 --- a/coordination/src/main/scala/org/apache/pekko/coordination/lease/LeaseUsageSettings.scala +++ b/coordination/src/main/scala/org/apache/pekko/coordination/lease/LeaseUsageSettings.scala @@ -14,9 +14,9 @@ package org.apache.pekko.coordination.lease import scala.concurrent.duration.FiniteDuration +import scala.jdk.DurationConverters._ import org.apache.pekko -import scala.jdk.DurationConverters._ import pekko.util.PrettyDuration._ final class LeaseUsageSettings private[pekko] (val leaseImplementation: String, diff --git a/coordination/src/main/scala/org/apache/pekko/coordination/lease/TimeoutSettings.scala b/coordination/src/main/scala/org/apache/pekko/coordination/lease/TimeoutSettings.scala index d3e0bb1195..07ef1204b5 100644 --- a/coordination/src/main/scala/org/apache/pekko/coordination/lease/TimeoutSettings.scala +++ b/coordination/src/main/scala/org/apache/pekko/coordination/lease/TimeoutSettings.scala @@ -14,11 +14,10 @@ package org.apache.pekko.coordination.lease import scala.concurrent.duration._ +import scala.jdk.DurationConverters._ import com.typesafe.config.{ Config, ConfigValueType } -import scala.jdk.DurationConverters._ - object TimeoutSettings { def apply(config: Config): TimeoutSettings = { val heartBeatTimeout = config.getDuration("heartbeat-timeout").toScala diff --git a/coordination/src/main/scala/org/apache/pekko/coordination/lease/internal/LeaseAdapter.scala b/coordination/src/main/scala/org/apache/pekko/coordination/lease/internal/LeaseAdapter.scala index 27e5937435..56a2da803c 100644 --- a/coordination/src/main/scala/org/apache/pekko/coordination/lease/internal/LeaseAdapter.scala +++ b/coordination/src/main/scala/org/apache/pekko/coordination/lease/internal/LeaseAdapter.scala @@ -19,14 +19,14 @@ import java.util.function.Consumer import scala.concurrent.ExecutionContext import scala.concurrent.Future +import scala.jdk.FutureConverters._ +import scala.jdk.OptionConverters._ import org.apache.pekko import pekko.annotation.InternalApi import pekko.coordination.lease.LeaseSettings import pekko.coordination.lease.javadsl.{ Lease => JavaLease } import pekko.coordination.lease.scaladsl.{ Lease => ScalaLease } -import scala.jdk.FutureConverters._ -import scala.jdk.OptionConverters._ /** * INTERNAL API diff --git a/coordination/src/test/scala/org/apache/pekko/coordination/lease/TestLease.scala b/coordination/src/test/scala/org/apache/pekko/coordination/lease/TestLease.scala index 066d5e55c1..71b218b696 100644 --- a/coordination/src/test/scala/org/apache/pekko/coordination/lease/TestLease.scala +++ b/coordination/src/test/scala/org/apache/pekko/coordination/lease/TestLease.scala @@ -18,8 +18,7 @@ import java.util.concurrent.atomic.AtomicReference import scala.concurrent.Future import scala.concurrent.Promise - -import com.typesafe.config.ConfigFactory +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.actor.ActorSystem @@ -31,7 +30,8 @@ import pekko.actor.ExtensionIdProvider import pekko.coordination.lease.scaladsl.Lease import pekko.event.Logging import pekko.testkit.TestProbe -import scala.jdk.CollectionConverters._ + +import com.typesafe.config.ConfigFactory object TestLeaseExt extends ExtensionId[TestLeaseExt] with ExtensionIdProvider { override def get(system: ActorSystem): TestLeaseExt = super.get(system) diff --git a/coordination/src/test/scala/org/apache/pekko/coordination/lease/TimeoutSettingsSpec.scala b/coordination/src/test/scala/org/apache/pekko/coordination/lease/TimeoutSettingsSpec.scala index ee2497cf9b..bce9eccef3 100644 --- a/coordination/src/test/scala/org/apache/pekko/coordination/lease/TimeoutSettingsSpec.scala +++ b/coordination/src/test/scala/org/apache/pekko/coordination/lease/TimeoutSettingsSpec.scala @@ -15,10 +15,11 @@ package org.apache.pekko.coordination.lease import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec +import com.typesafe.config.ConfigFactory + class TimeoutSettingsSpec extends AnyWordSpec with Matchers { private def conf(overrides: String): TimeoutSettings = { val c = ConfigFactory.parseString(overrides).withFallback(ConfigFactory.load()) diff --git a/coordination/src/test/scala/org/apache/pekko/coordination/lease/scaladsl/LeaseProviderSpec.scala b/coordination/src/test/scala/org/apache/pekko/coordination/lease/scaladsl/LeaseProviderSpec.scala index 469ad33673..2114e39a88 100644 --- a/coordination/src/test/scala/org/apache/pekko/coordination/lease/scaladsl/LeaseProviderSpec.scala +++ b/coordination/src/test/scala/org/apache/pekko/coordination/lease/scaladsl/LeaseProviderSpec.scala @@ -16,13 +16,13 @@ package org.apache.pekko.coordination.lease.scaladsl import scala.concurrent.Future import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.coordination.lease.LeaseSettings import pekko.testkit.{ EventFilter, PekkoSpec } +import com.typesafe.config.ConfigFactory + object LeaseProviderSpec { class LeaseA(settings: LeaseSettings) extends Lease(settings) { override def acquire(): Future[Boolean] = Future.successful(false) diff --git a/discovery/src/main/scala/org/apache/pekko/discovery/ServiceDiscovery.scala b/discovery/src/main/scala/org/apache/pekko/discovery/ServiceDiscovery.scala index 307cbd4250..8687dbb44f 100644 --- a/discovery/src/main/scala/org/apache/pekko/discovery/ServiceDiscovery.scala +++ b/discovery/src/main/scala/org/apache/pekko/discovery/ServiceDiscovery.scala @@ -21,11 +21,11 @@ import java.util.concurrent.TimeUnit import scala.collection.immutable import scala.concurrent.Future import scala.concurrent.duration.FiniteDuration +import scala.jdk.OptionConverters._ import org.apache.pekko import pekko.actor.{ DeadLetterSuppression, NoSerializationVerificationNeeded } import pekko.util.HashCode -import scala.jdk.OptionConverters._ object ServiceDiscovery { diff --git a/discovery/src/main/scala/org/apache/pekko/discovery/aggregate/AggregateServiceDiscovery.scala b/discovery/src/main/scala/org/apache/pekko/discovery/aggregate/AggregateServiceDiscovery.scala index 8876f219b4..011f38bb00 100644 --- a/discovery/src/main/scala/org/apache/pekko/discovery/aggregate/AggregateServiceDiscovery.scala +++ b/discovery/src/main/scala/org/apache/pekko/discovery/aggregate/AggregateServiceDiscovery.scala @@ -15,10 +15,9 @@ package org.apache.pekko.discovery.aggregate import scala.concurrent.Future import scala.concurrent.duration.FiniteDuration +import scala.jdk.CollectionConverters._ import scala.util.control.NonFatal -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.annotation.InternalApi @@ -28,7 +27,8 @@ import pekko.discovery.aggregate.AggregateServiceDiscovery.Methods import pekko.dispatch.MessageDispatcher import pekko.event.Logging import pekko.util.Helpers.Requiring -import scala.jdk.CollectionConverters._ + +import com.typesafe.config.Config /** * INTERNAL API diff --git a/discovery/src/main/scala/org/apache/pekko/discovery/config/ConfigServiceDiscovery.scala b/discovery/src/main/scala/org/apache/pekko/discovery/config/ConfigServiceDiscovery.scala index 0951bbcef0..0c67c167a4 100644 --- a/discovery/src/main/scala/org/apache/pekko/discovery/config/ConfigServiceDiscovery.scala +++ b/discovery/src/main/scala/org/apache/pekko/discovery/config/ConfigServiceDiscovery.scala @@ -15,8 +15,7 @@ package org.apache.pekko.discovery.config import scala.concurrent.Future import scala.concurrent.duration.FiniteDuration - -import com.typesafe.config.{ Config, ConfigUtil } +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.actor.ExtendedActorSystem @@ -24,7 +23,8 @@ import pekko.annotation.InternalApi import pekko.discovery.{ Lookup, ServiceDiscovery } import pekko.discovery.ServiceDiscovery.{ Resolved, ResolvedTarget } import pekko.event.Logging -import scala.jdk.CollectionConverters._ + +import com.typesafe.config.{ Config, ConfigUtil } /** * INTERNAL API diff --git a/discovery/src/test/scala/org/apache/pekko/discovery/DiscoveryConfigurationSpec.scala b/discovery/src/test/scala/org/apache/pekko/discovery/DiscoveryConfigurationSpec.scala index 1e0224248b..7cedaf46bf 100644 --- a/discovery/src/test/scala/org/apache/pekko/discovery/DiscoveryConfigurationSpec.scala +++ b/discovery/src/test/scala/org/apache/pekko/discovery/DiscoveryConfigurationSpec.scala @@ -16,15 +16,16 @@ package org.apache.pekko.discovery import scala.concurrent.Future import scala.concurrent.duration.FiniteDuration -import com.typesafe.config.ConfigFactory -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.ActorSystem import pekko.discovery.ServiceDiscovery.Resolved import pekko.testkit.TestKit +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + +import com.typesafe.config.ConfigFactory + class DiscoveryConfigurationSpec extends AnyWordSpec with Matchers { "ServiceDiscovery" should { diff --git a/discovery/src/test/scala/org/apache/pekko/discovery/aggregate/AggregateServiceDiscoverySpec.scala b/discovery/src/test/scala/org/apache/pekko/discovery/aggregate/AggregateServiceDiscoverySpec.scala index c89928d885..00fd779b7e 100644 --- a/discovery/src/test/scala/org/apache/pekko/discovery/aggregate/AggregateServiceDiscoverySpec.scala +++ b/discovery/src/test/scala/org/apache/pekko/discovery/aggregate/AggregateServiceDiscoverySpec.scala @@ -17,12 +17,6 @@ import scala.collection.immutable import scala.concurrent.Future import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigFactory } -import org.scalatest.BeforeAndAfterAll -import org.scalatest.concurrent.ScalaFutures -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.{ ActorSystem, ExtendedActorSystem } import pekko.discovery.{ Discovery, Lookup, ServiceDiscovery } @@ -30,6 +24,13 @@ import pekko.discovery.ServiceDiscovery.{ Resolved, ResolvedTarget } import pekko.testkit.TestKit import pekko.util.unused +import org.scalatest.BeforeAndAfterAll +import org.scalatest.concurrent.ScalaFutures +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.{ Config, ConfigFactory } + class StubbedServiceDiscovery(@unused system: ExtendedActorSystem) extends ServiceDiscovery { override def lookup(query: Lookup, resolveTimeout: FiniteDuration): Future[Resolved] = { diff --git a/discovery/src/test/scala/org/apache/pekko/discovery/config/ConfigServiceDiscoverySpec.scala b/discovery/src/test/scala/org/apache/pekko/discovery/config/ConfigServiceDiscoverySpec.scala index 5b2a418444..7a462f6f6a 100644 --- a/discovery/src/test/scala/org/apache/pekko/discovery/config/ConfigServiceDiscoverySpec.scala +++ b/discovery/src/test/scala/org/apache/pekko/discovery/config/ConfigServiceDiscoverySpec.scala @@ -16,16 +16,18 @@ package org.apache.pekko.discovery.config import scala.collection.immutable import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigFactory } +import org.apache.pekko +import pekko.actor.ActorSystem +import pekko.discovery.Discovery +import pekko.discovery.ServiceDiscovery.ResolvedTarget +import pekko.testkit.TestKit + import org.scalatest.BeforeAndAfterAll import org.scalatest.concurrent.ScalaFutures import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpecLike -import org.apache.pekko.actor.ActorSystem -import org.apache.pekko.discovery.Discovery -import org.apache.pekko.discovery.ServiceDiscovery.ResolvedTarget -import org.apache.pekko.testkit.TestKit +import com.typesafe.config.{ Config, ConfigFactory } object ConfigServiceDiscoverySpec { diff --git a/discovery/src/test/scala/org/apache/pekko/discovery/config/ConfigServicesParserSpec.scala b/discovery/src/test/scala/org/apache/pekko/discovery/config/ConfigServicesParserSpec.scala index e21a5a02c3..9a32594fdf 100644 --- a/discovery/src/test/scala/org/apache/pekko/discovery/config/ConfigServicesParserSpec.scala +++ b/discovery/src/test/scala/org/apache/pekko/discovery/config/ConfigServicesParserSpec.scala @@ -15,14 +15,15 @@ package org.apache.pekko.discovery.config import scala.collection.immutable -import com.typesafe.config.{ Config, ConfigFactory } -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.discovery.ServiceDiscovery.{ Resolved, ResolvedTarget } import pekko.discovery.config.ConfigServicesParserSpec._ +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + +import com.typesafe.config.{ Config, ConfigFactory } + object ConfigServicesParserSpec { val exampleConfig: Config = ConfigFactory.parseString(""" services { diff --git a/discovery/src/test/scala/org/apache/pekko/discovery/dns/DnsDiscoverySpec.scala b/discovery/src/test/scala/org/apache/pekko/discovery/dns/DnsDiscoverySpec.scala index 01e8257658..73a9115c27 100644 --- a/discovery/src/test/scala/org/apache/pekko/discovery/dns/DnsDiscoverySpec.scala +++ b/discovery/src/test/scala/org/apache/pekko/discovery/dns/DnsDiscoverySpec.scala @@ -16,7 +16,7 @@ package org.apache.pekko.discovery.dns import java.net.InetAddress import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory + import org.apache.pekko import pekko.actor.ActorSystem import pekko.discovery.{ Discovery, Lookup } @@ -25,6 +25,8 @@ import pekko.discovery.ServiceDiscovery.ResolvedTarget import pekko.io.dns.DockerBindDnsService import pekko.testkit.{ SocketUtil, TestKit } +import com.typesafe.config.ConfigFactory + object DnsDiscoverySpec { val config = ConfigFactory.parseString(s""" diff --git a/discovery/src/test/scala/org/apache/pekko/discovery/dns/DnsServiceDiscoverySpec.scala b/discovery/src/test/scala/org/apache/pekko/discovery/dns/DnsServiceDiscoverySpec.scala index 43196a5eaa..d5a1c0e215 100644 --- a/discovery/src/test/scala/org/apache/pekko/discovery/dns/DnsServiceDiscoverySpec.scala +++ b/discovery/src/test/scala/org/apache/pekko/discovery/dns/DnsServiceDiscoverySpec.scala @@ -18,10 +18,6 @@ import java.net.{ Inet6Address, InetAddress } import scala.collection.{ immutable => im } import scala.concurrent.duration._ -import org.scalatest.concurrent.ScalaFutures -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ExtendedActorSystem @@ -34,6 +30,10 @@ import pekko.io.dns.CachePolicy.Ttl import pekko.testkit.PekkoSpec import pekko.testkit.TestProbe +import org.scalatest.concurrent.ScalaFutures +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + class DnsServiceDiscoverySpec extends PekkoSpec with AnyWordSpecLike with Matchers with ScalaFutures { "DnsServiceDiscovery" must { diff --git a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/DurableStore.scala b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/DurableStore.scala index 7f4990d705..86048955c6 100644 --- a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/DurableStore.scala +++ b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/DurableStore.scala @@ -18,10 +18,10 @@ import java.nio.ByteBuffer import java.util.concurrent.TimeUnit import scala.concurrent.duration._ +import scala.jdk.CollectionConverters._ import scala.util.Try import scala.util.control.NonFatal -import com.typesafe.config.Config import org.lmdbjava.Dbi import org.lmdbjava.DbiFlags import org.lmdbjava.Env @@ -43,7 +43,8 @@ import pekko.serialization.SerializationExtension import pekko.serialization.SerializerWithStringManifest import pekko.util.ByteString import pekko.util.OptionVal -import scala.jdk.CollectionConverters._ + +import com.typesafe.config.Config /** * An actor implementing the durable store for the Distributed Data `Replicator` diff --git a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ReplicatedData.scala b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ReplicatedData.scala index bfe2f92900..5fa1c9e2d2 100644 --- a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ReplicatedData.scala +++ b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ReplicatedData.scala @@ -15,9 +15,10 @@ package org.apache.pekko.cluster.ddata import java.util.Optional +import scala.jdk.OptionConverters._ + import org.apache.pekko import pekko.cluster.UniqueAddress -import scala.jdk.OptionConverters._ /** * Interface for implementing a state based convergent diff --git a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala index 4700e772fd..dfc50fd04f 100644 --- a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala +++ b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala @@ -19,21 +19,20 @@ import java.util.concurrent.ThreadLocalRandom import java.util.concurrent.TimeUnit import java.util.function.{ Function => JFunction } +import scala.annotation.nowarn import scala.annotation.varargs import scala.collection.immutable import scala.collection.immutable.TreeSet import scala.collection.mutable import scala.concurrent.duration._ import scala.concurrent.duration.FiniteDuration +import scala.jdk.DurationConverters._ import scala.util.Failure import scala.util.Success import scala.util.Try import scala.util.control.NoStackTrace import scala.util.control.NonFatal -import scala.annotation.nowarn -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorInitializationException @@ -68,7 +67,8 @@ import pekko.remote.RARP import pekko.serialization.SerializationExtension import pekko.util.ByteString import pekko.util.Helpers.toRootLowerCase -import scala.jdk.DurationConverters._ + +import com.typesafe.config.Config object ReplicatorSettings { diff --git a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala index bd62d66161..37b33d6f31 100644 --- a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala +++ b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala @@ -19,9 +19,12 @@ import java.util import java.util.ArrayList import java.util.Collections import java.util.Comparator + +import scala.annotation.nowarn import scala.annotation.tailrec import scala.collection.immutable -import scala.annotation.nowarn +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ExtendedActorSystem @@ -36,7 +39,6 @@ import pekko.serialization.BaseSerializer import pekko.serialization.Serialization import pekko.serialization.SerializerWithStringManifest import pekko.util.ByteString.UTF_8 -import scala.jdk.CollectionConverters._ private object ReplicatedDataSerializer { /* diff --git a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatorMessageSerializer.scala b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatorMessageSerializer.scala index cfb1243e35..9af89a47f8 100644 --- a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatorMessageSerializer.scala +++ b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatorMessageSerializer.scala @@ -16,11 +16,14 @@ package org.apache.pekko.cluster.ddata.protobuf import java.io.NotSerializableException import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.AtomicInteger + import scala.annotation.tailrec import scala.collection.immutable import scala.concurrent.duration._ import scala.concurrent.duration.Duration import scala.concurrent.duration.FiniteDuration +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.actor.Address import pekko.actor.ExtendedActorSystem @@ -41,7 +44,6 @@ import pekko.serialization.BaseSerializer import pekko.serialization.Serialization import pekko.serialization.SerializerWithStringManifest import pekko.util.{ ByteString => PekkoByteString } -import scala.jdk.CollectionConverters._ /** * INTERNAL API diff --git a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/SerializationSupport.scala b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/SerializationSupport.scala index 8f69121ac5..f6861cbaf9 100644 --- a/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/SerializationSupport.scala +++ b/distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/SerializationSupport.scala @@ -17,8 +17,11 @@ import java.io.ByteArrayInputStream import java.io.ByteArrayOutputStream import java.util.zip.GZIPInputStream import java.util.zip.GZIPOutputStream + import scala.annotation.tailrec import scala.collection.immutable.TreeMap +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.Address @@ -30,7 +33,6 @@ import pekko.protobufv3.internal.ByteString import pekko.protobufv3.internal.MessageLite import pekko.remote.ByteStringUtils import pekko.serialization._ -import scala.jdk.CollectionConverters._ /** * Some useful serialization helper methods. diff --git a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/DurableDataSpec.scala b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/DurableDataSpec.scala index 1bde6f2d8d..a06e7a22db 100644 --- a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/DurableDataSpec.scala +++ b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/DurableDataSpec.scala @@ -17,9 +17,6 @@ import scala.concurrent.Await import scala.concurrent.duration._ import scala.util.control.NoStackTrace -import com.typesafe.config.ConfigFactory -import org.scalatest.CancelAfterFailure - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef @@ -31,6 +28,10 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec import pekko.testkit._ +import org.scalatest.CancelAfterFailure + +import com.typesafe.config.ConfigFactory + final case class DurableDataSpecConfig(writeBehind: Boolean) extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/DurablePruningSpec.scala b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/DurablePruningSpec.scala index 9ceb596632..7e66be8142 100644 --- a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/DurablePruningSpec.scala +++ b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/DurablePruningSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.cluster.ddata import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ActorSystem @@ -28,6 +26,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object DurablePruningSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/JepsenInspiredInsertSpec.scala b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/JepsenInspiredInsertSpec.scala index 6674c52df2..3d3e55bdd7 100644 --- a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/JepsenInspiredInsertSpec.scala +++ b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/JepsenInspiredInsertSpec.scala @@ -17,8 +17,6 @@ import java.util.concurrent.ThreadLocalRandom import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.cluster.Cluster import pekko.remote.testconductor.RoleName @@ -27,6 +25,8 @@ import pekko.remote.testkit.MultiNodeSpec import pekko.remote.transport.ThrottlerTransportAdapter.Direction import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object JepsenInspiredInsertSpec extends MultiNodeConfig { val controller = role("controller") val n1 = role("n1") diff --git a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/PerformanceSpec.scala b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/PerformanceSpec.scala index 8dd2c4d2ec..b36bc12134 100644 --- a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/PerformanceSpec.scala +++ b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/PerformanceSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.cluster.ddata import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef @@ -29,6 +27,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object PerformanceSpec extends MultiNodeConfig { val n1 = role("n1") val n2 = role("n2") diff --git a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorChaosSpec.scala b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorChaosSpec.scala index c59c755d66..cc0187e67a 100644 --- a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorChaosSpec.scala +++ b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorChaosSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.ddata import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.cluster.Cluster import pekko.remote.testconductor.RoleName @@ -25,6 +23,8 @@ import pekko.remote.testkit.MultiNodeSpec import pekko.remote.transport.ThrottlerTransportAdapter.Direction import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object ReplicatorChaosSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorDeltaSpec.scala b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorDeltaSpec.scala index 6d076cbfd2..fa8923857f 100644 --- a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorDeltaSpec.scala +++ b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorDeltaSpec.scala @@ -17,8 +17,6 @@ import java.util.concurrent.ThreadLocalRandom import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.cluster.Cluster import pekko.cluster.ddata.Replicator._ @@ -28,6 +26,8 @@ import pekko.remote.testkit.MultiNodeSpec import pekko.serialization.jackson.CborSerializable import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object ReplicatorDeltaSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorGossipSpec.scala b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorGossipSpec.scala index a2a9bf4d96..eaae981ace 100644 --- a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorGossipSpec.scala +++ b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorGossipSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.cluster.ddata import scala.concurrent.duration._ import scala.util.Random -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Dropped import pekko.cluster.Cluster @@ -26,6 +24,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object ReplicatorGossipSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorMapDeltaSpec.scala b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorMapDeltaSpec.scala index 993a4f181e..061c5a4f3a 100644 --- a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorMapDeltaSpec.scala +++ b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorMapDeltaSpec.scala @@ -17,8 +17,6 @@ import java.util.concurrent.ThreadLocalRandom import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.cluster.Cluster import pekko.cluster.ddata.Replicator._ @@ -28,6 +26,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object ReplicatorMapDeltaSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorORSetDeltaSpec.scala b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorORSetDeltaSpec.scala index 638feb968d..2ad05a63d4 100644 --- a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorORSetDeltaSpec.scala +++ b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorORSetDeltaSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.ddata import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.cluster.Cluster import pekko.remote.testconductor.RoleName @@ -25,6 +23,8 @@ import pekko.remote.testkit.MultiNodeSpec import pekko.remote.transport.ThrottlerTransportAdapter.Direction import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object ReplicatorORSetDeltaSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorPruningSpec.scala b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorPruningSpec.scala index a9445e04d8..477ce85b43 100644 --- a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorPruningSpec.scala +++ b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorPruningSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.ddata import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.cluster.Cluster import pekko.cluster.ClusterEvent.InitialStateAsEvents @@ -26,6 +24,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.MultiNodeSpec import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object ReplicatorPruningSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorSpec.scala b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorSpec.scala index 47cd9177c6..7e0e52a191 100644 --- a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorSpec.scala +++ b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/ReplicatorSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.cluster.ddata import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.cluster.Cluster import pekko.pattern.ask @@ -28,6 +26,8 @@ import pekko.remote.transport.ThrottlerTransportAdapter.Direction import pekko.testkit._ import pekko.util.Timeout +import com.typesafe.config.ConfigFactory + object ReplicatorSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/STMultiNodeSpec.scala b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/STMultiNodeSpec.scala index e1c4ce0aca..cac02ef8be 100644 --- a/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/STMultiNodeSpec.scala +++ b/distributed-data/src/multi-jvm/scala/org/apache/pekko/cluster/ddata/STMultiNodeSpec.scala @@ -13,12 +13,12 @@ package org.apache.pekko.cluster.ddata +import org.apache.pekko.remote.testkit.MultiNodeSpecCallbacks + import org.scalatest.BeforeAndAfterAll import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpecLike -import org.apache.pekko.remote.testkit.MultiNodeSpecCallbacks - /** * Hooks up MultiNodeSpec with ScalaTest */ diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/DataEnvelopeSpec.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/DataEnvelopeSpec.scala index e58535c011..7879ee501c 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/DataEnvelopeSpec.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/DataEnvelopeSpec.scala @@ -13,14 +13,14 @@ package org.apache.pekko.cluster.ddata -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.Address import pekko.cluster.UniqueAddress import pekko.cluster.ddata.Replicator.Internal.DataEnvelope +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class DataEnvelopeSpec extends AnyWordSpec with Matchers { import PruningState._ diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/DeltaPropagationSelectorSpec.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/DeltaPropagationSelectorSpec.scala index f0f8a74525..c3afff1661 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/DeltaPropagationSelectorSpec.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/DeltaPropagationSelectorSpec.scala @@ -14,8 +14,6 @@ package org.apache.pekko.cluster.ddata import org.scalactic.TypeCheckedTripleEquals -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec import org.apache.pekko import pekko.actor.Address @@ -26,6 +24,9 @@ import pekko.cluster.ddata.Replicator.Internal.Delta import pekko.cluster.ddata.Replicator.Internal.DeltaPropagation import pekko.cluster.ddata.Replicator.Internal.DeltaPropagation.NoDeltaPlaceholder +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + object DeltaPropagationSelectorSpec { class TestSelector(val selfUniqueAddress: UniqueAddress, override val allNodes: Vector[UniqueAddress]) extends DeltaPropagationSelector { diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/FlagSpec.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/FlagSpec.scala index 639d1b1c4b..1b0f3ba04f 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/FlagSpec.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/FlagSpec.scala @@ -13,11 +13,11 @@ package org.apache.pekko.cluster.ddata +import org.apache.pekko.cluster.ddata.Replicator.Changed + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import org.apache.pekko.cluster.ddata.Replicator.Changed - class FlagSpec extends AnyWordSpec with Matchers { "A Flag" must { diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/GCounterSpec.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/GCounterSpec.scala index 5042544890..398dcb76ad 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/GCounterSpec.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/GCounterSpec.scala @@ -13,14 +13,14 @@ package org.apache.pekko.cluster.ddata -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.Address import pekko.cluster.UniqueAddress import pekko.cluster.ddata.Replicator.Changed +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class GCounterSpec extends AnyWordSpec with Matchers { val node1 = UniqueAddress(Address("pekko", "Sys", "localhost", 7354), 1L) val node2 = UniqueAddress(node1.address.copy(port = Some(7355)), 2L) diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/GSetSpec.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/GSetSpec.scala index af8675ddfe..da1fc197c2 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/GSetSpec.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/GSetSpec.scala @@ -13,11 +13,11 @@ package org.apache.pekko.cluster.ddata +import org.apache.pekko.cluster.ddata.Replicator.Changed + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import org.apache.pekko.cluster.ddata.Replicator.Changed - class GSetSpec extends AnyWordSpec with Matchers { val user1 = """{"username":"john","password":"coltrane"}""" diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/LWWMapSpec.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/LWWMapSpec.scala index e9ec2691df..7e5fc41eb7 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/LWWMapSpec.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/LWWMapSpec.scala @@ -13,14 +13,14 @@ package org.apache.pekko.cluster.ddata -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.Address import pekko.cluster.UniqueAddress import pekko.cluster.ddata.Replicator.Changed +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class LWWMapSpec extends AnyWordSpec with Matchers { import LWWRegister.defaultClock diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/LWWRegisterSpec.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/LWWRegisterSpec.scala index 165788c8e9..d75e4377f9 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/LWWRegisterSpec.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/LWWRegisterSpec.scala @@ -13,14 +13,14 @@ package org.apache.pekko.cluster.ddata -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.Address import pekko.cluster.UniqueAddress import pekko.cluster.ddata.Replicator.Changed +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class LWWRegisterSpec extends AnyWordSpec with Matchers { import LWWRegister.defaultClock diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/LocalConcurrencySpec.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/LocalConcurrencySpec.scala index ceb966f545..3f7d66abe7 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/LocalConcurrencySpec.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/LocalConcurrencySpec.scala @@ -13,11 +13,6 @@ package org.apache.pekko.cluster.ddata -import com.typesafe.config.ConfigFactory -import org.scalatest.BeforeAndAfterAll -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorSystem @@ -26,6 +21,12 @@ import pekko.actor.Stash import pekko.testkit.ImplicitSender import pekko.testkit.TestKit +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + object LocalConcurrencySpec { final case class Add(s: String) diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/LotsOfDataBot.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/LotsOfDataBot.scala index 723e5ed914..7e5bb5b029 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/LotsOfDataBot.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/LotsOfDataBot.scala @@ -17,14 +17,14 @@ import java.util.concurrent.ThreadLocalRandom import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorLogging import pekko.actor.ActorSystem import pekko.actor.Props +import com.typesafe.config.ConfigFactory + /** * This "sample" simulates lots of data entries, and can be used for * optimizing replication (e.g. catch-up when adding more nodes). diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/ORMapSpec.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/ORMapSpec.scala index cb280c203a..152840c726 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/ORMapSpec.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/ORMapSpec.scala @@ -13,15 +13,15 @@ package org.apache.pekko.cluster.ddata -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.Address import pekko.cluster.UniqueAddress import pekko.cluster.ddata.ORSet.AddDeltaOp import pekko.cluster.ddata.Replicator.Changed +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class ORMapSpec extends AnyWordSpec with Matchers { val node1 = UniqueAddress(Address("pekko", "Sys", "localhost", 7354), 1L) diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/ORMultiMapSpec.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/ORMultiMapSpec.scala index db0aa3fd33..e8c8b343b6 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/ORMultiMapSpec.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/ORMultiMapSpec.scala @@ -13,14 +13,14 @@ package org.apache.pekko.cluster.ddata -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.Address import pekko.cluster.UniqueAddress import pekko.cluster.ddata.Replicator.Changed +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class ORMultiMapSpec extends AnyWordSpec with Matchers { val node1 = UniqueAddress(Address("pekko", "Sys", "localhost", 7354), 1L) diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/ORSetSpec.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/ORSetSpec.scala index feed93496f..d56f02db71 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/ORSetSpec.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/ORSetSpec.scala @@ -15,14 +15,14 @@ package org.apache.pekko.cluster.ddata import scala.collection.immutable.TreeMap -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.Address import pekko.cluster.UniqueAddress import pekko.cluster.ddata.Replicator.Changed +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class ORSetSpec extends AnyWordSpec with Matchers { val node1 = UniqueAddress(Address("pekko", "Sys", "localhost", 7354), 1L) diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/PNCounterMapSpec.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/PNCounterMapSpec.scala index d0961e70e3..57ad7fde6a 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/PNCounterMapSpec.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/PNCounterMapSpec.scala @@ -13,14 +13,14 @@ package org.apache.pekko.cluster.ddata -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.Address import pekko.cluster.UniqueAddress import pekko.cluster.ddata.Replicator.Changed +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class PNCounterMapSpec extends AnyWordSpec with Matchers { val node1 = UniqueAddress(Address("pekko", "Sys", "localhost", 7354), 1L) diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/PNCounterSpec.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/PNCounterSpec.scala index 6bcb2de347..f46ddd3e3c 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/PNCounterSpec.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/PNCounterSpec.scala @@ -13,14 +13,14 @@ package org.apache.pekko.cluster.ddata -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.Address import pekko.cluster.UniqueAddress import pekko.cluster.ddata.Replicator.Changed +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class PNCounterSpec extends AnyWordSpec with Matchers { val node1 = UniqueAddress(Address("pekko", "Sys", "localhost", 7354), 1L) val node2 = UniqueAddress(node1.address.copy(port = Some(7355)), 2L) diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/PruningStateSpec.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/PruningStateSpec.scala index 87e6409886..be3b714d5d 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/PruningStateSpec.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/PruningStateSpec.scala @@ -13,13 +13,13 @@ package org.apache.pekko.cluster.ddata -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.Address import pekko.cluster.UniqueAddress +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + class PruningStateSpec extends AnyWordSpec with Matchers { import PruningState._ diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/ReplicatorSettingsSpec.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/ReplicatorSettingsSpec.scala index e183e38b22..17b02d371f 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/ReplicatorSettingsSpec.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/ReplicatorSettingsSpec.scala @@ -13,11 +13,12 @@ package org.apache.pekko.cluster.ddata -import com.typesafe.config.ConfigFactory +import org.apache.pekko.testkit.PekkoSpec + import org.scalatest.BeforeAndAfterAll import org.scalatest.wordspec.AnyWordSpecLike -import org.apache.pekko.testkit.PekkoSpec +import com.typesafe.config.ConfigFactory object ReplicatorSettingsSpec { diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/VersionVectorSpec.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/VersionVectorSpec.scala index ad1e871d45..c8c726979c 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/VersionVectorSpec.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/VersionVectorSpec.scala @@ -13,16 +13,16 @@ package org.apache.pekko.cluster.ddata -import org.scalatest.BeforeAndAfterAll -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.ActorSystem import pekko.actor.Address import pekko.cluster.UniqueAddress import pekko.testkit.TestKit +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + class VersionVectorSpec extends TestKit(ActorSystem("VersionVectorSpec")) with AnyWordSpecLike diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializerSpec.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializerSpec.scala index 66116ed193..481b199a0d 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializerSpec.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializerSpec.scala @@ -13,11 +13,6 @@ package org.apache.pekko.cluster.ddata.protobuf -import com.typesafe.config.ConfigFactory -import org.scalatest.BeforeAndAfterAll -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.ActorIdentity import pekko.actor.ActorRef @@ -35,6 +30,12 @@ import pekko.remote.RARP import pekko.testkit.TestActors import pekko.testkit.TestKit +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + class ReplicatedDataSerializerSpec extends TestKit( ActorSystem( diff --git a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatorMessageSerializerSpec.scala b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatorMessageSerializerSpec.scala index c1a0212e0d..bdc84a55e1 100644 --- a/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatorMessageSerializerSpec.scala +++ b/distributed-data/src/test/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatorMessageSerializerSpec.scala @@ -15,11 +15,6 @@ package org.apache.pekko.cluster.ddata.protobuf import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.BeforeAndAfterAll -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.ActorSystem import pekko.actor.Address @@ -41,6 +36,12 @@ import pekko.remote.RARP import pekko.testkit.TestKit import pekko.util.{ unused, ByteString } +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + class ReplicatorMessageSerializerSpec extends TestKit( ActorSystem( diff --git a/docs/src/test/scala/docs/actor/io/dns/DnsCompileOnlyDocSpec.scala b/docs/src/test/scala/docs/actor/io/dns/DnsCompileOnlyDocSpec.scala index 804785aaf6..c418091058 100644 --- a/docs/src/test/scala/docs/actor/io/dns/DnsCompileOnlyDocSpec.scala +++ b/docs/src/test/scala/docs/actor/io/dns/DnsCompileOnlyDocSpec.scala @@ -13,12 +13,13 @@ package docs.actor.io.dns -import org.apache.pekko.actor.{ ActorRef, ActorSystem } -import org.apache.pekko.io.dns.DnsProtocol -import org.apache.pekko.io.dns.DnsProtocol.Srv -import org.apache.pekko.pattern.ask -import org.apache.pekko.io.{ Dns, IO } -import org.apache.pekko.util.Timeout +import org.apache.pekko +import pekko.actor.{ ActorRef, ActorSystem } +import pekko.io.dns.DnsProtocol +import pekko.io.dns.DnsProtocol.Srv +import pekko.pattern.ask +import pekko.io.{ Dns, IO } +import pekko.util.Timeout import scala.concurrent.Future import scala.concurrent.duration._ diff --git a/docs/src/test/scala/docs/io/EchoServer.scala b/docs/src/test/scala/docs/io/EchoServer.scala index f207c3f817..83076bcffe 100644 --- a/docs/src/test/scala/docs/io/EchoServer.scala +++ b/docs/src/test/scala/docs/io/EchoServer.scala @@ -16,9 +16,11 @@ package docs.io import java.net.InetSocketAddress import com.typesafe.config.ConfigFactory -import org.apache.pekko.actor.{ Actor, ActorLogging, ActorRef, ActorSystem, Props, SupervisorStrategy } -import org.apache.pekko.io.{ IO, Tcp } -import org.apache.pekko.util.ByteString + +import org.apache.pekko +import pekko.actor.{ Actor, ActorLogging, ActorRef, ActorSystem, Props, SupervisorStrategy } +import pekko.io.{ IO, Tcp } +import pekko.util.ByteString import scala.io.StdIn diff --git a/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/Conductor.scala b/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/Conductor.scala index 92e7e2ea67..303e09b8c9 100644 --- a/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/Conductor.scala +++ b/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/Conductor.scala @@ -24,8 +24,6 @@ import scala.reflect.classTag import scala.util.control.NoStackTrace import RemoteConnection.getAddrString -import io.netty.channel.{ Channel, ChannelHandlerContext, ChannelInboundHandlerAdapter } -import io.netty.channel.ChannelHandler.Sharable import org.apache.pekko import pekko.ConfigurationException @@ -49,6 +47,9 @@ import pekko.pattern.ask import pekko.remote.transport.ThrottlerTransportAdapter.Direction import pekko.util.Timeout +import io.netty.channel.{ Channel, ChannelHandlerContext, ChannelInboundHandlerAdapter } +import io.netty.channel.ChannelHandler.Sharable + /** * The conductor is the one orchestrating the test: it governs the * [[pekko.remote.testconductor.Controller]]’s port to which all diff --git a/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/DataTypes.scala b/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/DataTypes.scala index 65edfc1105..ae2d0a38ad 100644 --- a/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/DataTypes.scala +++ b/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/DataTypes.scala @@ -15,15 +15,17 @@ package org.apache.pekko.remote.testconductor import scala.concurrent.duration._ -import io.netty.channel.ChannelHandlerContext -import io.netty.handler.codec.{ MessageToMessageDecoder, MessageToMessageEncoder } import language.implicitConversions + import org.apache.pekko import pekko.actor.Address import pekko.remote.testconductor.{ TestConductorProtocol => TCP } import pekko.remote.testconductor.TestConductorProtocol.BarrierOp import pekko.remote.transport.ThrottlerTransportAdapter.Direction +import io.netty.channel.ChannelHandlerContext +import io.netty.handler.codec.{ MessageToMessageDecoder, MessageToMessageEncoder } + final case class RoleName(name: String) private[pekko] final case class ToClient(msg: ClientOp with NetworkOp) diff --git a/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/Extension.scala b/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/Extension.scala index cf64170b2e..9fead03ea5 100644 --- a/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/Extension.scala +++ b/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/Extension.scala @@ -13,8 +13,6 @@ package org.apache.pekko.remote.testconductor -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.{ ActorContext, ActorSystem, ExtendedActorSystem, Extension, ExtensionId, ExtensionIdProvider } import pekko.actor.ClassicActorSystemProvider @@ -22,6 +20,8 @@ import pekko.dispatch.ThreadPoolConfig import pekko.remote.RemoteActorRefProvider import pekko.util.Timeout +import com.typesafe.config.Config + /** * Access to the [[pekko.remote.testconductor.TestConductorExt]] extension: * diff --git a/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/Player.scala b/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/Player.scala index 148bd8f953..443f3609e4 100644 --- a/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/Player.scala +++ b/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/Player.scala @@ -26,9 +26,6 @@ import scala.util.{ Failure, Success, Try } import scala.util.control.NoStackTrace import scala.util.control.NonFatal -import io.netty.channel.{ Channel, ChannelHandlerContext, ChannelInboundHandlerAdapter } -import io.netty.channel.ChannelHandler.Sharable - import org.apache.pekko import pekko.actor._ import pekko.dispatch.{ RequiresMessageQueue, UnboundedMessageQueueSemantics } @@ -38,6 +35,9 @@ import pekko.remote.testconductor.RemoteConnection.getAddrString import pekko.remote.transport.ThrottlerTransportAdapter.{ Blackhole, SetThrottle, TokenBucket, Unthrottled } import pekko.util.Timeout +import io.netty.channel.{ Channel, ChannelHandlerContext, ChannelInboundHandlerAdapter } +import io.netty.channel.ChannelHandler.Sharable + object Player { final class Waiter extends Actor with RequiresMessageQueue[UnboundedMessageQueueSemantics] { diff --git a/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/RemoteConnection.scala b/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/RemoteConnection.scala index db5fc70066..ae9504934b 100644 --- a/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/RemoteConnection.scala +++ b/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/RemoteConnection.scala @@ -18,6 +18,10 @@ import java.util.concurrent.TimeUnit import scala.util.control.NonFatal +import org.apache.pekko +import pekko.protobufv3.internal.Message +import pekko.util.Helpers + import io.netty.bootstrap.{ Bootstrap, ServerBootstrap } import io.netty.buffer.{ ByteBuf, ByteBufUtil } import io.netty.channel._ @@ -32,10 +36,6 @@ import io.netty.handler.codec.{ MessageToMessageEncoder } -import org.apache.pekko -import pekko.protobufv3.internal.Message -import pekko.util.Helpers - /** * INTERNAL API. */ diff --git a/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testkit/MultiNodeSpec.scala b/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testkit/MultiNodeSpec.scala index f1d3615ccd..a69e509780 100644 --- a/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testkit/MultiNodeSpec.scala +++ b/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testkit/MultiNodeSpec.scala @@ -20,9 +20,8 @@ import scala.concurrent.{ Await, Awaitable } import scala.concurrent.duration._ import scala.util.control.NonFatal -import com.typesafe.config.{ Config, ConfigFactory, ConfigObject } -import io.netty.channel.ChannelException import language.implicitConversions + import org.apache.pekko import pekko.actor._ import pekko.actor.RootActorPath @@ -35,6 +34,10 @@ import pekko.testkit.TestEvent._ import pekko.testkit.TestKit import pekko.util.Timeout +import io.netty.channel.ChannelException + +import com.typesafe.config.{ Config, ConfigFactory, ConfigObject } + /** * Configure the role names and participants of the test, including configuration settings. */ diff --git a/osgi/src/main/scala/org/apache/pekko/osgi/ActorSystemActivator.scala b/osgi/src/main/scala/org/apache/pekko/osgi/ActorSystemActivator.scala index 12536c0326..fbcbe7fd36 100644 --- a/osgi/src/main/scala/org/apache/pekko/osgi/ActorSystemActivator.scala +++ b/osgi/src/main/scala/org/apache/pekko/osgi/ActorSystemActivator.scala @@ -15,7 +15,6 @@ package org.apache.pekko.osgi import java.util.{ Dictionary, Properties } -import com.typesafe.config.{ Config, ConfigFactory } import org.osgi.framework._ import org.osgi.service.log.LogService @@ -23,6 +22,8 @@ import org.apache.pekko import pekko.actor.{ ActorRefFactory, ActorSystem } import pekko.util.unused +import com.typesafe.config.{ Config, ConfigFactory } + /** * Abstract bundle activator implementation to bootstrap and configure an actor system in an * OSGi environment. It also provides a convenience method to register the actor system in diff --git a/osgi/src/main/scala/org/apache/pekko/osgi/BundleDelegatingClassLoader.scala b/osgi/src/main/scala/org/apache/pekko/osgi/BundleDelegatingClassLoader.scala index 97c9346cc0..2423fd1e41 100644 --- a/osgi/src/main/scala/org/apache/pekko/osgi/BundleDelegatingClassLoader.scala +++ b/osgi/src/main/scala/org/apache/pekko/osgi/BundleDelegatingClassLoader.scala @@ -17,6 +17,7 @@ import java.net.URL import java.util.Enumeration import scala.annotation.tailrec +import scala.jdk.CollectionConverters._ import scala.util.Failure import scala.util.Success import scala.util.Try @@ -24,8 +25,6 @@ import scala.util.Try import org.osgi.framework.{ Bundle, BundleContext } import org.osgi.framework.wiring.{ BundleRevision, BundleWire, BundleWiring } -import scala.jdk.CollectionConverters._ - /* * Companion object to create bundle delegating ClassLoader instances */ diff --git a/osgi/src/main/scala/org/apache/pekko/osgi/OsgiActorSystemFactory.scala b/osgi/src/main/scala/org/apache/pekko/osgi/OsgiActorSystemFactory.scala index 5b5c319e87..ec2ac267f1 100644 --- a/osgi/src/main/scala/org/apache/pekko/osgi/OsgiActorSystemFactory.scala +++ b/osgi/src/main/scala/org/apache/pekko/osgi/OsgiActorSystemFactory.scala @@ -13,13 +13,14 @@ package org.apache.pekko.osgi -import com.typesafe.config.{ Config, ConfigFactory } import org.osgi.framework.BundleContext import org.apache.pekko import pekko.actor.ActorSystem import pekko.util.unused +import com.typesafe.config.{ Config, ConfigFactory } + /** * Factory class to create ActorSystem implementations in an OSGi environment. This mainly involves dealing with * bundle classloaders appropriately to ensure that configuration files and classes get loaded properly diff --git a/osgi/src/test/scala/org/apache/pekko/osgi/ActorSystemActivatorTest.scala b/osgi/src/test/scala/org/apache/pekko/osgi/ActorSystemActivatorTest.scala index 2b73242f16..9ea5d3f924 100644 --- a/osgi/src/test/scala/org/apache/pekko/osgi/ActorSystemActivatorTest.scala +++ b/osgi/src/test/scala/org/apache/pekko/osgi/ActorSystemActivatorTest.scala @@ -19,8 +19,6 @@ import scala.concurrent.duration._ import PojoSRTestSupport.bundle import de.kalpatec.pojosr.framework.launch.BundleDescriptor -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec import test.{ PingPongActorSystemActivator, RuntimeNameActorSystemActivator, TestActivators } import test.PingPong._ @@ -29,6 +27,9 @@ import pekko.actor.ActorSystem import pekko.pattern.ask import pekko.util.Timeout +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + /** * Test cases for [[pekko.osgi.ActorSystemActivator]] in 2 different scenarios: * - no name configured for [[pekko.actor.ActorSystem]] diff --git a/osgi/src/test/scala/org/apache/pekko/osgi/PojoSRTestSupport.scala b/osgi/src/test/scala/org/apache/pekko/osgi/PojoSRTestSupport.scala index 621e9c62fe..5469a3facf 100644 --- a/osgi/src/test/scala/org/apache/pekko/osgi/PojoSRTestSupport.scala +++ b/osgi/src/test/scala/org/apache/pekko/osgi/PojoSRTestSupport.scala @@ -21,14 +21,14 @@ import java.util.jar.JarInputStream import scala.annotation.{ nowarn, tailrec } import scala.collection.immutable import scala.concurrent.duration._ +import scala.jdk.CollectionConverters._ import scala.reflect.ClassTag import de.kalpatec.pojosr.framework.launch.{ BundleDescriptor, ClasspathScanner, PojoServiceRegistryFactory } import org.apache.commons.io.IOUtils.copy import org.osgi.framework._ -import org.scalatest.{ BeforeAndAfterAll, Suite } -import scala.jdk.CollectionConverters._ +import org.scalatest.{ BeforeAndAfterAll, Suite } /** * Trait that provides support for building pekko-osgi tests using PojoSR diff --git a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/EventEnvelope.scala b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/EventEnvelope.scala index 2a91f29e71..c067e992c2 100644 --- a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/EventEnvelope.scala +++ b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/EventEnvelope.scala @@ -16,6 +16,7 @@ package org.apache.pekko.persistence.query import java.util.Optional import scala.runtime.AbstractFunction5 + import org.apache.pekko import pekko.annotation.InternalApi import pekko.util.HashCode diff --git a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/PersistenceQuery.scala b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/PersistenceQuery.scala index 02325bdd8a..89ea9cca07 100644 --- a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/PersistenceQuery.scala +++ b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/PersistenceQuery.scala @@ -15,8 +15,6 @@ package org.apache.pekko.persistence.query import scala.reflect.ClassTag -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.actor._ import pekko.annotation.InternalApi @@ -24,6 +22,8 @@ import pekko.persistence.{ PersistencePlugin, PluginProvider } import pekko.persistence.query.scaladsl.ReadJournal import pekko.util.unused +import com.typesafe.config.{ Config, ConfigFactory } + /** * Persistence extension for queries. */ diff --git a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/internal/QuerySerializer.scala b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/internal/QuerySerializer.scala index 51b0ec2ccb..f024f50aaf 100644 --- a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/internal/QuerySerializer.scala +++ b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/internal/QuerySerializer.scala @@ -18,7 +18,9 @@ import java.nio.charset.StandardCharsets.UTF_8 import java.time.Instant import java.util.Base64 import java.util.UUID + import scala.util.control.NonFatal + import org.apache.pekko import pekko.annotation.InternalApi import pekko.event.Logging diff --git a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/javadsl/DurableStateStoreQuery.scala b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/javadsl/DurableStateStoreQuery.scala index 826840403c..54a63f259a 100644 --- a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/javadsl/DurableStateStoreQuery.scala +++ b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/javadsl/DurableStateStoreQuery.scala @@ -15,9 +15,9 @@ package org.apache.pekko.persistence.query.javadsl import org.apache.pekko import pekko.NotUsed -import pekko.persistence.state.javadsl.DurableStateStore import pekko.persistence.query.DurableStateChange import pekko.persistence.query.Offset +import pekko.persistence.state.javadsl.DurableStateStore import pekko.stream.javadsl.Source /** diff --git a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/Buffer.scala b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/Buffer.scala index 2238e305cc..163007895e 100644 --- a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/Buffer.scala +++ b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/Buffer.scala @@ -15,11 +15,12 @@ package org.apache.pekko.persistence.query.journal.leveldb import java.util +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.annotation.InternalApi import pekko.stream.Outlet import pekko.stream.stage.GraphStageLogic -import scala.jdk.CollectionConverters._ /** * INTERNAL API diff --git a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByPersistenceIdStage.scala b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByPersistenceIdStage.scala index 2bc7f10ca6..cfd30c388d 100644 --- a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByPersistenceIdStage.scala +++ b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByPersistenceIdStage.scala @@ -14,6 +14,7 @@ package org.apache.pekko.persistence.query.journal.leveldb import scala.concurrent.duration.FiniteDuration + import org.apache.pekko import pekko.actor.ActorRef import pekko.annotation.InternalApi diff --git a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByTagStage.scala b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByTagStage.scala index 5d514ae575..32261327e9 100644 --- a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByTagStage.scala +++ b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByTagStage.scala @@ -14,6 +14,7 @@ package org.apache.pekko.persistence.query.journal.leveldb import scala.concurrent.duration.FiniteDuration + import org.apache.pekko import pekko.actor.ActorRef import pekko.annotation.InternalApi diff --git a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/LeveldbReadJournalProvider.scala b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/LeveldbReadJournalProvider.scala index 82bc690980..b15a4aa6c4 100644 --- a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/LeveldbReadJournalProvider.scala +++ b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/LeveldbReadJournalProvider.scala @@ -13,11 +13,12 @@ package org.apache.pekko.persistence.query.journal.leveldb -import com.typesafe.config.Config import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.persistence.query.ReadJournalProvider +import com.typesafe.config.Config + @deprecated("Use another journal/query implementation", "Akka 2.6.15") class LeveldbReadJournalProvider(system: ExtendedActorSystem, config: Config) extends ReadJournalProvider { diff --git a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/scaladsl/LeveldbReadJournal.scala b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/scaladsl/LeveldbReadJournal.scala index 9d1651a4b4..496f90cd02 100644 --- a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/scaladsl/LeveldbReadJournal.scala +++ b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/scaladsl/LeveldbReadJournal.scala @@ -17,8 +17,6 @@ import java.net.URLEncoder import scala.concurrent.duration._ -import com.typesafe.config.Config - import org.apache.pekko import pekko.NotUsed import pekko.actor.ExtendedActorSystem @@ -35,6 +33,8 @@ import pekko.persistence.query.scaladsl.ReadJournal import pekko.stream.scaladsl.Source import pekko.util.ByteString +import com.typesafe.config.Config + /** * Scala API [[pekko.persistence.query.scaladsl.ReadJournal]] implementation for LevelDB. * diff --git a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/scaladsl/DurableStateStoreQuery.scala b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/scaladsl/DurableStateStoreQuery.scala index 13155bf65a..aae8c84354 100644 --- a/persistence-query/src/main/scala/org/apache/pekko/persistence/query/scaladsl/DurableStateStoreQuery.scala +++ b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/scaladsl/DurableStateStoreQuery.scala @@ -16,8 +16,8 @@ package org.apache.pekko.persistence.query.scaladsl import org.apache.pekko import pekko.NotUsed import pekko.persistence.query.DurableStateChange -import pekko.persistence.state.scaladsl.DurableStateStore import pekko.persistence.query.Offset +import pekko.persistence.state.scaladsl.DurableStateStore import pekko.stream.scaladsl.Source /** diff --git a/persistence-query/src/test/scala/org/apache/pekko/persistence/query/DummyReadJournal.scala b/persistence-query/src/test/scala/org/apache/pekko/persistence/query/DummyReadJournal.scala index 0b7f3b6fe7..778c85cef0 100644 --- a/persistence-query/src/test/scala/org/apache/pekko/persistence/query/DummyReadJournal.scala +++ b/persistence-query/src/test/scala/org/apache/pekko/persistence/query/DummyReadJournal.scala @@ -13,14 +13,14 @@ package org.apache.pekko.persistence.query -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.NotUsed import pekko.actor.ExtendedActorSystem import pekko.stream.scaladsl.Source import pekko.util.unused +import com.typesafe.config.{ Config, ConfigFactory } + /** * Use for tests only! * Emits infinite stream of strings (representing queried for events). diff --git a/persistence-query/src/test/scala/org/apache/pekko/persistence/query/PersistenceQuerySpec.scala b/persistence-query/src/test/scala/org/apache/pekko/persistence/query/PersistenceQuerySpec.scala index d4f3a3913a..44e3323ef2 100644 --- a/persistence-query/src/test/scala/org/apache/pekko/persistence/query/PersistenceQuerySpec.scala +++ b/persistence-query/src/test/scala/org/apache/pekko/persistence/query/PersistenceQuerySpec.scala @@ -18,14 +18,15 @@ import java.util.concurrent.atomic.AtomicInteger import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigFactory } +import org.apache.pekko +import pekko.actor.ActorSystem +import pekko.persistence.journal.{ EventSeq, ReadEventAdapter } + import org.scalatest.BeforeAndAfterAll import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpecLike -import org.apache.pekko -import pekko.actor.ActorSystem -import pekko.persistence.journal.{ EventSeq, ReadEventAdapter } +import com.typesafe.config.{ Config, ConfigFactory } class PersistenceQuerySpec extends AnyWordSpecLike with Matchers with BeforeAndAfterAll { diff --git a/persistence-query/src/test/scala/org/apache/pekko/persistence/query/journal/leveldb/AllPersistenceIdsSpec.scala b/persistence-query/src/test/scala/org/apache/pekko/persistence/query/journal/leveldb/AllPersistenceIdsSpec.scala index f3c8a6783d..be349b166e 100644 --- a/persistence-query/src/test/scala/org/apache/pekko/persistence/query/journal/leveldb/AllPersistenceIdsSpec.scala +++ b/persistence-query/src/test/scala/org/apache/pekko/persistence/query/journal/leveldb/AllPersistenceIdsSpec.scala @@ -13,16 +13,16 @@ package org.apache.pekko.persistence.query.journal.leveldb +import scala.annotation.nowarn import scala.concurrent.duration._ + import org.apache.pekko import pekko.persistence.query.PersistenceQuery import pekko.persistence.query.journal.leveldb.scaladsl.LeveldbReadJournal import pekko.persistence.query.scaladsl.PersistenceIdsQuery import pekko.stream.testkit.scaladsl.TestSink -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender - -import scala.annotation.nowarn +import pekko.testkit.PekkoSpec object AllPersistenceIdsSpec { val config = """ diff --git a/persistence-query/src/test/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByPersistenceIdSpec.scala b/persistence-query/src/test/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByPersistenceIdSpec.scala index a4d29950b6..1489bc291f 100644 --- a/persistence-query/src/test/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByPersistenceIdSpec.scala +++ b/persistence-query/src/test/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByPersistenceIdSpec.scala @@ -13,7 +13,9 @@ package org.apache.pekko.persistence.query.journal.leveldb +import scala.annotation.nowarn import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.ActorRef import pekko.persistence.query.EventEnvelope @@ -21,10 +23,8 @@ import pekko.persistence.query.PersistenceQuery import pekko.persistence.query.journal.leveldb.scaladsl.LeveldbReadJournal import pekko.persistence.query.scaladsl.EventsByTagQuery import pekko.stream.testkit.scaladsl.TestSink -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender - -import scala.annotation.nowarn +import pekko.testkit.PekkoSpec object EventsByPersistenceIdSpec { val config = """ diff --git a/persistence-query/src/test/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByTagSpec.scala b/persistence-query/src/test/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByTagSpec.scala index 4c8e7d422c..e05887c928 100644 --- a/persistence-query/src/test/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByTagSpec.scala +++ b/persistence-query/src/test/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByTagSpec.scala @@ -13,7 +13,9 @@ package org.apache.pekko.persistence.query.journal.leveldb +import scala.annotation.nowarn import scala.concurrent.duration._ + import org.apache.pekko import pekko.persistence.journal.Tagged import pekko.persistence.journal.WriteEventAdapter @@ -24,10 +26,8 @@ import pekko.persistence.query.Sequence import pekko.persistence.query.journal.leveldb.scaladsl.LeveldbReadJournal import pekko.persistence.query.scaladsl.EventsByTagQuery import pekko.stream.testkit.scaladsl.TestSink -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender - -import scala.annotation.nowarn +import pekko.testkit.PekkoSpec object EventsByTagSpec { val config = s""" diff --git a/persistence-shared/src/test/scala/org/apache/pekko/persistence/journal/leveldb/PersistencePluginProxySpec.scala b/persistence-shared/src/test/scala/org/apache/pekko/persistence/journal/leveldb/PersistencePluginProxySpec.scala index c3fc0651e6..3364cfef33 100644 --- a/persistence-shared/src/test/scala/org/apache/pekko/persistence/journal/leveldb/PersistencePluginProxySpec.scala +++ b/persistence-shared/src/test/scala/org/apache/pekko/persistence/journal/leveldb/PersistencePluginProxySpec.scala @@ -13,14 +13,14 @@ package org.apache.pekko.persistence.journal.leveldb -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.persistence._ import pekko.persistence.journal.PersistencePluginProxy import pekko.testkit.{ PekkoSpec, TestProbe } +import com.typesafe.config.ConfigFactory + object PersistencePluginProxySpec { lazy val config = ConfigFactory.parseString(s""" diff --git a/persistence-shared/src/test/scala/org/apache/pekko/persistence/journal/leveldb/SharedLeveldbJournalSpec.scala b/persistence-shared/src/test/scala/org/apache/pekko/persistence/journal/leveldb/SharedLeveldbJournalSpec.scala index 149eaed5be..7d891bf1ef 100644 --- a/persistence-shared/src/test/scala/org/apache/pekko/persistence/journal/leveldb/SharedLeveldbJournalSpec.scala +++ b/persistence-shared/src/test/scala/org/apache/pekko/persistence/journal/leveldb/SharedLeveldbJournalSpec.scala @@ -14,12 +14,14 @@ package org.apache.pekko.persistence.journal.leveldb import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory + import org.apache.pekko import pekko.actor._ import pekko.persistence._ import pekko.testkit.{ PekkoSpec, TestProbe } +import com.typesafe.config.ConfigFactory + object SharedLeveldbJournalSpec { val config = ConfigFactory.parseString(s""" pekko { diff --git a/persistence-shared/src/test/scala/org/apache/pekko/persistence/serialization/SerializerSpec.scala b/persistence-shared/src/test/scala/org/apache/pekko/persistence/serialization/SerializerSpec.scala index bbadb24f9d..ae49b5dbfb 100644 --- a/persistence-shared/src/test/scala/org/apache/pekko/persistence/serialization/SerializerSpec.scala +++ b/persistence-shared/src/test/scala/org/apache/pekko/persistence/serialization/SerializerSpec.scala @@ -19,7 +19,6 @@ import java.util.UUID import scala.concurrent.Await import scala.concurrent.duration.Duration -import com.typesafe.config._ import org.apache.commons.codec.binary.Hex.{ decodeHex, encodeHex } import org.apache.pekko @@ -30,6 +29,8 @@ import pekko.serialization._ import pekko.testkit._ import pekko.util.ByteString.UTF_8 +import com.typesafe.config._ + object SerializerSpecConfigs { val customSerializers = ConfigFactory.parseString(""" diff --git a/persistence-tck/src/main/scala/org/apache/pekko/persistence/PluginSpec.scala b/persistence-tck/src/main/scala/org/apache/pekko/persistence/PluginSpec.scala index 053c9ef28d..3948c17222 100644 --- a/persistence-tck/src/main/scala/org/apache/pekko/persistence/PluginSpec.scala +++ b/persistence-tck/src/main/scala/org/apache/pekko/persistence/PluginSpec.scala @@ -18,14 +18,15 @@ import java.util.concurrent.atomic.AtomicInteger import scala.reflect.ClassTag -import com.typesafe.config._ +import org.apache.pekko +import pekko.actor._ +import pekko.testkit._ + import org.scalatest._ import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpecLike -import org.apache.pekko -import pekko.actor._ -import pekko.testkit._ +import com.typesafe.config._ abstract class PluginSpec(val config: Config) extends TestKitBase diff --git a/persistence-tck/src/main/scala/org/apache/pekko/persistence/TestSerializer.scala b/persistence-tck/src/main/scala/org/apache/pekko/persistence/TestSerializer.scala index 2cfd91b4e6..dd93ac4381 100644 --- a/persistence-tck/src/main/scala/org/apache/pekko/persistence/TestSerializer.scala +++ b/persistence-tck/src/main/scala/org/apache/pekko/persistence/TestSerializer.scala @@ -13,15 +13,15 @@ package org.apache.pekko.persistence +import java.io.NotSerializableException import java.nio.charset.StandardCharsets + import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ExtendedActorSystem import pekko.serialization.Serialization import pekko.serialization.SerializerWithStringManifest -import java.io.NotSerializableException - final case class TestPayload(ref: ActorRef) class TestSerializer(system: ExtendedActorSystem) extends SerializerWithStringManifest { diff --git a/persistence-tck/src/main/scala/org/apache/pekko/persistence/japi/journal/JavaJournalPerfSpec.scala b/persistence-tck/src/main/scala/org/apache/pekko/persistence/japi/journal/JavaJournalPerfSpec.scala index 1826a26699..1ea0b4865c 100644 --- a/persistence-tck/src/main/scala/org/apache/pekko/persistence/japi/journal/JavaJournalPerfSpec.scala +++ b/persistence-tck/src/main/scala/org/apache/pekko/persistence/japi/journal/JavaJournalPerfSpec.scala @@ -13,14 +13,16 @@ package org.apache.pekko.persistence.japi.journal -import com.typesafe.config.Config import org.scalactic.source.Position -import org.scalatest.Informer import org.apache.pekko import pekko.persistence.CapabilityFlag import pekko.persistence.journal.JournalPerfSpec +import org.scalatest.Informer + +import com.typesafe.config.Config + /** * JAVA API * diff --git a/persistence-tck/src/main/scala/org/apache/pekko/persistence/japi/journal/JavaJournalSpec.scala b/persistence-tck/src/main/scala/org/apache/pekko/persistence/japi/journal/JavaJournalSpec.scala index 35a0c7b02d..de63e3326b 100644 --- a/persistence-tck/src/main/scala/org/apache/pekko/persistence/japi/journal/JavaJournalSpec.scala +++ b/persistence-tck/src/main/scala/org/apache/pekko/persistence/japi/journal/JavaJournalSpec.scala @@ -15,12 +15,14 @@ package org.apache.pekko.persistence.japi.journal import scala.collection.immutable -import com.typesafe.config.Config import org.apache.pekko import pekko.persistence.CapabilityFlag import pekko.persistence.journal.JournalSpec + import org.scalatest.{ Args, ConfigMap, Filter, Status, Suite, TestData } +import com.typesafe.config.Config + /** * JAVA API * diff --git a/persistence-tck/src/main/scala/org/apache/pekko/persistence/japi/snapshot/JavaSnapshotStoreSpec.scala b/persistence-tck/src/main/scala/org/apache/pekko/persistence/japi/snapshot/JavaSnapshotStoreSpec.scala index 5ba0d1c1e8..fc1b45261a 100644 --- a/persistence-tck/src/main/scala/org/apache/pekko/persistence/japi/snapshot/JavaSnapshotStoreSpec.scala +++ b/persistence-tck/src/main/scala/org/apache/pekko/persistence/japi/snapshot/JavaSnapshotStoreSpec.scala @@ -15,12 +15,14 @@ package org.apache.pekko.persistence.japi.snapshot import scala.collection.immutable -import com.typesafe.config.Config import org.apache.pekko import pekko.persistence.CapabilityFlag import pekko.persistence.snapshot.SnapshotStoreSpec + import org.scalatest.{ Args, ConfigMap, Filter, Status, Suite, TestData } +import com.typesafe.config.Config + /** * JAVA API * diff --git a/persistence-tck/src/main/scala/org/apache/pekko/persistence/journal/JournalPerfSpec.scala b/persistence-tck/src/main/scala/org/apache/pekko/persistence/journal/JournalPerfSpec.scala index e72b540ccb..67e468e20c 100644 --- a/persistence-tck/src/main/scala/org/apache/pekko/persistence/journal/JournalPerfSpec.scala +++ b/persistence-tck/src/main/scala/org/apache/pekko/persistence/journal/JournalPerfSpec.scala @@ -18,9 +18,6 @@ import java.nio.charset.StandardCharsets import scala.collection.immutable import scala.concurrent.duration._ -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.ActorLogging import pekko.actor.ActorRef @@ -33,6 +30,9 @@ import pekko.persistence.journal.JournalPerfSpec.ResetCounter import pekko.serialization.SerializerWithStringManifest import pekko.testkit.TestProbe +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object JournalPerfSpec { class BenchActor(override val persistenceId: String, replyTo: ActorRef, replyAfter: Int) extends PersistentActor diff --git a/persistence-tck/src/main/scala/org/apache/pekko/persistence/journal/JournalSpec.scala b/persistence-tck/src/main/scala/org/apache/pekko/persistence/journal/JournalSpec.scala index dd6e216b31..9505e31f70 100644 --- a/persistence-tck/src/main/scala/org/apache/pekko/persistence/journal/JournalSpec.scala +++ b/persistence-tck/src/main/scala/org/apache/pekko/persistence/journal/JournalSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.persistence.journal import scala.concurrent.duration._ -import com.typesafe.config._ - import org.apache.pekko import pekko.actor._ import pekko.persistence._ @@ -25,6 +23,8 @@ import pekko.persistence.scalatest.{ MayVerb, OptionalTests } import pekko.testkit._ import pekko.util.unused +import com.typesafe.config._ + object JournalSpec { val config: Config = ConfigFactory.parseString(s""" pekko.persistence.publish-plugin-commands = on diff --git a/persistence-tck/src/main/scala/org/apache/pekko/persistence/scalatest/MayVerb.scala b/persistence-tck/src/main/scala/org/apache/pekko/persistence/scalatest/MayVerb.scala index ed95760fc3..72cc4202df 100644 --- a/persistence-tck/src/main/scala/org/apache/pekko/persistence/scalatest/MayVerb.scala +++ b/persistence-tck/src/main/scala/org/apache/pekko/persistence/scalatest/MayVerb.scala @@ -14,6 +14,7 @@ package org.apache.pekko.persistence.scalatest import org.scalactic.source.Position + import org.scalatest.exceptions.TestCanceledException import org.scalatest.verbs.StringVerbBlockRegistration diff --git a/persistence-tck/src/main/scala/org/apache/pekko/persistence/scalatest/OptionalTests.scala b/persistence-tck/src/main/scala/org/apache/pekko/persistence/scalatest/OptionalTests.scala index fe6371b730..67b5bce226 100644 --- a/persistence-tck/src/main/scala/org/apache/pekko/persistence/scalatest/OptionalTests.scala +++ b/persistence-tck/src/main/scala/org/apache/pekko/persistence/scalatest/OptionalTests.scala @@ -13,10 +13,10 @@ package org.apache.pekko.persistence.scalatest -import org.scalatest.Informing - import org.apache.pekko.persistence.CapabilityFlag +import org.scalatest.Informing + trait OptionalTests { this: Informing => diff --git a/persistence-tck/src/main/scala/org/apache/pekko/persistence/snapshot/SnapshotStoreSpec.scala b/persistence-tck/src/main/scala/org/apache/pekko/persistence/snapshot/SnapshotStoreSpec.scala index 9f985ee505..464bb84d0b 100644 --- a/persistence-tck/src/main/scala/org/apache/pekko/persistence/snapshot/SnapshotStoreSpec.scala +++ b/persistence-tck/src/main/scala/org/apache/pekko/persistence/snapshot/SnapshotStoreSpec.scala @@ -15,9 +15,6 @@ package org.apache.pekko.persistence.snapshot import scala.collection.immutable.Seq -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.persistence._ @@ -25,6 +22,9 @@ import pekko.persistence.SnapshotProtocol._ import pekko.persistence.scalatest.{ MayVerb, OptionalTests } import pekko.testkit.TestProbe +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object SnapshotStoreSpec { val config: Config = ConfigFactory.parseString(s""" pekko.persistence.publish-plugin-commands = on diff --git a/persistence-tck/src/test/scala/org/apache/pekko/persistence/PluginCleanup.scala b/persistence-tck/src/test/scala/org/apache/pekko/persistence/PluginCleanup.scala index fc15db9d91..c2750e01ed 100644 --- a/persistence-tck/src/test/scala/org/apache/pekko/persistence/PluginCleanup.scala +++ b/persistence-tck/src/test/scala/org/apache/pekko/persistence/PluginCleanup.scala @@ -16,6 +16,7 @@ package org.apache.pekko.persistence import java.io.File import org.apache.commons.io.FileUtils + import org.scalatest.BeforeAndAfterAll trait PluginCleanup extends BeforeAndAfterAll { self: PluginSpec => diff --git a/persistence-tck/src/test/scala/org/apache/pekko/persistence/japi/JavaJournalSpecSpec.scala b/persistence-tck/src/test/scala/org/apache/pekko/persistence/japi/JavaJournalSpecSpec.scala index 6917d3b975..ff2e35703f 100644 --- a/persistence-tck/src/test/scala/org/apache/pekko/persistence/japi/JavaJournalSpecSpec.scala +++ b/persistence-tck/src/test/scala/org/apache/pekko/persistence/japi/JavaJournalSpecSpec.scala @@ -13,10 +13,11 @@ package org.apache.pekko.persistence.japi -import com.typesafe.config.ConfigFactory +import org.apache.pekko.persistence.japi.journal.JavaJournalSpec + import org.scalatest.DoNotDiscover -import org.apache.pekko.persistence.japi.journal.JavaJournalSpec +import com.typesafe.config.ConfigFactory /* Only checking that compilation works with the constructor here as expected (no other abstract fields leaked) */ @DoNotDiscover diff --git a/persistence-tck/src/test/scala/org/apache/pekko/persistence/snapshot/local/LocalSnapshotStoreSpec.scala b/persistence-tck/src/test/scala/org/apache/pekko/persistence/snapshot/local/LocalSnapshotStoreSpec.scala index c3e2b96dec..b3559153db 100644 --- a/persistence-tck/src/test/scala/org/apache/pekko/persistence/snapshot/local/LocalSnapshotStoreSpec.scala +++ b/persistence-tck/src/test/scala/org/apache/pekko/persistence/snapshot/local/LocalSnapshotStoreSpec.scala @@ -13,13 +13,13 @@ package org.apache.pekko.persistence.snapshot.local -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.persistence.CapabilityFlag import pekko.persistence.PluginCleanup import pekko.persistence.snapshot.SnapshotStoreSpec +import com.typesafe.config.ConfigFactory + class LocalSnapshotStoreSpec extends SnapshotStoreSpec( config = diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/EventStorage.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/EventStorage.scala index 6b35612212..e116549fb8 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/EventStorage.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/EventStorage.scala @@ -13,20 +13,20 @@ package org.apache.pekko.persistence.testkit -import org.apache.pekko -import pekko.NotUsed import java.util.{ List => JList } import scala.collection.immutable +import scala.jdk.CollectionConverters._ import scala.util.{ Failure, Success, Try } +import org.apache.pekko +import pekko.NotUsed import pekko.annotation.InternalApi import pekko.persistence.PersistentRepr import pekko.persistence.journal.Tagged import pekko.persistence.testkit.ProcessingPolicy.DefaultPolicies import pekko.persistence.testkit.internal.TestKitStorage import pekko.stream.scaladsl.Source -import scala.jdk.CollectionConverters._ /** * INTERNAL API diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/PersistenceTestKitPlugin.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/PersistenceTestKitPlugin.scala index e42cc92beb..5729ac262f 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/PersistenceTestKitPlugin.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/PersistenceTestKitPlugin.scala @@ -13,23 +13,23 @@ package org.apache.pekko.persistence.testkit -import org.apache.pekko -import pekko.actor.ActorLogging import scala.collection.immutable import scala.concurrent.Future import scala.util.Try -import com.typesafe.config.{ Config, ConfigFactory } - +import org.apache.pekko +import pekko.actor.ActorLogging import pekko.annotation.InternalApi import pekko.persistence._ import pekko.persistence.journal.AsyncWriteJournal import pekko.persistence.journal.Tagged import pekko.persistence.snapshot.SnapshotStore -import pekko.persistence.testkit.internal.CurrentTime import pekko.persistence.testkit.internal.{ InMemStorageExtension, SnapshotStorageEmulatorExtension } +import pekko.persistence.testkit.internal.CurrentTime import pekko.util.unused +import com.typesafe.config.{ Config, ConfigFactory } + /** * INTERNAL API * diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/ProcessingPolicy.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/ProcessingPolicy.scala index 1d7c0bc021..ea11b13199 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/ProcessingPolicy.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/ProcessingPolicy.scala @@ -13,10 +13,10 @@ package org.apache.pekko.persistence.testkit -import org.apache.pekko.annotation.{ ApiMayChange, InternalApi } - import scala.util.control.NoStackTrace +import org.apache.pekko.annotation.{ ApiMayChange, InternalApi } + /** * Policies allow to emulate behavior of the storage (failures and rejections). * diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/SnapshotStorage.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/SnapshotStorage.scala index 0a4d9b1ac2..438a9df687 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/SnapshotStorage.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/SnapshotStorage.scala @@ -13,10 +13,10 @@ package org.apache.pekko.persistence.testkit +import scala.util.Success + import org.apache.pekko import pekko.actor.Extension - -import scala.util.Success import pekko.annotation.InternalApi import pekko.persistence.{ SelectedSnapshot, SnapshotMetadata, SnapshotSelectionCriteria } import pekko.persistence.testkit.ProcessingPolicy.DefaultPolicies diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/EventSourcedBehaviorTestKitImpl.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/EventSourcedBehaviorTestKitImpl.scala index fb95f40636..654408a7ee 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/EventSourcedBehaviorTestKitImpl.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/EventSourcedBehaviorTestKitImpl.scala @@ -17,6 +17,7 @@ import scala.collection.immutable import scala.concurrent.Await import scala.reflect.ClassTag import scala.util.control.NonFatal + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.ActorTestKit import pekko.actor.testkit.typed.scaladsl.SerializationTestKit diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/InMemStorageExtension.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/InMemStorageExtension.scala index 3846ebd649..d529e254f4 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/InMemStorageExtension.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/InMemStorageExtension.scala @@ -16,8 +16,8 @@ package org.apache.pekko.persistence.testkit.internal import java.util.concurrent.ConcurrentHashMap import org.apache.pekko -import pekko.actor.Extension import pekko.actor.{ ActorSystem, ExtendedActorSystem, ExtensionId, ExtensionIdProvider } +import pekko.actor.Extension import pekko.annotation.InternalApi import pekko.persistence.testkit.EventStorage import pekko.persistence.testkit.JournalOperation diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/SnapshotStorageEmulatorExtension.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/SnapshotStorageEmulatorExtension.scala index b185557139..fa86080279 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/SnapshotStorageEmulatorExtension.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/SnapshotStorageEmulatorExtension.scala @@ -16,8 +16,8 @@ package org.apache.pekko.persistence.testkit.internal import java.util.concurrent.ConcurrentHashMap import org.apache.pekko -import pekko.actor.Extension import pekko.actor.{ ActorSystem, ExtendedActorSystem, ExtensionId, ExtensionIdProvider } +import pekko.actor.Extension import pekko.annotation.InternalApi import pekko.persistence.testkit.SnapshotStorage import pekko.persistence.testkit.scaladsl.SnapshotTestKit diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/TestKitStorage.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/TestKitStorage.scala index ba36b05448..827edd4a53 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/TestKitStorage.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/TestKitStorage.scala @@ -15,12 +15,12 @@ package org.apache.pekko.persistence.testkit.internal import java.util.concurrent.atomic.AtomicReference +import scala.collection.immutable + import org.apache.pekko import pekko.annotation.InternalApi import pekko.persistence.testkit.ProcessingPolicy -import scala.collection.immutable - /** * INTERNAL API */ diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/EventSourcedBehaviorTestKit.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/EventSourcedBehaviorTestKit.scala index 42df92ac7a..ca7b94031f 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/EventSourcedBehaviorTestKit.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/EventSourcedBehaviorTestKit.scala @@ -13,12 +13,14 @@ package org.apache.pekko.persistence.testkit.javadsl -import java.util.Optional import java.util.{ List => JList } +import java.util.Optional import java.util.function.{ Function => JFunction } +import scala.annotation.varargs +import scala.jdk.CollectionConverters._ import scala.reflect.ClassTag -import com.typesafe.config.Config + import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.actor.typed.ActorSystem @@ -26,9 +28,8 @@ import pekko.actor.typed.Behavior import pekko.annotation.ApiMayChange import pekko.annotation.DoNotInherit import pekko.persistence.testkit.scaladsl -import scala.jdk.CollectionConverters._ -import scala.annotation.varargs +import com.typesafe.config.Config /** * Testing of [[pekko.persistence.typed.javadsl.EventSourcedBehavior]] implementations. diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/PersistenceInit.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/PersistenceInit.scala index 3c29ae5c8e..0b6b5ef349 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/PersistenceInit.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/PersistenceInit.scala @@ -16,12 +16,13 @@ package org.apache.pekko.persistence.testkit.javadsl import java.time.Duration import java.util.concurrent.CompletionStage +import scala.jdk.DurationConverters._ +import scala.jdk.FutureConverters._ + import org.apache.pekko import pekko.Done import pekko.actor.ClassicActorSystemProvider import pekko.persistence.testkit.scaladsl -import scala.jdk.FutureConverters._ -import scala.jdk.DurationConverters._ /** * Test utility to initialize persistence plugins. Useful when initialization order or coordination diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/PersistenceTestKit.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/PersistenceTestKit.scala index 02620d7432..4d40428156 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/PersistenceTestKit.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/PersistenceTestKit.scala @@ -17,13 +17,14 @@ import java.time.Duration import java.util.{ List => JList } import java.util.{ function => jf } +import scala.jdk.CollectionConverters._ +import scala.jdk.DurationConverters._ + import org.apache.pekko import pekko.actor.ActorSystem import pekko.annotation.ApiMayChange import pekko.persistence.testkit.{ EventStorage, ExpectedFailure, ExpectedRejection, JournalOperation } import pekko.persistence.testkit.scaladsl.{ PersistenceTestKit => ScalaTestKit } -import scala.jdk.DurationConverters._ -import scala.jdk.CollectionConverters._ /** * Class for testing persisted events in persistent actors. diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/SnapshotTestKit.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/SnapshotTestKit.scala index 8d57e4032a..62bcccaf0b 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/SnapshotTestKit.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/javadsl/SnapshotTestKit.scala @@ -17,14 +17,15 @@ import java.time.Duration import java.util.{ List => JList } import java.util.{ function => jf } +import scala.jdk.CollectionConverters._ +import scala.jdk.DurationConverters._ + import org.apache.pekko import pekko.actor.ActorSystem import pekko.annotation.ApiMayChange import pekko.japi.Pair import pekko.persistence.testkit.{ ExpectedFailure, SnapshotMeta, SnapshotOperation, SnapshotStorage } import pekko.persistence.testkit.scaladsl.{ SnapshotTestKit => ScalaTestKit } -import scala.jdk.DurationConverters._ -import scala.jdk.CollectionConverters._ /** * Class for testing persisted snapshots in persistent actors. diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/PersistenceTestKitReadJournalProvider.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/PersistenceTestKitReadJournalProvider.scala index 74a12af037..c64c315338 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/PersistenceTestKitReadJournalProvider.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/PersistenceTestKitReadJournalProvider.scala @@ -15,6 +15,7 @@ package org.apache.pekko.persistence.testkit.query import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.persistence.query.ReadJournalProvider + import com.typesafe.config.Config class PersistenceTestKitReadJournalProvider(system: ExtendedActorSystem, config: Config, configPath: String) diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/internal/EventsBySliceStage.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/internal/EventsBySliceStage.scala index 24dc79811e..b3c94efb78 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/internal/EventsBySliceStage.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/internal/EventsBySliceStage.scala @@ -21,18 +21,18 @@ import org.apache.pekko import pekko.actor.ActorRef import pekko.annotation.InternalApi import pekko.persistence.Persistence -import pekko.persistence.query.typed import pekko.persistence.query.Sequence +import pekko.persistence.query.typed import pekko.persistence.testkit.EventStorage import pekko.persistence.testkit.PersistenceTestKitPlugin.SliceWrite import pekko.persistence.typed.PersistenceId +import pekko.stream.Attributes +import pekko.stream.Outlet +import pekko.stream.SourceShape import pekko.stream.stage.GraphStage import pekko.stream.stage.GraphStageLogic import pekko.stream.stage.GraphStageLogicWithLogging import pekko.stream.stage.OutHandler -import pekko.stream.Attributes -import pekko.stream.Outlet -import pekko.stream.SourceShape /** * INTERNAL API diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/internal/EventsByTagStage.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/internal/EventsByTagStage.scala index f2ca34c6cb..301e26433f 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/internal/EventsByTagStage.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/internal/EventsByTagStage.scala @@ -26,13 +26,13 @@ import pekko.persistence.query.Sequence import pekko.persistence.testkit.EventStorage import pekko.persistence.testkit.PersistenceTestKitPlugin import pekko.persistence.testkit.PersistenceTestKitPlugin.TagWrite +import pekko.stream.Attributes +import pekko.stream.Outlet +import pekko.stream.SourceShape import pekko.stream.stage.GraphStage import pekko.stream.stage.GraphStageLogic import pekko.stream.stage.GraphStageLogicWithLogging import pekko.stream.stage.OutHandler -import pekko.stream.Attributes -import pekko.stream.Outlet -import pekko.stream.SourceShape /** * INTERNAL API diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/scaladsl/PersistenceTestKitReadJournal.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/scaladsl/PersistenceTestKitReadJournal.scala index 92fb8f083e..9060d13427 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/scaladsl/PersistenceTestKitReadJournal.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/scaladsl/PersistenceTestKitReadJournal.scala @@ -12,10 +12,14 @@ */ package org.apache.pekko.persistence.testkit.query.scaladsl +import scala.collection.immutable + import org.apache.pekko import pekko.NotUsed import pekko.actor.ExtendedActorSystem +import pekko.persistence.Persistence import pekko.persistence.journal.Tagged +import pekko.persistence.query.{ EventEnvelope, Sequence } import pekko.persistence.query.NoOffset import pekko.persistence.query.Offset import pekko.persistence.query.scaladsl.{ @@ -25,24 +29,22 @@ import pekko.persistence.query.scaladsl.{ PagedPersistenceIdsQuery, ReadJournal } -import pekko.persistence.query.{ EventEnvelope, Sequence } -import pekko.persistence.testkit.EventStorage -import pekko.persistence.testkit.internal.InMemStorageExtension -import pekko.persistence.testkit.query.internal.EventsByPersistenceIdStage -import pekko.stream.scaladsl.Source -import pekko.util.unused -import com.typesafe.config.Config -import org.slf4j.LoggerFactory -import pekko.persistence.Persistence +import pekko.persistence.query.scaladsl.EventsByTagQuery import pekko.persistence.query.typed import pekko.persistence.query.typed.scaladsl.CurrentEventsBySliceQuery import pekko.persistence.query.typed.scaladsl.EventsBySliceQuery -import pekko.persistence.typed.PersistenceId -import pekko.persistence.query.scaladsl.EventsByTagQuery -import pekko.persistence.testkit.query.internal.EventsByTagStage +import pekko.persistence.testkit.EventStorage +import pekko.persistence.testkit.internal.InMemStorageExtension +import pekko.persistence.testkit.query.internal.EventsByPersistenceIdStage import pekko.persistence.testkit.query.internal.EventsBySliceStage +import pekko.persistence.testkit.query.internal.EventsByTagStage +import pekko.persistence.typed.PersistenceId +import pekko.stream.scaladsl.Source +import pekko.util.unused -import scala.collection.immutable +import org.slf4j.LoggerFactory + +import com.typesafe.config.Config object PersistenceTestKitReadJournal { val Identifier = "pekko.persistence.testkit.query" diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/scaladsl/EventSourcedBehaviorTestKit.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/scaladsl/EventSourcedBehaviorTestKit.scala index 4e73dff87d..65d1ef6bf9 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/scaladsl/EventSourcedBehaviorTestKit.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/scaladsl/EventSourcedBehaviorTestKit.scala @@ -15,8 +15,7 @@ package org.apache.pekko.persistence.testkit.scaladsl import scala.collection.immutable import scala.reflect.ClassTag -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.ActorTestKit import pekko.actor.typed.ActorRef @@ -28,6 +27,9 @@ import pekko.persistence.testkit.PersistenceTestKitPlugin import pekko.persistence.testkit.PersistenceTestKitSnapshotPlugin import pekko.persistence.testkit.internal.EventSourcedBehaviorTestKitImpl +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + /** * Testing of [[pekko.persistence.typed.scaladsl.EventSourcedBehavior]] implementations. * It supports running one command at a time and you can assert that the synchronously returned result is as expected. diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/scaladsl/PersistenceTestKit.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/scaladsl/PersistenceTestKit.scala index 51aff3d757..d3f084cbe8 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/scaladsl/PersistenceTestKit.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/scaladsl/PersistenceTestKit.scala @@ -16,7 +16,7 @@ package org.apache.pekko.persistence.testkit.scaladsl import scala.collection.immutable import scala.concurrent.duration.FiniteDuration import scala.util.Try -import com.typesafe.config.Config + import org.apache.pekko import pekko.actor.ActorSystem import pekko.actor.ClassicActorSystemProvider @@ -34,6 +34,8 @@ import pekko.persistence.testkit.internal.InMemStorageExtension import pekko.persistence.testkit.internal.SnapshotStorageEmulatorExtension import pekko.testkit.TestProbe +import com.typesafe.config.Config + private[testkit] trait CommonTestKitOps[S, P] extends ClearOps with PolicyOpsTestKit[P] { this: HasStorage[P, S] => diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/state/PersistenceTestKitDurableStateStoreProvider.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/state/PersistenceTestKitDurableStateStoreProvider.scala index 070f5d1515..f716becb5e 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/state/PersistenceTestKitDurableStateStoreProvider.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/state/PersistenceTestKitDurableStateStoreProvider.scala @@ -16,12 +16,12 @@ package org.apache.pekko.persistence.testkit.state import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.persistence.state.DurableStateStoreProvider -import pekko.persistence.state.scaladsl.DurableStateStore -import pekko.persistence.testkit.state.scaladsl.PersistenceTestKitDurableStateStore import pekko.persistence.state.javadsl.{ DurableStateStore => JDurableStateStore } +import pekko.persistence.state.scaladsl.DurableStateStore import pekko.persistence.testkit.state.javadsl.{ PersistenceTestKitDurableStateStore => JPersistenceTestKitDurableStateStore } +import pekko.persistence.testkit.state.scaladsl.PersistenceTestKitDurableStateStore class PersistenceTestKitDurableStateStoreProvider(system: ExtendedActorSystem) extends DurableStateStoreProvider { private val _scaladslDurableStateStore = new PersistenceTestKitDurableStateStore[Any](system) diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/state/javadsl/PersistenceTestKitDurableStateStore.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/state/javadsl/PersistenceTestKitDurableStateStore.scala index 57aee7e4d4..51513600b9 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/state/javadsl/PersistenceTestKitDurableStateStore.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/state/javadsl/PersistenceTestKitDurableStateStore.scala @@ -15,9 +15,13 @@ package org.apache.pekko.persistence.testkit.state.javadsl import java.util.Optional import java.util.concurrent.{ CompletableFuture, CompletionStage } + +import scala.jdk.FutureConverters._ +import scala.jdk.OptionConverters._ + import org.apache.pekko -import pekko.japi.Pair import pekko.{ Done, NotUsed } +import pekko.japi.Pair import pekko.persistence.query.DurableStateChange import pekko.persistence.query.Offset import pekko.persistence.query.javadsl.{ DurableStateStorePagedPersistenceIdsQuery, DurableStateStoreQuery } @@ -26,8 +30,6 @@ import pekko.persistence.state.javadsl.DurableStateUpdateStore import pekko.persistence.state.javadsl.GetObjectResult import pekko.persistence.testkit.state.scaladsl.{ PersistenceTestKitDurableStateStore => SStore } import pekko.stream.javadsl.Source -import scala.jdk.FutureConverters._ -import scala.jdk.OptionConverters._ object PersistenceTestKitDurableStateStore { val Identifier = pekko.persistence.testkit.state.scaladsl.PersistenceTestKitDurableStateStore.Identifier diff --git a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/state/scaladsl/PersistenceTestKitDurableStateStore.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/state/scaladsl/PersistenceTestKitDurableStateStore.scala index 2e72027a4f..0ced17de1e 100644 --- a/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/state/scaladsl/PersistenceTestKitDurableStateStore.scala +++ b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/state/scaladsl/PersistenceTestKitDurableStateStore.scala @@ -15,6 +15,7 @@ package org.apache.pekko.persistence.testkit.state.scaladsl import java.util.concurrent.atomic.AtomicLong +import scala.collection.immutable import scala.concurrent.Future import org.apache.pekko @@ -33,12 +34,11 @@ import pekko.persistence.query.scaladsl.{ DurableStateStorePagedPersistenceIdsQu import pekko.persistence.query.typed.scaladsl.DurableStateStoreBySliceQuery import pekko.persistence.state.scaladsl.{ DurableStateUpdateStore, GetObjectResult } import pekko.persistence.typed.PersistenceId +import pekko.stream.OverflowStrategy import pekko.stream.scaladsl.BroadcastHub import pekko.stream.scaladsl.Keep import pekko.stream.scaladsl.Source import pekko.stream.typed.scaladsl.ActorSource -import pekko.stream.OverflowStrategy -import scala.collection.immutable object PersistenceTestKitDurableStateStore { val Identifier = "pekko.persistence.testkit.state" diff --git a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/CommonUtils.scala b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/CommonUtils.scala index 677520b4b3..76f74316c7 100644 --- a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/CommonUtils.scala +++ b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/CommonUtils.scala @@ -15,14 +15,15 @@ package org.apache.pekko.persistence.testkit import java.util.UUID -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.{ ActorRef, ActorSystem } import pekko.persistence._ import pekko.testkit.TestKitBase +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + trait CommonUtils extends AnyWordSpecLike with TestKitBase { protected def randomPid() = UUID.randomUUID().toString diff --git a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/javadsl/CommonSnapshotTests.scala b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/javadsl/CommonSnapshotTests.scala index 2fc5526177..706c27d086 100644 --- a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/javadsl/CommonSnapshotTests.scala +++ b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/javadsl/CommonSnapshotTests.scala @@ -13,7 +13,7 @@ package org.apache.pekko.persistence.testkit.javadsl -import org.scalatest.matchers.should.Matchers._ +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.actor.Props @@ -22,7 +22,8 @@ import pekko.japi.Pair import pekko.persistence._ import pekko.persistence.testkit._ import pekko.testkit.EventFilter -import scala.jdk.CollectionConverters._ + +import org.scalatest.matchers.should.Matchers._ trait CommonSnapshotTests extends JavaDslUtils { diff --git a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/javadsl/CommonTestKitTests.scala b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/javadsl/CommonTestKitTests.scala index 0f086323e6..a88a25bc2f 100644 --- a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/javadsl/CommonTestKitTests.scala +++ b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/javadsl/CommonTestKitTests.scala @@ -13,7 +13,7 @@ package org.apache.pekko.persistence.testkit.javadsl -import org.scalatest.matchers.should.Matchers._ +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.actor.Props @@ -21,7 +21,8 @@ import pekko.actor.typed.javadsl.Adapter import pekko.persistence._ import pekko.persistence.testkit._ import pekko.testkit.EventFilter -import scala.jdk.CollectionConverters._ + +import org.scalatest.matchers.should.Matchers._ trait CommonTestKitTests extends JavaDslUtils { diff --git a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/CurrentEventsBySlicesSpec.scala b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/CurrentEventsBySlicesSpec.scala index 4e2ed9f19c..ab40bf9412 100644 --- a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/CurrentEventsBySlicesSpec.scala +++ b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/CurrentEventsBySlicesSpec.scala @@ -13,8 +13,6 @@ package org.apache.pekko.persistence.testkit.query -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -28,6 +26,8 @@ import pekko.persistence.testkit.query.EventsByPersistenceIdSpec.testBehaviour import pekko.persistence.testkit.query.scaladsl.PersistenceTestKitReadJournal import pekko.stream.scaladsl.Sink +import org.scalatest.wordspec.AnyWordSpecLike + class CurrentEventsBySlicesSpec extends ScalaTestWithActorTestKit(EventsByPersistenceIdSpec.config) with LogCapturing diff --git a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/CurrentEventsByTagSpec.scala b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/CurrentEventsByTagSpec.scala index bfcba39caf..26ab4c83f9 100644 --- a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/CurrentEventsByTagSpec.scala +++ b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/CurrentEventsByTagSpec.scala @@ -24,6 +24,7 @@ import pekko.persistence.testkit.query.EventsByPersistenceIdSpec.Command import pekko.persistence.testkit.query.EventsByPersistenceIdSpec.testBehaviour import pekko.persistence.testkit.query.scaladsl.PersistenceTestKitReadJournal import pekko.stream.scaladsl.Sink + import org.scalatest.wordspec.AnyWordSpecLike class CurrentEventsByTagSpec diff --git a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/EventsByPersistenceIdSpec.scala b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/EventsByPersistenceIdSpec.scala index bf2eb166f3..fefa91e6b0 100644 --- a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/EventsByPersistenceIdSpec.scala +++ b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/EventsByPersistenceIdSpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.persistence.testkit.query +import scala.concurrent.duration._ + import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.scaladsl.{ LogCapturing, ScalaTestWithActorTestKit } @@ -23,10 +25,10 @@ import pekko.persistence.testkit.query.scaladsl.PersistenceTestKitReadJournal import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.scaladsl.{ Effect, EventSourcedBehavior } import pekko.stream.testkit.scaladsl.TestSink -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike -import scala.concurrent.duration._ +import com.typesafe.config.ConfigFactory object EventsByPersistenceIdSpec { val config = PersistenceTestKitPlugin.config.withFallback( diff --git a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/EventsBySliceSpec.scala b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/EventsBySliceSpec.scala index 9141a9acff..18bbade242 100644 --- a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/EventsBySliceSpec.scala +++ b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/EventsBySliceSpec.scala @@ -17,15 +17,17 @@ package org.apache.pekko.persistence.testkit.query -import com.typesafe.config.ConfigFactory +import scala.collection.immutable.Seq +import scala.concurrent.duration._ + import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import pekko.actor.typed.ActorRef import pekko.persistence.Persistence -import pekko.persistence.query.PersistenceQuery import pekko.persistence.query.NoOffset +import pekko.persistence.query.PersistenceQuery import pekko.persistence.query.typed.EventEnvelope import pekko.persistence.testkit.PersistenceTestKitPlugin import pekko.persistence.testkit.internal.InMemStorageExtension @@ -35,11 +37,11 @@ import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.scaladsl.Effect import pekko.persistence.typed.scaladsl.EventSourcedBehavior import pekko.stream.testkit.scaladsl.TestSink + import org.scalatest.BeforeAndAfterEach import org.scalatest.wordspec.AnyWordSpecLike -import scala.collection.immutable.Seq -import scala.concurrent.duration._ +import com.typesafe.config.ConfigFactory object EventsBySliceSpec { val config = PersistenceTestKitPlugin.config.withFallback( diff --git a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/EventsByTagSpec.scala b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/EventsByTagSpec.scala index 3eb63431c0..7cb21233ff 100644 --- a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/EventsByTagSpec.scala +++ b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/query/EventsByTagSpec.scala @@ -17,15 +17,17 @@ package org.apache.pekko.persistence.testkit.query -import com.typesafe.config.ConfigFactory +import scala.collection.immutable.Seq +import scala.concurrent.duration._ + import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import pekko.actor.typed.ActorRef import pekko.persistence.query.EventEnvelope -import pekko.persistence.query.PersistenceQuery import pekko.persistence.query.NoOffset +import pekko.persistence.query.PersistenceQuery import pekko.persistence.testkit.PersistenceTestKitPlugin import pekko.persistence.testkit.query.javadsl.{ PersistenceTestKitReadJournal => JavaPersistenceTestKitReadJournal } import pekko.persistence.testkit.query.scaladsl.PersistenceTestKitReadJournal @@ -34,10 +36,10 @@ import pekko.persistence.typed.scaladsl.Effect import pekko.persistence.typed.scaladsl.EventSourcedBehavior import pekko.stream.testkit.TestSubscriber import pekko.stream.testkit.scaladsl.TestSink + import org.scalatest.wordspec.AnyWordSpecLike -import scala.collection.immutable.Seq -import scala.concurrent.duration._ +import com.typesafe.config.ConfigFactory object EventsByTagSpec { val config = PersistenceTestKitPlugin.config.withFallback( diff --git a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/CommonSnapshotTests.scala b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/CommonSnapshotTests.scala index ea555f695c..4fc9a47d44 100644 --- a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/CommonSnapshotTests.scala +++ b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/CommonSnapshotTests.scala @@ -13,8 +13,6 @@ package org.apache.pekko.persistence.testkit.scaladsl -import org.scalatest.matchers.should.Matchers._ - import org.apache.pekko import pekko.actor.Props import pekko.actor.typed.scaladsl.adapter._ @@ -23,6 +21,8 @@ import pekko.persistence.testkit._ import pekko.persistence.typed.scaladsl.RetentionCriteria import pekko.testkit.EventFilter +import org.scalatest.matchers.should.Matchers._ + trait CommonSnapshotTests extends ScalaDslUtils { final lazy val testKit = new SnapshotTestKit(system) diff --git a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/CommonTestKitTests.scala b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/CommonTestKitTests.scala index 8b7703af3e..e506abe1a3 100644 --- a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/CommonTestKitTests.scala +++ b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/CommonTestKitTests.scala @@ -13,8 +13,6 @@ package org.apache.pekko.persistence.testkit.scaladsl -import org.scalatest.matchers.should.Matchers._ - import org.apache.pekko import pekko.actor.Props import pekko.actor.typed.scaladsl.adapter._ @@ -22,6 +20,8 @@ import pekko.persistence.{ DeleteMessagesFailure, DeleteMessagesSuccess } import pekko.persistence.testkit._ import pekko.testkit.EventFilter +import org.scalatest.matchers.should.Matchers._ + trait CommonTestKitTests extends ScalaDslUtils { final lazy val testKit: PersistenceTestKit = new PersistenceTestKit(system) diff --git a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/EventSourcedBehaviorNoSnapshotTestKitSpec.scala b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/EventSourcedBehaviorNoSnapshotTestKitSpec.scala index 716658a09a..c6b8a8cfc8 100644 --- a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/EventSourcedBehaviorNoSnapshotTestKitSpec.scala +++ b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/EventSourcedBehaviorNoSnapshotTestKitSpec.scala @@ -19,9 +19,11 @@ import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import pekko.persistence.testkit.PersistenceTestKitPlugin import pekko.persistence.testkit.scaladsl.EventSourcedBehaviorTestKitSpec.TestCounter import pekko.persistence.typed.PersistenceId -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike +import com.typesafe.config.ConfigFactory + class EventSourcedBehaviorNoSnapshotTestKitSpec extends ScalaTestWithActorTestKit(ConfigFactory.parseString(""" pekko.persistence.testkit.events.serialize = off diff --git a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/EventSourcedBehaviorTestKitSpec.scala b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/EventSourcedBehaviorTestKitSpec.scala index 98e38ebf4c..5c8c4781bf 100644 --- a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/EventSourcedBehaviorTestKitSpec.scala +++ b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/EventSourcedBehaviorTestKitSpec.scala @@ -14,7 +14,7 @@ package org.apache.pekko.persistence.testkit.scaladsl import java.io.NotSerializableException -import org.scalatest.wordspec.AnyWordSpecLike + import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.TestException @@ -36,6 +36,8 @@ import pekko.persistence.typed.scaladsl.EventSourcedBehavior import pekko.serialization.DisabledJavaSerializer import pekko.serialization.jackson.CborSerializable +import org.scalatest.wordspec.AnyWordSpecLike + object EventSourcedBehaviorTestKitSpec { object TestCounter { diff --git a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/MultipleJournalsSpec.scala b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/MultipleJournalsSpec.scala index fad1191528..455ae80c80 100644 --- a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/MultipleJournalsSpec.scala +++ b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/MultipleJournalsSpec.scala @@ -26,9 +26,11 @@ import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.scaladsl.Effect import pekko.persistence.typed.scaladsl.EventSourcedBehavior import pekko.stream.scaladsl.Sink -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike +import com.typesafe.config.ConfigFactory + object MultipleJournalsSpec { object ListActor { diff --git a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/RuntimeJournalsSpec.scala b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/RuntimeJournalsSpec.scala index 644df55d07..3c5f18bcd3 100644 --- a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/RuntimeJournalsSpec.scala +++ b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/RuntimeJournalsSpec.scala @@ -17,7 +17,6 @@ package org.apache.pekko.persistence.testkit.scaladsl -import com.typesafe.config.ConfigFactory import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -39,9 +38,12 @@ import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.scaladsl.Effect import pekko.persistence.typed.scaladsl.EventSourcedBehavior import pekko.persistence.typed.scaladsl.RetentionCriteria + import org.scalatest.Inside import org.scalatest.wordspec.AnyWordSpecLike +import com.typesafe.config.ConfigFactory + object RuntimeJournalsSpec { private object Actor { diff --git a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/state/scaladsl/PersistenceTestKitDurableStateStoreSpec.scala b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/state/scaladsl/PersistenceTestKitDurableStateStoreSpec.scala index faf69d3553..bc3b46a252 100644 --- a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/state/scaladsl/PersistenceTestKitDurableStateStoreSpec.scala +++ b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/state/scaladsl/PersistenceTestKitDurableStateStoreSpec.scala @@ -24,9 +24,10 @@ import pekko.persistence.testkit.PersistenceTestKitDurableStateStorePlugin import pekko.stream.scaladsl.Sink import pekko.stream.testkit.scaladsl.TestSink -import com.typesafe.config.ConfigFactory import org.scalatest.wordspec.AnyWordSpecLike +import com.typesafe.config.ConfigFactory + object PersistenceTestKitDurableStateStoreSpec { val config = PersistenceTestKitDurableStateStorePlugin.config.withFallback(ConfigFactory.parseString(""" diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/EventPublishingSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/EventPublishingSpec.scala index 87862657c2..e503a51078 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/EventPublishingSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/EventPublishingSpec.scala @@ -24,6 +24,7 @@ import pekko.persistence.testkit.PersistenceTestKitPlugin import pekko.persistence.typed.scaladsl.Effect import pekko.persistence.typed.scaladsl.EventSourcedBehavior import pekko.serialization.jackson.CborSerializable + import org.scalatest.wordspec.AnyWordSpecLike object EventPublishingSpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/EventSourcedBehaviorLoggingSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/EventSourcedBehaviorLoggingSpec.scala index 8e646e04ff..bca952a8ca 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/EventSourcedBehaviorLoggingSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/EventSourcedBehaviorLoggingSpec.scala @@ -14,9 +14,11 @@ package org.apache.pekko.persistence.typed import org.apache.pekko +import pekko.Done import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.LoggingTestKit import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit +import pekko.actor.typed.ActorRef import pekko.actor.typed.Behavior import pekko.actor.typed.scaladsl.Behaviors import pekko.persistence.testkit.PersistenceTestKitPlugin @@ -25,11 +27,10 @@ import pekko.persistence.typed.EventSourcedBehaviorLoggingSpec.ChattyEventSourci import pekko.persistence.typed.scaladsl.Effect import pekko.persistence.typed.scaladsl.EventSourcedBehavior import pekko.serialization.jackson.CborSerializable -import com.typesafe.config.{ Config, ConfigFactory } + import org.scalatest.wordspec.AnyWordSpecLike -import pekko.Done -import pekko.actor.typed.ActorRef +import com.typesafe.config.{ Config, ConfigFactory } object EventSourcedBehaviorLoggingSpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/MultiJournalReplicationSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/MultiJournalReplicationSpec.scala index e0150b6bfa..70153f2994 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/MultiJournalReplicationSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/MultiJournalReplicationSpec.scala @@ -24,15 +24,17 @@ import pekko.actor.typed.Behavior import pekko.persistence.query.PersistenceQuery import pekko.persistence.query.scaladsl.CurrentEventsByPersistenceIdQuery import pekko.persistence.testkit.PersistenceTestKitPlugin -import pekko.persistence.typed.scaladsl.ReplicatedEventSourcing import pekko.persistence.typed.scaladsl.Effect import pekko.persistence.typed.scaladsl.EventSourcedBehavior +import pekko.persistence.typed.scaladsl.ReplicatedEventSourcing import pekko.stream.scaladsl.Sink -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory + import org.scalatest.concurrent.Eventually import org.scalatest.wordspec.AnyWordSpecLike +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object MultiJournalReplicationSpec { object Actor { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicatedEventPublishingSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicatedEventPublishingSpec.scala index e93826eee0..7faab3f63c 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicatedEventPublishingSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicatedEventPublishingSpec.scala @@ -23,9 +23,10 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.persistence.testkit.PersistenceTestKitPlugin import pekko.persistence.testkit.query.scaladsl.PersistenceTestKitReadJournal import pekko.persistence.typed.internal.{ ReplicatedPublishedEventMetaData, VersionVector } -import pekko.persistence.typed.scaladsl.ReplicatedEventSourcing import pekko.persistence.typed.scaladsl.Effect import pekko.persistence.typed.scaladsl.EventSourcedBehavior +import pekko.persistence.typed.scaladsl.ReplicatedEventSourcing + import org.scalatest.wordspec.AnyWordSpecLike object ReplicatedEventPublishingSpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicatedEventSourcingSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicatedEventSourcingSpec.scala index 10c8a07ebc..71702f92a6 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicatedEventSourcingSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicatedEventSourcingSpec.scala @@ -28,6 +28,7 @@ import pekko.persistence.testkit.query.scaladsl.PersistenceTestKitReadJournal import pekko.persistence.testkit.scaladsl.PersistenceTestKit import pekko.persistence.typed.scaladsl.{ Effect, EventSourcedBehavior, ReplicatedEventSourcing, ReplicationContext } import pekko.serialization.jackson.CborSerializable + import org.scalatest.concurrent.Eventually import org.scalatest.wordspec.AnyWordSpecLike diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicatedEventSourcingTaggingSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicatedEventSourcingTaggingSpec.scala index 928ed902d4..50257807db 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicatedEventSourcingTaggingSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicatedEventSourcingTaggingSpec.scala @@ -21,15 +21,16 @@ import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import pekko.actor.typed.ActorRef import pekko.persistence.query.NoOffset -import pekko.persistence.query.scaladsl.CurrentEventsByTagQuery import pekko.persistence.query.PersistenceQuery +import pekko.persistence.query.scaladsl.CurrentEventsByTagQuery import pekko.persistence.testkit.PersistenceTestKitPlugin import pekko.persistence.testkit.query.scaladsl.PersistenceTestKitReadJournal import pekko.persistence.typed.scaladsl.Effect import pekko.persistence.typed.scaladsl.EventSourcedBehavior import pekko.persistence.typed.scaladsl.ReplicatedEventSourcing -import pekko.stream.scaladsl.Sink import pekko.serialization.jackson.CborSerializable +import pekko.stream.scaladsl.Sink + import org.scalatest.concurrent.Eventually import org.scalatest.wordspec.AnyWordSpecLike diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicationBaseSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicationBaseSpec.scala index 55a8fae5f4..0241537093 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicationBaseSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicationBaseSpec.scala @@ -18,6 +18,7 @@ import java.util.concurrent.atomic.AtomicInteger import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.{ LogCapturing, ScalaTestWithActorTestKit } import pekko.persistence.testkit.{ PersistenceTestKitPlugin, PersistenceTestKitSnapshotPlugin } + import org.scalatest.concurrent.Eventually import org.scalatest.wordspec.AnyWordSpecLike diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicationIllegalAccessSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicationIllegalAccessSpec.scala index c918b016ee..5f06dc4990 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicationIllegalAccessSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicationIllegalAccessSpec.scala @@ -20,6 +20,7 @@ import pekko.persistence.testkit.PersistenceTestKitPlugin import pekko.persistence.testkit.query.scaladsl.PersistenceTestKitReadJournal import pekko.persistence.typed.scaladsl.{ Effect, EventSourcedBehavior, ReplicatedEventSourcing } import pekko.serialization.jackson.CborSerializable + import org.scalatest.concurrent.Eventually import org.scalatest.wordspec.AnyWordSpecLike diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicationSnapshotSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicationSnapshotSpec.scala index b2e646a461..2ef3da3f59 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicationSnapshotSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/ReplicationSnapshotSpec.scala @@ -19,10 +19,11 @@ import pekko.Done import pekko.actor.testkit.typed.scaladsl.{ LogCapturing, ScalaTestWithActorTestKit } import pekko.actor.typed.{ ActorRef, Behavior } import pekko.persistence.testkit.{ PersistenceTestKitPlugin, PersistenceTestKitSnapshotPlugin } -import pekko.persistence.testkit.scaladsl.{ PersistenceTestKit, SnapshotTestKit } import pekko.persistence.testkit.query.scaladsl.PersistenceTestKitReadJournal +import pekko.persistence.testkit.scaladsl.{ PersistenceTestKit, SnapshotTestKit } import pekko.persistence.typed.internal.{ ReplicatedPublishedEventMetaData, VersionVector } import pekko.persistence.typed.scaladsl.ReplicatedEventSourcing + import org.scalatest.concurrent.Eventually import org.scalatest.wordspec.AnyWordSpecLike diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/crdt/CounterSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/crdt/CounterSpec.scala index 9b029f404e..080666d8b6 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/crdt/CounterSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/crdt/CounterSpec.scala @@ -17,10 +17,10 @@ import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.actor.typed.scaladsl.Behaviors import pekko.persistence.testkit.query.scaladsl.PersistenceTestKitReadJournal +import pekko.persistence.typed.{ ReplicaId, ReplicationBaseSpec } import pekko.persistence.typed.ReplicationId import pekko.persistence.typed.crdt.CounterSpec.PlainCounter.{ Decrement, Get, Increment } import pekko.persistence.typed.scaladsl.{ Effect, EventSourcedBehavior, ReplicatedEventSourcing } -import pekko.persistence.typed.{ ReplicaId, ReplicationBaseSpec } object CounterSpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/crdt/LwwSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/crdt/LwwSpec.scala index 688aa171a9..890964c1cf 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/crdt/LwwSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/crdt/LwwSpec.scala @@ -13,21 +13,21 @@ package org.apache.pekko.persistence.typed.crdt +import java.util.concurrent.CountDownLatch +import java.util.concurrent.TimeUnit + import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.actor.typed.Behavior import pekko.persistence.testkit.query.scaladsl.PersistenceTestKitReadJournal +import pekko.persistence.typed.ReplicaId +import pekko.persistence.typed.ReplicationBaseSpec import pekko.persistence.typed.ReplicationId import pekko.persistence.typed.scaladsl.Effect import pekko.persistence.typed.scaladsl.EventSourcedBehavior import pekko.persistence.typed.scaladsl.ReplicatedEventSourcing -import pekko.persistence.typed.ReplicaId -import pekko.persistence.typed.ReplicationBaseSpec import pekko.serialization.jackson.CborSerializable -import java.util.concurrent.CountDownLatch -import java.util.concurrent.TimeUnit - object LwwSpec { import ReplicationBaseSpec._ diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/crdt/ORSetSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/crdt/ORSetSpec.scala index 3adb76484c..00f9634615 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/crdt/ORSetSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/crdt/ORSetSpec.scala @@ -13,17 +13,18 @@ package org.apache.pekko.persistence.typed.crdt +import scala.util.Random + +import ORSetSpec.ORSetEntity._ + import org.apache.pekko import pekko.actor.typed.{ ActorRef, Behavior } import pekko.persistence.testkit.query.scaladsl.PersistenceTestKitReadJournal -import pekko.persistence.typed.scaladsl.{ Effect, EventSourcedBehavior, ReplicatedEventSourcing } import pekko.persistence.typed.{ ReplicaId, ReplicationBaseSpec } -import ORSetSpec.ORSetEntity._ import pekko.persistence.typed.ReplicationBaseSpec.{ R1, R2 } import pekko.persistence.typed.ReplicationId import pekko.persistence.typed.crdt.ORSetSpec.ORSetEntity - -import scala.util.Random +import pekko.persistence.typed.scaladsl.{ Effect, EventSourcedBehavior, ReplicatedEventSourcing } object ORSetSpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/jackson/ReplicatedEventSourcingJacksonSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/jackson/ReplicatedEventSourcingJacksonSpec.scala index e9cf19b177..c89d83d844 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/jackson/ReplicatedEventSourcingJacksonSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/jackson/ReplicatedEventSourcingJacksonSpec.scala @@ -13,13 +13,15 @@ package org.apache.pekko.persistence.typed.jackson +import com.fasterxml.jackson.databind.annotation.{ JsonDeserialize, JsonSerialize } + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.{ LogCapturing, ScalaTestWithActorTestKit, SerializationTestKit } import pekko.persistence.typed.ReplicaId import pekko.persistence.typed.crdt.{ Counter, LwwTime, ORSet } import pekko.persistence.typed.jackson.ReplicatedEventSourcingJacksonSpec.{ WithCounter, WithLwwTime, WithOrSet } import pekko.serialization.jackson.{ JsonSerializable, PekkoSerializationDeserializer, PekkoSerializationSerializer } -import com.fasterxml.jackson.databind.annotation.{ JsonDeserialize, JsonSerialize } + import org.scalatest.wordspec.AnyWordSpecLike object ReplicatedEventSourcingJacksonSpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorFailureSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorFailureSpec.scala index bba7de2f3e..45ca777021 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorFailureSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorFailureSpec.scala @@ -13,6 +13,11 @@ package org.apache.pekko.persistence.typed.scaladsl +import scala.collection.immutable +import scala.concurrent.Future +import scala.concurrent.duration._ +import scala.util.Try + import org.apache.pekko import pekko.actor.testkit.typed.TestException import pekko.actor.testkit.typed.TestKitSettings @@ -31,14 +36,11 @@ import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.RecoveryCompleted import pekko.persistence.typed.RecoveryFailed import pekko.persistence.typed.internal.JournalFailureException -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike -import scala.collection.immutable -import scala.concurrent.Future -import scala.concurrent.duration._ -import scala.util.Try +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory class ChaosJournal extends InmemJournal { var counts = Map.empty[String, Int] diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorInterceptorSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorInterceptorSpec.scala index b97314721b..ce996c1a07 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorInterceptorSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorInterceptorSpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.persistence.typed.scaladsl +import java.util.concurrent.atomic.AtomicInteger + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl._ import pekko.actor.typed.ActorRef @@ -22,11 +24,11 @@ import pekko.actor.typed.TypedActorContext import pekko.actor.typed.scaladsl.Behaviors import pekko.persistence.testkit.PersistenceTestKitPlugin import pekko.persistence.typed.PersistenceId -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike -import java.util.concurrent.atomic.AtomicInteger +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory object EventSourcedBehaviorInterceptorSpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorRecoveryTimeoutSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorRecoveryTimeoutSpec.scala index 10a611d4cc..a5429116a2 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorRecoveryTimeoutSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorRecoveryTimeoutSpec.scala @@ -13,6 +13,10 @@ package org.apache.pekko.persistence.typed.scaladsl +import java.util.concurrent.atomic.AtomicInteger + +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl._ import pekko.actor.typed.ActorRef @@ -23,12 +27,11 @@ import pekko.persistence.journal.SteppingInmemJournal import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.RecoveryFailed import pekko.persistence.typed.internal.JournalFailureException -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike -import java.util.concurrent.atomic.AtomicInteger -import scala.concurrent.duration._ +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory object EventSourcedBehaviorRecoveryTimeoutSpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorReplySpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorReplySpec.scala index fe5e92221a..a9e6eee6d2 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorReplySpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorReplySpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.persistence.typed.scaladsl +import java.util.concurrent.atomic.AtomicInteger + import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.scaladsl._ @@ -23,9 +25,8 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.persistence.testkit.PersistenceTestKitPlugin import pekko.persistence.typed.PersistenceId import pekko.serialization.jackson.CborSerializable -import org.scalatest.wordspec.AnyWordSpecLike -import java.util.concurrent.atomic.AtomicInteger +import org.scalatest.wordspec.AnyWordSpecLike object EventSourcedBehaviorReplySpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorRetentionSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorRetentionSpec.scala index db4d88f47c..29a29b6369 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorRetentionSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorRetentionSpec.scala @@ -13,6 +13,12 @@ package org.apache.pekko.persistence.typed.scaladsl +import java.util.concurrent.atomic.AtomicInteger + +import scala.concurrent.duration._ +import scala.util.Success +import scala.util.Try + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl._ import pekko.actor.typed.ActorRef @@ -33,14 +39,10 @@ import pekko.persistence.typed.SnapshotFailed import pekko.persistence.typed.SnapshotSelectionCriteria import pekko.serialization.jackson.CborSerializable import pekko.util.unused + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpecLike -import java.util.concurrent.atomic.AtomicInteger -import scala.concurrent.duration._ -import scala.util.Success -import scala.util.Try - object EventSourcedBehaviorRetentionSpec extends Matchers { sealed trait Command extends CborSerializable diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorSignalSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorSignalSpec.scala index d5176e5fd0..bb0421986c 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorSignalSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorSignalSpec.scala @@ -17,6 +17,11 @@ package org.apache.pekko.persistence.typed.scaladsl +import scala.collection.immutable +import scala.concurrent.Future +import scala.concurrent.duration._ +import scala.util.Try + import org.apache.pekko import pekko.actor.testkit.typed.TestException import pekko.actor.testkit.typed.scaladsl._ @@ -29,14 +34,11 @@ import pekko.persistence.typed.JournalPersistRejected import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.RecoveryCompleted import pekko.serialization.jackson.CborSerializable -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike -import scala.collection.immutable -import scala.concurrent.Future -import scala.concurrent.duration._ -import scala.util.Try +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory // Custom journal that checks event flags to determine whether to reject or fail writes class SignalTestJournal extends InmemJournal { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorSpec.scala index a03fb97284..e764d2805d 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorSpec.scala @@ -13,6 +13,16 @@ package org.apache.pekko.persistence.typed.scaladsl +import java.util.UUID +import java.util.concurrent.atomic.AtomicInteger + +import scala.concurrent.Future +import scala.concurrent.Promise +import scala.concurrent.duration._ +import scala.util.Failure +import scala.util.Success +import scala.util.Try + import org.apache.pekko import pekko.Done import pekko.actor.ActorInitializationException @@ -25,6 +35,8 @@ import pekko.actor.typed.SupervisorStrategy import pekko.actor.typed.Terminated import pekko.actor.typed.scaladsl.ActorContext import pekko.actor.typed.scaladsl.Behaviors +import pekko.persistence.{ SnapshotMetadata => ClassicSnapshotMetadata } +import pekko.persistence.{ SnapshotSelectionCriteria => ClassicSnapshotSelectionCriteria } import pekko.persistence.SelectedSnapshot import pekko.persistence.journal.inmem.InmemJournal import pekko.persistence.query.EventEnvelope @@ -40,22 +52,13 @@ import pekko.persistence.typed.SnapshotCompleted import pekko.persistence.typed.SnapshotFailed import pekko.persistence.typed.SnapshotMetadata import pekko.persistence.typed.SnapshotSelectionCriteria -import pekko.persistence.{ SnapshotMetadata => ClassicSnapshotMetadata } -import pekko.persistence.{ SnapshotSelectionCriteria => ClassicSnapshotSelectionCriteria } import pekko.serialization.jackson.CborSerializable import pekko.stream.scaladsl.Sink -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike -import java.util.UUID -import java.util.concurrent.atomic.AtomicInteger -import scala.concurrent.Future -import scala.concurrent.Promise -import scala.concurrent.duration._ -import scala.util.Failure -import scala.util.Success -import scala.util.Try +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory object EventSourcedBehaviorSpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorStashSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorStashSpec.scala index 16883b014d..0f05cdf016 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorStashSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorStashSpec.scala @@ -13,6 +13,12 @@ package org.apache.pekko.persistence.typed.scaladsl +import java.util.concurrent.CountDownLatch +import java.util.concurrent.TimeUnit +import java.util.concurrent.atomic.AtomicInteger + +import scala.concurrent.duration._ + import org.apache.pekko import pekko.NotUsed import pekko.actor.Dropped @@ -30,14 +36,11 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.actor.typed.scaladsl.adapter._ import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.RecoveryCompleted -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike -import java.util.concurrent.CountDownLatch -import java.util.concurrent.TimeUnit -import java.util.concurrent.atomic.AtomicInteger -import scala.concurrent.duration._ +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory object EventSourcedBehaviorStashSpec { def conf: Config = ConfigFactory.parseString(s""" diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorTimersSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorTimersSpec.scala index 158654a7d6..1dee8d80f8 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorTimersSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorTimersSpec.scala @@ -13,6 +13,10 @@ package org.apache.pekko.persistence.typed.scaladsl +import java.util.concurrent.atomic.AtomicInteger + +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl._ import pekko.actor.typed.ActorRef @@ -20,10 +24,8 @@ import pekko.actor.typed.Behavior import pekko.actor.typed.scaladsl.Behaviors import pekko.persistence.testkit.PersistenceTestKitPlugin import pekko.persistence.typed.PersistenceId -import org.scalatest.wordspec.AnyWordSpecLike -import java.util.concurrent.atomic.AtomicInteger -import scala.concurrent.duration._ +import org.scalatest.wordspec.AnyWordSpecLike object EventSourcedBehaviorTimersSpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorWatchSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorWatchSpec.scala index 17250d4e73..9b8418f559 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorWatchSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehaviorWatchSpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.persistence.typed.scaladsl +import java.util.concurrent.atomic.AtomicInteger + import org.apache.pekko import pekko.actor.testkit.typed.TestException import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -22,22 +24,22 @@ import pekko.actor.testkit.typed.scaladsl.TestProbe import pekko.actor.typed._ import pekko.actor.typed.scaladsl.ActorContext import pekko.actor.typed.scaladsl.Behaviors -import pekko.persistence.typed.internal.EventSourcedBehaviorImpl.WriterIdentity +import pekko.persistence.{ Recovery => ClassicRecovery } +import pekko.persistence.typed.NoOpEventAdapter +import pekko.persistence.typed.PersistenceId +import pekko.persistence.typed.RecoveryCompleted import pekko.persistence.typed.internal.BehaviorSetup +import pekko.persistence.typed.internal.EventSourcedBehaviorImpl.WriterIdentity import pekko.persistence.typed.internal.EventSourcedSettings import pekko.persistence.typed.internal.InternalProtocol import pekko.persistence.typed.internal.NoOpSnapshotAdapter import pekko.persistence.typed.internal.StashState -import pekko.persistence.typed.NoOpEventAdapter -import pekko.persistence.typed.PersistenceId -import pekko.persistence.typed.RecoveryCompleted -import pekko.persistence.{ Recovery => ClassicRecovery } import pekko.serialization.jackson.CborSerializable import pekko.util.ConstantFun -import org.scalatest.wordspec.AnyWordSpecLike -import org.slf4j.LoggerFactory -import java.util.concurrent.atomic.AtomicInteger +import org.scalatest.wordspec.AnyWordSpecLike + +import org.slf4j.LoggerFactory object EventSourcedBehaviorWatchSpec { sealed trait Command extends CborSerializable diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedEventAdapterSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedEventAdapterSpec.scala index 0c8ec10a50..d654265d70 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedEventAdapterSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedEventAdapterSpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.persistence.typed.scaladsl +import java.util.concurrent.atomic.AtomicInteger + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -30,10 +32,10 @@ import pekko.persistence.typed.PersistenceId import pekko.serialization.jackson.CborSerializable import pekko.stream.scaladsl.Sink import pekko.testkit.JavaSerializable -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike -import java.util.concurrent.atomic.AtomicInteger +import com.typesafe.config.ConfigFactory object EventSourcedEventAdapterSpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedSequenceNumberSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedSequenceNumberSpec.scala index 4726284753..73d0516e99 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedSequenceNumberSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedSequenceNumberSpec.scala @@ -17,14 +17,16 @@ import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import pekko.actor.testkit.typed.scaladsl.TestProbe -import pekko.actor.typed.scaladsl.Behaviors import pekko.actor.typed.ActorRef import pekko.actor.typed.Behavior +import pekko.actor.typed.scaladsl.Behaviors import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.RecoveryCompleted -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike +import com.typesafe.config.ConfigFactory + object EventSourcedSequenceNumberSpec { private val conf = ConfigFactory.parseString(s""" diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedSnapshotAdapterSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedSnapshotAdapterSpec.scala index 88573dfc20..35ec3a37b8 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedSnapshotAdapterSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedSnapshotAdapterSpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.persistence.typed.scaladsl +import java.util.concurrent.atomic.AtomicInteger + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -25,9 +27,8 @@ import pekko.persistence.testkit.query.scaladsl.PersistenceTestKitReadJournal import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.SnapshotAdapter import pekko.serialization.jackson.CborSerializable -import org.scalatest.wordspec.AnyWordSpecLike -import java.util.concurrent.atomic.AtomicInteger +import org.scalatest.wordspec.AnyWordSpecLike object EventSourcedSnapshotAdapterSpec { @@ -43,6 +44,7 @@ class EventSourcedSnapshotAdapterSpec with AnyWordSpecLike with LogCapturing { import EventSourcedSnapshotAdapterSpec._ + import pekko.actor.typed.scaladsl.adapter._ val pidCounter = new AtomicInteger(0) diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedStashOverflowSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedStashOverflowSpec.scala index 34f15089e6..0040ce6556 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedStashOverflowSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedStashOverflowSpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.persistence.typed.scaladsl +import scala.concurrent.duration._ + import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -22,10 +24,10 @@ import pekko.actor.typed.Behavior import pekko.actor.typed.scaladsl.adapter._ import pekko.persistence.journal.SteppingInmemJournal import pekko.persistence.typed.PersistenceId -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike -import scala.concurrent.duration._ +import com.typesafe.config.ConfigFactory // Reproducer for #29401 object EventSourcedStashOverflowSpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/LoggerSourceSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/LoggerSourceSpec.scala index 1231d252a0..8fa974ad6f 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/LoggerSourceSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/LoggerSourceSpec.scala @@ -12,6 +12,8 @@ */ package org.apache.pekko.persistence.typed.scaladsl +import java.util.concurrent.atomic.AtomicInteger + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.LoggingTestKit @@ -22,10 +24,10 @@ import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.RecoveryCompleted import pekko.persistence.typed.SnapshotCompleted import pekko.persistence.typed.SnapshotFailed -import org.scalatest.wordspec.AnyWordSpecLike -import org.slf4j.event.Level -import java.util.concurrent.atomic.AtomicInteger +import org.scalatest.wordspec.AnyWordSpecLike + +import org.slf4j.event.Level // Note that the spec name here is important since there are heuristics in place to avoid names // starting with EventSourcedBehavior diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/NullEmptyStateSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/NullEmptyStateSpec.scala index 4696f272a5..d55d4e3305 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/NullEmptyStateSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/NullEmptyStateSpec.scala @@ -20,9 +20,11 @@ import pekko.actor.typed.ActorRef import pekko.actor.typed.Behavior import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.RecoveryCompleted -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike +import com.typesafe.config.ConfigFactory + object NullEmptyStateSpec { private val conf = ConfigFactory.parseString(s""" diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/OptionalSnapshotStoreSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/OptionalSnapshotStoreSpec.scala index a52cfd9890..b4dd5ca5e7 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/OptionalSnapshotStoreSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/OptionalSnapshotStoreSpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.persistence.typed.scaladsl +import java.util.UUID + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.LoggingTestKit @@ -21,9 +23,8 @@ import pekko.actor.testkit.typed.scaladsl.TestProbe import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.scaladsl.EventSourcedBehavior.CommandHandler import pekko.serialization.jackson.CborSerializable -import org.scalatest.wordspec.AnyWordSpecLike -import java.util.UUID +import org.scalatest.wordspec.AnyWordSpecLike object OptionalSnapshotStoreSpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/PerformanceSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/PerformanceSpec.scala index a8b181576f..a5057e1411 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/PerformanceSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/PerformanceSpec.scala @@ -13,6 +13,10 @@ package org.apache.pekko.persistence.typed.scaladsl +import java.util.UUID + +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.testkit.typed.TestException import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -26,11 +30,10 @@ import pekko.persistence.testkit.PersistenceTestKitSnapshotPlugin import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.RecoveryCompleted import pekko.persistence.typed.scaladsl.EventSourcedBehavior.CommandHandler -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike -import java.util.UUID -import scala.concurrent.duration._ +import com.typesafe.config.ConfigFactory object PerformanceSpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/PrimitiveStateSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/PrimitiveStateSpec.scala index 7f76ce277f..3c3a30758f 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/PrimitiveStateSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/PrimitiveStateSpec.scala @@ -19,9 +19,11 @@ import pekko.actor.typed.ActorRef import pekko.actor.typed.Behavior import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.RecoveryCompleted -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike +import com.typesafe.config.ConfigFactory + object PrimitiveStateSpec { private val conf = ConfigFactory.parseString(s""" diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/SlowInMemorySnapshotStore.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/SlowInMemorySnapshotStore.scala index 958128cb11..424c0b405a 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/SlowInMemorySnapshotStore.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/SlowInMemorySnapshotStore.scala @@ -13,14 +13,14 @@ package org.apache.pekko.persistence.typed.scaladsl +import scala.concurrent.Future + import org.apache.pekko +import pekko.persistence.{ SnapshotMetadata => ClassicSnapshotMetadata } +import pekko.persistence.{ SnapshotSelectionCriteria => ClassicSnapshotSelectionCriteria } import pekko.persistence.SelectedSnapshot import pekko.persistence.snapshot.SnapshotStore import pekko.persistence.typed.scaladsl.SnapshotMutableStateSpec.MutableState -import pekko.persistence.{ SnapshotMetadata => ClassicSnapshotMetadata } -import pekko.persistence.{ SnapshotSelectionCriteria => ClassicSnapshotSelectionCriteria } - -import scala.concurrent.Future class SlowInMemorySnapshotStore extends SnapshotStore { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/SnapshotMutableStateSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/SnapshotMutableStateSpec.scala index e152a2721d..051197386f 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/SnapshotMutableStateSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/SnapshotMutableStateSpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.persistence.typed.scaladsl +import java.util.concurrent.atomic.AtomicInteger + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl._ import pekko.actor.typed.ActorRef @@ -22,11 +24,11 @@ import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.SnapshotCompleted import pekko.persistence.typed.SnapshotFailed import pekko.serialization.jackson.CborSerializable -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike -import java.util.concurrent.atomic.AtomicInteger +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory object SnapshotMutableStateSpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/SnapshotRecoveryWithEmptyJournalSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/SnapshotRecoveryWithEmptyJournalSpec.scala index 6773be9edc..272ea65be0 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/SnapshotRecoveryWithEmptyJournalSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/SnapshotRecoveryWithEmptyJournalSpec.scala @@ -13,6 +13,11 @@ package org.apache.pekko.persistence.typed.scaladsl +import java.io.File +import java.util.UUID + +import org.apache.commons.io.FileUtils + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -24,13 +29,11 @@ import pekko.persistence.testkit.PersistenceTestKitPlugin import pekko.persistence.typed.PersistenceId import pekko.serialization.Serialization import pekko.serialization.SerializationExtension -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import org.apache.commons.io.FileUtils + import org.scalatest.wordspec.AnyWordSpecLike -import java.io.File -import java.util.UUID +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory object SnapshotRecoveryWithEmptyJournalSpec { val survivingSnapshotPath = s"target/survivingSnapshotPath-${UUID.randomUUID().toString}" diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehaviorInterceptorSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehaviorInterceptorSpec.scala index 603f84bc78..2437d59388 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehaviorInterceptorSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehaviorInterceptorSpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.persistence.typed.state.scaladsl +import java.util.concurrent.atomic.AtomicInteger + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl._ import pekko.actor.typed.ActorRef @@ -20,13 +22,13 @@ import pekko.actor.typed.Behavior import pekko.actor.typed.BehaviorInterceptor import pekko.actor.typed.TypedActorContext import pekko.actor.typed.scaladsl.Behaviors +import pekko.persistence.testkit.PersistenceTestKitDurableStateStorePlugin import pekko.persistence.typed.PersistenceId -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike -import java.util.concurrent.atomic.AtomicInteger -import pekko.persistence.testkit.PersistenceTestKitDurableStateStorePlugin +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory object DurableStateBehaviorInterceptorSpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehaviorReplySpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehaviorReplySpec.scala index b8c9b0cfad..0a77d5f646 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehaviorReplySpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehaviorReplySpec.scala @@ -15,10 +15,6 @@ package org.apache.pekko.persistence.typed.state.scaladsl import java.util.concurrent.atomic.AtomicInteger -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.scaladsl._ @@ -26,10 +22,14 @@ import pekko.actor.typed.ActorRef import pekko.actor.typed.Behavior import pekko.actor.typed.scaladsl.ActorContext import pekko.actor.typed.scaladsl.Behaviors +import pekko.persistence.testkit.PersistenceTestKitDurableStateStorePlugin import pekko.persistence.typed.PersistenceId import pekko.serialization.jackson.CborSerializable -import pekko.persistence.testkit.PersistenceTestKitDurableStateStorePlugin +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory object DurableStateBehaviorReplySpec { def conf: Config = PersistenceTestKitDurableStateStorePlugin.config.withFallback(ConfigFactory.parseString(s""" diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehaviorStashOverflowSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehaviorStashOverflowSpec.scala index ada975be5b..dfbf1ed3e7 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehaviorStashOverflowSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehaviorStashOverflowSpec.scala @@ -13,6 +13,9 @@ package org.apache.pekko.persistence.typed.state.scaladsl +import scala.concurrent.{ Future, Promise } +import scala.concurrent.duration._ + import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -20,14 +23,13 @@ import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import pekko.actor.typed.ActorRef import pekko.actor.typed.Behavior import pekko.persistence.state.DurableStateStoreProvider -import pekko.persistence.state.scaladsl.{ DurableStateStore, DurableStateUpdateStore, GetObjectResult } import pekko.persistence.state.javadsl.{ DurableStateStore => JDurableStateStore } +import pekko.persistence.state.scaladsl.{ DurableStateStore, DurableStateUpdateStore, GetObjectResult } import pekko.persistence.typed.PersistenceId -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike -import scala.concurrent.{ Future, Promise } -import scala.concurrent.duration._ +import com.typesafe.config.ConfigFactory object DurableStateBehaviorStashOverflowSpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehaviorTimersSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehaviorTimersSpec.scala index ddbd3bfb52..2f8848f84d 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehaviorTimersSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehaviorTimersSpec.scala @@ -13,21 +13,23 @@ package org.apache.pekko.persistence.typed.state.scaladsl +import java.util.concurrent.atomic.AtomicInteger + +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.testkit.typed.scaladsl._ import pekko.actor.typed.ActorRef import pekko.actor.typed.Behavior import pekko.actor.typed.scaladsl.Behaviors +import pekko.persistence.testkit.PersistenceTestKitDurableStateStorePlugin import pekko.persistence.typed.PersistenceId + import org.scalatest.wordspec.AnyWordSpecLike + import com.typesafe.config.Config import com.typesafe.config.ConfigFactory -import java.util.concurrent.atomic.AtomicInteger -import scala.concurrent.duration._ - -import pekko.persistence.testkit.PersistenceTestKitDurableStateStorePlugin - object DurableStateBehaviorTimersSpec { def conf: Config = PersistenceTestKitDurableStateStorePlugin.config.withFallback(ConfigFactory.parseString(s""" diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateRevisionSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateRevisionSpec.scala index b396e4537f..28f0c5b755 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateRevisionSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateRevisionSpec.scala @@ -13,10 +13,6 @@ package org.apache.pekko.persistence.typed.state.scaladsl -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -28,6 +24,11 @@ import pekko.persistence.testkit.PersistenceTestKitDurableStateStorePlugin import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.state.RecoveryCompleted +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object DurableStateRevisionSpec { def conf: Config = PersistenceTestKitDurableStateStorePlugin.config.withFallback(ConfigFactory.parseString(s""" diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/NullEmptyStateSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/NullEmptyStateSpec.scala index 1a61bc71ef..b00b60c8fe 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/NullEmptyStateSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/NullEmptyStateSpec.scala @@ -18,12 +18,13 @@ import pekko.actor.testkit.typed.TestKitSettings import pekko.actor.testkit.typed.scaladsl._ import pekko.actor.typed.ActorRef import pekko.actor.typed.Behavior +import pekko.persistence.testkit.PersistenceTestKitDurableStateStorePlugin import pekko.persistence.typed.PersistenceId -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike -import pekko.persistence.testkit.PersistenceTestKitDurableStateStorePlugin +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory object NullEmptyStateSpec { diff --git a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/PrimitiveStateSpec.scala b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/PrimitiveStateSpec.scala index d802410224..7bd7689a22 100644 --- a/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/PrimitiveStateSpec.scala +++ b/persistence-typed-tests/src/test/scala/org/apache/pekko/persistence/typed/state/scaladsl/PrimitiveStateSpec.scala @@ -17,12 +17,13 @@ import org.apache.pekko import pekko.actor.testkit.typed.scaladsl._ import pekko.actor.typed.ActorRef import pekko.actor.typed.Behavior +import pekko.persistence.testkit.PersistenceTestKitDurableStateStorePlugin import pekko.persistence.typed.PersistenceId -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory + import org.scalatest.wordspec.AnyWordSpecLike -import pekko.persistence.testkit.PersistenceTestKitDurableStateStorePlugin +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory object PrimitiveStateSpec { diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala index 826508f917..8bc193c9b1 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala @@ -15,12 +15,13 @@ package org.apache.pekko.persistence.typed.crdt import scala.annotation.tailrec import scala.collection.immutable + import org.apache.pekko -import pekko.util.HashCode import pekko.annotation.InternalApi import pekko.persistence.typed.ReplicaId import pekko.persistence.typed.crdt.ORSet.DeltaOp import pekko.persistence.typed.internal.{ ManyVersionVector, OneVersionVector, VersionVector } +import pekko.util.HashCode object ORSet { def empty[A](originReplica: ReplicaId): ORSet[A] = new ORSet(originReplica.id, Map.empty, VersionVector.empty) diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/delivery/EventSourcedProducerQueue.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/delivery/EventSourcedProducerQueue.scala index 5d406e8a9d..5fc74e95be 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/delivery/EventSourcedProducerQueue.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/delivery/EventSourcedProducerQueue.scala @@ -16,8 +16,7 @@ package org.apache.pekko.persistence.typed.delivery import java.time.{ Duration => JavaDuration } import scala.concurrent.duration._ - -import com.typesafe.config.Config +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.actor.typed.ActorSystem @@ -32,7 +31,8 @@ import pekko.persistence.typed.delivery.EventSourcedProducerQueue.CleanupTick import pekko.persistence.typed.scaladsl.Effect import pekko.persistence.typed.scaladsl.EventSourcedBehavior import pekko.persistence.typed.scaladsl.RetentionCriteria -import scala.jdk.DurationConverters._ + +import com.typesafe.config.Config /** * [[pekko.actor.typed.delivery.DurableProducerQueue]] that can be used with [[pekko.actor.typed.delivery.ProducerController]] diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/BehaviorSetup.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/BehaviorSetup.scala index 101c04e589..54bc204356 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/BehaviorSetup.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/BehaviorSetup.scala @@ -16,13 +16,12 @@ package org.apache.pekko.persistence.typed.internal import scala.concurrent.ExecutionContext import scala.concurrent.duration.FiniteDuration import scala.util.control.NonFatal -import com.typesafe.config.ConfigFactory + import org.apache.pekko -import pekko.util.Helpers.ConfigOps +import pekko.actor.{ ActorRef => ClassicActorRef } import pekko.actor.Cancellable import pekko.actor.typed.Signal import pekko.actor.typed.scaladsl.ActorContext -import pekko.actor.{ ActorRef => ClassicActorRef } import pekko.annotation.InternalApi import pekko.persistence._ import pekko.persistence.typed.EventAdapter @@ -31,10 +30,14 @@ import pekko.persistence.typed.ReplicaId import pekko.persistence.typed.SnapshotAdapter import pekko.persistence.typed.scaladsl.EventSourcedBehavior import pekko.persistence.typed.scaladsl.RetentionCriteria +import pekko.util.Helpers.ConfigOps import pekko.util.OptionVal + import org.slf4j.Logger import org.slf4j.MDC +import com.typesafe.config.ConfigFactory + /** * INTERNAL API */ @@ -72,6 +75,7 @@ private[pekko] final class BehaviorSetup[C, E, S]( import BehaviorSetup._ import InternalProtocol.RecoveryTickEvent + import pekko.actor.typed.scaladsl.adapter._ val persistence: Persistence = Persistence(context.system.toClassic) diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala index 9433e16357..82bd7c535e 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala @@ -17,7 +17,6 @@ import java.util.Optional import java.util.UUID import java.util.concurrent.atomic.AtomicInteger -import com.typesafe.config.Config import org.apache.pekko import pekko.actor.typed import pekko.actor.typed.ActorRef @@ -50,13 +49,16 @@ import pekko.persistence.typed.ReplicaId import pekko.persistence.typed.SnapshotAdapter import pekko.persistence.typed.SnapshotCompleted import pekko.persistence.typed.SnapshotFailed -import pekko.persistence.typed.scaladsl.RetentionCriteria import pekko.persistence.typed.scaladsl._ import pekko.persistence.typed.scaladsl.{ Recovery => TypedRecovery } +import pekko.persistence.typed.scaladsl.RetentionCriteria import pekko.util.ConstantFun import pekko.util.unused + import org.slf4j.LoggerFactory +import com.typesafe.config.Config + @InternalApi private[pekko] object EventSourcedBehaviorImpl { diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedSettings.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedSettings.scala index 6ab4dcf661..cdc1e94bfe 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedSettings.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedSettings.scala @@ -13,12 +13,12 @@ package org.apache.pekko.persistence.typed.internal -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.typed.ActorSystem import pekko.annotation.InternalApi +import com.typesafe.config.Config + /** * INTERNAL API */ diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ExternalInteractions.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ExternalInteractions.scala index 304e3a0d2b..5cfde884f3 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ExternalInteractions.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ExternalInteractions.scala @@ -14,6 +14,7 @@ package org.apache.pekko.persistence.typed.internal import scala.collection.immutable + import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.typed.Behavior diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingEvents.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingEvents.scala index 8407bb4f5c..955e2575a3 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingEvents.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingEvents.scala @@ -13,8 +13,10 @@ package org.apache.pekko.persistence.typed.internal +import scala.collection.immutable import scala.concurrent.duration._ import scala.util.control.NonFatal + import org.apache.pekko import pekko.actor.typed.{ Behavior, Signal } import pekko.actor.typed.internal.PoisonPill @@ -39,8 +41,6 @@ import pekko.util.OptionVal import pekko.util.PrettyDuration._ import pekko.util.unused -import scala.collection.immutable - /** * * * INTERNAL API diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingSnapshot.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingSnapshot.scala index cf94e9f480..866a7e49bf 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingSnapshot.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingSnapshot.scala @@ -17,6 +17,7 @@ import org.apache.pekko import pekko.actor.typed.Behavior import pekko.actor.typed.internal.PoisonPill import pekko.actor.typed.scaladsl.{ ActorContext, Behaviors } +import pekko.actor.typed.scaladsl.LoggerOps import pekko.annotation.{ InternalApi, InternalStableApi } import pekko.persistence._ import pekko.persistence.SnapshotProtocol.LoadSnapshotFailed @@ -24,7 +25,6 @@ import pekko.persistence.SnapshotProtocol.LoadSnapshotResult import pekko.persistence.typed.{ RecoveryFailed, ReplicaId } import pekko.persistence.typed.internal.EventSourcedBehaviorImpl.{ GetSeenSequenceNr, GetState } import pekko.util.unused -import pekko.actor.typed.scaladsl.LoggerOps /** * INTERNAL API diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplicationSetup.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplicationSetup.scala index e4af45c9f2..5c4f00016b 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplicationSetup.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplicationSetup.scala @@ -13,6 +13,8 @@ package org.apache.pekko.persistence.typed.internal +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.annotation.InternalApi import pekko.persistence.typed.PersistenceId @@ -20,7 +22,6 @@ import pekko.persistence.typed.ReplicaId import pekko.persistence.typed.ReplicationId import pekko.util.OptionVal import pekko.util.WallClock -import scala.jdk.CollectionConverters._ /** * INTERNAL API diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala index 23d3cbc8b9..2aff1b37ad 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala @@ -18,12 +18,14 @@ import java.time.LocalDateTime import java.time.ZoneId import java.time.format.DateTimeFormatter import java.util.concurrent.atomic.AtomicReference + import scala.annotation.tailrec import scala.collection.immutable + import org.apache.pekko import pekko.actor.UnhandledMessage -import pekko.actor.typed.eventstream.EventStream import pekko.actor.typed.{ Behavior, Signal } +import pekko.actor.typed.eventstream.EventStream import pekko.actor.typed.internal.PoisonPill import pekko.actor.typed.scaladsl.{ AbstractBehavior, ActorContext, Behaviors, LoggerOps } import pekko.annotation.{ InternalApi, InternalStableApi } @@ -43,8 +45,6 @@ import pekko.persistence.SnapshotProtocol import pekko.persistence.journal.Tagged import pekko.persistence.query.{ EventEnvelope, PersistenceQuery } import pekko.persistence.query.scaladsl.EventsByPersistenceIdQuery -import pekko.persistence.typed.ReplicaId -import pekko.persistence.typed.ReplicationId import pekko.persistence.typed.{ DeleteEventsCompleted, DeleteEventsFailed, @@ -60,19 +60,21 @@ import pekko.persistence.typed.{ SnapshotMetadata, SnapshotSelectionCriteria } +import pekko.persistence.typed.ReplicaId +import pekko.persistence.typed.ReplicationId import pekko.persistence.typed.internal.EventSourcedBehaviorImpl.{ GetSeenSequenceNr, GetState, GetStateReply } import pekko.persistence.typed.internal.InternalProtocol.ReplicatedEventEnvelope import pekko.persistence.typed.internal.JournalInteractions.EventToPersist import pekko.persistence.typed.internal.Running.WithSeqNrAccessible import pekko.persistence.typed.scaladsl.Effect -import pekko.stream.scaladsl.Keep import pekko.stream.{ RestartSettings, SystemMaterializer, WatchedActorTerminatedException } -import pekko.stream.scaladsl.Source import pekko.stream.scaladsl.{ RestartSource, Sink } +import pekko.stream.scaladsl.Keep +import pekko.stream.scaladsl.Source import pekko.stream.typed.scaladsl.ActorFlow import pekko.util.OptionVal -import pekko.util.unused import pekko.util.Timeout +import pekko.util.unused /** * INTERNAL API diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/VersionVector.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/VersionVector.scala index d8a2ab99e2..f79bbb24d6 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/VersionVector.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/VersionVector.scala @@ -14,6 +14,7 @@ package org.apache.pekko.persistence.typed.internal import scala.annotation.tailrec import scala.collection.immutable.TreeMap + import org.apache.pekko.annotation.InternalApi /** diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/Effect.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/Effect.scala index 1f5bd607cb..fc6ed9e2b2 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/Effect.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/Effect.scala @@ -13,6 +13,8 @@ package org.apache.pekko.persistence.typed.javadsl +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.annotation.DoNotInherit @@ -20,7 +22,6 @@ import pekko.annotation.InternalApi import pekko.japi.function import pekko.persistence.typed.internal._ import pekko.persistence.typed.internal.SideEffect -import scala.jdk.CollectionConverters._ /** * INTERNAL API: see `class EffectFactories` diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventHandler.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventHandler.scala index 973682fd48..b2ed2e322b 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventHandler.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventHandler.scala @@ -18,8 +18,8 @@ import java.util.function.{ BiFunction, Function => JFunction, Predicate, Suppli import org.apache.pekko import pekko.annotation.InternalApi -import pekko.util.OptionVal import pekko.util.FunctionConverters._ +import pekko.util.OptionVal /** * FunctionalInterface for reacting on events having been persisted diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehavior.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehavior.scala index f0a17fed6d..6d8d88c344 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehavior.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehavior.scala @@ -16,7 +16,8 @@ package org.apache.pekko.persistence.typed.javadsl import java.util.Collections import java.util.Optional -import com.typesafe.config.Config +import scala.jdk.OptionConverters._ + import org.apache.pekko import pekko.actor.typed import pekko.actor.typed.BackoffSupervisorStrategy @@ -27,9 +28,10 @@ import pekko.annotation.InternalApi import pekko.persistence.typed._ import pekko.persistence.typed.EventAdapter import pekko.persistence.typed.internal._ -import scala.jdk.OptionConverters._ import pekko.util.unused +import com.typesafe.config.Config + abstract class EventSourcedBehavior[Command, Event, State] private[pekko] ( val persistenceId: PersistenceId, onPersistFailure: Optional[BackoffSupervisorStrategy]) diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/PersistentFSMMigration.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/PersistentFSMMigration.scala index 9005513eeb..e97c1894b2 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/PersistentFSMMigration.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/PersistentFSMMigration.scala @@ -16,11 +16,12 @@ package org.apache.pekko.persistence.typed.javadsl import java.time.Duration import java.util.Optional +import scala.jdk.DurationConverters._ +import scala.jdk.OptionConverters._ + import org.apache.pekko import pekko.japi.function.Function3 import pekko.persistence.typed.SnapshotAdapter -import scala.jdk.DurationConverters._ -import scala.jdk.OptionConverters._ /** * Helper functions for migration from PersistentFSM to Persistence Typed diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/ReplicatedEventSourcing.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/ReplicatedEventSourcing.scala index 831c99f59e..9fbc6d15e3 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/ReplicatedEventSourcing.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/ReplicatedEventSourcing.scala @@ -13,9 +13,11 @@ package org.apache.pekko.persistence.typed.javadsl -import java.util.function.{ Function => JFunction } -import java.util.{ Set => JSet } import java.util.{ Map => JMap } +import java.util.{ Set => JSet } +import java.util.function.{ Function => JFunction } + +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.annotation.DoNotInherit @@ -23,7 +25,6 @@ import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.ReplicaId import pekko.persistence.typed.ReplicationId import pekko.persistence.typed.internal.ReplicationContextImpl -import scala.jdk.CollectionConverters._ /** * Provides access to replication specific state diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehavior.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehavior.scala index 03ba7714d1..5563e8f084 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehavior.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehavior.scala @@ -13,7 +13,8 @@ package org.apache.pekko.persistence.typed.scaladsl -import com.typesafe.config.Config +import scala.annotation.tailrec + import org.apache.pekko import pekko.actor.typed.BackoffSupervisorStrategy import pekko.actor.typed.Behavior @@ -30,7 +31,7 @@ import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.SnapshotAdapter import pekko.persistence.typed.internal._ -import scala.annotation.tailrec +import com.typesafe.config.Config object EventSourcedBehavior { diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/serialization/ReplicatedEventSourcingSerializer.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/serialization/ReplicatedEventSourcingSerializer.scala index 0c9ce88ef0..18338f09ba 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/serialization/ReplicatedEventSourcingSerializer.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/serialization/ReplicatedEventSourcingSerializer.scala @@ -13,9 +13,14 @@ package org.apache.pekko.persistence.typed.serialization +import java.{ lang => jl } import java.io.NotSerializableException import java.util.{ ArrayList, Collections, Comparator } -import java.{ lang => jl } + +import scala.annotation.tailrec +import scala.collection.immutable.TreeMap +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.annotation.InternalApi @@ -24,19 +29,14 @@ import pekko.persistence.typed.ReplicaId import pekko.persistence.typed.crdt.{ Counter, ORSet } import pekko.persistence.typed.internal.PublishedEventImpl import pekko.persistence.typed.internal.ReplicatedEventMetadata -import pekko.persistence.typed.internal.ReplicatedSnapshotMetadata import pekko.persistence.typed.internal.ReplicatedPublishedEventMetaData +import pekko.persistence.typed.internal.ReplicatedSnapshotMetadata import pekko.persistence.typed.internal.VersionVector import pekko.remote.ByteStringUtils import pekko.remote.ContainerFormats.Payload import pekko.remote.serialization.WrappedPayloadSupport import pekko.serialization.{ BaseSerializer, SerializerWithStringManifest } -import scala.annotation.tailrec -import scala.jdk.CollectionConverters._ - -import scala.collection.immutable.TreeMap - /** * INTERNAL API */ diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/BehaviorSetup.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/BehaviorSetup.scala index 924f03e5f4..c74421ab20 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/BehaviorSetup.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/BehaviorSetup.scala @@ -15,24 +15,24 @@ package org.apache.pekko.persistence.typed.state.internal import scala.util.control.NonFatal -import org.slf4j.Logger -import org.slf4j.MDC - import org.apache.pekko +import pekko.actor.{ ActorRef => ClassicActorRef } import pekko.actor.Cancellable import pekko.actor.typed.Signal import pekko.actor.typed.scaladsl.ActorContext -import pekko.actor.{ ActorRef => ClassicActorRef } import pekko.annotation.InternalApi import pekko.persistence._ -import pekko.persistence.typed.state.internal.InternalProtocol.RecoveryTimeout -import pekko.persistence.typed.state.scaladsl.DurableStateBehavior import pekko.persistence.state.DurableStateStoreRegistry import pekko.persistence.state.scaladsl.DurableStateUpdateStore import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.SnapshotAdapter +import pekko.persistence.typed.state.internal.InternalProtocol.RecoveryTimeout +import pekko.persistence.typed.state.scaladsl.DurableStateBehavior import pekko.util.OptionVal +import org.slf4j.Logger +import org.slf4j.MDC + /** * INTERNAL API: Carry state for the `DurableStateBehavior` implementation behaviors. */ diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateBehaviorImpl.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateBehaviorImpl.scala index b87589e68f..89497c45db 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateBehaviorImpl.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateBehaviorImpl.scala @@ -13,8 +13,6 @@ package org.apache.pekko.persistence.typed.state.internal -import org.slf4j.LoggerFactory - import org.apache.pekko import pekko.actor.typed import pekko.actor.typed.ActorRef @@ -29,13 +27,15 @@ import pekko.actor.typed.scaladsl.ActorContext import pekko.actor.typed.scaladsl.Behaviors import pekko.annotation._ import pekko.persistence.RecoveryPermitter -import pekko.persistence.typed.state.scaladsl._ import pekko.persistence.state.exception.DurableStateException import pekko.persistence.state.scaladsl.GetObjectResult import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.SnapshotAdapter +import pekko.persistence.typed.state.scaladsl._ import pekko.util.unused +import org.slf4j.LoggerFactory + @InternalApi private[pekko] object DurableStateBehaviorImpl { diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateSettings.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateSettings.scala index 4d1d472794..df66eaeb39 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateSettings.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateSettings.scala @@ -15,16 +15,16 @@ package org.apache.pekko.persistence.typed.state.internal import java.util.concurrent.TimeUnit -import scala.concurrent.duration.FiniteDuration import scala.concurrent.duration._ - -import com.typesafe.config.Config +import scala.concurrent.duration.FiniteDuration import org.apache.pekko import pekko.actor.typed.ActorSystem import pekko.annotation.InternalApi import pekko.persistence.Persistence +import com.typesafe.config.Config + /** * INTERNAL API */ diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala index c4449d6215..a8b592ff3c 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala @@ -14,16 +14,16 @@ package org.apache.pekko.persistence.typed.state.javadsl import java.util.Objects +import java.util.function.{ Function => JFunction } import java.util.function.BiFunction import java.util.function.Predicate import java.util.function.Supplier -import java.util.function.{ Function => JFunction } import org.apache.pekko import pekko.annotation.InternalApi import pekko.persistence.typed.state.internal._ -import pekko.util.OptionVal import pekko.util.FunctionConverters._ +import pekko.util.OptionVal /** * FunctionalInterface for reacting on commands diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandlerWithReply.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandlerWithReply.scala index 657a82f5a7..67d5103f2d 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandlerWithReply.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandlerWithReply.scala @@ -14,16 +14,16 @@ package org.apache.pekko.persistence.typed.state.javadsl import java.util.Objects +import java.util.function.{ Function => JFunction } import java.util.function.BiFunction import java.util.function.Predicate import java.util.function.Supplier -import java.util.function.{ Function => JFunction } import org.apache.pekko import pekko.annotation.InternalApi import pekko.persistence.typed.state.internal._ -import pekko.util.OptionVal import pekko.util.FunctionConverters._ +import pekko.util.OptionVal /* Note that this is a copy of CommandHandler.scala to support ReplyEffect * s/Effect/ReplyEffect/ diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/DurableStateBehavior.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/DurableStateBehavior.scala index 7aebd4422b..bfe61836fc 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/DurableStateBehavior.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/DurableStateBehavior.scala @@ -23,11 +23,11 @@ import pekko.actor.typed.internal.BehaviorImpl.DeferredBehavior import pekko.actor.typed.javadsl.ActorContext import pekko.annotation.ApiMayChange import pekko.annotation.InternalApi +import pekko.persistence.typed.PersistenceId +import pekko.persistence.typed.SnapshotAdapter import pekko.persistence.typed.state.internal import pekko.persistence.typed.state.internal._ import pekko.persistence.typed.state.scaladsl -import pekko.persistence.typed.PersistenceId -import pekko.persistence.typed.SnapshotAdapter /** * A `Behavior` for a persistent actor with durable storage of its state. diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/Effect.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/Effect.scala index 17fd83947d..3cccde5bf6 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/Effect.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/Effect.scala @@ -19,8 +19,8 @@ import pekko.annotation.ApiMayChange import pekko.annotation.DoNotInherit import pekko.annotation.InternalApi import pekko.japi.function -import pekko.persistence.typed.state.internal.SideEffect import pekko.persistence.typed.state.internal._ +import pekko.persistence.typed.state.internal.SideEffect /** * INTERNAL API: see `class EffectFactories` diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehavior.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehavior.scala index 998c0dbcdf..b623f36632 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehavior.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/scaladsl/DurableStateBehavior.scala @@ -25,9 +25,9 @@ import pekko.actor.typed.internal.LoggerClass import pekko.actor.typed.scaladsl.ActorContext import pekko.annotation.ApiMayChange import pekko.annotation.DoNotInherit -import pekko.persistence.typed.state.internal._ import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.SnapshotAdapter +import pekko.persistence.typed.state.internal._ /** * API May Change diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/scaladsl/Effect.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/scaladsl/Effect.scala index e0209d6e3f..90e0bae0a0 100644 --- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/scaladsl/Effect.scala +++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/scaladsl/Effect.scala @@ -17,8 +17,8 @@ import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.annotation.ApiMayChange import pekko.annotation.DoNotInherit -import pekko.persistence.typed.state.internal.SideEffect import pekko.persistence.typed.state.internal._ +import pekko.persistence.typed.state.internal.SideEffect /** * Factory methods for creating [[Effect]] directives - how a `DurableStateBehavior` reacts on a command. diff --git a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/ClusterSingletonPersistenceSpec.scala b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/ClusterSingletonPersistenceSpec.scala index fde922f085..fd93908bad 100644 --- a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/ClusterSingletonPersistenceSpec.scala +++ b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/ClusterSingletonPersistenceSpec.scala @@ -13,9 +13,6 @@ package org.apache.pekko.persistence.typed -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -29,6 +26,10 @@ import pekko.cluster.typed.SingletonActor import pekko.persistence.typed.scaladsl.Effect import pekko.persistence.typed.scaladsl.EventSourcedBehavior +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + object ClusterSingletonPersistenceSpec { val config = ConfigFactory.parseString(""" pekko.actor.provider = cluster diff --git a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/ManyRecoveriesSpec.scala b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/ManyRecoveriesSpec.scala index fed313043f..21c868594d 100644 --- a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/ManyRecoveriesSpec.scala +++ b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/ManyRecoveriesSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.persistence.typed import scala.concurrent.Await import scala.concurrent.duration._ -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -28,6 +26,8 @@ import pekko.persistence.typed.scaladsl.{ Effect, EventSourcedBehavior } import pekko.persistence.typed.scaladsl.EventSourcedBehavior.CommandHandler import pekko.testkit.TestLatch +import org.scalatest.wordspec.AnyWordSpecLike + object ManyRecoveriesSpec { sealed case class Cmd(s: String) diff --git a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/PersistenceIdSpec.scala b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/PersistenceIdSpec.scala index 2886264f32..db73aa10d4 100644 --- a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/PersistenceIdSpec.scala +++ b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/PersistenceIdSpec.scala @@ -13,11 +13,11 @@ package org.apache.pekko.persistence.typed +import org.apache.pekko.actor.testkit.typed.scaladsl.LogCapturing + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import org.apache.pekko.actor.testkit.typed.scaladsl.LogCapturing - class PersistenceIdSpec extends AnyWordSpec with Matchers with LogCapturing { "PersistenceId" must { diff --git a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/ReplicatedEventSourcingSerializationSpec.scala b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/ReplicatedEventSourcingSerializationSpec.scala index 70edc77aa0..c048cf1453 100644 --- a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/ReplicatedEventSourcingSerializationSpec.scala +++ b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/ReplicatedEventSourcingSerializationSpec.scala @@ -21,6 +21,7 @@ import pekko.persistence.typed.crdt.ORSet import pekko.persistence.typed.internal.ReplicatedEventMetadata import pekko.persistence.typed.internal.ReplicatedSnapshotMetadata import pekko.persistence.typed.internal.VersionVector + import org.scalatest.wordspec.AnyWordSpecLike class ReplicatedEventSourcingSerializationSpec diff --git a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/StashingWhenSnapshottingSpec.scala b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/StashingWhenSnapshottingSpec.scala index 165213a159..404746b9b3 100644 --- a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/StashingWhenSnapshottingSpec.scala +++ b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/StashingWhenSnapshottingSpec.scala @@ -19,9 +19,6 @@ import scala.concurrent.Future import scala.concurrent.Promise import scala.util.Success -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -37,6 +34,10 @@ import pekko.persistence.typed.StashingWhenSnapshottingSpec.ControllableSnapshot import pekko.persistence.typed.scaladsl.Effect import pekko.persistence.typed.scaladsl.EventSourcedBehavior +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + object StashingWhenSnapshottingSpec { object ControllableSnapshotStoreExt extends ExtensionId[ControllableSnapshotStoreExt] { diff --git a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/delivery/EventSourcedProducerQueueSpec.scala b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/delivery/EventSourcedProducerQueueSpec.scala index 02dca35216..470f67a280 100644 --- a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/delivery/EventSourcedProducerQueueSpec.scala +++ b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/delivery/EventSourcedProducerQueueSpec.scala @@ -18,10 +18,6 @@ import java.util.concurrent.atomic.AtomicInteger import scala.concurrent.duration._ -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl._ import pekko.actor.typed.delivery.DurableProducerQueue.Confirmed @@ -36,6 +32,11 @@ import pekko.actor.typed.eventstream.EventStream import pekko.persistence.journal.inmem.InmemJournal import pekko.persistence.typed.PersistenceId +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object EventSourcedProducerQueueSpec { def conf: Config = ConfigFactory.parseString(s""" diff --git a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/delivery/ReliableDeliveryWithEventSourcedProducerQueueSpec.scala b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/delivery/ReliableDeliveryWithEventSourcedProducerQueueSpec.scala index 221a2d537e..802f255dd7 100644 --- a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/delivery/ReliableDeliveryWithEventSourcedProducerQueueSpec.scala +++ b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/delivery/ReliableDeliveryWithEventSourcedProducerQueueSpec.scala @@ -15,16 +15,17 @@ package org.apache.pekko.persistence.typed.delivery import java.util.UUID -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl._ import pekko.actor.typed.delivery.ConsumerController import pekko.actor.typed.delivery.ProducerController import pekko.persistence.typed.PersistenceId +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object ReliableDeliveryWithEventSourcedProducerQueueSpec { def conf: Config = ConfigFactory.parseString(s""" diff --git a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/delivery/WorkPullingWithEventSourcedProducerQueueSpec.scala b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/delivery/WorkPullingWithEventSourcedProducerQueueSpec.scala index cc4de0f1a4..ca428d4c45 100644 --- a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/delivery/WorkPullingWithEventSourcedProducerQueueSpec.scala +++ b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/delivery/WorkPullingWithEventSourcedProducerQueueSpec.scala @@ -13,13 +13,10 @@ package org.apache.pekko.persistence.typed.delivery -import scala.concurrent.duration._ import java.util.UUID import java.util.concurrent.atomic.AtomicInteger -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike +import scala.concurrent.duration._ import org.apache.pekko import pekko.actor.testkit.typed.FishingOutcome @@ -29,6 +26,11 @@ import pekko.actor.typed.delivery.WorkPullingProducerController import pekko.actor.typed.receptionist.ServiceKey import pekko.persistence.typed.PersistenceId +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object WorkPullingWithEventSourcedProducerQueueSpec { def conf: Config = ConfigFactory.parseString(s""" diff --git a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/internal/RecoveryPermitterSpec.scala b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/internal/RecoveryPermitterSpec.scala index fcd3e6bcd2..6eae8d0fd4 100644 --- a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/internal/RecoveryPermitterSpec.scala +++ b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/internal/RecoveryPermitterSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.persistence.typed.internal import scala.concurrent.duration._ import scala.util.control.NoStackTrace -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.ActorSystem import pekko.actor.PoisonPill @@ -35,6 +33,8 @@ import pekko.persistence.typed.RecoveryCompleted import pekko.persistence.typed.scaladsl.{ Effect, EventSourcedBehavior } import pekko.persistence.typed.scaladsl.EventSourcedBehavior.CommandHandler +import org.scalatest.wordspec.AnyWordSpecLike + object RecoveryPermitterSpec { class TE extends RuntimeException("Boom!") with NoStackTrace diff --git a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/internal/RetentionCriteriaSpec.scala b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/internal/RetentionCriteriaSpec.scala index c4f1e332c5..d8a903ab4e 100644 --- a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/internal/RetentionCriteriaSpec.scala +++ b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/internal/RetentionCriteriaSpec.scala @@ -13,14 +13,14 @@ package org.apache.pekko.persistence.typed.internal -import org.scalatest.TestSuite -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.persistence.typed.scaladsl.RetentionCriteria +import org.scalatest.TestSuite +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + class RetentionCriteriaSpec extends TestSuite with Matchers with AnyWordSpecLike with LogCapturing { "RetentionCriteria" must { diff --git a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/internal/StashStateSpec.scala b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/internal/StashStateSpec.scala index 80b710a8dd..3695d9692d 100644 --- a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/internal/StashStateSpec.scala +++ b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/internal/StashStateSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.persistence.typed.internal import scala.concurrent.duration._ -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing import pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -26,6 +24,8 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.persistence.typed.internal.InternalProtocol.IncomingCommand import pekko.persistence.typed.internal.InternalProtocol.RecoveryPermitGranted +import org.scalatest.wordspec.AnyWordSpecLike + class StashStateSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "StashState" should { diff --git a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/PersistentActorCompileOnlyTest.scala b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/PersistentActorCompileOnlyTest.scala index 909a09de51..a7d7638964 100644 --- a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/PersistentActorCompileOnlyTest.scala +++ b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/PersistentActorCompileOnlyTest.scala @@ -13,6 +13,11 @@ package org.apache.pekko.persistence.typed.scaladsl +import scala.annotation.nowarn +import scala.concurrent.ExecutionContext +import scala.concurrent.Future +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.actor.typed.ActorSystem @@ -22,11 +27,6 @@ import pekko.actor.typed.scaladsl.TimerScheduler import pekko.persistence.typed.PersistenceId import pekko.persistence.typed.RecoveryCompleted -import scala.annotation.nowarn -import scala.concurrent.ExecutionContext -import scala.concurrent.Future -import scala.concurrent.duration._ - // unused names in pattern match can be useful in the docs @nowarn object PersistentActorCompileOnlyTest { diff --git a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/SnapshotIsOptionalSpec.scala b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/SnapshotIsOptionalSpec.scala index 69d9a0d432..1bb7ca59d4 100644 --- a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/SnapshotIsOptionalSpec.scala +++ b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/scaladsl/SnapshotIsOptionalSpec.scala @@ -17,9 +17,6 @@ import java.util.UUID import java.util.concurrent.atomic.AtomicInteger import com.fasterxml.jackson.annotation.JsonCreator -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import org.scalatest.wordspec.AnyWordSpecLike import org.apache.pekko import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -28,6 +25,11 @@ import pekko.actor.typed.ActorRef import pekko.persistence.typed.PersistenceId import pekko.serialization.jackson.CborSerializable +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object SnapshotIsOptionalSpec { private val conf: Config = ConfigFactory.parseString(s""" pekko.persistence.journal.plugin = "pekko.persistence.journal.inmem" diff --git a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/serialization/ReplicatedEventSourcingSerializerSpec.scala b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/serialization/ReplicatedEventSourcingSerializerSpec.scala index 5547db73f5..32d8b72fa2 100644 --- a/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/serialization/ReplicatedEventSourcingSerializerSpec.scala +++ b/persistence-typed/src/test/scala/org/apache/pekko/persistence/typed/serialization/ReplicatedEventSourcingSerializerSpec.scala @@ -23,6 +23,7 @@ import pekko.persistence.typed.crdt.ORSet import pekko.persistence.typed.internal.PublishedEventImpl import pekko.persistence.typed.internal.ReplicatedPublishedEventMetaData import pekko.persistence.typed.internal.VersionVector + import org.scalatest.wordspec.AnyWordSpecLike class ReplicatedEventSourcingSerializerSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/Eventsourced.scala b/persistence/src/main/scala/org/apache/pekko/persistence/Eventsourced.scala index eea04cff76..b20934245b 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/Eventsourced.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/Eventsourced.scala @@ -16,13 +16,11 @@ package org.apache.pekko.persistence import java.util.UUID import java.util.concurrent.atomic.AtomicInteger +import scala.annotation.nowarn import scala.collection.immutable import scala.concurrent.duration.FiniteDuration import scala.util.control.NonFatal -import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ Actor, ActorCell, DeadLetter, StashOverflowException } import pekko.annotation.{ InternalApi, InternalStableApi } @@ -30,6 +28,8 @@ import pekko.dispatch.Envelope import pekko.event.{ Logging, LoggingAdapter } import pekko.util.Helpers.ConfigOps +import com.typesafe.config.ConfigFactory + /** INTERNAL API */ @InternalApi private[persistence] object Eventsourced { diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/Persistence.scala b/persistence/src/main/scala/org/apache/pekko/persistence/Persistence.scala index c3cc3a1e03..4f2bd2d57a 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/Persistence.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/Persistence.scala @@ -21,8 +21,6 @@ import scala.collection.immutable import scala.concurrent.duration._ import scala.util.control.NonFatal -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.actor._ import pekko.annotation.InternalApi @@ -34,6 +32,8 @@ import pekko.util.Collections.EmptyImmutableSeq import pekko.util.Helpers.ConfigOps import pekko.util.Reflect +import com.typesafe.config.{ Config, ConfigFactory } + /** * Persistence configuration. */ diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/PersistencePlugin.scala b/persistence/src/main/scala/org/apache/pekko/persistence/PersistencePlugin.scala index 46d5412398..e125a96ca1 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/PersistencePlugin.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/PersistencePlugin.scala @@ -19,14 +19,14 @@ import scala.annotation.tailrec import scala.reflect.ClassTag import scala.util.Failure -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.{ ExtendedActorSystem, Extension, ExtensionId } import pekko.annotation.InternalApi import pekko.event.Logging import pekko.persistence.PersistencePlugin.PluginHolder +import com.typesafe.config.Config + /** * INTERNAL API */ diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/PersistentActor.scala b/persistence/src/main/scala/org/apache/pekko/persistence/PersistentActor.scala index df69333fe9..239999d84d 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/PersistentActor.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/PersistentActor.scala @@ -18,13 +18,13 @@ import java.lang.{ Iterable => JIterable } import scala.collection.immutable import scala.util.control.NoStackTrace -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor._ import pekko.annotation.InternalApi -import pekko.japi.function.Procedure import pekko.japi.Util +import pekko.japi.function.Procedure + +import com.typesafe.config.Config abstract class RecoveryCompleted diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSM.scala b/persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSM.scala index 223c5fba13..df67e50519 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSM.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSM.scala @@ -13,15 +13,13 @@ package org.apache.pekko.persistence.fsm +import scala.annotation.nowarn import scala.annotation.varargs import scala.collection.immutable import scala.concurrent.ExecutionContextExecutor import scala.concurrent.duration._ import scala.reflect.ClassTag -import scala.annotation.nowarn -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor._ import pekko.annotation.InternalApi @@ -29,6 +27,8 @@ import pekko.persistence.{ PersistentActor, RecoveryCompleted, SnapshotOffer } import pekko.persistence.fsm.PersistentFSM.FSMState import pekko.persistence.serialization.Message +import com.typesafe.config.Config + /** * SnapshotAfter Extension Id and factory for creating SnapshotAfter extension */ diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala b/persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala index be7867c6c6..c83f0c930c 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala @@ -15,15 +15,15 @@ package org.apache.pekko.persistence.fsm import scala.collection.mutable import scala.concurrent.duration.FiniteDuration +import scala.jdk.DurationConverters._ import language.implicitConversions import org.apache.pekko -import pekko.japi.function.{ Effect, Function2, Predicate, Predicate2, Procedure, Procedure2, Procedure3 } import pekko.actor._ +import pekko.japi.function.{ Effect, Function2, Predicate, Predicate2, Procedure, Procedure2, Procedure3 } import pekko.japi.pf.{ FSMTransitionHandlerBuilder, UnitMatch, UnitPFBuilder } import pekko.routing.{ Deafen, Listen, Listeners } -import scala.jdk.DurationConverters._ import pekko.util.unused /** diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/journal/EventAdapters.scala b/persistence/src/main/scala/org/apache/pekko/persistence/journal/EventAdapters.scala index 234d71cbe8..b2d55379fe 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/journal/EventAdapters.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/journal/EventAdapters.scala @@ -21,12 +21,12 @@ import scala.collection.mutable.ArrayBuffer import scala.reflect.ClassTag import scala.util.Try -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.event.{ Logging, LoggingAdapter } +import com.typesafe.config.Config + /** * `EventAdapters` serves as a per-journal collection of bound event adapters. */ diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/journal/PersistencePluginProxy.scala b/persistence/src/main/scala/org/apache/pekko/persistence/journal/PersistencePluginProxy.scala index 3878ed869c..3711e06303 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/journal/PersistencePluginProxy.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/journal/PersistencePluginProxy.scala @@ -18,8 +18,6 @@ import java.util.concurrent.TimeoutException import scala.concurrent.duration._ -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor._ import pekko.persistence.{ @@ -35,6 +33,8 @@ import pekko.persistence.{ } import pekko.util.Helpers.Requiring +import com.typesafe.config.Config + object PersistencePluginProxy { final case class TargetLocation(address: Address) private case object InitTimeout diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/journal/inmem/InmemJournal.scala b/persistence/src/main/scala/org/apache/pekko/persistence/journal/inmem/InmemJournal.scala index ec0c5352d5..4888a6f789 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/journal/inmem/InmemJournal.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/journal/inmem/InmemJournal.scala @@ -13,27 +13,28 @@ package org.apache.pekko.persistence.journal.inmem -import org.apache.pekko -import pekko.actor.ActorRef - import scala.collection.immutable import scala.concurrent.Future import scala.util.Try import scala.util.control.NonFatal -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory + +import org.apache.pekko +import pekko.actor.ActorRef import pekko.annotation.ApiMayChange import pekko.annotation.InternalApi import pekko.event.Logging import pekko.persistence.AtomicWrite import pekko.persistence.JournalProtocol.RecoverySuccess import pekko.persistence.PersistentRepr -import pekko.persistence.journal.inmem.InmemJournal.{ MessageWithMeta, ReplayWithMeta } import pekko.persistence.journal.{ AsyncWriteJournal, Tagged } +import pekko.persistence.journal.inmem.InmemJournal.{ MessageWithMeta, ReplayWithMeta } import pekko.serialization.SerializationExtension import pekko.serialization.Serializers import pekko.util.OptionVal +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + /** * The InmemJournal publishes writes and deletes to the `eventStream`, which tests may use to * verify that expected events have been persisted or deleted. diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/journal/japi/AsyncRecovery.scala b/persistence/src/main/scala/org/apache/pekko/persistence/journal/japi/AsyncRecovery.scala index 26878fc56b..38375b399d 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/journal/japi/AsyncRecovery.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/journal/japi/AsyncRecovery.scala @@ -15,15 +15,15 @@ package org.apache.pekko.persistence.journal.japi import java.util.function.Consumer +import scala.concurrent.ExecutionContext import scala.concurrent.Future +import scala.jdk.FutureConverters._ import org.apache.pekko import pekko.actor.Actor -import scala.concurrent.ExecutionContext import pekko.persistence.PersistentRepr import pekko.persistence.journal.{ AsyncRecovery => SAsyncReplay } import pekko.util.ConstantFun.scalaAnyToUnit -import scala.jdk.FutureConverters._ /** * Java API: asynchronous message replay and sequence number recovery interface. diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/journal/japi/AsyncWriteJournal.scala b/persistence/src/main/scala/org/apache/pekko/persistence/journal/japi/AsyncWriteJournal.scala index 5ee272bf1b..bdedb96330 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/journal/japi/AsyncWriteJournal.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/journal/japi/AsyncWriteJournal.scala @@ -14,17 +14,17 @@ package org.apache.pekko.persistence.journal.japi import scala.collection.immutable +import scala.concurrent.ExecutionContext import scala.concurrent.Future +import scala.jdk.CollectionConverters._ +import scala.jdk.FutureConverters._ import scala.util.Failure import scala.util.Try import org.apache.pekko -import scala.concurrent.ExecutionContext import pekko.persistence._ import pekko.persistence.journal.{ AsyncWriteJournal => SAsyncWriteJournal } import pekko.util.ConstantFun.scalaAnyToUnit -import scala.jdk.FutureConverters._ -import scala.jdk.CollectionConverters._ /** * Java API: abstract journal, optimized for asynchronous, non-blocking writes. diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/journal/leveldb/LeveldbJournal.scala b/persistence/src/main/scala/org/apache/pekko/persistence/journal/leveldb/LeveldbJournal.scala index 2021f11120..fbc36b3fff 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/journal/leveldb/LeveldbJournal.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/journal/leveldb/LeveldbJournal.scala @@ -15,9 +15,6 @@ package org.apache.pekko.persistence.journal.leveldb import scala.concurrent.Future -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.pattern.pipe @@ -29,6 +26,9 @@ import pekko.persistence.journal._ import pekko.util.Helpers.ConfigOps import pekko.util.Timeout +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + /** * INTERNAL API. * diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/journal/leveldb/LeveldbStore.scala b/persistence/src/main/scala/org/apache/pekko/persistence/journal/leveldb/LeveldbStore.scala index 869eddf01e..09da8bd19b 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/journal/leveldb/LeveldbStore.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/journal/leveldb/LeveldbStore.scala @@ -18,10 +18,10 @@ import java.io.File import scala.collection.immutable import scala.collection.mutable import scala.concurrent.Future +import scala.jdk.CollectionConverters._ import scala.util._ import scala.util.control.NonFatal -import com.typesafe.config.{ Config, ConfigFactory, ConfigObject } import org.iq80.leveldb._ import org.apache.pekko @@ -30,7 +30,8 @@ import pekko.persistence._ import pekko.persistence.journal.Tagged import pekko.persistence.journal.WriteJournalBase import pekko.serialization.SerializationExtension -import scala.jdk.CollectionConverters._ + +import com.typesafe.config.{ Config, ConfigFactory, ConfigObject } private[persistence] object LeveldbStore { val emptyConfig = ConfigFactory.empty() diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/journal/leveldb/SharedLeveldbStore.scala b/persistence/src/main/scala/org/apache/pekko/persistence/journal/leveldb/SharedLeveldbStore.scala index 4d62c4d2d4..3a5592205c 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/journal/leveldb/SharedLeveldbStore.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/journal/leveldb/SharedLeveldbStore.scala @@ -19,13 +19,13 @@ import scala.util.Success import scala.util.Try import scala.util.control.NonFatal -import com.typesafe.config.Config - import org.apache.pekko import pekko.pattern.pipe import pekko.persistence.AtomicWrite import pekko.persistence.journal.AsyncWriteTarget +import com.typesafe.config.Config + /** * A LevelDB store that can be shared by multiple actor systems. The shared store must be * set for each actor system that uses the store via `SharedLeveldbJournal.setStore`. The diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/serialization/MessageSerializer.scala b/persistence/src/main/scala/org/apache/pekko/persistence/serialization/MessageSerializer.scala index d6648cd5f7..ffc4963774 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/serialization/MessageSerializer.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/serialization/MessageSerializer.scala @@ -14,11 +14,13 @@ package org.apache.pekko.persistence.serialization import java.io.NotSerializableException + +import scala.annotation.nowarn import scala.collection.immutable import scala.collection.immutable.VectorBuilder import scala.concurrent.duration import scala.concurrent.duration.Duration -import scala.annotation.nowarn + import org.apache.pekko import pekko.actor.{ ActorPath, ExtendedActorSystem } import pekko.actor.Actor diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/snapshot/japi/SnapshotStore.scala b/persistence/src/main/scala/org/apache/pekko/persistence/snapshot/japi/SnapshotStore.scala index 46109416a1..2f2953ebd5 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/snapshot/japi/SnapshotStore.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/snapshot/japi/SnapshotStore.scala @@ -13,14 +13,14 @@ package org.apache.pekko.persistence.snapshot.japi +import scala.concurrent.ExecutionContext import scala.concurrent.Future +import scala.jdk.FutureConverters._ import org.apache.pekko -import scala.concurrent.ExecutionContext import pekko.persistence._ import pekko.persistence.snapshot.{ SnapshotStore => SSnapshotStore } import pekko.util.ConstantFun.scalaAnyToUnit -import scala.jdk.FutureConverters._ /** * Java API: abstract snapshot store. diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/snapshot/local/LocalSnapshotStore.scala b/persistence/src/main/scala/org/apache/pekko/persistence/snapshot/local/LocalSnapshotStore.scala index ffd45cdb56..f2aff5d56b 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/snapshot/local/LocalSnapshotStore.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/snapshot/local/LocalSnapshotStore.scala @@ -22,8 +22,6 @@ import scala.collection.immutable import scala.concurrent.Future import scala.util._ -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.ActorLogging import pekko.persistence._ @@ -32,6 +30,8 @@ import pekko.persistence.snapshot._ import pekko.serialization.SerializationExtension import pekko.util.ByteString.UTF_8 +import com.typesafe.config.Config + /** * INTERNAL API * diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/state/DurableStateStoreRegistry.scala b/persistence/src/main/scala/org/apache/pekko/persistence/state/DurableStateStoreRegistry.scala index 7d8558e0c3..874a6ec7cc 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/state/DurableStateStoreRegistry.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/state/DurableStateStoreRegistry.scala @@ -15,8 +15,6 @@ package org.apache.pekko.persistence.state import scala.reflect.ClassTag -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.ActorSystem import pekko.actor.ClassicActorSystemProvider @@ -31,6 +29,8 @@ import pekko.persistence.PluginProvider import pekko.persistence.state.scaladsl.DurableStateStore import pekko.util.unused +import com.typesafe.config.Config + /** * Persistence extension for queries. */ diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/state/javadsl/DurableStateStore.scala b/persistence/src/main/scala/org/apache/pekko/persistence/state/javadsl/DurableStateStore.scala index 662dcfc128..d659128d44 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/state/javadsl/DurableStateStore.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/state/javadsl/DurableStateStore.scala @@ -16,9 +16,10 @@ package org.apache.pekko.persistence.state.javadsl import java.util.Optional import java.util.concurrent.CompletionStage +import scala.jdk.OptionConverters._ + import org.apache.pekko import pekko.persistence.state.scaladsl.{ GetObjectResult => SGetObjectResult } -import scala.jdk.OptionConverters._ /** * API for reading durable state objects with payload `A`. diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/state/scaladsl/DurableStateStore.scala b/persistence/src/main/scala/org/apache/pekko/persistence/state/scaladsl/DurableStateStore.scala index 7a2710bcca..a93b5875b1 100644 --- a/persistence/src/main/scala/org/apache/pekko/persistence/state/scaladsl/DurableStateStore.scala +++ b/persistence/src/main/scala/org/apache/pekko/persistence/state/scaladsl/DurableStateStore.scala @@ -14,10 +14,10 @@ package org.apache.pekko.persistence.state.scaladsl import scala.concurrent.Future +import scala.jdk.OptionConverters._ import org.apache.pekko import pekko.persistence.state.javadsl.{ GetObjectResult => JGetObjectResult } -import scala.jdk.OptionConverters._ /** * API for reading durable state objects with payload `A`. diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/AtLeastOnceDeliveryFailureSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/AtLeastOnceDeliveryFailureSpec.scala index 4471fe1db9..72daa02564 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/AtLeastOnceDeliveryFailureSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/AtLeastOnceDeliveryFailureSpec.scala @@ -17,12 +17,12 @@ import java.util.concurrent.ThreadLocalRandom import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object AtLeastOnceDeliveryFailureSpec { val config = ConfigFactory.parseString(s""" pekko.persistence.sender.chaos.live-processing-failure-rate = 0.3 diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/EndToEndEventAdapterSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/EndToEndEventAdapterSpec.scala index 0babafe052..f1fc8bb47f 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/EndToEndEventAdapterSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/EndToEndEventAdapterSpec.scala @@ -18,11 +18,7 @@ import java.io.File import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigFactory } import org.apache.commons.io.FileUtils -import org.scalatest.BeforeAndAfterAll -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike import org.apache.pekko import pekko.actor._ @@ -30,6 +26,12 @@ import pekko.persistence.journal.{ EventAdapter, EventSeq } import pekko.testkit.TestProbe import pekko.util.unused +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.{ Config, ConfigFactory } + object EndToEndEventAdapterSpec { trait AppModel { def payload: Any } diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/EventAdapterSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/EventAdapterSpec.scala index 100463f7fd..1467ac1b30 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/EventAdapterSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/EventAdapterSpec.scala @@ -15,14 +15,14 @@ package org.apache.pekko.persistence import scala.collection.immutable -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.actor._ import pekko.event.Logging import pekko.persistence.journal.{ EventAdapter, EventSeq, SingleEventSeq } import pekko.testkit.ImplicitSender +import com.typesafe.config.{ Config, ConfigFactory } + object EventAdapterSpec { final val JournalModelClassName = diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/LoadPluginSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/LoadPluginSpec.scala index dc5e2132df..91a351cf9b 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/LoadPluginSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/LoadPluginSpec.scala @@ -13,14 +13,14 @@ package org.apache.pekko.persistence -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.Actor import pekko.persistence.journal.inmem.InmemJournal import pekko.testkit.ImplicitSender import pekko.util.unused +import com.typesafe.config.Config + object LoadPluginSpec { case object GetConfig diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/ManyRecoveriesSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/ManyRecoveriesSpec.scala index 856c80a57a..d8d70070d2 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/ManyRecoveriesSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/ManyRecoveriesSpec.scala @@ -16,12 +16,12 @@ package org.apache.pekko.persistence import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object ManyRecoveriesSpec { def testProps(name: String, latch: Option[TestLatch]): Props = diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/OptionalSnapshotStoreSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/OptionalSnapshotStoreSpec.scala index 577a1a2b65..bbba51c745 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/OptionalSnapshotStoreSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/OptionalSnapshotStoreSpec.scala @@ -13,14 +13,14 @@ package org.apache.pekko.persistence -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ Actor, Props } import pekko.event.Logging import pekko.event.Logging.Warning import pekko.testkit.{ EventFilter, ImplicitSender, TestEvent } +import com.typesafe.config.ConfigFactory + object OptionalSnapshotStoreSpec { class AnyPersistentActor(name: String) extends PersistentActor { diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/PerformanceSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/PerformanceSpec.scala index f75ce5fc28..1a80465b82 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/PerformanceSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/PerformanceSpec.scala @@ -15,12 +15,12 @@ package org.apache.pekko.persistence import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object PerformanceSpec { val config = """ diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/PersistenceSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/PersistenceSpec.scala index 67c5f4437d..d952cd5949 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/PersistenceSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/PersistenceSpec.scala @@ -20,15 +20,17 @@ import scala.collection.immutable import scala.reflect.ClassTag import scala.util.control.NoStackTrace -import com.typesafe.config.{ Config, ConfigFactory } import org.apache.commons.io.FileUtils -import org.scalatest.BeforeAndAfterEach -import org.scalatest.matchers.{ MatchResult, Matcher } import org.apache.pekko import pekko.actor.Props import pekko.testkit.PekkoSpec +import org.scalatest.BeforeAndAfterEach +import org.scalatest.matchers.{ MatchResult, Matcher } + +import com.typesafe.config.{ Config, ConfigFactory } + abstract class PersistenceSpec(config: Config) extends PekkoSpec(config) with BeforeAndAfterEach diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorBoundedStashingSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorBoundedStashingSpec.scala index f09d5dd430..1b580a14bc 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorBoundedStashingSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorBoundedStashingSpec.scala @@ -15,9 +15,6 @@ package org.apache.pekko.persistence import scala.concurrent.duration._ -import com.typesafe.config.Config -import org.scalatest.BeforeAndAfterEach - import org.apache.pekko import pekko.actor.DeadLetter import pekko.persistence.PersistentActorBoundedStashingSpec._ @@ -26,6 +23,10 @@ import pekko.testkit.EventFilter import pekko.testkit.ImplicitSender import pekko.testkit.TestEvent.Mute +import org.scalatest.BeforeAndAfterEach + +import com.typesafe.config.Config + object PersistentActorBoundedStashingSpec { final case class Cmd(data: Any) final case class Evt(data: Any) diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorJournalProtocolSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorJournalProtocolSpec.scala index 71f25e9554..711037f6a5 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorJournalProtocolSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorJournalProtocolSpec.scala @@ -15,13 +15,13 @@ package org.apache.pekko.persistence import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.persistence.JournalProtocol._ import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object PersistentActorJournalProtocolSpec { val config = ConfigFactory.parseString(""" diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorRecoveryTimeoutSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorRecoveryTimeoutSpec.scala index a16934b678..248c34a7d9 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorRecoveryTimeoutSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorRecoveryTimeoutSpec.scala @@ -15,14 +15,14 @@ package org.apache.pekko.persistence import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ Actor, ActorLogging, ActorRef, Props } import pekko.actor.Status.Failure import pekko.persistence.journal.SteppingInmemJournal import pekko.testkit.{ ImplicitSender, PekkoSpec, TestProbe } +import com.typesafe.config.ConfigFactory + object PersistentActorRecoveryTimeoutSpec { val journalId = "persistent-actor-recovery-timeout-spec" diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorSpec.scala index 00ee94c336..75d666bbd7 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorSpec.scala @@ -15,20 +15,22 @@ package org.apache.pekko.persistence import java.util.concurrent.atomic.AtomicInteger +import scala.annotation.nowarn import scala.collection.immutable.Seq import scala.concurrent.Await import scala.concurrent.duration._ import scala.util.Random import scala.util.control.NoStackTrace -import scala.annotation.nowarn -import com.typesafe.config.{ Config, ConfigFactory } import org.apache.pekko import pekko.actor._ import pekko.persistence.PersistentActorSpec._ import pekko.testkit.{ EventFilter, ImplicitSender, TestLatch, TestProbe } + import org.scalatest.concurrent.Eventually +import com.typesafe.config.{ Config, ConfigFactory } + object PersistentActorSpec { final case class Cmd(data: Any) diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorStashingSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorStashingSpec.scala index a6be948f2b..c9b3936f27 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorStashingSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/PersistentActorStashingSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.persistence import scala.concurrent.duration._ import scala.reflect.ClassTag -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.{ Actor, ActorRef, OneForOneStrategy, Props } import pekko.actor.SupervisorStrategy.Resume @@ -25,6 +23,8 @@ import pekko.persistence.journal.SteppingInmemJournal import pekko.testkit.ImplicitSender import pekko.util.unused +import com.typesafe.config.Config + object PersistentActorStashingSpec { final case class Cmd(data: Any) final case class Evt(data: Any) diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/RecoveryPermitterSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/RecoveryPermitterSpec.scala index 7515afc3ac..bf4a91f98b 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/RecoveryPermitterSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/RecoveryPermitterSpec.scala @@ -16,14 +16,14 @@ package org.apache.pekko.persistence import scala.concurrent.duration._ import scala.util.control.NoStackTrace -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.testkit.{ EventFilter, ImplicitSender, TestEvent } import pekko.testkit.TestActors import pekko.testkit.TestProbe +import com.typesafe.config.ConfigFactory + object RecoveryPermitterSpec { class TestExc extends RuntimeException("simulated exc") with NoStackTrace diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/SnapshotFailureRobustnessSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/SnapshotFailureRobustnessSpec.scala index 5bd3f60b29..7fa9b0e493 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/SnapshotFailureRobustnessSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/SnapshotFailureRobustnessSpec.scala @@ -20,14 +20,14 @@ import java.util.UUID import scala.concurrent.Future import scala.concurrent.duration._ -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.{ ActorRef, Props } import pekko.event.Logging import pekko.persistence.snapshot.local.LocalSnapshotStore import pekko.testkit.{ EventFilter, ImplicitSender, TestEvent } +import com.typesafe.config.Config + object SnapshotFailureRobustnessSpec { case class Cmd(payload: String) diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/TimerPersistentActorSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/TimerPersistentActorSpec.scala index f52fa18c21..b912761755 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/TimerPersistentActorSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/TimerPersistentActorSpec.scala @@ -16,14 +16,14 @@ package org.apache.pekko.persistence import scala.concurrent.duration._ import scala.runtime.BoxedUnit -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.japi.function.Procedure import pekko.testkit.{ EventFilter, ImplicitSender } import pekko.testkit.TestEvent.Mute +import com.typesafe.config.ConfigFactory + object TimerPersistentActorSpec { def testProps(name: String): Props = diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/fsm/PersistentFSMSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/fsm/PersistentFSMSpec.scala index 0ee3f0cba7..c2d2708670 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/fsm/PersistentFSMSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/fsm/PersistentFSMSpec.scala @@ -15,11 +15,10 @@ package org.apache.pekko.persistence.fsm import java.io.File +import scala.annotation.nowarn import scala.concurrent.duration._ import scala.reflect.ClassTag -import scala.annotation.nowarn -import com.typesafe.config.{ Config, ConfigFactory } import org.apache.commons.io.FileUtils import org.apache.pekko @@ -28,6 +27,8 @@ import pekko.persistence._ import pekko.persistence.fsm.PersistentFSM._ import pekko.testkit._ +import com.typesafe.config.{ Config, ConfigFactory } + @nowarn("msg=deprecated|Unused import") abstract class PersistentFSMSpec(config: Config) extends PersistenceSpec(config) with ImplicitSender { import PersistentFSMSpec._ diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/journal/AsyncWriteJournalResponseOrderSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/journal/AsyncWriteJournalResponseOrderSpec.scala index a0faa633c0..c7c9efa58e 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/journal/AsyncWriteJournalResponseOrderSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/journal/AsyncWriteJournalResponseOrderSpec.scala @@ -17,13 +17,13 @@ package org.apache.pekko.persistence.journal -import org.apache.pekko.persistence.{ AtomicWrite, JournalProtocol, PersistenceSpec, PersistentRepr } -import org.apache.pekko.testkit.ImplicitSender - import scala.collection.immutable import scala.concurrent.{ ExecutionContext, Future, Promise } import scala.util.Try +import org.apache.pekko.persistence.{ AtomicWrite, JournalProtocol, PersistenceSpec, PersistentRepr } +import org.apache.pekko.testkit.ImplicitSender + /** * Verifies write response ordering logic for [[AsyncWriteJournal]]. * diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/journal/InmemEventAdaptersSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/journal/InmemEventAdaptersSpec.scala index 174eea4d50..3807fcfb2f 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/journal/InmemEventAdaptersSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/journal/InmemEventAdaptersSpec.scala @@ -13,12 +13,13 @@ package org.apache.pekko.persistence.journal -import com.typesafe.config.ConfigFactory +import scala.annotation.nowarn + import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.testkit.PekkoSpec -import scala.annotation.nowarn +import com.typesafe.config.ConfigFactory @nowarn("msg=Unused import") class InmemEventAdaptersSpec extends PekkoSpec { diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/journal/SteppingInmemJournal.scala b/persistence/src/test/scala/org/apache/pekko/persistence/journal/SteppingInmemJournal.scala index 75d6fd1ddd..6b2c46e335 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/journal/SteppingInmemJournal.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/journal/SteppingInmemJournal.scala @@ -18,8 +18,6 @@ import scala.concurrent.{ Await, Future, Promise } import scala.concurrent.duration._ import scala.util.Try -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.actor.{ ActorRef, ActorSystem } import pekko.pattern.ask @@ -28,6 +26,8 @@ import pekko.persistence.journal.inmem.InmemJournal import pekko.testkit._ import pekko.util.Timeout +import com.typesafe.config.{ Config, ConfigFactory } + object SteppingInmemJournal { /** allow the journal to do one operation */ diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/journal/leveldb/JournalCompactionSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/journal/leveldb/JournalCompactionSpec.scala index 65f6529dd0..04d8c9d9fb 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/journal/leveldb/JournalCompactionSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/journal/leveldb/JournalCompactionSpec.scala @@ -17,7 +17,6 @@ import java.io.File import scala.util.Random -import com.typesafe.config.Config import org.apache.commons.io.FileUtils import org.apache.pekko @@ -27,6 +26,8 @@ import pekko.persistence.journal.leveldb.JournalCompactionSpec.EventLogger._ import pekko.persistence.journal.leveldb.JournalCompactionSpec.SpecComponentBuilder import pekko.testkit.TestProbe +import com.typesafe.config.Config + class JournalNoCompactionSpec extends JournalCompactionSpecBase(SpecComponentBuilder("leveldb-JournalNoCompactionSpec")) { diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/serialization/SnapshotSerializerMigrationAkkaSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/serialization/SnapshotSerializerMigrationAkkaSpec.scala index 952df9ed9c..edc1e263a1 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/serialization/SnapshotSerializerMigrationAkkaSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/serialization/SnapshotSerializerMigrationAkkaSpec.scala @@ -17,15 +17,16 @@ package org.apache.pekko.persistence.serialization -import com.typesafe.config.ConfigFactory +import java.io.NotSerializableException +import java.util.Base64 + import org.apache.pekko import pekko.actor.ActorSystem import pekko.persistence.fsm.PersistentFSM.PersistentFSMSnapshot import pekko.serialization.SerializationExtension import pekko.testkit.PekkoSpec -import java.io.NotSerializableException -import java.util.Base64 +import com.typesafe.config.ConfigFactory class SnapshotSerializerMigrationAkkaSpec extends PekkoSpec( s"${SnapshotAutoMigration.ConfigName}=akka" diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/serialization/SnapshotSerializerNoMigrationSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/serialization/SnapshotSerializerNoMigrationSpec.scala index bab9ede550..695e23e221 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/serialization/SnapshotSerializerNoMigrationSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/serialization/SnapshotSerializerNoMigrationSpec.scala @@ -17,14 +17,14 @@ package org.apache.pekko.persistence.serialization +import java.io.NotSerializableException +import java.util.Base64 + import org.apache.pekko import pekko.persistence.fsm.PersistentFSM.PersistentFSMSnapshot import pekko.serialization.SerializationExtension import pekko.testkit.PekkoSpec -import java.io.NotSerializableException -import java.util.Base64 - class SnapshotSerializerNoMigrationSpec extends PekkoSpec( s"${SnapshotAutoMigration.ConfigName}=no-migration" ) { diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/serialization/SnapshotSerializerSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/serialization/SnapshotSerializerSpec.scala index 6dc0d1502f..ac018561b4 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/serialization/SnapshotSerializerSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/serialization/SnapshotSerializerSpec.scala @@ -17,6 +17,8 @@ package org.apache.pekko.persistence.serialization +import java.util.Base64 + import annotation.nowarn import org.apache.pekko @@ -24,8 +26,6 @@ import pekko.persistence.fsm.PersistentFSM.PersistentFSMSnapshot import pekko.serialization.SerializationExtension import pekko.testkit.PekkoSpec -import java.util.Base64 - @nowarn("msg=deprecated") private[serialization] object SnapshotSerializerTestData { val fsmSnapshot = PersistentFSMSnapshot[String]("test-identifier", "test-data", None) diff --git a/persistence/src/test/scala/org/apache/pekko/persistence/state/exception/DurableStateExceptionsSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/state/exception/DurableStateExceptionsSpec.scala index 0d6dcd7a54..bac0b475a9 100644 --- a/persistence/src/test/scala/org/apache/pekko/persistence/state/exception/DurableStateExceptionsSpec.scala +++ b/persistence/src/test/scala/org/apache/pekko/persistence/state/exception/DurableStateExceptionsSpec.scala @@ -22,8 +22,8 @@ import java.lang.invoke.{ MethodHandles, MethodType } import scala.util.Try import scala.util.control.NoStackTrace -import org.scalatest.wordspec.AnyWordSpecLike import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike /** * Tests for [[DurableStateException]]s. diff --git a/pki/src/main/scala/org/apache/pekko/pki/pem/DERPrivateKeyLoader.scala b/pki/src/main/scala/org/apache/pekko/pki/pem/DERPrivateKeyLoader.scala index 50d5a3db72..342cfd7926 100644 --- a/pki/src/main/scala/org/apache/pekko/pki/pem/DERPrivateKeyLoader.scala +++ b/pki/src/main/scala/org/apache/pekko/pki/pem/DERPrivateKeyLoader.scala @@ -21,14 +21,15 @@ import java.security.spec.RSAMultiPrimePrivateCrtKeySpec import java.security.spec.RSAOtherPrimeInfo import java.security.spec.RSAPrivateCrtKeySpec -import org.apache.pekko -import pekko.annotation.ApiMayChange -import pekko.pki.pem.PEMDecoder.DERData import com.hierynomus.asn1.ASN1InputStream import com.hierynomus.asn1.encodingrules.der.DERDecoder import com.hierynomus.asn1.types.constructed.ASN1Sequence import com.hierynomus.asn1.types.primitive.ASN1Integer +import org.apache.pekko +import pekko.annotation.ApiMayChange +import pekko.pki.pem.PEMDecoder.DERData + final class PEMLoadingException(message: String, cause: Throwable) extends RuntimeException(message, cause) { def this(msg: String) = this(msg, null) } diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/AttemptSysMsgRedeliverySpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/AttemptSysMsgRedeliverySpec.scala index 33b69666b0..02100d41e9 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/AttemptSysMsgRedeliverySpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/AttemptSysMsgRedeliverySpec.scala @@ -15,7 +15,6 @@ package org.apache.pekko.remote import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import testkit.MultiNodeConfig import org.apache.pekko @@ -28,6 +27,8 @@ import pekko.actor.Props import pekko.remote.transport.ThrottlerTransportAdapter.Direction import pekko.testkit._ +import com.typesafe.config.ConfigFactory + class AttemptSysMsgRedeliveryMultiJvmSpec(artery: Boolean) extends MultiNodeConfig { val first = role("first") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/LookupRemoteActorSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/LookupRemoteActorSpec.scala index 599d92e360..fa862c6ee5 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/LookupRemoteActorSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/LookupRemoteActorSpec.scala @@ -13,7 +13,6 @@ package org.apache.pekko.remote -import com.typesafe.config.ConfigFactory import testkit.MultiNodeConfig import org.apache.pekko @@ -25,6 +24,8 @@ import pekko.actor.Props import pekko.pattern.ask import pekko.testkit._ +import com.typesafe.config.ConfigFactory + class LookupRemoteActorMultiJvmSpec(artery: Boolean) extends MultiNodeConfig { commonConfig(debugConfig(on = false).withFallback(ConfigFactory.parseString(s""" diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/NewRemoteActorSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/NewRemoteActorSpec.scala index f6bdb7ea5b..ae840a77f6 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/NewRemoteActorSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/NewRemoteActorSpec.scala @@ -15,7 +15,6 @@ package org.apache.pekko.remote import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import testkit.MultiNodeConfig import org.apache.pekko @@ -25,6 +24,8 @@ import pekko.actor.Props import pekko.actor.Terminated import pekko.util.unused +import com.typesafe.config.ConfigFactory + class NewRemoteActorMultiJvmSpec(artery: Boolean) extends MultiNodeConfig { commonConfig(debugConfig(on = false).withFallback(ConfigFactory.parseString(s""" diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/PiercingShouldKeepQuarantineSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/PiercingShouldKeepQuarantineSpec.scala index 7d72676f98..58beaf88b2 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/PiercingShouldKeepQuarantineSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/PiercingShouldKeepQuarantineSpec.scala @@ -15,13 +15,13 @@ package org.apache.pekko.remote import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + class PiercingShouldKeepQuarantineConfig(artery: Boolean) extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteDeliverySpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteDeliverySpec.scala index 8833f16115..1a5feec9d2 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteDeliverySpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteDeliverySpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.remote import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorIdentity @@ -27,6 +25,8 @@ import pekko.remote.testconductor.RoleName import pekko.remote.testkit.MultiNodeConfig import pekko.serialization.jackson.CborSerializable +import com.typesafe.config.ConfigFactory + class RemoteDeliveryConfig(artery: Boolean) extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteDeploymentDeathWatchSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteDeploymentDeathWatchSpec.scala index 5d1a4dcc4c..1aea319afc 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteDeploymentDeathWatchSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteDeploymentDeathWatchSpec.scala @@ -18,8 +18,6 @@ import java.util.concurrent.TimeoutException import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorSystemImpl @@ -27,6 +25,8 @@ import pekko.actor.Props import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + class RemoteDeploymentDeathWatchMultiJvmSpec(artery: Boolean) extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteFeaturesSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteFeaturesSpec.scala index 8b7c1b9262..d68e6de9f6 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteFeaturesSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteFeaturesSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.remote import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.ActorIdentity import pekko.actor.ActorRef @@ -40,6 +38,8 @@ import pekko.routing.RoundRobinPool import pekko.routing.RoutedActorRef import pekko.testkit.TestProbe +import com.typesafe.config.ConfigFactory + class RemotingFeaturesConfig(val useUnsafe: Boolean, artery: Boolean) extends MultiNodeConfig { val first = role("first") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteNodeDeathWatchSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteNodeDeathWatchSpec.scala index 73bea9484b..a2e1642f52 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteNodeDeathWatchSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteNodeDeathWatchSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.remote import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorIdentity @@ -29,6 +27,8 @@ import pekko.remote.testconductor.RoleName import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + class RemoteNodeDeathWatchConfig(artery: Boolean) extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteNodeRestartDeathWatchSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteNodeRestartDeathWatchSpec.scala index c556ed8df6..b8bc7c0a8a 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteNodeRestartDeathWatchSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteNodeRestartDeathWatchSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.remote import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorIdentity @@ -32,6 +30,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.transport.ThrottlerTransportAdapter.Direction import pekko.testkit._ +import com.typesafe.config.ConfigFactory + class RemoteNodeRestartDeathWatchConfig(artery: Boolean) extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteQuarantinePiercingSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteQuarantinePiercingSpec.scala index a33b8f9e1a..5dd4f9cf39 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteQuarantinePiercingSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteQuarantinePiercingSpec.scala @@ -16,14 +16,14 @@ package org.apache.pekko.remote import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.remote.testconductor.RoleName import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + class RemoteQuarantinePiercingConfig(artery: Boolean) extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteReDeploymentSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteReDeploymentSpec.scala index e08b6535dc..843aed0d45 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteReDeploymentSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemoteReDeploymentSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.remote import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorIdentity @@ -30,6 +28,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.transport.ThrottlerTransportAdapter.Direction._ import pekko.testkit.TestProbe +import com.typesafe.config.ConfigFactory + class RemoteReDeploymentConfig(artery: Boolean) extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemotingMultiNodeSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemotingMultiNodeSpec.scala index 7d4fb84fc8..0201060b9b 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemotingMultiNodeSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/RemotingMultiNodeSpec.scala @@ -13,14 +13,15 @@ package org.apache.pekko.remote -import com.typesafe.config.ConfigFactory -import org.scalatest.Suite - import org.apache.pekko import pekko.remote.artery.ArterySpecSupport import pekko.remote.testkit.{ MultiNodeConfig, MultiNodeSpec, STMultiNodeSpec } import pekko.testkit.{ DefaultTimeout, ImplicitSender } +import org.scalatest.Suite + +import com.typesafe.config.ConfigFactory + object RemotingMultiNodeSpec { def commonConfig = diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/TransportFailSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/TransportFailSpec.scala index ba383730ec..b4b4af8002 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/TransportFailSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/TransportFailSpec.scala @@ -15,11 +15,8 @@ package org.apache.pekko.remote import java.util.concurrent.atomic.AtomicBoolean -import scala.concurrent.duration._ - import scala.annotation.nowarn -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory +import scala.concurrent.duration._ import org.apache.pekko import pekko.actor.Actor @@ -34,6 +31,9 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ import pekko.util.unused +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object TransportFailConfig extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/DirectMemorySpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/DirectMemorySpec.scala index c4d7cba6f2..93dfc81273 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/DirectMemorySpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/DirectMemorySpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.remote.artery import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ Actor, ActorPath, ActorRef, Props } import pekko.remote.RemotingMultiNodeSpec @@ -24,6 +22,8 @@ import pekko.remote.testkit.{ MultiNodeConfig, MultiNodeSpec, STMultiNodeSpec } import pekko.testkit.ImplicitSender import pekko.testkit.JavaSerializable +import com.typesafe.config.ConfigFactory + object DirectMemorySpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/FanInThrougputSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/FanInThrougputSpec.scala index 77bd679993..786bed4980 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/FanInThrougputSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/FanInThrougputSpec.scala @@ -17,8 +17,6 @@ import java.util.concurrent.Executors import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.remote.{ RemoteActorRefProvider, RemotingMultiNodeSpec } @@ -27,6 +25,8 @@ import pekko.remote.testconductor.RoleName import pekko.remote.testkit.{ MultiNodeConfig, PerfFlamesSupport } import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object FanInThroughputSpec extends MultiNodeConfig { val totalNumberOfNodes = System.getProperty("org.apache.pekko.test.FanInThroughputSpec.nrOfNodes") match { diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/FanOutThrougputSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/FanOutThrougputSpec.scala index a272a1dedf..2346910ab0 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/FanOutThrougputSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/FanOutThrougputSpec.scala @@ -17,8 +17,6 @@ import java.util.concurrent.Executors import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.remote.{ RemoteActorRefProvider, RemotingMultiNodeSpec } @@ -28,6 +26,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.testkit.PerfFlamesSupport import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object FanOutThroughputSpec extends MultiNodeConfig { val totalNumberOfNodes = System.getProperty("org.apache.pekko.test.FanOutThroughputSpec.nrOfNodes") match { diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/HandshakeRestartReceiverSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/HandshakeRestartReceiverSpec.scala index 747e7c2ad3..e59b4083de 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/HandshakeRestartReceiverSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/HandshakeRestartReceiverSpec.scala @@ -18,8 +18,6 @@ import scala.concurrent.Future import scala.concurrent.Promise import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.remote.AddressUidExtension @@ -30,6 +28,8 @@ import pekko.remote.testkit.MultiNodeSpec import pekko.remote.testkit.STMultiNodeSpec import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object HandshakeRestartReceiverSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/LatencySpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/LatencySpec.scala index ba0ac9c2e0..bf4be95582 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/LatencySpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/LatencySpec.scala @@ -20,7 +20,6 @@ import java.util.concurrent.locks.LockSupport import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import org.HdrHistogram.Histogram import org.apache.pekko @@ -34,6 +33,8 @@ import pekko.stream.ThrottleMode import pekko.stream.scaladsl.Source import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object LatencySpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/MaxThroughputSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/MaxThroughputSpec.scala index 0ee81052da..5a788df1a4 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/MaxThroughputSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/MaxThroughputSpec.scala @@ -21,7 +21,6 @@ import java.util.concurrent.TimeUnit.NANOSECONDS import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import org.apache.pekko import pekko.actor._ import pekko.remote.{ RARP, RemoteActorRefProvider, RemotingMultiNodeSpec } @@ -32,6 +31,8 @@ import pekko.serialization.{ ByteBufferSerializer, SerializerWithStringManifest import pekko.serialization.jackson.CborSerializable import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object MaxThroughputSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/RemoteRestartedQuarantinedSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/RemoteRestartedQuarantinedSpec.scala index dffea04a02..4f1520d8b9 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/RemoteRestartedQuarantinedSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/RemoteRestartedQuarantinedSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.remote.artery import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ ActorIdentity, Identify, _ } import pekko.remote.{ AddressUidExtension, RARP, RemotingMultiNodeSpec } @@ -25,6 +23,8 @@ import pekko.remote.testconductor.RoleName import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object RemoteRestartedQuarantinedSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/SurviveInboundStreamRestartWithCompressionInFlightSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/SurviveInboundStreamRestartWithCompressionInFlightSpec.scala index b6afb04848..8bcbc6464a 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/SurviveInboundStreamRestartWithCompressionInFlightSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/SurviveInboundStreamRestartWithCompressionInFlightSpec.scala @@ -15,9 +15,6 @@ package org.apache.pekko.remote.artery import scala.util.control.NoStackTrace -import com.typesafe.config.ConfigFactory -import org.scalatest.concurrent.ScalaFutures - import org.apache.pekko import pekko.actor._ import pekko.actor.ActorIdentity @@ -26,6 +23,10 @@ import pekko.remote.{ RARP, RemotingMultiNodeSpec } import pekko.remote.testkit.MultiNodeConfig import pekko.testkit._ +import org.scalatest.concurrent.ScalaFutures + +import com.typesafe.config.ConfigFactory + object SurviveInboundStreamRestartWithCompressionInFlightSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/SurviveNetworkPartitionSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/SurviveNetworkPartitionSpec.scala index 1bc6643f61..814530cca3 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/SurviveNetworkPartitionSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/SurviveNetworkPartitionSpec.scala @@ -13,10 +13,8 @@ package org.apache.pekko.remote.artery -import scala.concurrent.duration._ - import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory +import scala.concurrent.duration._ import org.apache.pekko import pekko.actor._ @@ -27,6 +25,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.transport.ThrottlerTransportAdapter.Direction import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object SurviveNetworkPartitionSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/TestMessage.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/TestMessage.scala index b555806d47..0c81fe56ad 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/TestMessage.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/TestMessage.scala @@ -13,14 +13,14 @@ package org.apache.pekko.remote.artery +import java.io.NotSerializableException + import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.protobufv3.internal.ByteString import pekko.remote.artery.protobuf.{ TestMessages => proto } import pekko.serialization.SerializerWithStringManifest -import java.io.NotSerializableException - object TestMessage { final case class Item(id: Long, name: String) } diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/aeron/AeronStreamConcistencySpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/aeron/AeronStreamConcistencySpec.scala index 768c7447f1..ff6540eb67 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/aeron/AeronStreamConcistencySpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/aeron/AeronStreamConcistencySpec.scala @@ -21,7 +21,6 @@ import java.util.concurrent.atomic.AtomicInteger import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import io.aeron.Aeron import org.agrona.IoUtil @@ -37,6 +36,8 @@ import pekko.stream.scaladsl.Source import pekko.testkit._ import pekko.util.ByteString +import com.typesafe.config.ConfigFactory + object AeronStreamConsistencySpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/aeron/AeronStreamLatencySpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/aeron/AeronStreamLatencySpec.scala index 4ac3632387..2864cef677 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/aeron/AeronStreamLatencySpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/aeron/AeronStreamLatencySpec.scala @@ -26,7 +26,6 @@ import java.util.concurrent.locks.LockSupport import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import io.aeron.Aeron import io.aeron.CncFileDescriptor import org.HdrHistogram.Histogram @@ -45,6 +44,8 @@ import pekko.stream.scaladsl.Source import pekko.testkit._ import pekko.util.ByteString +import com.typesafe.config.ConfigFactory + object AeronStreamLatencySpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/aeron/AeronStreamMaxThroughputSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/aeron/AeronStreamMaxThroughputSpec.scala index 1af66cfa3c..9e78a90f3c 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/aeron/AeronStreamMaxThroughputSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/artery/aeron/AeronStreamMaxThroughputSpec.scala @@ -22,7 +22,6 @@ import scala.collection.AbstractIterator import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory import io.aeron.Aeron import io.aeron.CncFileDescriptor import org.agrona.IoUtil @@ -36,6 +35,8 @@ import pekko.stream.scaladsl.Source import pekko.testkit._ import pekko.util.ByteString +import com.typesafe.config.ConfigFactory + object AeronStreamMaxThroughputSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/classic/RemoteGatePiercingSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/classic/RemoteGatePiercingSpec.scala index c015ed19b6..1e7e19ce4f 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/classic/RemoteGatePiercingSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/classic/RemoteGatePiercingSpec.scala @@ -13,12 +13,10 @@ package org.apache.pekko.remote.classic +import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.duration._ -import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ ActorIdentity, Identify, _ } import pekko.remote.{ RARP, RemotingMultiNodeSpec } @@ -28,6 +26,8 @@ import pekko.remote.transport.AssociationHandle import pekko.remote.transport.ThrottlerTransportAdapter.ForceDisassociateExplicitly import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object RemoteGatePiercingSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/classic/RemoteNodeRestartGateSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/classic/RemoteNodeRestartGateSpec.scala index bbd4f74798..55d187cfb5 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/classic/RemoteNodeRestartGateSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/classic/RemoteNodeRestartGateSpec.scala @@ -13,12 +13,10 @@ package org.apache.pekko.remote.classic +import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.duration._ -import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ ActorIdentity, Identify, _ } import pekko.remote.{ RARP, RemotingMultiNodeSpec } @@ -28,6 +26,8 @@ import pekko.remote.transport.AssociationHandle import pekko.remote.transport.ThrottlerTransportAdapter.ForceDisassociateExplicitly import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object RemoteNodeRestartGateSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/classic/RemoteNodeShutdownAndComesBackSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/classic/RemoteNodeShutdownAndComesBackSpec.scala index 04a6945124..145672924e 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/classic/RemoteNodeShutdownAndComesBackSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/classic/RemoteNodeShutdownAndComesBackSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.remote.classic import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ ActorIdentity, Identify, _ } import pekko.remote.{ RARP, RemotingMultiNodeSpec } @@ -26,6 +24,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.transport.ThrottlerTransportAdapter.{ Direction, ForceDisassociate } import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object RemoteNodeShutdownAndComesBackSpec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/classic/Ticket15109Spec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/classic/Ticket15109Spec.scala index b38695b0f3..009871487b 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/classic/Ticket15109Spec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/classic/Ticket15109Spec.scala @@ -13,12 +13,10 @@ package org.apache.pekko.remote.classic +import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.duration._ -import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ ActorIdentity, Identify, _ } import pekko.remote.{ RARP, RemotingMultiNodeSpec } @@ -28,6 +26,8 @@ import pekko.remote.transport.AssociationHandle import pekko.remote.transport.ThrottlerTransportAdapter.ForceDisassociateExplicitly import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object Ticket15109Spec extends MultiNodeConfig { val first = role("first") val second = role("second") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/routing/RemoteRandomSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/routing/RemoteRandomSpec.scala index bfe1e69b97..54d8ab3c00 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/routing/RemoteRandomSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/routing/RemoteRandomSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.remote.routing import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef @@ -30,6 +28,8 @@ import pekko.routing.RandomPool import pekko.routing.RoutedActorRef import pekko.testkit._ +import com.typesafe.config.ConfigFactory + class RemoteRandomConfig(artery: Boolean) extends MultiNodeConfig { val first = role("first") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/routing/RemoteRoundRobinSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/routing/RemoteRoundRobinSpec.scala index 98fc82c8de..acc2ca273f 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/routing/RemoteRoundRobinSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/routing/RemoteRoundRobinSpec.scala @@ -17,8 +17,6 @@ import scala.collection.immutable import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko.actor.{ Actor, ActorRef, Address, PoisonPill, Props } import org.apache.pekko.pattern.ask import org.apache.pekko.remote.RemotingMultiNodeSpec @@ -26,6 +24,8 @@ import org.apache.pekko.remote.testkit.MultiNodeConfig import org.apache.pekko.routing._ import org.apache.pekko.testkit._ +import com.typesafe.config.ConfigFactory + class RemoteRoundRobinConfig(artery: Boolean) extends MultiNodeConfig { val first = role("first") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/routing/RemoteScatterGatherSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/routing/RemoteScatterGatherSpec.scala index 1b11dc204e..4fb030145f 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/routing/RemoteScatterGatherSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/routing/RemoteScatterGatherSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.remote.routing import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko.actor.Actor import org.apache.pekko.actor.ActorRef import org.apache.pekko.actor.Address @@ -30,6 +28,8 @@ import org.apache.pekko.routing.ScatterGatherFirstCompletedPool import org.apache.pekko.testkit._ import org.apache.pekko.testkit.TestEvent._ +import com.typesafe.config.ConfigFactory + class RemoteScatterGatherConfig(artery: Boolean) extends MultiNodeConfig { val first = role("first") diff --git a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/testconductor/TestConductorSpec.scala b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/testconductor/TestConductorSpec.scala index eee8ef87db..4f745e26a4 100644 --- a/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/testconductor/TestConductorSpec.scala +++ b/remote-tests/src/multi-jvm/scala/org/apache/pekko/remote/testconductor/TestConductorSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.remote.testconductor import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ Actor, ActorIdentity, Deploy, Identify, Props } import pekko.remote.RemotingMultiNodeSpec @@ -24,6 +22,8 @@ import pekko.remote.testkit.MultiNodeConfig import pekko.remote.transport.ThrottlerTransportAdapter.Direction import pekko.testkit.LongRunningTest +import com.typesafe.config.ConfigFactory + object TestConductorMultiJvmSpec extends MultiNodeConfig { commonConfig(debugConfig(on = false).withFallback(ConfigFactory.parseString(""" pekko.remote.artery.enabled = false diff --git a/remote-tests/src/test/scala/org/apache/pekko/remote/artery/ArteryFailedToBindSpec.scala b/remote-tests/src/test/scala/org/apache/pekko/remote/artery/ArteryFailedToBindSpec.scala index 19fbe1bfd6..103e2cb618 100644 --- a/remote-tests/src/test/scala/org/apache/pekko/remote/artery/ArteryFailedToBindSpec.scala +++ b/remote-tests/src/test/scala/org/apache/pekko/remote/artery/ArteryFailedToBindSpec.scala @@ -13,10 +13,6 @@ package org.apache.pekko.remote.artery -import com.typesafe.config.ConfigFactory -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.ActorSystem import pekko.remote.RARP @@ -24,6 +20,11 @@ import pekko.remote.RemoteTransportException import pekko.testkit.SocketUtil import pekko.testkit.TestKit +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + +import com.typesafe.config.ConfigFactory + class ArteryFailedToBindSpec extends AnyWordSpec with Matchers { "an ActorSystem" must { diff --git a/remote-tests/src/test/scala/org/apache/pekko/remote/classic/RemotingFailedToBindSpec.scala b/remote-tests/src/test/scala/org/apache/pekko/remote/classic/RemotingFailedToBindSpec.scala index b610c708e9..ddd8884326 100644 --- a/remote-tests/src/test/scala/org/apache/pekko/remote/classic/RemotingFailedToBindSpec.scala +++ b/remote-tests/src/test/scala/org/apache/pekko/remote/classic/RemotingFailedToBindSpec.scala @@ -13,14 +13,16 @@ package org.apache.pekko.remote.classic -import com.typesafe.config.ConfigFactory -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec +import java.net.BindException + import org.apache.pekko import pekko.actor.ActorSystem import pekko.testkit.SocketUtil -import java.net.BindException +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + +import com.typesafe.config.ConfigFactory class RemotingFailedToBindSpec extends AnyWordSpec with Matchers { diff --git a/remote-tests/src/test/scala/org/apache/pekko/remote/testconductor/ControllerSpec.scala b/remote-tests/src/test/scala/org/apache/pekko/remote/testconductor/ControllerSpec.scala index ed2bd08901..18867c0cf1 100644 --- a/remote-tests/src/test/scala/org/apache/pekko/remote/testconductor/ControllerSpec.scala +++ b/remote-tests/src/test/scala/org/apache/pekko/remote/testconductor/ControllerSpec.scala @@ -19,8 +19,8 @@ import java.net.InetSocketAddress import org.apache.pekko import pekko.actor.{ AddressFromURIString, PoisonPill, Props } import pekko.remote.testconductor.Controller.NodeInfo -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec object ControllerSpec { val config = """ diff --git a/remote/src/main/scala/org/apache/pekko/remote/ByteStringUtils.scala b/remote/src/main/scala/org/apache/pekko/remote/ByteStringUtils.scala index 4d4440e6b4..e6c58bfa82 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/ByteStringUtils.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/ByteStringUtils.scala @@ -15,9 +15,9 @@ package org.apache.pekko.remote import org.apache.pekko import pekko.annotation.InternalApi +import pekko.protobufv3.internal.{ ByteString => ProtoByteString } import pekko.protobufv3.internal.UnsafeByteOperations import pekko.util.ByteString -import pekko.protobufv3.internal.{ ByteString => ProtoByteString } import pekko.util.ByteString.ByteString1 import pekko.util.ByteString.ByteString1C diff --git a/remote/src/main/scala/org/apache/pekko/remote/DeadlineFailureDetector.scala b/remote/src/main/scala/org/apache/pekko/remote/DeadlineFailureDetector.scala index 15cf6bc8b3..51e4319c49 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/DeadlineFailureDetector.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/DeadlineFailureDetector.scala @@ -16,13 +16,13 @@ package org.apache.pekko.remote import scala.concurrent.duration.Duration import scala.concurrent.duration.FiniteDuration -import com.typesafe.config.Config - import org.apache.pekko import pekko.event.EventStream import pekko.remote.FailureDetector.Clock import pekko.util.Helpers.ConfigOps +import com.typesafe.config.Config + /** * Implementation of failure detector using an absolute timeout of missing heartbeats * to trigger unavailability. diff --git a/remote/src/main/scala/org/apache/pekko/remote/Endpoint.scala b/remote/src/main/scala/org/apache/pekko/remote/Endpoint.scala index d9120ec4cb..3b3facfce6 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/Endpoint.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/Endpoint.scala @@ -17,14 +17,13 @@ import java.io.NotSerializableException import java.util.concurrent.{ ConcurrentHashMap, TimeoutException } import java.util.concurrent.locks.LockSupport +import scala.annotation.nowarn import scala.annotation.tailrec import scala.concurrent.Future import scala.concurrent.duration.Deadline import scala.concurrent.duration.Duration import scala.util.control.NonFatal -import scala.annotation.nowarn - import org.apache.pekko import pekko.{ OnlyCauseStackTrace, PekkoException } import pekko.actor._ @@ -38,13 +37,13 @@ import pekko.remote.EndpointManager.{ Link, ResendState, Send } import pekko.remote.EndpointWriter.{ FlushAndStop, StoppedReading } import pekko.remote.WireFormats.SerializedMessage import pekko.remote.transport._ -import pekko.remote.transport.PekkoPduCodec.Message import pekko.remote.transport.AssociationHandle.{ ActorHandleEventListener, DisassociateInfo, Disassociated, InboundPayload } +import pekko.remote.transport.PekkoPduCodec.Message import pekko.remote.transport.Transport.InvalidAssociationException import pekko.serialization.Serialization import pekko.util.ByteString diff --git a/remote/src/main/scala/org/apache/pekko/remote/FailureDetectorRegistry.scala b/remote/src/main/scala/org/apache/pekko/remote/FailureDetectorRegistry.scala index b006f7844a..d06aa856ef 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/FailureDetectorRegistry.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/FailureDetectorRegistry.scala @@ -13,13 +13,13 @@ package org.apache.pekko.remote -import com.typesafe.config.Config - import org.apache.pekko import pekko.ConfigurationException import pekko.actor.{ ActorContext, ActorSystem, ExtendedActorSystem } import pekko.event.EventStream +import com.typesafe.config.Config + /** * Interface for a registry of Pekko failure detectors. New resources are implicitly registered when heartbeat is first * called with the resource given as parameter. diff --git a/remote/src/main/scala/org/apache/pekko/remote/MessageSerializer.scala b/remote/src/main/scala/org/apache/pekko/remote/MessageSerializer.scala index c637301948..171a2d4116 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/MessageSerializer.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/MessageSerializer.scala @@ -14,6 +14,7 @@ package org.apache.pekko.remote import scala.util.control.NonFatal + import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.annotation.InternalApi diff --git a/remote/src/main/scala/org/apache/pekko/remote/PhiAccrualFailureDetector.scala b/remote/src/main/scala/org/apache/pekko/remote/PhiAccrualFailureDetector.scala index 6493c606fa..aed93af2b4 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/PhiAccrualFailureDetector.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/PhiAccrualFailureDetector.scala @@ -14,11 +14,12 @@ package org.apache.pekko.remote import java.util.concurrent.atomic.AtomicReference + import scala.annotation.tailrec import scala.collection.immutable import scala.concurrent.duration.Duration import scala.concurrent.duration.FiniteDuration -import com.typesafe.config.Config + import org.apache.pekko import pekko.annotation.InternalApi import pekko.event.EventStream @@ -27,6 +28,8 @@ import pekko.event.Logging.Warning import pekko.remote.FailureDetector.Clock import pekko.util.Helpers.ConfigOps +import com.typesafe.config.Config + /** * Implementation of 'The Phi Accrual Failure Detector' by Hayashibara et al. as defined in their paper: * [https://oneofus.la/have-emacs-will-hack/files/HDY04.pdf] diff --git a/remote/src/main/scala/org/apache/pekko/remote/RemoteActorRefProvider.scala b/remote/src/main/scala/org/apache/pekko/remote/RemoteActorRefProvider.scala index 58fb687cff..9d1245be07 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/RemoteActorRefProvider.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/RemoteActorRefProvider.scala @@ -13,13 +13,12 @@ package org.apache.pekko.remote +import scala.annotation.nowarn import scala.concurrent.Future import scala.util.Failure import scala.util.control.Exception.Catcher import scala.util.control.NonFatal -import scala.annotation.nowarn - import org.apache.pekko import pekko.ConfigurationException import pekko.Done diff --git a/remote/src/main/scala/org/apache/pekko/remote/RemoteDeployer.scala b/remote/src/main/scala/org/apache/pekko/remote/RemoteDeployer.scala index 75e0380ac7..0e08d7d15f 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/RemoteDeployer.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/RemoteDeployer.scala @@ -13,7 +13,7 @@ package org.apache.pekko.remote -import com.typesafe.config._ +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.ConfigurationException @@ -21,7 +21,8 @@ import pekko.actor._ import pekko.remote.routing.RemoteRouterConfig import pekko.routing._ import pekko.routing.Pool -import scala.jdk.CollectionConverters._ + +import com.typesafe.config._ @SerialVersionUID(1L) final case class RemoteScope(node: Address) extends Scope { diff --git a/remote/src/main/scala/org/apache/pekko/remote/RemoteMetricsExtension.scala b/remote/src/main/scala/org/apache/pekko/remote/RemoteMetricsExtension.scala index 63f2545193..529a8d3b40 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/RemoteMetricsExtension.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/RemoteMetricsExtension.scala @@ -15,9 +15,8 @@ package org.apache.pekko.remote import java.util.concurrent.ConcurrentHashMap -import scala.annotation.tailrec - import scala.annotation.nowarn +import scala.annotation.tailrec import org.apache.pekko import pekko.actor.ActorSelectionMessage diff --git a/remote/src/main/scala/org/apache/pekko/remote/RemoteSettings.scala b/remote/src/main/scala/org/apache/pekko/remote/RemoteSettings.scala index 418f395fd9..b0926bc09a 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/RemoteSettings.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/RemoteSettings.scala @@ -13,12 +13,10 @@ package org.apache.pekko.remote +import scala.annotation.nowarn import scala.collection.immutable import scala.concurrent.duration._ -import scala.annotation.nowarn -import com.typesafe.config.Config - import org.apache.pekko import pekko.ConfigurationException import pekko.actor.Props @@ -30,11 +28,13 @@ import pekko.remote.artery.ArterySettings import pekko.util.Helpers.{ toRootLowerCase, ConfigOps, Requiring } import pekko.util.Timeout -final class RemoteSettings(val config: Config) { - import config._ +import com.typesafe.config.Config +final class RemoteSettings(val config: Config) { import scala.jdk.CollectionConverters._ + import config._ + val Artery = ArterySettings(getConfig("pekko.remote.artery")) val WarnAboutDirectUse: Boolean = getBoolean("pekko.remote.warn-about-direct-use") diff --git a/remote/src/main/scala/org/apache/pekko/remote/RemoteTransport.scala b/remote/src/main/scala/org/apache/pekko/remote/RemoteTransport.scala index 6c0b39eb08..93da52c9da 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/RemoteTransport.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/RemoteTransport.scala @@ -18,8 +18,8 @@ import scala.concurrent.Future import scala.util.control.NoStackTrace import org.apache.pekko -import pekko.PekkoException import pekko.Done +import pekko.PekkoException import pekko.actor._ import pekko.annotation.InternalStableApi import pekko.event.LoggingAdapter diff --git a/remote/src/main/scala/org/apache/pekko/remote/RemoteWatcher.scala b/remote/src/main/scala/org/apache/pekko/remote/RemoteWatcher.scala index f283c1c6c7..ac2088c92b 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/RemoteWatcher.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/RemoteWatcher.scala @@ -13,11 +13,10 @@ package org.apache.pekko.remote +import scala.annotation.nowarn import scala.collection.mutable import scala.concurrent.duration._ -import scala.annotation.nowarn - import org.apache.pekko import pekko.actor._ import pekko.annotation.InternalApi diff --git a/remote/src/main/scala/org/apache/pekko/remote/Remoting.scala b/remote/src/main/scala/org/apache/pekko/remote/Remoting.scala index 629eeb3c5e..ef6e78f8ac 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/Remoting.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/Remoting.scala @@ -17,6 +17,7 @@ import java.net.URLEncoder import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.TimeoutException +import scala.annotation.nowarn import scala.collection.immutable import scala.collection.immutable.{ HashMap, Seq } import scala.concurrent.{ Await, Future, Promise } @@ -24,9 +25,6 @@ import scala.concurrent.duration._ import scala.util.{ Failure, Success } import scala.util.control.NonFatal -import scala.annotation.nowarn -import com.typesafe.config.Config - import org.apache.pekko import pekko.Done import pekko.actor._ @@ -44,6 +42,8 @@ import pekko.remote.transport.Transport.{ ActorAssociationEventListener, Associa import pekko.util.ByteString.UTF_8 import pekko.util.OptionVal +import com.typesafe.config.Config + /** * INTERNAL API */ diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/ArterySettings.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/ArterySettings.scala index 0e88d416ce..cb3ef30a9d 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/ArterySettings.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/ArterySettings.scala @@ -15,21 +15,21 @@ package org.apache.pekko.remote.artery import java.net.InetAddress -import scala.concurrent.duration._ - import scala.annotation.nowarn -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory +import scala.concurrent.duration._ +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.NotUsed +import pekko.io.dns.internal.AsyncDnsResolver import pekko.stream.ActorMaterializerSettings import pekko.util.Helpers.ConfigOps import pekko.util.Helpers.Requiring import pekko.util.Helpers.toRootLowerCase import pekko.util.WildcardIndex -import scala.jdk.CollectionConverters._ -import pekko.io.dns.internal.AsyncDnsResolver + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory /** INTERNAL API */ private[pekko] final class ArterySettings private (config: Config) { diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/ArteryTransport.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/ArteryTransport.scala index ae7b3a091e..4d4aff0d50 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/ArteryTransport.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/ArteryTransport.scala @@ -18,6 +18,7 @@ import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.atomic.AtomicLong import java.util.concurrent.atomic.AtomicReference +import scala.annotation.nowarn import scala.annotation.tailrec import scala.concurrent.Await import scala.concurrent.Future @@ -26,8 +27,6 @@ import scala.concurrent.duration._ import scala.util.Try import scala.util.control.NoStackTrace -import scala.annotation.nowarn - import org.apache.pekko import pekko.Done import pekko.NotUsed diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/Association.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/Association.scala index 0d40b416cb..b49f4897ce 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/Association.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/Association.scala @@ -21,13 +21,13 @@ import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.atomic.AtomicReference +import scala.annotation.nowarn import scala.annotation.tailrec import scala.concurrent.Future import scala.concurrent.Promise import scala.concurrent.duration._ import scala.util.control.NoStackTrace -import scala.annotation.nowarn import org.agrona.concurrent.ManyToOneConcurrentArrayQueue import org.apache.pekko diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/Codecs.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/Codecs.scala index 90f14f7c46..e790ad5995 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/Codecs.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/Codecs.scala @@ -22,8 +22,8 @@ import scala.util.control.NonFatal import org.apache.pekko import pekko.Done -import pekko.actor.EmptyLocalActorRef import pekko.actor._ +import pekko.actor.EmptyLocalActorRef import pekko.event.Logging import pekko.remote.MessageSerializer import pekko.remote.OversizedPayloadException @@ -35,8 +35,8 @@ import pekko.remote.artery.Decoder.InboundCompressionAccess import pekko.remote.artery.Decoder.InboundCompressionAccessImpl import pekko.remote.artery.OutboundHandshake.HandshakeReq import pekko.remote.artery.SystemMessageDelivery.SystemMessageEnvelope -import pekko.remote.artery.compress.CompressionProtocol._ import pekko.remote.artery.compress._ +import pekko.remote.artery.compress.CompressionProtocol._ import pekko.remote.serialization.AbstractActorRefResolveCache import pekko.serialization.Serialization import pekko.serialization.SerializationExtension diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/EnvelopeBufferPool.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/EnvelopeBufferPool.scala index 3ad099e3d8..306ce5fbbd 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/EnvelopeBufferPool.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/EnvelopeBufferPool.scala @@ -14,7 +14,9 @@ package org.apache.pekko.remote.artery import java.nio.{ ByteBuffer, ByteOrder } + import org.agrona.concurrent.{ ManyToManyConcurrentArrayQueue, UnsafeBuffer } + import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.InternalActorRef diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/FlushOnShutdown.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/FlushOnShutdown.scala index 67610f6b22..210376b7fe 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/FlushOnShutdown.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/FlushOnShutdown.scala @@ -16,6 +16,7 @@ package org.apache.pekko.remote.artery import scala.concurrent.Promise import scala.concurrent.duration.FiniteDuration import scala.util.control.NonFatal + import org.apache.pekko import pekko.Done import pekko.actor.{ Actor, ActorLogging, Props } diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/Handshake.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/Handshake.scala index 913027ba89..b5c953f66e 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/Handshake.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/Handshake.scala @@ -13,6 +13,7 @@ package org.apache.pekko.remote.artery +import scala.concurrent.ExecutionContext import scala.concurrent.Future import scala.concurrent.duration._ import scala.util.control.NoStackTrace @@ -21,7 +22,6 @@ import org.apache.pekko import pekko.Done import pekko.actor.ActorSystem import pekko.actor.Address -import scala.concurrent.ExecutionContext import pekko.remote.UniqueAddress import pekko.stream.Attributes import pekko.stream.FlowShape diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/RemoteInstrument.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/RemoteInstrument.scala index da0d70396e..771c2fbc1d 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/RemoteInstrument.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/RemoteInstrument.scala @@ -20,10 +20,10 @@ import scala.annotation.tailrec import scala.util.control.NonFatal import org.apache.pekko -import pekko.actor.ActorSystem -import pekko.actor.WrappedMessage import pekko.actor.ActorRef +import pekko.actor.ActorSystem import pekko.actor.ExtendedActorSystem +import pekko.actor.WrappedMessage import pekko.annotation.InternalApi import pekko.annotation.InternalStableApi import pekko.event.Logging diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/SystemMessageDelivery.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/SystemMessageDelivery.scala index bdf339beb1..d13e6dc0a9 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/SystemMessageDelivery.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/SystemMessageDelivery.scala @@ -16,6 +16,7 @@ package org.apache.pekko.remote.artery import java.util.ArrayDeque import scala.annotation.tailrec +import scala.concurrent.ExecutionContext import scala.concurrent.duration._ import scala.util.Failure import scala.util.Success @@ -26,7 +27,6 @@ import org.apache.pekko import pekko.Done import pekko.actor.ActorRef import pekko.annotation.InternalApi -import scala.concurrent.ExecutionContext import pekko.dispatch.sysmsg.SystemMessage import pekko.event.Logging import pekko.remote.UniqueAddress diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/TestStage.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/TestStage.scala index a8829637d2..1d1b56d5a4 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/TestStage.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/TestStage.scala @@ -14,7 +14,9 @@ package org.apache.pekko.remote.artery import java.util.concurrent.atomic.AtomicReference + import scala.annotation.tailrec + import org.apache.pekko import pekko.actor.Address import pekko.event.Logging diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ConfigSSLEngineProvider.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ConfigSSLEngineProvider.scala index eca77f416e..3fd09f6d6d 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ConfigSSLEngineProvider.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ConfigSSLEngineProvider.scala @@ -20,15 +20,6 @@ import java.nio.file.Paths import java.security.GeneralSecurityException import java.security.KeyStore import java.security.SecureRandom - -import org.apache.pekko -import pekko.actor.ActorSystem -import pekko.event.LogMarker -import pekko.event.Logging -import pekko.event.MarkerLoggingAdapter -import pekko.remote.artery.tcp.ssl.SSLEngineConfig -import pekko.stream.TLSRole -import com.typesafe.config.Config import javax.net.ssl.KeyManager import javax.net.ssl.KeyManagerFactory import javax.net.ssl.SSLContext @@ -39,6 +30,16 @@ import javax.net.ssl.TrustManagerFactory import scala.util.Try +import org.apache.pekko +import pekko.actor.ActorSystem +import pekko.event.LogMarker +import pekko.event.Logging +import pekko.event.MarkerLoggingAdapter +import pekko.remote.artery.tcp.ssl.SSLEngineConfig +import pekko.stream.TLSRole + +import com.typesafe.config.Config + /** * Config in pekko.remote.artery.ssl.config-ssl-engine * diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/SSLEngineProvider.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/SSLEngineProvider.scala index 23d554ef12..2f26b27c65 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/SSLEngineProvider.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/SSLEngineProvider.scala @@ -14,11 +14,12 @@ package org.apache.pekko.remote.artery package tcp +import javax.net.ssl.SSLEngine +import javax.net.ssl.SSLSession + import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.actor.setup.Setup -import javax.net.ssl.SSLEngine -import javax.net.ssl.SSLSession trait SSLEngineProvider { diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/SecureRandomFactory.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/SecureRandomFactory.scala index 8a87688f02..78f9d1b771 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/SecureRandomFactory.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/SecureRandomFactory.scala @@ -18,6 +18,7 @@ import java.security.SecureRandom import org.apache.pekko import pekko.annotation.InternalApi import pekko.event.MarkerLoggingAdapter + import com.typesafe.config.Config /** diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/PemManagersProvider.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/PemManagersProvider.scala index 21b26105ba..09c0db8fb6 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/PemManagersProvider.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/PemManagersProvider.scala @@ -18,15 +18,14 @@ import java.nio.charset.StandardCharsets import java.nio.file.Files import java.security.{ KeyStore, PrivateKey } import java.security.cert.{ Certificate, CertificateFactory, X509Certificate } +import javax.net.ssl.{ KeyManager, KeyManagerFactory, TrustManager, TrustManagerFactory } + +import scala.concurrent.blocking import org.apache.pekko import pekko.annotation.InternalApi import pekko.pki.pem.{ DERPrivateKeyLoader, PEMDecoder } -import javax.net.ssl.{ KeyManager, KeyManagerFactory, TrustManager, TrustManagerFactory } - -import scala.concurrent.blocking - /** * INTERNAL API */ diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/RotatingKeysSSLEngineProvider.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/RotatingKeysSSLEngineProvider.scala index 4b400ebba1..62f3064998 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/RotatingKeysSSLEngineProvider.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/RotatingKeysSSLEngineProvider.scala @@ -20,6 +20,13 @@ import java.security.PrivateKey import java.security.SecureRandom import java.security.cert.Certificate import java.security.cert.X509Certificate +import javax.net.ssl.KeyManager +import javax.net.ssl.SSLContext +import javax.net.ssl.SSLEngine +import javax.net.ssl.SSLSession +import javax.net.ssl.TrustManager + +import scala.concurrent.duration._ import org.apache.pekko import pekko.actor.ActorSystem @@ -33,14 +40,8 @@ import pekko.remote.artery.tcp.SslTransportException import pekko.remote.artery.tcp.ssl.RotatingKeysSSLEngineProvider.CachedContext import pekko.remote.artery.tcp.ssl.RotatingKeysSSLEngineProvider.ConfiguredContext import pekko.stream.TLSRole -import com.typesafe.config.Config -import javax.net.ssl.KeyManager -import javax.net.ssl.SSLContext -import javax.net.ssl.SSLEngine -import javax.net.ssl.SSLSession -import javax.net.ssl.TrustManager -import scala.concurrent.duration._ +import com.typesafe.config.Config /** * Variation on ConfigSSLEngineProvider that will periodically reload the keys and certificates diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/SSLEngineConfig.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/SSLEngineConfig.scala index 6efd461e69..65a542badd 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/SSLEngineConfig.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/SSLEngineConfig.scala @@ -13,13 +13,14 @@ package org.apache.pekko.remote.artery.tcp.ssl +import scala.concurrent.duration._ +import scala.concurrent.duration.FiniteDuration +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.annotation.InternalApi -import scala.jdk.CollectionConverters._ -import com.typesafe.config.Config -import scala.concurrent.duration.FiniteDuration -import scala.concurrent.duration._ +import com.typesafe.config.Config /** * INTERNAL API diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/SessionVerifier.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/SessionVerifier.scala index b2c14d935e..5edaf7e6e6 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/SessionVerifier.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/SessionVerifier.scala @@ -14,9 +14,9 @@ package org.apache.pekko.remote.artery.tcp.ssl import java.security.cert.X509Certificate +import javax.net.ssl.SSLSession import org.apache.pekko.annotation.InternalApi -import javax.net.ssl.SSLSession /** * Allows hooking in extra verification before finishing the SSL handshake. diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/X509Readers.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/X509Readers.scala index 7deeaeca91..0b43e9f641 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/X509Readers.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/X509Readers.scala @@ -15,11 +15,12 @@ package org.apache.pekko.remote.artery.tcp.ssl import java.security.cert.X509Certificate import java.util +import javax.naming.ldap.LdapName + +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.annotation.InternalApi -import javax.naming.ldap.LdapName -import scala.jdk.CollectionConverters._ /** * INTERNAL API diff --git a/remote/src/main/scala/org/apache/pekko/remote/routing/RemoteRouterConfig.scala b/remote/src/main/scala/org/apache/pekko/remote/routing/RemoteRouterConfig.scala index 29f528afbc..3d6a07760f 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/routing/RemoteRouterConfig.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/routing/RemoteRouterConfig.scala @@ -16,7 +16,7 @@ package org.apache.pekko.remote.routing import java.util.concurrent.atomic.AtomicInteger import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.actor.ActorCell @@ -34,7 +34,8 @@ import pekko.routing.Routee import pekko.routing.Router import pekko.routing.RouterActor import pekko.routing.RouterConfig -import scala.jdk.CollectionConverters._ + +import com.typesafe.config.ConfigFactory /** * [[pekko.routing.RouterConfig]] implementation for remote deployment on defined diff --git a/remote/src/main/scala/org/apache/pekko/remote/serialization/ArteryMessageSerializer.scala b/remote/src/main/scala/org/apache/pekko/remote/serialization/ArteryMessageSerializer.scala index 23e7f90199..291e3d0fd7 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/serialization/ArteryMessageSerializer.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/serialization/ArteryMessageSerializer.scala @@ -21,12 +21,12 @@ import pekko.protobufv3.internal.MessageLite import pekko.remote._ import pekko.remote.RemoteWatcher.ArteryHeartbeatRsp import pekko.remote.artery.{ ActorSystemTerminating, ActorSystemTerminatingAck, Quarantined, SystemMessageDelivery } +import pekko.remote.artery.Flush +import pekko.remote.artery.FlushAck import pekko.remote.artery.OutboundHandshake.{ HandshakeReq, HandshakeRsp } import pekko.remote.artery.compress.{ CompressionProtocol, CompressionTable } import pekko.remote.artery.compress.CompressionProtocol._ import pekko.serialization.{ BaseSerializer, Serialization, SerializationExtension, SerializerWithStringManifest } -import pekko.remote.artery.Flush -import pekko.remote.artery.FlushAck /** INTERNAL API */ private[pekko] object ArteryMessageSerializer { diff --git a/remote/src/main/scala/org/apache/pekko/remote/serialization/DaemonMsgCreateSerializer.scala b/remote/src/main/scala/org/apache/pekko/remote/serialization/DaemonMsgCreateSerializer.scala index 7f7810015f..a68f7ad1a6 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/serialization/DaemonMsgCreateSerializer.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/serialization/DaemonMsgCreateSerializer.scala @@ -14,9 +14,10 @@ package org.apache.pekko.remote.serialization import scala.collection.immutable -import com.typesafe.config.{ Config, ConfigFactory } +import scala.jdk.CollectionConverters._ import util.{ Failure, Success } + import org.apache.pekko import pekko.actor.{ Deploy, ExtendedActorSystem, NoScopeGiven, Props, Scope } import pekko.protobufv3.internal.ByteString @@ -25,7 +26,8 @@ import pekko.remote.DaemonMsgCreate import pekko.remote.WireFormats.{ DaemonMsgCreateData, DeployData, PropsData } import pekko.routing.{ NoRouter, RouterConfig } import pekko.serialization.{ BaseSerializer, SerializationExtension, SerializerWithStringManifest } -import scala.jdk.CollectionConverters._ + +import com.typesafe.config.{ Config, ConfigFactory } /** * Serializes Pekko's internal DaemonMsgCreate using protobuf diff --git a/remote/src/main/scala/org/apache/pekko/remote/serialization/MessageContainerSerializer.scala b/remote/src/main/scala/org/apache/pekko/remote/serialization/MessageContainerSerializer.scala index 9d6f3395aa..35acd38a81 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/serialization/MessageContainerSerializer.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/serialization/MessageContainerSerializer.scala @@ -14,6 +14,7 @@ package org.apache.pekko.remote.serialization import scala.collection.immutable + import org.apache.pekko import pekko.actor.ActorSelectionMessage import pekko.actor.ExtendedActorSystem diff --git a/remote/src/main/scala/org/apache/pekko/remote/serialization/MiscMessageSerializer.scala b/remote/src/main/scala/org/apache/pekko/remote/serialization/MiscMessageSerializer.scala index 456a9ca4ec..a74d60d9eb 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/serialization/MiscMessageSerializer.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/serialization/MiscMessageSerializer.scala @@ -19,7 +19,8 @@ import java.util.Optional import java.util.concurrent.TimeUnit import scala.concurrent.duration.{ FiniteDuration, TimeUnit } -import com.typesafe.config.{ Config, ConfigFactory, ConfigRenderOptions } +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.{ Done, NotUsed } import pekko.actor._ @@ -30,7 +31,8 @@ import pekko.remote.WireFormats.AddressData import pekko.remote.routing.RemoteRouterConfig import pekko.routing._ import pekko.serialization.{ BaseSerializer, Serialization, SerializationExtension, SerializerWithStringManifest } -import scala.jdk.CollectionConverters._ + +import com.typesafe.config.{ Config, ConfigFactory, ConfigRenderOptions } class MiscMessageSerializer(val system: ExtendedActorSystem) extends SerializerWithStringManifest with BaseSerializer { diff --git a/remote/src/main/scala/org/apache/pekko/remote/serialization/WrappedPayloadSupport.scala b/remote/src/main/scala/org/apache/pekko/remote/serialization/WrappedPayloadSupport.scala index eadcafc96e..3624ad172d 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/serialization/WrappedPayloadSupport.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/serialization/WrappedPayloadSupport.scala @@ -13,20 +13,20 @@ package org.apache.pekko.remote.serialization +import java.nio.ByteOrder + import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.event.{ Logging, LoggingAdapter } import pekko.protobufv3.internal.ByteString import pekko.remote.ByteStringUtils import pekko.remote.ContainerFormats -import pekko.serialization.ByteBufferSerializer import pekko.serialization.{ SerializationExtension, Serializers } +import pekko.serialization.ByteBufferSerializer import pekko.serialization.DisabledJavaSerializer import pekko.serialization.Serialization import pekko.serialization.SerializerWithStringManifest -import java.nio.ByteOrder - /** * INTERNAL API */ diff --git a/remote/src/main/scala/org/apache/pekko/remote/transport/FailureInjectorTransportAdapter.scala b/remote/src/main/scala/org/apache/pekko/remote/transport/FailureInjectorTransportAdapter.scala index a17da99b72..3c4ebe889e 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/transport/FailureInjectorTransportAdapter.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/transport/FailureInjectorTransportAdapter.scala @@ -16,11 +16,11 @@ package org.apache.pekko.remote.transport import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.ThreadLocalRandom +import scala.annotation.nowarn import scala.concurrent.{ Future, Promise } import scala.util.control.NoStackTrace import FailureInjectorTransportAdapter._ -import scala.annotation.nowarn import org.apache.pekko import pekko.PekkoException diff --git a/remote/src/main/scala/org/apache/pekko/remote/transport/PekkoPduCodec.scala b/remote/src/main/scala/org/apache/pekko/remote/transport/PekkoPduCodec.scala index 0726a9a537..a4610f5fee 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/transport/PekkoPduCodec.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/transport/PekkoPduCodec.scala @@ -14,6 +14,7 @@ package org.apache.pekko.remote.transport import scala.annotation.nowarn + import org.apache.pekko import pekko.PekkoException import pekko.actor.{ ActorRef, Address, AddressFromURIString, InternalActorRef } diff --git a/remote/src/main/scala/org/apache/pekko/remote/transport/PekkoProtocolTransport.scala b/remote/src/main/scala/org/apache/pekko/remote/transport/PekkoProtocolTransport.scala index 168d80af03..cba06c4ccf 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/transport/PekkoProtocolTransport.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/transport/PekkoProtocolTransport.scala @@ -15,14 +15,12 @@ package org.apache.pekko.remote.transport import java.util.concurrent.TimeoutException +import scala.annotation.nowarn import scala.collection.immutable import scala.concurrent.{ Future, Promise } import scala.concurrent.duration._ import scala.util.control.NonFatal -import scala.annotation.nowarn -import com.typesafe.config.Config - import org.apache.pekko import pekko.{ OnlyCauseStackTrace, PekkoException } import pekko.actor._ @@ -32,14 +30,16 @@ import pekko.event.LoggingAdapter import pekko.pattern.pipe import pekko.remote._ import pekko.remote.transport.ActorTransportAdapter._ +import pekko.remote.transport.AssociationHandle._ import pekko.remote.transport.PekkoPduCodec._ import pekko.remote.transport.PekkoProtocolTransport._ -import pekko.remote.transport.AssociationHandle._ import pekko.remote.transport.ProtocolStateActor._ import pekko.remote.transport.Transport._ import pekko.util.ByteString import pekko.util.Helpers.Requiring +import com.typesafe.config.Config + @SerialVersionUID(1L) class PekkoProtocolException( msg: String, cause: Throwable) extends PekkoException(msg, cause) with OnlyCauseStackTrace { diff --git a/remote/src/main/scala/org/apache/pekko/remote/transport/TestTransport.scala b/remote/src/main/scala/org/apache/pekko/remote/transport/TestTransport.scala index 2fd2508243..7321ec366c 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/transport/TestTransport.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/transport/TestTransport.scala @@ -19,8 +19,6 @@ import scala.concurrent.{ Await, Future, Promise } import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.duration._ -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor._ import pekko.event.LoggingAdapter @@ -28,6 +26,8 @@ import pekko.remote.transport.AssociationHandle._ import pekko.remote.transport.Transport._ import pekko.util.ByteString +import com.typesafe.config.Config + /** * Transport implementation to be used for testing. * diff --git a/remote/src/main/scala/org/apache/pekko/remote/transport/ThrottlerTransportAdapter.scala b/remote/src/main/scala/org/apache/pekko/remote/transport/ThrottlerTransportAdapter.scala index cf5a535c9c..2660b21b19 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/transport/ThrottlerTransportAdapter.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/transport/ThrottlerTransportAdapter.scala @@ -16,26 +16,24 @@ package org.apache.pekko.remote.transport import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.AtomicReference +import scala.annotation.nowarn import scala.annotation.tailrec import scala.collection.immutable.Queue import scala.concurrent.{ Future, Promise } +import scala.concurrent.ExecutionContext import scala.concurrent.duration._ import scala.math.min import scala.util.{ Failure, Success } import scala.util.control.NonFatal -import scala.annotation.nowarn - import org.apache.pekko import pekko.actor._ import pekko.dispatch.{ RequiresMessageQueue, UnboundedMessageQueueSemantics } -import scala.concurrent.ExecutionContext import pekko.dispatch.sysmsg.{ Unwatch, Watch } import pekko.event.LoggingAdapter import pekko.pattern.{ ask, pipe, PromiseActorRef } import pekko.remote.RARP import pekko.remote.transport.ActorTransportAdapter.AssociateUnderlying -import pekko.remote.transport.PekkoPduCodec.Associate import pekko.remote.transport.AssociationHandle.{ ActorHandleEventListener, DisassociateInfo, @@ -43,6 +41,7 @@ import pekko.remote.transport.AssociationHandle.{ HandleEventListener, InboundPayload } +import pekko.remote.transport.PekkoPduCodec.Associate import pekko.remote.transport.ThrottlerManager.{ Checkin, Handle, Listener, ListenerAndMode } import pekko.remote.transport.ThrottlerTransportAdapter._ import pekko.remote.transport.Transport._ diff --git a/remote/src/main/scala/org/apache/pekko/remote/transport/Transport.scala b/remote/src/main/scala/org/apache/pekko/remote/transport/Transport.scala index d8635aed9f..83f4570f6c 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/transport/Transport.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/transport/Transport.scala @@ -13,11 +13,10 @@ package org.apache.pekko.remote.transport +import scala.annotation.nowarn import scala.concurrent.{ Future, Promise } import scala.util.control.NoStackTrace -import scala.annotation.nowarn - import org.apache.pekko import pekko.PekkoException import pekko.actor.{ ActorRef, Address, NoSerializationVerificationNeeded } diff --git a/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettySSLSupport.scala b/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettySSLSupport.scala index 12832b520b..c127e4b0e8 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettySSLSupport.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettySSLSupport.scala @@ -14,14 +14,14 @@ package org.apache.pekko.remote.transport.netty import scala.annotation.nowarn - -import com.typesafe.config.Config import scala.jdk.CollectionConverters._ import io.netty.channel.Channel import io.netty.handler.ssl.SslHandler import io.netty.util.concurrent.Future +import com.typesafe.config.Config + /** * INTERNAL API */ diff --git a/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettyTransport.scala b/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettyTransport.scala index 0cfef86623..6cad95e682 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettyTransport.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettyTransport.scala @@ -23,8 +23,6 @@ import scala.concurrent.duration.FiniteDuration import scala.util.Try import scala.util.control.{ NoStackTrace, NonFatal } -import com.typesafe.config.Config - import org.apache.pekko import pekko.ConfigurationException import pekko.OnlyCauseStackTrace @@ -35,8 +33,8 @@ import pekko.remote.RARP import pekko.remote.transport.{ AssociationHandle, Transport } import pekko.remote.transport.AssociationHandle.HandleEventListener import pekko.remote.transport.Transport._ -import pekko.util.Helpers.Requiring import pekko.util.{ Helpers, OptionVal } +import pekko.util.Helpers.Requiring import io.netty.bootstrap.{ Bootstrap => ClientBootstrap, ServerBootstrap } import io.netty.buffer.{ @@ -65,6 +63,8 @@ import io.netty.handler.flush.FlushConsolidationHandler import io.netty.handler.ssl.SslHandler import io.netty.util.concurrent.GlobalEventExecutor +import com.typesafe.config.Config + @deprecated("Classic remoting is deprecated, use Artery", "Akka 2.6.0") object NettyFutureBridge { def apply(nettyFuture: ChannelFuture): Future[Channel] = { @@ -128,6 +128,7 @@ class NettyTransportExceptionNoStack(msg: String, cause: Throwable) class NettyTransportSettings(config: Config) { import config._ + import pekko.util.Helpers.ConfigOps val EnableSsl: Boolean = getBoolean("enable-ssl") diff --git a/remote/src/test/scala/org/apache/pekko/remote/AccrualFailureDetectorSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/AccrualFailureDetectorSpec.scala index f0a8e66267..f9b1cdd118 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/AccrualFailureDetectorSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/AccrualFailureDetectorSpec.scala @@ -13,11 +13,10 @@ package org.apache.pekko.remote +import scala.annotation.nowarn import scala.collection.immutable.TreeMap import scala.concurrent.duration._ -import scala.annotation.nowarn - import org.apache.pekko import pekko.remote.FailureDetector.Clock import pekko.testkit.PekkoSpec diff --git a/remote/src/test/scala/org/apache/pekko/remote/AckedDeliverySpec.scala b/remote/src/test/scala/org/apache/pekko/remote/AckedDeliverySpec.scala index 60494a661b..ecc09f2e06 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/AckedDeliverySpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/AckedDeliverySpec.scala @@ -15,9 +15,8 @@ package org.apache.pekko.remote import java.util.concurrent.ThreadLocalRandom -import scala.annotation.tailrec - import scala.annotation.nowarn +import scala.annotation.tailrec import org.apache.pekko.testkit.PekkoSpec diff --git a/remote/src/test/scala/org/apache/pekko/remote/DaemonicSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/DaemonicSpec.scala index 555600c8d5..80a255f706 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/DaemonicSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/DaemonicSpec.scala @@ -14,13 +14,13 @@ package org.apache.pekko.remote import scala.concurrent.duration._ - -import com.typesafe.config.ConfigFactory +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.actor.{ ActorSystem, Address } import pekko.testkit._ -import scala.jdk.CollectionConverters._ + +import com.typesafe.config.ConfigFactory class DaemonicSpec extends PekkoSpec { diff --git a/remote/src/test/scala/org/apache/pekko/remote/MessageLoggingSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/MessageLoggingSpec.scala index 462d7aebc1..476a28929c 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/MessageLoggingSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/MessageLoggingSpec.scala @@ -14,14 +14,15 @@ package org.apache.pekko.remote import MessageLoggingSpec._ -import com.typesafe.config.{ Config, ConfigFactory } import org.apache.pekko import pekko.actor.{ Actor, ActorIdentity, ActorSystem, ExtendedActorSystem, Identify, Props, RootActorPath } import pekko.serialization.jackson.CborSerializable +import pekko.testkit.{ ImplicitSender, PekkoSpec, TestKit } import pekko.testkit.EventFilter import pekko.testkit.TestActors -import pekko.testkit.{ ImplicitSender, PekkoSpec, TestKit } + +import com.typesafe.config.{ Config, ConfigFactory } object MessageLoggingSpec { def config(artery: Boolean) = ConfigFactory.parseString(s""" diff --git a/remote/src/test/scala/org/apache/pekko/remote/NetworkFailureSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/NetworkFailureSpec.scala index daff38b837..d3486ea23d 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/NetworkFailureSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/NetworkFailureSpec.scala @@ -18,8 +18,8 @@ import java.util.concurrent.atomic.AtomicBoolean import scala.concurrent.Future import org.apache.pekko -import pekko.testkit.PekkoSpec import pekko.testkit.DefaultTimeout +import pekko.testkit.PekkoSpec trait NetworkFailureSpec extends DefaultTimeout { self: PekkoSpec => import scala.concurrent.duration.Duration diff --git a/remote/src/test/scala/org/apache/pekko/remote/RemoteActorMailboxSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/RemoteActorMailboxSpec.scala index 99f4928bfe..c3f3ca8949 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/RemoteActorMailboxSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/RemoteActorMailboxSpec.scala @@ -13,10 +13,10 @@ package org.apache.pekko.remote -import com.typesafe.config.ConfigFactory - import org.apache.pekko.actor.ActorMailboxSpec +import com.typesafe.config.ConfigFactory + class RemoteActorMailboxSpec extends ActorMailboxSpec( ConfigFactory.parseString("""pekko.actor.provider = remote""").withFallback(ActorMailboxSpec.mailboxConf)) {} diff --git a/remote/src/test/scala/org/apache/pekko/remote/RemoteConfigSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/RemoteConfigSpec.scala index 9821e30172..85e2594287 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/RemoteConfigSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/RemoteConfigSpec.scala @@ -13,10 +13,8 @@ package org.apache.pekko.remote -import io.netty.buffer.PooledByteBufAllocator - -import scala.concurrent.duration._ import scala.annotation.nowarn +import scala.concurrent.duration._ import org.apache.pekko import pekko.remote.transport.PekkoProtocolSettings @@ -25,6 +23,8 @@ import pekko.testkit.PekkoSpec import pekko.util.Helpers import pekko.util.Helpers.ConfigOps +import io.netty.buffer.PooledByteBufAllocator + @nowarn // classic deprecated class RemoteConfigSpec extends PekkoSpec(""" pekko.actor.provider = remote diff --git a/remote/src/test/scala/org/apache/pekko/remote/RemoteDeployerSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/RemoteDeployerSpec.scala index 44edd85118..d840b01709 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/RemoteDeployerSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/RemoteDeployerSpec.scala @@ -13,14 +13,14 @@ package org.apache.pekko.remote -import com.typesafe.config._ - import org.apache.pekko import pekko.ConfigurationException import pekko.actor._ import pekko.routing._ import pekko.testkit._ +import com.typesafe.config._ + object RemoteDeployerSpec { val deployerConf = ConfigFactory.parseString( """ diff --git a/remote/src/test/scala/org/apache/pekko/remote/RemoteFeaturesSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/RemoteFeaturesSpec.scala index 78a50a3eca..2c67cab2bc 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/RemoteFeaturesSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/RemoteFeaturesSpec.scala @@ -13,11 +13,8 @@ package org.apache.pekko.remote -import scala.concurrent.duration._ - import scala.annotation.nowarn -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory +import scala.concurrent.duration._ import org.apache.pekko import pekko.actor.Actor @@ -37,6 +34,9 @@ import pekko.testkit.EventFilter import pekko.testkit.ImplicitSender import pekko.testkit.TestProbe +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object RemoteFeaturesSpec { val instances = 1 diff --git a/remote/src/test/scala/org/apache/pekko/remote/RemoteRouterSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/RemoteRouterSpec.scala index a5e457e1d6..612e95e034 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/RemoteRouterSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/RemoteRouterSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.remote import scala.collection.immutable -import com.typesafe.config._ - import org.apache.pekko import pekko.actor._ import pekko.remote.routing._ @@ -24,6 +22,8 @@ import pekko.routing._ import pekko.testkit._ import pekko.testkit.TestActors.echoActorProps +import com.typesafe.config._ + object RemoteRouterSpec { class Parent extends Actor { def receive = { diff --git a/remote/src/test/scala/org/apache/pekko/remote/Ticket1978CommunicationSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/Ticket1978CommunicationSpec.scala index 8e045fd6bf..84ff2206dc 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/Ticket1978CommunicationSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/Ticket1978CommunicationSpec.scala @@ -17,13 +17,11 @@ import java.io.ByteArrayOutputStream import java.security.NoSuchAlgorithmException import java.util.zip.GZIPOutputStream +import scala.annotation.nowarn import scala.concurrent.{ Await, Future } import scala.concurrent.duration._ import scala.reflect.classTag -import scala.annotation.nowarn -import com.typesafe.config._ - import org.apache.pekko import pekko.actor._ import pekko.event.NoMarkerLogging @@ -34,6 +32,8 @@ import pekko.remote.transport.netty.SSLSettings import pekko.testkit._ import pekko.util.Timeout +import com.typesafe.config._ + @nowarn("msg=deprecated") object Configuration { // set this in your JAVA_OPTS to see all ssl debug info: "-Djavax.net.debug=ssl,keymanager" diff --git a/remote/src/test/scala/org/apache/pekko/remote/TransientSerializationErrorSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/TransientSerializationErrorSpec.scala index 001906e21f..7f9ef20085 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/TransientSerializationErrorSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/TransientSerializationErrorSpec.scala @@ -15,14 +15,14 @@ package org.apache.pekko.remote import java.io.NotSerializableException -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.actor.{ ActorSystem, ExtendedActorSystem, RootActorPath } import pekko.serialization.SerializerWithStringManifest import pekko.testkit.{ PekkoSpec, TestActors, TestKit } import pekko.util.unused +import com.typesafe.config.{ Config, ConfigFactory } + object TransientSerializationErrorSpec { object ManifestNotSerializable object ManifestIllegal diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/ActorRefResolveCacheQuarantineSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/ActorRefResolveCacheQuarantineSpec.scala index 1d2cb64d10..c7fe08ee8a 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/ActorRefResolveCacheQuarantineSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/ActorRefResolveCacheQuarantineSpec.scala @@ -14,13 +14,13 @@ package org.apache.pekko.remote.artery import org.apache.pekko +import pekko.pattern.ask import pekko.remote.RARP import pekko.testkit.DeadLettersFilter import pekko.testkit.ImplicitSender import pekko.testkit.TestActors -import pekko.testkit.TestEvent.Mute import pekko.testkit.TestDuration -import pekko.pattern.ask +import pekko.testkit.TestEvent.Mute import pekko.util.Timeout /** diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/ArteryMultiNodeSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/ArteryMultiNodeSpec.scala index 1a732a80e6..1be9747afc 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/ArteryMultiNodeSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/ArteryMultiNodeSpec.scala @@ -13,15 +13,16 @@ package org.apache.pekko.remote.artery -import com.typesafe.config.{ Config, ConfigFactory } -import org.scalatest.{ Outcome, Pending } - import org.apache.pekko import pekko.actor.{ ActorSystem, Address, BootstrapSetup, RootActorPath } import pekko.actor.setup.ActorSystemSetup import pekko.remote.RARP import pekko.testkit.{ PekkoSpec, SocketUtil } +import org.scalatest.{ Outcome, Pending } + +import com.typesafe.config.{ Config, ConfigFactory } + /** * Base class for remoting tests what needs to test interaction between a "local" actor system * which is always created (the usual PekkoSpec system), and multiple additional actor systems over artery diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/BindCanonicalAddressSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/BindCanonicalAddressSpec.scala index 58a6c222b7..c4b4f746d0 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/BindCanonicalAddressSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/BindCanonicalAddressSpec.scala @@ -18,15 +18,16 @@ import java.net.InetAddress import scala.concurrent.Await import scala.concurrent.duration.Duration -import com.typesafe.config.ConfigFactory -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec - import org.apache.pekko import pekko.actor.{ ActorSystem, Address } import pekko.remote.transport.NettyTransportSpec._ import pekko.testkit.SocketUtil +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + +import com.typesafe.config.ConfigFactory + trait BindCanonicalAddressBehaviors { this: AnyWordSpec with Matchers => def arteryConnectionTest(transport: String, isUDP: Boolean): Unit = { diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/DuplicateFlushSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/DuplicateFlushSpec.scala index d48f56d113..1ad9220b70 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/DuplicateFlushSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/DuplicateFlushSpec.scala @@ -24,8 +24,8 @@ import pekko.stream.testkit.TestPublisher import pekko.stream.testkit.TestSubscriber import pekko.stream.testkit.scaladsl.TestSink import pekko.stream.testkit.scaladsl.TestSource -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.util.OptionVal class DuplicateFlushSpec extends PekkoSpec(""" diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/DuplicateHandshakeSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/DuplicateHandshakeSpec.scala index 1a0d0e6677..a7eb5652be 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/DuplicateHandshakeSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/DuplicateHandshakeSpec.scala @@ -25,8 +25,8 @@ import pekko.stream.testkit.TestPublisher import pekko.stream.testkit.TestSubscriber import pekko.stream.testkit.scaladsl.TestSink import pekko.stream.testkit.scaladsl.TestSource -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.util.OptionVal class DuplicateHandshakeSpec extends PekkoSpec(""" diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/EnvelopeBufferSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/EnvelopeBufferSpec.scala index 25869cacf4..2a57a0e1ef 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/EnvelopeBufferSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/EnvelopeBufferSpec.scala @@ -14,6 +14,7 @@ package org.apache.pekko.remote.artery import java.nio.{ ByteBuffer, ByteOrder } + import org.apache.pekko import pekko.actor._ import pekko.remote.artery.compress.{ CompressionTable, CompressionTestUtils, InboundCompressions } diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/HandshakeDenySpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/HandshakeDenySpec.scala index 44e1e5e0f3..0c05767f98 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/HandshakeDenySpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/HandshakeDenySpec.scala @@ -15,13 +15,13 @@ package org.apache.pekko.remote.artery import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ ActorIdentity, Identify } import pekko.actor.RootActorPath import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object HandshakeDenySpec { val commonConfig = ConfigFactory.parseString(s""" diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/HandshakeFailureSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/HandshakeFailureSpec.scala index 7e953754e4..f29e04a2f6 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/HandshakeFailureSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/HandshakeFailureSpec.scala @@ -15,14 +15,14 @@ package org.apache.pekko.remote.artery import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ ActorIdentity, Identify } import pekko.testkit.ImplicitSender import pekko.testkit.TestActors import pekko.testkit.TestProbe +import com.typesafe.config.ConfigFactory + object HandshakeFailureSpec { val commonConfig = ConfigFactory.parseString(s""" diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/HandshakeRetrySpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/HandshakeRetrySpec.scala index 407bd7c271..cbce270c20 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/HandshakeRetrySpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/HandshakeRetrySpec.scala @@ -15,13 +15,13 @@ package org.apache.pekko.remote.artery import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.testkit.ImplicitSender import pekko.testkit.TestActors +import com.typesafe.config.ConfigFactory + object HandshakeRetrySpec { val commonConfig = ConfigFactory.parseString(s""" pekko.remote.artery.advanced.handshake-timeout = 10s diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/HarmlessQuarantineSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/HarmlessQuarantineSpec.scala index eae4dd97a9..8b3dba1fdd 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/HarmlessQuarantineSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/HarmlessQuarantineSpec.scala @@ -16,9 +16,6 @@ package org.apache.pekko.remote.artery import scala.concurrent.Future import scala.concurrent.Promise -import org.scalatest.concurrent.Eventually -import org.scalatest.time.Span - import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ActorSystem @@ -30,6 +27,9 @@ import pekko.testkit.ImplicitSender import pekko.testkit.TestActors import pekko.testkit.TestProbe +import org.scalatest.concurrent.Eventually +import org.scalatest.time.Span + class HarmlessQuarantineSpec extends ArteryMultiNodeSpec(""" pekko.loglevel=INFO pekko.remote.artery.propagate-harmless-quarantine-events = off diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/ImmutableLongMapSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/ImmutableLongMapSpec.scala index f3757910b5..dd862885f2 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/ImmutableLongMapSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/ImmutableLongMapSpec.scala @@ -15,11 +15,11 @@ package org.apache.pekko.remote.artery import scala.util.Random +import org.apache.pekko.util.OptionVal + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import org.apache.pekko.util.OptionVal - class ImmutableLongMapSpec extends AnyWordSpec with Matchers { "ImmutableLongMap" must { diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/InboundControlJunctionSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/InboundControlJunctionSpec.scala index cd1cef1892..d6d49b0749 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/InboundControlJunctionSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/InboundControlJunctionSpec.scala @@ -23,8 +23,8 @@ import pekko.remote.artery.InboundControlJunction.ControlMessageObserver import pekko.stream.scaladsl.Keep import pekko.stream.testkit.scaladsl.TestSink import pekko.stream.testkit.scaladsl.TestSource -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.testkit.TestProbe import pekko.util.OptionVal diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/InboundHandshakeSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/InboundHandshakeSpec.scala index 98a705fe13..29277d3b9b 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/InboundHandshakeSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/InboundHandshakeSpec.scala @@ -28,8 +28,8 @@ import pekko.stream.testkit.TestPublisher import pekko.stream.testkit.TestSubscriber import pekko.stream.testkit.scaladsl.TestSink import pekko.stream.testkit.scaladsl.TestSource -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.testkit.TestProbe import pekko.util.OptionVal diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/LateConnectSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/LateConnectSpec.scala index 5f2861c706..7f036dbc7d 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/LateConnectSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/LateConnectSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.remote.artery import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.RootActorPath import pekko.remote.RARP @@ -24,6 +22,8 @@ import pekko.testkit.ImplicitSender import pekko.testkit.TestActors import pekko.testkit.TestProbe +import com.typesafe.config.ConfigFactory + object LateConnectSpec { val config = ConfigFactory.parseString(s""" diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/LruBoundedCacheSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/LruBoundedCacheSpec.scala index b3f8fd1006..972a0c1926 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/LruBoundedCacheSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/LruBoundedCacheSpec.scala @@ -13,9 +13,8 @@ package org.apache.pekko.remote.artery -import scala.util.Random - import scala.annotation.nowarn +import scala.util.Random import org.apache.pekko import pekko.testkit.PekkoSpec diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundControlJunctionSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundControlJunctionSpec.scala index 81719c8916..e59d8d994f 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundControlJunctionSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundControlJunctionSpec.scala @@ -19,8 +19,8 @@ import pekko.remote.UniqueAddress import pekko.stream.scaladsl.Keep import pekko.stream.testkit.scaladsl.TestSink import pekko.stream.testkit.scaladsl.TestSource -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.util.OptionVal object OutboundControlJunctionSpec { diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundHandshakeSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundHandshakeSpec.scala index 4a1a39a1e7..8be04dc9bc 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundHandshakeSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundHandshakeSpec.scala @@ -25,8 +25,8 @@ import pekko.stream.testkit.TestPublisher import pekko.stream.testkit.TestSubscriber import pekko.stream.testkit.scaladsl.TestSink import pekko.stream.testkit.scaladsl.TestSource -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.util.OptionVal class OutboundHandshakeSpec extends PekkoSpec(""" diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundIdleShutdownSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundIdleShutdownSpec.scala index 8846c40f44..8569262c35 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundIdleShutdownSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundIdleShutdownSpec.scala @@ -17,9 +17,6 @@ import scala.concurrent.Future import scala.concurrent.Promise import scala.concurrent.duration._ -import org.scalatest.concurrent.Eventually -import org.scalatest.time.Span - import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ActorSystem @@ -31,6 +28,9 @@ import pekko.testkit.ImplicitSender import pekko.testkit.TestActors import pekko.testkit.TestProbe +import org.scalatest.concurrent.Eventually +import org.scalatest.time.Span + class OutboundIdleShutdownSpec extends ArteryMultiNodeSpec(""" pekko.loglevel=INFO pekko.remote.artery.advanced { diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteDeathWatchSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteDeathWatchSpec.scala index c6ad0f3aec..d3f7aa17d9 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteDeathWatchSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteDeathWatchSpec.scala @@ -13,10 +13,8 @@ package org.apache.pekko.remote.artery -import scala.concurrent.duration._ - import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory +import scala.concurrent.duration._ import org.apache.pekko import pekko.actor._ @@ -25,6 +23,8 @@ import pekko.remote.RARP import pekko.testkit._ import pekko.testkit.SocketUtil +import com.typesafe.config.ConfigFactory + object RemoteDeathWatchSpec { val otherPort = ArteryMultiNodeSpec.freePort(ConfigFactory.load()) diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteDeployerSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteDeployerSpec.scala index 4e27852c85..0fe7dfa3b5 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteDeployerSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteDeployerSpec.scala @@ -13,8 +13,6 @@ package org.apache.pekko.remote.artery -import com.typesafe.config._ - import org.apache.pekko import pekko.ConfigurationException import pekko.actor._ @@ -22,6 +20,8 @@ import pekko.remote.RemoteScope import pekko.routing._ import pekko.testkit._ +import com.typesafe.config._ + object RemoteDeployerSpec { val deployerConf = ConfigFactory.parseString(""" pekko.actor.deployment { diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteDeploymentSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteDeploymentSpec.scala index 13c5fd9a7e..34583b0485 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteDeploymentSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteDeploymentSpec.scala @@ -13,13 +13,13 @@ package org.apache.pekko.remote.artery -import com.typesafe.config._ - import org.apache.pekko import pekko.actor._ import pekko.remote.RARP import pekko.testkit._ +import com.typesafe.config._ + object RemoteDeploymentSpec { class Echo1 extends Actor { var target: ActorRef = context.system.deadLetters diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteInstrumentsSerializationSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteInstrumentsSerializationSpec.scala index fb76ecb83f..e03e31cc95 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteInstrumentsSerializationSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteInstrumentsSerializationSpec.scala @@ -14,8 +14,11 @@ package org.apache.pekko.remote.artery import java.nio.{ ByteBuffer, CharBuffer } +import java.nio.ByteOrder import java.nio.charset.StandardCharsets + import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.{ ActorRef, ActorSystem, ExtendedActorSystem, InternalActorRef } import pekko.event._ @@ -23,8 +26,6 @@ import pekko.testkit.{ EventFilter, PekkoSpec, TestProbe } import pekko.testkit.TestEvent.Mute import pekko.util.{ unused, OptionVal } -import java.nio.ByteOrder - class RemoteInstrumentsSerializationSpec extends PekkoSpec("pekko.loglevel = DEBUG") { import RemoteInstrumentsSerializationSpec._ diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteInstrumentsSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteInstrumentsSpec.scala index f1df9dc9df..470e923824 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteInstrumentsSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteInstrumentsSpec.scala @@ -14,9 +14,10 @@ package org.apache.pekko.remote.artery import org.scalacheck.{ Arbitrary, Gen } +import org.scalatestplus.scalacheck.Checkers + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import org.scalatestplus.scalacheck.Checkers class RemoteInstrumentsSpec extends AnyWordSpec with Matchers with Checkers { diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteMessageSerializationSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteMessageSerializationSpec.scala index c94a66bdbb..0e23268cff 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteMessageSerializationSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteMessageSerializationSpec.scala @@ -16,8 +16,9 @@ package org.apache.pekko.remote.artery import java.io.NotSerializableException import java.util.concurrent.ThreadLocalRandom -import scala.concurrent.duration._ import scala.annotation.nowarn +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.{ Actor, ActorRef, Dropped, PoisonPill, Props } import pekko.remote.{ AssociationErrorEvent, DisassociatedEvent, OversizedPayloadException, RARP } diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteRouterSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteRouterSpec.scala index f1fd7986a1..b0ce4190bf 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteRouterSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteRouterSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.remote.artery import scala.collection.immutable -import com.typesafe.config._ - import org.apache.pekko import pekko.actor._ import pekko.remote.{ RARP, RemoteScope } @@ -25,6 +23,8 @@ import pekko.routing._ import pekko.testkit._ import pekko.testkit.TestActors.echoActorProps +import com.typesafe.config._ + object RemoteRouterSpec { class Parent extends Actor { def receive = { diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteSendConsistencySpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteSendConsistencySpec.scala index 4871b3022f..69590cab69 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteSendConsistencySpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteSendConsistencySpec.scala @@ -17,8 +17,6 @@ import java.util.UUID import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorIdentity @@ -32,6 +30,8 @@ import pekko.actor.Props import pekko.actor.RootActorPath import pekko.testkit.{ ImplicitSender, TestActors, TestProbe } +import com.typesafe.config.{ Config, ConfigFactory } + class ArteryUpdSendConsistencyWithOneLaneSpec extends AbstractRemoteSendConsistencySpec(ConfigFactory.parseString(""" pekko.remote.artery.transport = aeron-udp diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteWatcherSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteWatcherSpec.scala index f8cc5fbf21..a51eafdf87 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteWatcherSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/RemoteWatcherSpec.scala @@ -15,13 +15,13 @@ package org.apache.pekko.remote.artery import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.remote._ import pekko.testkit._ +import com.typesafe.config.ConfigFactory + object RemoteWatcherSpec { class TestActorProxy(testActor: ActorRef) extends Actor { diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/RemotingFlightRecorderSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/RemotingFlightRecorderSpec.scala index ac45bf070e..9f57b56722 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/RemotingFlightRecorderSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/RemotingFlightRecorderSpec.scala @@ -13,12 +13,12 @@ package org.apache.pekko.remote.artery -import org.scalatest.matchers.should.Matchers - import org.apache.pekko import pekko.testkit.PekkoSpec import pekko.util.JavaVersion +import org.scalatest.matchers.should.Matchers + class RemotingFlightRecorderSpec extends PekkoSpec with Matchers { "The RemotingFlightRecorder" must { diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/SendQueueSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/SendQueueSpec.scala index 062d1358dd..9df0c93e97 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/SendQueueSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/SendQueueSpec.scala @@ -26,8 +26,8 @@ import pekko.stream.scaladsl.Keep import pekko.stream.scaladsl.Source import pekko.stream.testkit.TestSubscriber import pekko.stream.testkit.scaladsl.TestSink -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec object SendQueueSpec { diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/SystemMessageAckerSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/SystemMessageAckerSpec.scala index 86c4682d49..90c81b6ea7 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/SystemMessageAckerSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/SystemMessageAckerSpec.scala @@ -22,8 +22,8 @@ import pekko.stream.testkit.TestPublisher import pekko.stream.testkit.TestSubscriber import pekko.stream.testkit.scaladsl.TestSink import pekko.stream.testkit.scaladsl.TestSource -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.testkit.TestProbe import pekko.util.OptionVal diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/SystemMessageDeliverySpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/SystemMessageDeliverySpec.scala index 22d520e7e4..face22258b 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/SystemMessageDeliverySpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/SystemMessageDeliverySpec.scala @@ -18,9 +18,6 @@ import java.util.concurrent.ThreadLocalRandom import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.NotUsed import pekko.actor.ActorIdentity @@ -43,6 +40,9 @@ import pekko.testkit.TestEvent import pekko.testkit.TestProbe import pekko.util.OptionVal +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object SystemMessageDeliverySpec { case class TestSysMsg(s: String) extends SystemMessageDelivery.AckedDeliveryMessage diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/TestContext.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/TestContext.scala index b83fec37e3..0212214d83 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/TestContext.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/TestContext.scala @@ -17,20 +17,20 @@ import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.CopyOnWriteArrayList import java.util.concurrent.ThreadLocalRandom +import scala.concurrent.ExecutionContext import scala.concurrent.Future -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.Done import pekko.actor.ActorRef import pekko.actor.Address -import scala.concurrent.ExecutionContext import pekko.remote.UniqueAddress import pekko.remote.artery.InboundControlJunction.ControlMessageObserver import pekko.remote.artery.InboundControlJunction.ControlMessageSubject import pekko.util.OptionVal +import com.typesafe.config.ConfigFactory + private[remote] class TestInboundContext( override val localAddress: UniqueAddress, val controlSubject: TestControlMessageSubject = new TestControlMessageSubject, diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/UntrustedSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/UntrustedSpec.scala index 2151f7a624..4abf7b1d0d 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/UntrustedSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/UntrustedSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.remote.artery import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorIdentity @@ -36,6 +34,8 @@ import pekko.testkit.ImplicitSender import pekko.testkit.TestEvent import pekko.testkit.TestProbe +import com.typesafe.config.ConfigFactory + object UntrustedSpec { final case class IdentifyReq(path: String) extends CborSerializable final case class StopChild(name: String) extends CborSerializable diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/aeron/AeronSinkSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/aeron/AeronSinkSpec.scala index f118c7922c..1533db83f6 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/aeron/AeronSinkSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/aeron/AeronSinkSpec.scala @@ -29,8 +29,8 @@ import pekko.actor.ExtendedActorSystem import pekko.remote.artery.aeron.AeronSink.GaveUpMessageException import pekko.stream.scaladsl.Sink import pekko.stream.scaladsl.Source -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.testkit.SocketUtil class AeronSinkSpec extends PekkoSpec(""" diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/compress/CompressionIntegrationSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/compress/CompressionIntegrationSpec.scala index 34e9975b8a..84c50cf0af 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/compress/CompressionIntegrationSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/compress/CompressionIntegrationSpec.scala @@ -13,8 +13,10 @@ package org.apache.pekko.remote.artery.compress +import java.io.NotSerializableException + import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory + import org.apache.pekko import pekko.actor._ import pekko.actor.ExtendedActorSystem @@ -23,7 +25,7 @@ import pekko.remote.artery.compress.CompressionProtocol.Events import pekko.serialization.SerializerWithStringManifest import pekko.testkit._ -import java.io.NotSerializableException +import com.typesafe.config.ConfigFactory object CompressionIntegrationSpec { diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/compress/HandshakeShouldDropCompressionTableSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/compress/HandshakeShouldDropCompressionTableSpec.scala index 0e5ab6857e..cfd8f9d047 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/compress/HandshakeShouldDropCompressionTableSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/compress/HandshakeShouldDropCompressionTableSpec.scala @@ -16,9 +16,6 @@ package org.apache.pekko.remote.artery.compress import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory -import org.scalatest.BeforeAndAfter - import org.apache.pekko import pekko.actor.{ ActorIdentity, ActorSystem, Identify } import pekko.pattern.ask @@ -28,6 +25,10 @@ import pekko.remote.artery.compress.CompressionProtocol.Events.{ Event, Received import pekko.testkit._ import pekko.util.Timeout +import org.scalatest.BeforeAndAfter + +import com.typesafe.config.ConfigFactory + object HandshakeShouldDropCompressionTableSpec { val commonConfig = ConfigFactory.parseString(s""" pekko { diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/jfr/JFRRemotingFlightRecorderSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/jfr/JFRRemotingFlightRecorderSpec.scala index e64e7c885c..7e5da9765b 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/jfr/JFRRemotingFlightRecorderSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/jfr/JFRRemotingFlightRecorderSpec.scala @@ -13,8 +13,6 @@ package org.apache.pekko.remote.artery.jfr -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.ActorSystem import pekko.remote.artery.NoOpRemotingFlightRecorder @@ -22,6 +20,8 @@ import pekko.remote.artery.RemotingFlightRecorder import pekko.testkit.PekkoSpec import pekko.testkit.TestKit +import com.typesafe.config.ConfigFactory + class JFRRemotingFlightRecorderSpec extends PekkoSpec { "The RemotingFlightRecorder" must { diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/TcpFramingSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/TcpFramingSpec.scala index df171c7e49..2f845f96b2 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/TcpFramingSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/TcpFramingSpec.scala @@ -21,8 +21,8 @@ import pekko.stream.scaladsl.Flow import pekko.stream.scaladsl.Framing.FramingException import pekko.stream.scaladsl.Sink import pekko.stream.scaladsl.Source -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender +import pekko.testkit.PekkoSpec import pekko.util.ByteString class TcpFramingSpec extends PekkoSpec(""" diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/TlsTcpSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/TlsTcpSpec.scala index 8de3683341..5a22054bfd 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/TlsTcpSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/TlsTcpSpec.scala @@ -15,6 +15,11 @@ package org.apache.pekko.remote.artery package tcp import java.security.NoSuchAlgorithmException +import javax.net.ssl.SSLEngine +import javax.net.ssl.SSLSession + +import scala.concurrent.duration._ +import scala.util.{ Failure, Success } import org.apache.pekko import pekko.actor.{ ActorIdentity, ActorPath, ActorRef, Identify, RootActorPath } @@ -24,14 +29,11 @@ import pekko.testkit.EventFilter import pekko.testkit.ImplicitSender import pekko.testkit.TestActors import pekko.testkit.TestProbe -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import javax.net.ssl.SSLEngine -import javax.net.ssl.SSLSession + import org.scalatest.matchers.should.Matchers -import scala.concurrent.duration._ -import scala.util.{ Failure, Success } +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory class TlsTcpWithDefaultConfigSpec extends TlsTcpSpec(ConfigFactory.empty()) diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/CipherSuiteSupportCheck.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/CipherSuiteSupportCheck.scala index 3d8b842f68..d9061a5b2a 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/CipherSuiteSupportCheck.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/CipherSuiteSupportCheck.scala @@ -14,16 +14,17 @@ package org.apache.pekko.remote.artery.tcp.ssl import java.security.NoSuchAlgorithmException +import javax.net.ssl.SSLEngine + +import scala.util.Try import org.apache.pekko import pekko.actor.ActorSystem import pekko.actor.ExtendedActorSystem import pekko.event.NoMarkerLogging import pekko.remote.artery.tcp.SecureRandomFactory -import com.typesafe.config.Config -import javax.net.ssl.SSLEngine -import scala.util.Try +import com.typesafe.config.Config object CipherSuiteSupportCheck { diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/PeerSubjectVerifierSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/PeerSubjectVerifierSpec.scala index 90c9bce52d..750be49d0d 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/PeerSubjectVerifierSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/PeerSubjectVerifierSpec.scala @@ -16,9 +16,9 @@ package org.apache.pekko.remote.artery.tcp.ssl import java.security.Principal import java.security.cert.Certificate import java.security.cert.X509Certificate - import javax.net.ssl.SSLSession import javax.net.ssl.SSLSessionContext + import org.scalatest.matchers.must.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/PemManagersProviderSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/PemManagersProviderSpec.scala index 2049515614..f55a7b7cea 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/PemManagersProviderSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/PemManagersProviderSpec.scala @@ -16,6 +16,7 @@ package org.apache.pekko.remote.artery.tcp.ssl import java.security.PrivateKey import java.security.cert.Certificate import java.security.cert.X509Certificate + import scala.annotation.nowarn import org.scalatest.matchers.must.Matchers diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/RotatingKeysSSLEngineProviderSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/RotatingKeysSSLEngineProviderSpec.scala index 0c3b2680a9..14ad6a00fb 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/RotatingKeysSSLEngineProviderSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/RotatingKeysSSLEngineProviderSpec.scala @@ -18,6 +18,12 @@ import java.nio.file.Files import java.nio.file.Path import java.nio.file.StandardCopyOption import java.util.concurrent.atomic.AtomicReference +import javax.net.ssl.SSLContext +import javax.net.ssl.SSLEngine +import javax.net.ssl.SSLSession + +import scala.concurrent.blocking +import scala.util.control.NonFatal import org.apache.pekko import pekko.actor.ActorIdentity @@ -36,13 +42,8 @@ import pekko.remote.artery.tcp.TlsTcpSpec import pekko.testkit.ImplicitSender import pekko.testkit.TestActors import pekko.testkit.TestProbe -import com.typesafe.config.ConfigFactory -import javax.net.ssl.SSLContext -import javax.net.ssl.SSLEngine -import javax.net.ssl.SSLSession -import scala.concurrent.blocking -import scala.util.control.NonFatal +import com.typesafe.config.ConfigFactory // This is a simplification Spec. It doesn't rely on changing files. class RotatingProviderWithStaticKeysSpec diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/TlsResourcesSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/TlsResourcesSpec.scala index e887f065b2..638033ed0e 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/TlsResourcesSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/tcp/ssl/TlsResourcesSpec.scala @@ -16,13 +16,12 @@ package org.apache.pekko.remote.artery.tcp.ssl import java.security.cert.CertificateFactory import java.security.cert.X509Certificate -import org.scalatest.matchers.must.Matchers -import org.scalatest.wordspec.AnyWordSpec - +import scala.jdk.CollectionConverters._ import scala.util.Try import scala.util.control.NonFatal -import scala.jdk.CollectionConverters._ +import org.scalatest.matchers.must.Matchers +import org.scalatest.wordspec.AnyWordSpec /** */ diff --git a/remote/src/test/scala/org/apache/pekko/remote/classic/ActorsLeakSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/classic/ActorsLeakSpec.scala index 2a9dd698d0..13d8bd3277 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/classic/ActorsLeakSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/classic/ActorsLeakSpec.scala @@ -13,13 +13,11 @@ package org.apache.pekko.remote.classic +import scala.annotation.nowarn import scala.collection.immutable import scala.concurrent.Await import scala.concurrent.duration._ -import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor._ import pekko.actor.dungeon.ChildrenContainer @@ -28,6 +26,8 @@ import pekko.remote.transport.ThrottlerTransportAdapter.ForceDisassociate import pekko.testkit._ import pekko.testkit.TestActors.EchoActor +import com.typesafe.config.ConfigFactory + object ActorsLeakSpec { val config = ConfigFactory.parseString(""" diff --git a/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteDeathWatchSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteDeathWatchSpec.scala index c448719f3e..4a2c4647c3 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteDeathWatchSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteDeathWatchSpec.scala @@ -13,10 +13,8 @@ package org.apache.pekko.remote.classic -import scala.concurrent.duration._ - import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory +import scala.concurrent.duration._ import org.apache.pekko import pekko.actor.{ RootActorPath, _ } @@ -24,6 +22,8 @@ import pekko.event.Logging.Warning import pekko.remote.{ QuarantinedEvent, RARP, RemoteActorRef } import pekko.testkit.{ SocketUtil, _ } +import com.typesafe.config.ConfigFactory + @nowarn // classic deprecated class RemoteDeathWatchSpec extends PekkoSpec(ConfigFactory.parseString(""" diff --git a/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteDeploymentAllowListSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteDeploymentAllowListSpec.scala index 458057f735..d884caa534 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteDeploymentAllowListSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteDeploymentAllowListSpec.scala @@ -13,9 +13,9 @@ package org.apache.pekko.remote.classic -import scala.concurrent.duration._ import scala.annotation.nowarn -import com.typesafe.config._ +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor._ import pekko.remote.EndpointException @@ -23,6 +23,8 @@ import pekko.remote.NotAllowedClassRemoteDeploymentAttemptException import pekko.remote.transport._ import pekko.testkit._ +import com.typesafe.config._ + // relies on test transport object RemoteDeploymentAllowListSpec { diff --git a/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteInitErrorSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteInitErrorSpec.scala index 2865d7e2c1..25d4ed3cae 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteInitErrorSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteInitErrorSpec.scala @@ -16,16 +16,17 @@ package org.apache.pekko.remote.classic import scala.annotation.nowarn import scala.collection.mutable.Set import scala.concurrent.duration._ +import scala.jdk.CollectionConverters._ import scala.util.control.NonFatal -import com.typesafe.config.ConfigFactory +import org.apache.pekko +import pekko.actor.ActorSystem + import org.scalatest.concurrent.Eventually._ import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import org.apache.pekko -import pekko.actor.ActorSystem -import scala.jdk.CollectionConverters._ +import com.typesafe.config.ConfigFactory /** * The 192.0.2.1 is a Documentation IP-address and should not be used at all diff --git a/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteSettingsSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteSettingsSpec.scala index b2dee383db..8ffd316146 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteSettingsSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteSettingsSpec.scala @@ -14,15 +14,17 @@ package org.apache.pekko.remote.classic import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec import org.apache.pekko import pekko.ConfigurationException import pekko.remote.RemoteSettings import pekko.testkit.PekkoSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + +import com.typesafe.config.ConfigFactory + @nowarn("msg=deprecated") class RemoteSettingsSpec extends AnyWordSpec with Matchers { diff --git a/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteWatcherSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteWatcherSpec.scala index f0569189ec..c913711e79 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteWatcherSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/classic/RemoteWatcherSpec.scala @@ -13,9 +13,8 @@ package org.apache.pekko.remote.classic -import scala.concurrent.duration._ - import scala.annotation.nowarn +import scala.concurrent.duration._ import org.apache.pekko import pekko.actor._ diff --git a/remote/src/test/scala/org/apache/pekko/remote/classic/RemotingSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/classic/RemotingSpec.scala index a85b28f0a9..335af689dd 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/classic/RemotingSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/classic/RemotingSpec.scala @@ -21,7 +21,6 @@ import scala.concurrent.{ Await, Future } import scala.concurrent.duration._ import scala.util.control.NonFatal -import com.typesafe.config._ import org.apache.pekko import pekko.actor._ import pekko.event.AddressTerminatedTopic @@ -34,6 +33,8 @@ import pekko.testkit._ import pekko.testkit.SocketUtil.temporaryServerAddress import pekko.util.ByteString +import com.typesafe.config._ + object RemotingSpec { final case class ActorSelReq(s: String) diff --git a/remote/src/test/scala/org/apache/pekko/remote/classic/UntrustedSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/classic/UntrustedSpec.scala index c4c74213a7..376b7e2d7a 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/classic/UntrustedSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/classic/UntrustedSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.remote.classic import scala.concurrent.duration._ -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorIdentity @@ -31,13 +29,15 @@ import pekko.actor.Props import pekko.actor.RootActorPath import pekko.actor.Terminated import pekko.event.Logging -import pekko.testkit.PekkoSpec import pekko.testkit.EventFilter import pekko.testkit.ImplicitSender import pekko.testkit.JavaSerializable +import pekko.testkit.PekkoSpec import pekko.testkit.TestEvent import pekko.testkit.TestProbe +import com.typesafe.config.ConfigFactory + object UntrustedSpec { final case class IdentifyReq(path: String) extends JavaSerializable final case class StopChild(name: String) extends JavaSerializable diff --git a/remote/src/test/scala/org/apache/pekko/remote/classic/transport/GenericTransportSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/classic/transport/GenericTransportSpec.scala index e16f82fdce..7c1f564ffd 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/classic/transport/GenericTransportSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/classic/transport/GenericTransportSpec.scala @@ -13,9 +13,8 @@ package org.apache.pekko.remote.classic.transport -import scala.concurrent.{ Await, Future } - import scala.annotation.nowarn +import scala.concurrent.{ Await, Future } import org.apache.pekko import pekko.actor.{ Address, ExtendedActorSystem } diff --git a/remote/src/test/scala/org/apache/pekko/remote/classic/transport/PekkoProtocolSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/classic/transport/PekkoProtocolSpec.scala index 6f24e12aaf..f869337eed 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/classic/transport/PekkoProtocolSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/classic/transport/PekkoProtocolSpec.scala @@ -15,31 +15,31 @@ package org.apache.pekko.remote.classic.transport import java.util.concurrent.TimeoutException +import scala.annotation.nowarn import scala.concurrent.{ Await, Promise } import scala.concurrent.duration._ -import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Address import pekko.protobufv3.internal.{ ByteString => PByteString } import pekko.remote.{ FailureDetector, WireFormats } import pekko.remote.classic.transport.PekkoProtocolSpec.TestFailureDetector import pekko.remote.transport.{ AssociationRegistry => _, _ } -import pekko.remote.transport.PekkoPduCodec.{ Associate, Disassociate, Heartbeat } import pekko.remote.transport.AssociationHandle.{ ActorHandleEventListener, DisassociateInfo, Disassociated, InboundPayload } +import pekko.remote.transport.PekkoPduCodec.{ Associate, Disassociate, Heartbeat } import pekko.remote.transport.ProtocolStateActor import pekko.remote.transport.TestTransport._ import pekko.remote.transport.Transport._ import pekko.testkit.{ ImplicitSender, PekkoSpec } import pekko.util.{ ByteString, OptionVal } +import com.typesafe.config.ConfigFactory + object PekkoProtocolSpec { class TestFailureDetector extends FailureDetector { diff --git a/remote/src/test/scala/org/apache/pekko/remote/classic/transport/PekkoProtocolStressTest.scala b/remote/src/test/scala/org/apache/pekko/remote/classic/transport/PekkoProtocolStressTest.scala index 9e0bf6bcea..0f0f0392fa 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/classic/transport/PekkoProtocolStressTest.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/classic/transport/PekkoProtocolStressTest.scala @@ -16,8 +16,6 @@ package org.apache.pekko.remote.classic.transport import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.actor._ import pekko.remote.{ EndpointException, RARP } @@ -25,6 +23,8 @@ import pekko.remote.classic.transport.PekkoProtocolStressTest._ import pekko.remote.transport.FailureInjectorTransportAdapter.{ Drop, One } import pekko.testkit._ +import com.typesafe.config.{ Config, ConfigFactory } + object PekkoProtocolStressTest { val configA: Config = ConfigFactory.parseString(""" diff --git a/remote/src/test/scala/org/apache/pekko/remote/classic/transport/SystemMessageDeliveryStressTest.scala b/remote/src/test/scala/org/apache/pekko/remote/classic/transport/SystemMessageDeliveryStressTest.scala index 4c05610b35..1e62fec8c3 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/classic/transport/SystemMessageDeliveryStressTest.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/classic/transport/SystemMessageDeliveryStressTest.scala @@ -13,12 +13,10 @@ package org.apache.pekko.remote.classic.transport +import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.duration._ -import scala.annotation.nowarn -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.actor._ import pekko.dispatch.sysmsg.{ Failed, SystemMessage } @@ -28,6 +26,8 @@ import pekko.remote.transport.FailureInjectorTransportAdapter.{ Drop, One } import pekko.remote.transport.ThrottlerTransportAdapter._ import pekko.testkit._ +import com.typesafe.config.{ Config, ConfigFactory } + object SystemMessageDeliveryStressTest { val msgCount = 5000 val burstSize = 100 diff --git a/remote/src/test/scala/org/apache/pekko/remote/classic/transport/TestTransportSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/classic/transport/TestTransportSpec.scala index d2abe6f980..b2c0eaff59 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/classic/transport/TestTransportSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/classic/transport/TestTransportSpec.scala @@ -13,9 +13,8 @@ package org.apache.pekko.remote.classic.transport -import scala.concurrent._ - import scala.annotation.nowarn +import scala.concurrent._ import org.apache.pekko import pekko.actor.Address diff --git a/remote/src/test/scala/org/apache/pekko/remote/classic/transport/ThrottlerTransportAdapterSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/classic/transport/ThrottlerTransportAdapterSpec.scala index 1acffea712..3a7f6916f5 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/classic/transport/ThrottlerTransportAdapterSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/classic/transport/ThrottlerTransportAdapterSpec.scala @@ -13,12 +13,10 @@ package org.apache.pekko.remote.classic.transport +import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.duration._ -import scala.annotation.nowarn -import com.typesafe.config.{ Config, ConfigFactory } - import org.apache.pekko import pekko.actor._ import pekko.remote.{ EndpointException, RemoteActorRefProvider } @@ -27,6 +25,8 @@ import pekko.remote.transport.{ TestTransport, ThrottlerTransportAdapter } import pekko.remote.transport.ThrottlerTransportAdapter._ import pekko.testkit.{ DefaultTimeout, EventFilter, ImplicitSender, PekkoSpec, TestEvent, TimingTest } +import com.typesafe.config.{ Config, ConfigFactory } + object ThrottlerTransportAdapterSpec { val configA: Config = ConfigFactory.parseString(""" diff --git a/remote/src/test/scala/org/apache/pekko/remote/serialization/AllowJavaSerializationOffSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/serialization/AllowJavaSerializationOffSpec.scala index 8b553c6380..5b0996cad7 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/serialization/AllowJavaSerializationOffSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/serialization/AllowJavaSerializationOffSpec.scala @@ -16,8 +16,6 @@ package org.apache.pekko.remote.serialization import java.util.{ BitSet => ProgrammaticJavaDummy } import java.util.{ Date => SerializableDummy } -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.ActorSystem import pekko.actor.BootstrapSetup @@ -27,6 +25,8 @@ import pekko.serialization._ import pekko.testkit.PekkoSpec import pekko.testkit.TestKit +import com.typesafe.config.ConfigFactory + class ConfigurationDummy class ProgrammaticDummy diff --git a/remote/src/test/scala/org/apache/pekko/remote/serialization/ArteryMessageSerializerSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/serialization/ArteryMessageSerializerSpec.scala index bc01ea2e78..7810e6acc9 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/serialization/ArteryMessageSerializerSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/serialization/ArteryMessageSerializerSpec.scala @@ -17,10 +17,10 @@ import java.io.NotSerializableException import org.apache.pekko import pekko.actor._ -import pekko.remote.artery.Flush -import pekko.remote.artery.FlushAck import pekko.remote.{ RemoteWatcher, UniqueAddress } import pekko.remote.artery.{ ActorSystemTerminating, ActorSystemTerminatingAck, Quarantined, SystemMessageDelivery } +import pekko.remote.artery.Flush +import pekko.remote.artery.FlushAck import pekko.remote.artery.OutboundHandshake.{ HandshakeReq, HandshakeRsp } import pekko.remote.artery.compress.CompressionProtocol.{ ActorRefCompressionAdvertisement, diff --git a/remote/src/test/scala/org/apache/pekko/remote/serialization/DaemonMsgCreateSerializerAllowJavaSerializationSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/serialization/DaemonMsgCreateSerializerAllowJavaSerializationSpec.scala index 1773f9c5a0..7bdbaa574b 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/serialization/DaemonMsgCreateSerializerAllowJavaSerializationSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/serialization/DaemonMsgCreateSerializerAllowJavaSerializationSpec.scala @@ -13,8 +13,6 @@ package org.apache.pekko.remote.serialization -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorRef @@ -30,10 +28,12 @@ import pekko.routing.FromConfig import pekko.routing.RoundRobinPool import pekko.serialization.Serialization import pekko.serialization.SerializationExtension -import pekko.testkit.PekkoSpec import pekko.testkit.JavaSerializable +import pekko.testkit.PekkoSpec import pekko.util.unused +import com.typesafe.config.ConfigFactory + object DaemonMsgCreateSerializerAllowJavaSerializationSpec { trait EmptyActor extends Actor { diff --git a/remote/src/test/scala/org/apache/pekko/remote/serialization/MiscMessageSerializerSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/serialization/MiscMessageSerializerSpec.scala index 5a062742d9..f66de88a05 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/serialization/MiscMessageSerializerSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/serialization/MiscMessageSerializerSpec.scala @@ -21,7 +21,6 @@ import scala.annotation.nowarn import scala.concurrent.duration._ import scala.util.control.NoStackTrace -import com.typesafe.config.ConfigFactory import org.apache.pekko import pekko.{ Done, NotUsed } import pekko.actor._ @@ -31,8 +30,10 @@ import pekko.remote.{ RemoteScope, RemoteWatcher } import pekko.remote.routing.RemoteRouterConfig import pekko.routing._ import pekko.serialization.SerializationExtension -import pekko.testkit.PekkoSpec import pekko.testkit.JavaSerializable +import pekko.testkit.PekkoSpec + +import com.typesafe.config.ConfigFactory object MiscMessageSerializerSpec { val serializationTestOverrides = diff --git a/remote/src/test/scala/org/apache/pekko/remote/serialization/SerializationTransportInformationSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/serialization/SerializationTransportInformationSpec.scala index 946f87abce..4daf7b5c78 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/serialization/SerializationTransportInformationSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/serialization/SerializationTransportInformationSpec.scala @@ -13,9 +13,9 @@ package org.apache.pekko.remote.serialization +import java.io.NotSerializableException import java.nio.charset.StandardCharsets -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory + import org.apache.pekko import pekko.actor.ActorIdentity import pekko.actor.ActorRef @@ -26,12 +26,13 @@ import pekko.actor.RootActorPath import pekko.remote.RARP import pekko.serialization.Serialization import pekko.serialization.SerializerWithStringManifest -import pekko.testkit.PekkoSpec import pekko.testkit.ImplicitSender import pekko.testkit.JavaSerializable +import pekko.testkit.PekkoSpec import pekko.testkit.TestActors -import java.io.NotSerializableException +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory object SerializationTransportInformationSpec { diff --git a/remote/src/test/scala/org/apache/pekko/remote/serialization/SystemMessageSerializationSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/serialization/SystemMessageSerializationSpec.scala index 31b4c4fdf6..3bda09a491 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/serialization/SystemMessageSerializationSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/serialization/SystemMessageSerializationSpec.scala @@ -13,8 +13,6 @@ package org.apache.pekko.remote.serialization -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.{ ActorInitializationException, ExtendedActorSystem, InternalActorRef } import pekko.dispatch.sysmsg._ @@ -22,6 +20,8 @@ import pekko.serialization.SerializationExtension import pekko.testkit.{ PekkoSpec, TestProbe } import pekko.testkit.JavaSerializable +import com.typesafe.config.ConfigFactory + object SystemMessageSerializationSpec { val serializationTestOverrides = """ diff --git a/remote/src/test/scala/org/apache/pekko/remote/transport/NettyTransportSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/transport/NettyTransportSpec.scala index 436994de58..fa3d3bddbd 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/transport/NettyTransportSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/transport/NettyTransportSpec.scala @@ -13,8 +13,11 @@ package org.apache.pekko.remote.transport -import com.typesafe.config.ConfigFactory -import io.netty.buffer.{ AdaptiveByteBufAllocator, PooledByteBufAllocator, UnpooledByteBufAllocator } +import java.net.{ InetAddress, InetSocketAddress } +import java.nio.channels.ServerSocketChannel + +import scala.concurrent.Await +import scala.concurrent.duration.Duration import org.apache.pekko import pekko.actor.{ ActorSystem, Address, ExtendedActorSystem } @@ -22,13 +25,12 @@ import pekko.remote.BoundAddressesExtension import pekko.remote.transport.netty.NettyTransport.deriveByteBufAllocator import pekko.testkit.SocketUtil +import io.netty.buffer.{ AdaptiveByteBufAllocator, PooledByteBufAllocator, UnpooledByteBufAllocator } + import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import java.net.{ InetAddress, InetSocketAddress } -import java.nio.channels.ServerSocketChannel -import scala.concurrent.Await -import scala.concurrent.duration.Duration +import com.typesafe.config.ConfigFactory object NettyTransportSpec { val commonConfig = ConfigFactory.parseString(""" diff --git a/serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/FiniteDurationModule.scala b/serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/FiniteDurationModule.scala index bf5f2b0cfe..c19baad4f1 100644 --- a/serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/FiniteDurationModule.scala +++ b/serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/FiniteDurationModule.scala @@ -14,6 +14,7 @@ package org.apache.pekko.serialization.jackson import scala.concurrent.duration.FiniteDuration +import scala.jdk.DurationConverters._ import com.fasterxml.jackson.core.JsonGenerator import com.fasterxml.jackson.core.JsonParser @@ -26,7 +27,6 @@ import com.fasterxml.jackson.datatype.jsr310.ser.DurationSerializer import org.apache.pekko import pekko.annotation.InternalApi -import scala.jdk.DurationConverters._ /** * INTERNAL API: Adds support for serializing and deserializing [[FiniteDuration]]. diff --git a/serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala b/serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala index b4f75fd6fb..c458503c5e 100644 --- a/serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala +++ b/serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala @@ -15,8 +15,10 @@ package org.apache.pekko.serialization.jackson import java.util.Optional import java.util.concurrent.ConcurrentHashMap + import scala.annotation.nowarn import scala.collection.immutable +import scala.jdk.OptionConverters._ import scala.util.{ Failure, Success } import com.fasterxml.jackson.annotation.{ JsonAutoDetect, JsonCreator, PropertyAccessor } @@ -42,7 +44,7 @@ import com.fasterxml.jackson.databind.{ import com.fasterxml.jackson.databind.cfg.EnumFeature import com.fasterxml.jackson.databind.json.JsonMapper import com.fasterxml.jackson.module.paramnames.ParameterNamesModule -import com.typesafe.config.Config + import org.apache.pekko import pekko.actor.{ ActorSystem, @@ -57,7 +59,8 @@ import pekko.actor.setup.Setup import pekko.annotation.InternalStableApi import pekko.event.{ Logging, LoggingAdapter } import pekko.util.unused -import scala.jdk.OptionConverters._ + +import com.typesafe.config.Config object JacksonObjectMapperProvider extends ExtensionId[JacksonObjectMapperProvider] with ExtensionIdProvider { override def get(system: ActorSystem): JacksonObjectMapperProvider = super.get(system) diff --git a/serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/PekkoSerializationModule.scala b/serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/PekkoSerializationModule.scala index 1c4d46fb1a..3d170bd675 100644 --- a/serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/PekkoSerializationModule.scala +++ b/serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/PekkoSerializationModule.scala @@ -17,6 +17,7 @@ import com.fasterxml.jackson.core.{ JsonGenerator, JsonParser, ObjectCodec } import com.fasterxml.jackson.databind.{ DeserializationContext, JsonNode, SerializerProvider } import com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer import com.fasterxml.jackson.databind.ser.std.StdScalarSerializer + import org.apache.pekko.serialization.{ SerializationExtension, Serializer, Serializers } final class PekkoSerializationSerializer extends StdScalarSerializer[AnyRef](classOf[AnyRef]) with ActorSystemAccess { diff --git a/serialization-jackson/src/test/scala/org/apache/pekko/serialization/jackson/JacksonFactorySpec.scala b/serialization-jackson/src/test/scala/org/apache/pekko/serialization/jackson/JacksonFactorySpec.scala index d1a853d24c..9192ee4927 100644 --- a/serialization-jackson/src/test/scala/org/apache/pekko/serialization/jackson/JacksonFactorySpec.scala +++ b/serialization-jackson/src/test/scala/org/apache/pekko/serialization/jackson/JacksonFactorySpec.scala @@ -18,14 +18,17 @@ package org.apache.pekko.serialization.jackson import com.fasterxml.jackson.core.util.JsonRecyclerPools.BoundedPool -import com.typesafe.config.ConfigFactory -import org.scalatest.BeforeAndAfterAll -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike + import org.apache.pekko import pekko.actor.{ ActorSystem, ExtendedActorSystem } import pekko.testkit.TestKit +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + class JacksonFactorySpec extends TestKit(ActorSystem("JacksonFactorySpec")) with AnyWordSpecLike with Matchers with BeforeAndAfterAll { diff --git a/serialization-jackson/src/test/scala/org/apache/pekko/serialization/jackson/JacksonSerializerSpec.scala b/serialization-jackson/src/test/scala/org/apache/pekko/serialization/jackson/JacksonSerializerSpec.scala index 60fab76c93..e4c15686d4 100644 --- a/serialization-jackson/src/test/scala/org/apache/pekko/serialization/jackson/JacksonSerializerSpec.scala +++ b/serialization-jackson/src/test/scala/org/apache/pekko/serialization/jackson/JacksonSerializerSpec.scala @@ -24,10 +24,12 @@ import java.util.Locale import java.util.Optional import java.util.UUID import java.util.logging.FileHandler + import scala.annotation.nowarn import scala.collection.immutable -import scala.concurrent.duration.FiniteDuration import scala.concurrent.duration._ +import scala.concurrent.duration.FiniteDuration + import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.annotation.JsonSubTypes import com.fasterxml.jackson.annotation.JsonTypeInfo @@ -48,14 +50,10 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize import com.fasterxml.jackson.databind.cfg.EnumFeature import com.fasterxml.jackson.databind.exc.InvalidTypeIdException import com.fasterxml.jackson.databind.json.JsonMapper -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule import com.fasterxml.jackson.databind.module.SimpleModule +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule import com.fasterxml.jackson.module.scala.JsonScalaEnumeration -import com.typesafe.config.ConfigFactory -import org.scalatest.BeforeAndAfterAll -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ActorSystem @@ -71,6 +69,12 @@ import pekko.serialization.SerializerWithStringManifest import pekko.testkit.TestActors import pekko.testkit.TestKit +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.ConfigFactory + object ScalaTestMessages { trait TestMessage diff --git a/slf4j/src/main/scala/org/apache/pekko/event/slf4j/Slf4jLogger.scala b/slf4j/src/main/scala/org/apache/pekko/event/slf4j/Slf4jLogger.scala index 7fbc1fae37..3e2591e787 100644 --- a/slf4j/src/main/scala/org/apache/pekko/event/slf4j/Slf4jLogger.scala +++ b/slf4j/src/main/scala/org/apache/pekko/event/slf4j/Slf4jLogger.scala @@ -13,8 +13,6 @@ package org.apache.pekko.event.slf4j -import org.slf4j.{ Logger => SLFLogger, LoggerFactory => SLFLoggerFactory, MDC, Marker, MarkerFactory } - import org.apache.pekko import pekko.actor._ import pekko.dispatch.RequiresMessageQueue @@ -22,6 +20,8 @@ import pekko.event.{ LogMarker, _ } import pekko.event.Logging._ import pekko.util.{ unused, Helpers } +import org.slf4j.{ Logger => SLFLogger, LoggerFactory => SLFLoggerFactory, MDC, Marker, MarkerFactory } + /** * Base trait for all classes that wants to be able use the SLF4J logging infrastructure. */ diff --git a/slf4j/src/test/scala/org/apache/pekko/event/slf4j/Slf4jLoggerSpec.scala b/slf4j/src/test/scala/org/apache/pekko/event/slf4j/Slf4jLoggerSpec.scala index ecc699cce1..616aefc961 100644 --- a/slf4j/src/test/scala/org/apache/pekko/event/slf4j/Slf4jLoggerSpec.scala +++ b/slf4j/src/test/scala/org/apache/pekko/event/slf4j/Slf4jLoggerSpec.scala @@ -19,14 +19,16 @@ import java.nio.charset.StandardCharsets import scala.concurrent.duration._ import ch.qos.logback.core.OutputStreamAppender -import org.scalatest.BeforeAndAfterEach -import org.slf4j.{ Marker, MarkerFactory } import org.apache.pekko import pekko.actor.{ Actor, DiagnosticActorLogging, Props } import pekko.event.{ LogMarker, Logging } import pekko.testkit.PekkoSpec +import org.scalatest.BeforeAndAfterEach + +import org.slf4j.{ Marker, MarkerFactory } + object Slf4jLoggerSpec { // This test depends on logback configuration in src/test/resources/logback-test.xml diff --git a/slf4j/src/test/scala/org/apache/pekko/event/slf4j/Slf4jLoggingFilterSpec.scala b/slf4j/src/test/scala/org/apache/pekko/event/slf4j/Slf4jLoggingFilterSpec.scala index 53e0ff0736..e2ee0816a5 100644 --- a/slf4j/src/test/scala/org/apache/pekko/event/slf4j/Slf4jLoggingFilterSpec.scala +++ b/slf4j/src/test/scala/org/apache/pekko/event/slf4j/Slf4jLoggingFilterSpec.scala @@ -15,8 +15,6 @@ package org.apache.pekko.event.slf4j import scala.concurrent.duration._ -import org.scalatest.BeforeAndAfterEach - import org.apache.pekko import pekko.actor.{ Actor, ActorLogging, Props } import pekko.actor.ActorRef @@ -30,6 +28,8 @@ import pekko.event.Logging.Warning import pekko.testkit.PekkoSpec import pekko.testkit.TestProbe +import org.scalatest.BeforeAndAfterEach + object Slf4jLoggingFilterSpec { // This test depends on logback configuration in src/test/resources/logback-test.xml diff --git a/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala b/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala index 797b70217f..36abb43fc8 100644 --- a/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala +++ b/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala @@ -19,6 +19,8 @@ import java.util.concurrent.CountDownLatch import scala.annotation.tailrec import scala.collection.immutable import scala.concurrent.duration._ +import scala.jdk.CollectionConverters._ +import scala.jdk.DurationConverters._ import scala.reflect.ClassTag import org.apache.pekko @@ -34,8 +36,6 @@ import pekko.stream._ import pekko.stream.impl._ import pekko.testkit.{ TestActor, TestProbe } import pekko.testkit.TestActor.AutoPilot -import scala.jdk.DurationConverters._ -import scala.jdk.CollectionConverters._ import org.reactivestreams.{ Publisher, Subscriber, Subscription } diff --git a/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/javadsl/StreamTestKit.scala b/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/javadsl/StreamTestKit.scala index 306082a757..314425a974 100644 --- a/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/javadsl/StreamTestKit.scala +++ b/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/javadsl/StreamTestKit.scala @@ -13,16 +13,17 @@ package org.apache.pekko.stream.testkit.javadsl +import java.time.Duration +import java.util.concurrent.TimeUnit + +import scala.concurrent.duration.FiniteDuration + import org.apache.pekko import pekko.actor.ClassicActorSystemProvider import pekko.stream.{ Materializer, SystemMaterializer } import pekko.stream.impl.PhasedFusingActorMaterializer import pekko.stream.testkit.scaladsl -import java.time.Duration -import java.util.concurrent.TimeUnit -import scala.concurrent.duration.FiniteDuration - object StreamTestKit { /** diff --git a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamConfiguration.scala b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamConfiguration.scala index 929917b334..1745ea3b66 100644 --- a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamConfiguration.scala +++ b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamConfiguration.scala @@ -17,11 +17,12 @@ package org.apache.pekko.stream.testkit -import org.apache.pekko.testkit.TestKitBase -import org.scalatest.time.{ Millis, Span } - import java.util.concurrent.TimeUnit +import org.apache.pekko.testkit.TestKitBase + +import org.scalatest.time.{ Millis, Span } + trait StreamConfiguration extends TestKitBase { case class StreamConfig(allStagesStoppedTimeout: Span = Span({ val c = system.settings.config.getConfig("pekko.stream.testkit") diff --git a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamSpec.scala b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamSpec.scala index 2fc883026a..6032e57c8f 100644 --- a/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamSpec.scala +++ b/stream-testkit/src/test/scala/org/apache/pekko/stream/testkit/StreamSpec.scala @@ -13,6 +13,8 @@ package org.apache.pekko.stream.testkit +import java.util.concurrent.TimeUnit + import scala.concurrent.Future import scala.concurrent.duration._ @@ -30,8 +32,6 @@ import org.scalatest.Failed import com.typesafe.config.{ Config, ConfigFactory } -import java.util.concurrent.TimeUnit - abstract class StreamSpec(_system: ActorSystem) extends PekkoSpec(_system) with StreamConfiguration { def this(config: Config) = diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/ActorSystemLifecycle.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/ActorSystemLifecycle.scala index 135bd37667..158a2796b3 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/ActorSystemLifecycle.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/ActorSystemLifecycle.scala @@ -18,8 +18,6 @@ import java.util.concurrent.TimeoutException import scala.concurrent.Await import scala.concurrent.duration._ -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory import org.testng.annotations.AfterClass import org.testng.annotations.BeforeClass @@ -27,10 +25,13 @@ import org.apache.pekko import pekko.actor.ActorSystem import pekko.actor.ActorSystemImpl import pekko.event.Logging -import pekko.testkit.PekkoSpec import pekko.testkit.EventFilter +import pekko.testkit.PekkoSpec import pekko.testkit.TestEvent +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + trait ActorSystemLifecycle { protected var _system: ActorSystem = _ diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/CancelledSinkSubscriberTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/CancelledSinkSubscriberTest.scala index a24ab2d971..407e92b8dc 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/CancelledSinkSubscriberTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/CancelledSinkSubscriberTest.scala @@ -13,11 +13,12 @@ package org.apache.pekko.stream.tck -import org.reactivestreams.Subscriber import org.testng.SkipException import org.apache.pekko.stream.scaladsl._ +import org.reactivestreams.Subscriber + class CancelledSinkSubscriberTest extends PekkoSubscriberBlackboxVerification[Int] { override def createSubscriber(): Subscriber[Int] = diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/ConcatTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/ConcatTest.scala index 0d77dae413..a241640f32 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/ConcatTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/ConcatTest.scala @@ -13,12 +13,12 @@ package org.apache.pekko.stream.tck -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.stream.scaladsl.Sink import pekko.stream.scaladsl.Source +import org.reactivestreams.Publisher + class ConcatTest extends PekkoPublisherVerification[Int] { def createPublisher(elements: Long): Publisher[Int] = { diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/EmptyPublisherTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/EmptyPublisherTest.scala index 406d2e0e05..576f87824a 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/EmptyPublisherTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/EmptyPublisherTest.scala @@ -13,10 +13,10 @@ package org.apache.pekko.stream.tck -import org.reactivestreams.Publisher - import org.apache.pekko.stream.impl.EmptyPublisher +import org.reactivestreams.Publisher + class EmptyPublisherTest extends PekkoPublisherVerification[Int] { def createPublisher(elements: Long): Publisher[Int] = EmptyPublisher[Int] diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FanoutPublisherTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FanoutPublisherTest.scala index 951cccfc2d..bd66c47e31 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FanoutPublisherTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FanoutPublisherTest.scala @@ -15,12 +15,12 @@ package org.apache.pekko.stream.tck import scala.collection.immutable -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.stream.scaladsl.Sink import pekko.stream.scaladsl.Source +import org.reactivestreams.Publisher + class FanoutPublisherTest extends PekkoPublisherVerification[Int] { def createPublisher(elements: Long): Publisher[Int] = { diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FilePublisherTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FilePublisherTest.scala index bdc64f881c..0c53ebbbe5 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FilePublisherTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FilePublisherTest.scala @@ -15,7 +15,6 @@ package org.apache.pekko.stream.tck import java.nio.file.Files -import org.reactivestreams.Publisher import org.testng.annotations.{ AfterClass, BeforeClass } import org.apache.pekko @@ -27,6 +26,8 @@ import pekko.testkit.{ EventFilter, TestEvent } import pekko.testkit.PekkoSpec import pekko.util.ByteString +import org.reactivestreams.Publisher + class FilePublisherTest extends PekkoPublisherVerification[ByteString] { val ChunkSize = 256 diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FlatMapConcatDoubleSubscriberTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FlatMapConcatDoubleSubscriberTest.scala index e9083d675a..d8f577af66 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FlatMapConcatDoubleSubscriberTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FlatMapConcatDoubleSubscriberTest.scala @@ -16,10 +16,10 @@ package org.apache.pekko.stream.tck import scala.concurrent.{ Await, Promise } import scala.concurrent.duration._ -import org.reactivestreams.{ Publisher, Subscriber } - import org.apache.pekko.stream.scaladsl.{ Sink, Source } +import org.reactivestreams.{ Publisher, Subscriber } + class FlatMapConcatDoubleSubscriberTest extends PekkoSubscriberBlackboxVerification[Int] { def createSubscriber(): Subscriber[Int] = { diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FlatMapPrefixTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FlatMapPrefixTest.scala index 5c9a3ad539..3bfbc6e767 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FlatMapPrefixTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FlatMapPrefixTest.scala @@ -13,10 +13,10 @@ package org.apache.pekko.stream.tck -import org.reactivestreams.Publisher - import org.apache.pekko.stream.scaladsl.{ Flow, Keep, Sink, Source } +import org.reactivestreams.Publisher + class FlatMapPrefixTest extends PekkoPublisherVerification[Int] { override def createPublisher(elements: Long): Publisher[Int] = { val publisher = Source(iterable(elements)) diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FlattenTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FlattenTest.scala index 437c07f6e4..27e1dfd2dd 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FlattenTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FlattenTest.scala @@ -13,13 +13,13 @@ package org.apache.pekko.stream.tck -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.stream.scaladsl.Sink import pekko.stream.scaladsl.Source import pekko.util.ConstantFun +import org.reactivestreams.Publisher + class FlattenTest extends PekkoPublisherVerification[Int] { def createPublisher(elements: Long): Publisher[Int] = { diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FoldSinkSubscriberTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FoldSinkSubscriberTest.scala index 234929cfea..4e23641b5d 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FoldSinkSubscriberTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FoldSinkSubscriberTest.scala @@ -13,10 +13,10 @@ package org.apache.pekko.stream.tck -import org.reactivestreams.Subscriber - import org.apache.pekko.stream.scaladsl._ +import org.reactivestreams.Subscriber + class FoldSinkSubscriberTest extends PekkoSubscriberBlackboxVerification[Int] { override def createSubscriber(): Subscriber[Int] = diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/ForeachSinkSubscriberTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/ForeachSinkSubscriberTest.scala index 6cab3c7617..c4f19d9bca 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/ForeachSinkSubscriberTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/ForeachSinkSubscriberTest.scala @@ -13,10 +13,10 @@ package org.apache.pekko.stream.tck -import org.reactivestreams.Subscriber - import org.apache.pekko.stream.scaladsl._ +import org.reactivestreams.Subscriber + class ForeachSinkSubscriberTest extends PekkoSubscriberBlackboxVerification[Int] { override def createSubscriber(): Subscriber[Int] = diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FusableProcessorTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FusableProcessorTest.scala index 9be1b43314..1cdb45a2df 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FusableProcessorTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FusableProcessorTest.scala @@ -13,12 +13,12 @@ package org.apache.pekko.stream.tck -import org.reactivestreams.Processor - import org.apache.pekko import pekko.stream._ import pekko.stream.scaladsl.Flow +import org.reactivestreams.Processor + class FusableProcessorTest extends PekkoIdentityProcessorVerification[Int] { override def createIdentityProcessor(maxBufferSize: Int): Processor[Int, Int] = { diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FuturePublisherTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FuturePublisherTest.scala index 4f857c6edd..85190f5b16 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FuturePublisherTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/FuturePublisherTest.scala @@ -15,12 +15,12 @@ package org.apache.pekko.stream.tck import scala.concurrent.Promise -import org.reactivestreams._ - import org.apache.pekko import pekko.stream.scaladsl.Sink import pekko.stream.scaladsl.Source +import org.reactivestreams._ + class FuturePublisherTest extends PekkoPublisherVerification[Int] { def createPublisher(elements: Long): Publisher[Int] = { diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/GroupByTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/GroupByTest.scala index cc27d9052d..8935defd21 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/GroupByTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/GroupByTest.scala @@ -16,13 +16,13 @@ package org.apache.pekko.stream.tck import scala.concurrent.Await import scala.concurrent.duration._ -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.stream.impl.EmptyPublisher import pekko.stream.scaladsl.Sink import pekko.stream.scaladsl.Source +import org.reactivestreams.Publisher + class GroupByTest extends PekkoPublisherVerification[Int] { def createPublisher(elements: Long): Publisher[Int] = diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/InputStreamSourceTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/InputStreamSourceTest.scala index 55e78c3e93..bc54abba43 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/InputStreamSourceTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/InputStreamSourceTest.scala @@ -15,13 +15,13 @@ package org.apache.pekko.stream.tck import java.io.InputStream -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.stream.ActorAttributes import pekko.stream.scaladsl.{ Sink, StreamConverters } import pekko.util.ByteString +import org.reactivestreams.Publisher + class InputStreamSourceTest extends PekkoPublisherVerification[ByteString] { def createPublisher(elements: Long): Publisher[ByteString] = { diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/IterablePublisherTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/IterablePublisherTest.scala index a15d1e63b7..61daca038c 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/IterablePublisherTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/IterablePublisherTest.scala @@ -13,12 +13,12 @@ package org.apache.pekko.stream.tck -import org.reactivestreams._ - import org.apache.pekko import pekko.stream.scaladsl.Sink import pekko.stream.scaladsl.Source +import org.reactivestreams._ + class IterablePublisherTest extends PekkoPublisherVerification[Int] { override def createPublisher(elements: Long): Publisher[Int] = { diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/MapTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/MapTest.scala index f4a21911a2..a87a1648ee 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/MapTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/MapTest.scala @@ -13,10 +13,10 @@ package org.apache.pekko.stream.tck -import org.reactivestreams.Processor - import org.apache.pekko.stream.scaladsl.Flow +import org.reactivestreams.Processor + class MapTest extends PekkoIdentityProcessorVerification[Int] { override def createIdentityProcessor(maxBufferSize: Int): Processor[Int, Int] = { diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/MaybeSourceTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/MaybeSourceTest.scala index e894000043..098f0584c6 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/MaybeSourceTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/MaybeSourceTest.scala @@ -13,10 +13,10 @@ package org.apache.pekko.stream.tck -import org.reactivestreams.Publisher - import org.apache.pekko.stream.scaladsl.{ Keep, Sink, Source } +import org.reactivestreams.Publisher + class MaybeSourceTest extends PekkoPublisherVerification[Int] { def createPublisher(elements: Long): Publisher[Int] = { diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/PekkoIdentityProcessorVerification.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/PekkoIdentityProcessorVerification.scala index e1ee6f24f8..606d69466d 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/PekkoIdentityProcessorVerification.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/PekkoIdentityProcessorVerification.scala @@ -17,14 +17,15 @@ import java.util.concurrent.ExecutorService import java.util.concurrent.Executors import java.util.concurrent.TimeUnit -import org.reactivestreams.{ Processor, Publisher, Subscriber, Subscription } -import org.reactivestreams.tck.IdentityProcessorVerification -import org.reactivestreams.tck.TestEnvironment import org.scalatestplus.testng.TestNGSuiteLike import org.testng.annotations.AfterClass import org.apache.pekko.stream.testkit.TestPublisher +import org.reactivestreams.{ Processor, Publisher, Subscriber, Subscription } +import org.reactivestreams.tck.IdentityProcessorVerification +import org.reactivestreams.tck.TestEnvironment + abstract class PekkoIdentityProcessorVerification[T](env: TestEnvironment, publisherShutdownTimeout: Long) extends IdentityProcessorVerification[T](env, publisherShutdownTimeout) with TestNGSuiteLike diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/PekkoPublisherVerification.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/PekkoPublisherVerification.scala index 85a754c17e..d1649dd087 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/PekkoPublisherVerification.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/PekkoPublisherVerification.scala @@ -15,15 +15,17 @@ package org.apache.pekko.stream.tck import scala.collection.immutable -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory -import org.reactivestreams.Publisher -import org.reactivestreams.tck.PublisherVerification -import org.reactivestreams.tck.TestEnvironment import org.scalatestplus.testng.TestNGSuiteLike import org.apache.pekko.stream.testkit.TestPublisher +import org.reactivestreams.Publisher +import org.reactivestreams.tck.PublisherVerification +import org.reactivestreams.tck.TestEnvironment + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + abstract class PekkoPublisherVerification[T](val env: TestEnvironment, publisherShutdownTimeout: Long) extends PublisherVerification[T](env, publisherShutdownTimeout) with TestNGSuiteLike diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/PekkoSubscriberVerification.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/PekkoSubscriberVerification.scala index b02799c9bc..3de993f839 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/PekkoSubscriberVerification.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/PekkoSubscriberVerification.scala @@ -13,13 +13,14 @@ package org.apache.pekko.stream.tck -import org.reactivestreams.tck.SubscriberBlackboxVerification -import org.reactivestreams.tck.SubscriberWhiteboxVerification -import org.reactivestreams.tck.TestEnvironment import org.scalatestplus.testng.TestNGSuiteLike import org.apache.pekko.actor.ActorSystem +import org.reactivestreams.tck.SubscriberBlackboxVerification +import org.reactivestreams.tck.SubscriberWhiteboxVerification +import org.reactivestreams.tck.TestEnvironment + abstract class PekkoSubscriberBlackboxVerification[T](env: TestEnvironment) extends SubscriberBlackboxVerification[T](env) with TestNGSuiteLike diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/PrefixAndTailTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/PrefixAndTailTest.scala index 41afa40bc0..1b70dfd1e3 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/PrefixAndTailTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/PrefixAndTailTest.scala @@ -16,12 +16,12 @@ package org.apache.pekko.stream.tck import scala.concurrent.Await import scala.concurrent.duration._ -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.stream.scaladsl.Sink import pekko.stream.scaladsl.Source +import org.reactivestreams.Publisher + class PrefixAndTailTest extends PekkoPublisherVerification[Int] { def createPublisher(elements: Long): Publisher[Int] = { diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/SingleElementSourceTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/SingleElementSourceTest.scala index 0397d1a269..765f673319 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/SingleElementSourceTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/SingleElementSourceTest.scala @@ -13,12 +13,12 @@ package org.apache.pekko.stream.tck -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.stream.scaladsl.Sink import pekko.stream.scaladsl.Source +import org.reactivestreams.Publisher + class SingleElementSourceTest extends PekkoPublisherVerification[Int] { def createPublisher(elements: Long): Publisher[Int] = diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/SinkholeSubscriberTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/SinkholeSubscriberTest.scala index 4b29185f7e..77c3088101 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/SinkholeSubscriberTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/SinkholeSubscriberTest.scala @@ -17,15 +17,16 @@ import java.lang.{ Integer => JInt } import scala.concurrent.Promise -import org.reactivestreams.{ Subscriber, Subscription } -import org.reactivestreams.tck.{ SubscriberWhiteboxVerification, TestEnvironment } -import org.reactivestreams.tck.SubscriberWhiteboxVerification.{ SubscriberPuppet, WhiteboxSubscriberProbe } import org.scalatestplus.testng.TestNGSuiteLike import org.apache.pekko import pekko.Done import pekko.stream.impl.SinkholeSubscriber +import org.reactivestreams.{ Subscriber, Subscription } +import org.reactivestreams.tck.{ SubscriberWhiteboxVerification, TestEnvironment } +import org.reactivestreams.tck.SubscriberWhiteboxVerification.{ SubscriberPuppet, WhiteboxSubscriberProbe } + class SinkholeSubscriberTest extends SubscriberWhiteboxVerification[JInt](new TestEnvironment()) with TestNGSuiteLike { override def createSubscriber(probe: WhiteboxSubscriberProbe[JInt]): Subscriber[JInt] = { new Subscriber[JInt] { diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/SplitWhenTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/SplitWhenTest.scala index e6cd76a4d1..7da16df48b 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/SplitWhenTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/SplitWhenTest.scala @@ -16,13 +16,13 @@ package org.apache.pekko.stream.tck import scala.concurrent.Await import scala.concurrent.duration._ -import org.reactivestreams.Publisher - import org.apache.pekko import pekko.stream.impl.EmptyPublisher import pekko.stream.scaladsl.Sink import pekko.stream.scaladsl.Source +import org.reactivestreams.Publisher + class SplitWhenTest extends PekkoPublisherVerification[Int] { def createPublisher(elements: Long): Publisher[Int] = diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/TransformProcessorTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/TransformProcessorTest.scala index 2c88f80ff6..572b3846e2 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/TransformProcessorTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/TransformProcessorTest.scala @@ -13,8 +13,6 @@ package org.apache.pekko.stream.tck -import org.reactivestreams.Processor - import org.apache.pekko import pekko.stream.Attributes import pekko.stream.impl.fusing.GraphStages.SimpleLinearGraphStage @@ -23,6 +21,8 @@ import pekko.stream.stage.GraphStageLogic import pekko.stream.stage.InHandler import pekko.stream.stage.OutHandler +import org.reactivestreams.Processor + class TransformProcessorTest extends PekkoIdentityProcessorVerification[Int] { override def createIdentityProcessor(maxBufferSize: Int): Processor[Int, Int] = { diff --git a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/VirtualPublisherTest.scala b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/VirtualPublisherTest.scala index 31251371a4..33f48068d7 100644 --- a/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/VirtualPublisherTest.scala +++ b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/VirtualPublisherTest.scala @@ -13,12 +13,12 @@ package org.apache.pekko.stream.tck -import org.reactivestreams.Processor - import org.apache.pekko import pekko.stream.impl.VirtualProcessor import pekko.stream.scaladsl.Flow +import org.reactivestreams.Processor + class VirtualProcessorTest extends PekkoIdentityProcessorVerification[Int] { override def createIdentityProcessor(maxBufferSize: Int): Processor[Int, Int] = { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/SubInletOutletSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/SubInletOutletSpec.scala index 619bef28fb..bc0af60069 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/SubInletOutletSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/SubInletOutletSpec.scala @@ -13,13 +13,13 @@ package org.apache.pekko.stream.impl +import scala.concurrent.ExecutionContext import scala.util.Failure import scala.util.Success import org.apache.pekko import pekko.Done import pekko.NotUsed -import scala.concurrent.ExecutionContext import pekko.stream.Attributes import pekko.stream.FlowShape import pekko.stream.Inlet diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/TraversalBuilderSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/TraversalBuilderSpec.scala index 5bac7f5a3c..36e91364fe 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/TraversalBuilderSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/TraversalBuilderSpec.scala @@ -13,17 +13,17 @@ package org.apache.pekko.stream.impl +import scala.concurrent.Future + import org.apache.pekko import pekko.NotUsed import pekko.stream._ import pekko.stream.impl.TraversalTestUtils._ -import pekko.stream.impl.fusing.IterableSource import pekko.stream.impl.fusing.GraphStages.{ FutureSource, SingleSource } +import pekko.stream.impl.fusing.IterableSource import pekko.stream.scaladsl.{ Keep, Source } -import pekko.util.OptionVal import pekko.testkit.PekkoSpec - -import scala.concurrent.Future +import pekko.util.OptionVal class TraversalBuilderSpec extends PekkoSpec { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/fusing/AsyncCallbackSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/fusing/AsyncCallbackSpec.scala index 5e194e010d..7806e1d6bb 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/impl/fusing/AsyncCallbackSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/fusing/AsyncCallbackSpec.scala @@ -13,18 +13,18 @@ package org.apache.pekko.stream.impl.fusing +import scala.concurrent.{ Await, Future, Promise } + import org.apache.pekko import pekko.Done import pekko.actor.ActorRef import pekko.stream._ import pekko.stream.scaladsl.{ Keep, Sink, Source } import pekko.stream.stage._ -import pekko.stream.testkit.Utils.TE import pekko.stream.testkit.{ TestPublisher, TestSubscriber } +import pekko.stream.testkit.Utils.TE import pekko.testkit.{ PekkoSpec, TestProbe } -import scala.concurrent.{ Await, Future, Promise } - class AsyncCallbackSpec extends PekkoSpec(""" pekko.stream.materializer.debug.fuzzing-mode = off """) { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowCollectFirstSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowCollectFirstSpec.scala index 8c8bd2ef5a..f38a905b13 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowCollectFirstSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowCollectFirstSpec.scala @@ -21,9 +21,9 @@ import org.apache.pekko import pekko.stream.ActorAttributes._ import pekko.stream.OverflowStrategy import pekko.stream.Supervision._ +import pekko.stream.testkit.{ ScriptedTest, StreamSpec } import pekko.stream.testkit.Utils.TE import pekko.stream.testkit.scaladsl.TestSink -import pekko.stream.testkit.{ ScriptedTest, StreamSpec } class FlowCollectFirstSpec extends StreamSpec with ScriptedTest { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowDispatcherSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowDispatcherSpec.scala index a4973e35f9..3b3917cf59 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowDispatcherSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowDispatcherSpec.scala @@ -18,8 +18,8 @@ import scala.annotation.nowarn import org.apache.pekko import pekko.stream.ActorMaterializer import pekko.stream.ActorMaterializerSettings -import pekko.stream.testkit.StreamSpec import pekko.stream.Materializer +import pekko.stream.testkit.StreamSpec import pekko.testkit.TestProbe @nowarn("msg=deprecated") diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowDropRepeatedSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowDropRepeatedSpec.scala index 40f50329ab..0848b77d02 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowDropRepeatedSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowDropRepeatedSpec.scala @@ -13,14 +13,14 @@ package org.apache.pekko.stream.scaladsl +import scala.util.control.NoStackTrace + import org.apache.pekko import pekko.stream.ActorAttributes._ import pekko.stream.Supervision._ import pekko.stream.testkit._ import pekko.stream.testkit.scaladsl.TestSink -import scala.util.control.NoStackTrace - class FlowDropRepeatedSpec extends StreamSpec(""" pekko.stream.materializer.initial-input-buffer-size = 2 """) with ScriptedTest { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowFlatMapConcatParallelismSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowFlatMapConcatParallelismSpec.scala index 996f702d74..2a43334b06 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowFlatMapConcatParallelismSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowFlatMapConcatParallelismSpec.scala @@ -17,22 +17,22 @@ package org.apache.pekko.stream.scaladsl +import java.util.Collections +import java.util.concurrent.ThreadLocalRandom +import java.util.concurrent.atomic.AtomicInteger + +import scala.annotation.switch +import scala.concurrent.Future +import scala.concurrent.duration.DurationInt +import scala.util.control.NoStackTrace + import org.apache.pekko -import pekko.pattern.FutureTimeoutSupport import pekko.NotUsed +import pekko.pattern.FutureTimeoutSupport import pekko.stream._ import pekko.stream.testkit.{ ScriptedTest, StreamSpec } import pekko.stream.testkit.scaladsl.TestSink -import java.util.concurrent.ThreadLocalRandom -import java.util.concurrent.atomic.AtomicInteger -import java.util.Collections - -import scala.annotation.switch -import scala.concurrent.duration.DurationInt -import scala.concurrent.Future -import scala.util.control.NoStackTrace - class FlowFlatMapConcatParallelismSpec extends StreamSpec(""" pekko.stream.materializer.initial-input-buffer-size = 2 """) with ScriptedTest with FutureTimeoutSupport { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowGroupedAdjacentByWeightedSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowGroupedAdjacentByWeightedSpec.scala index b6b53fdf18..785612d908 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowGroupedAdjacentByWeightedSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowGroupedAdjacentByWeightedSpec.scala @@ -18,8 +18,8 @@ package org.apache.pekko.stream.scaladsl import org.apache.pekko -import pekko.stream.testkit.scaladsl.TestSink import pekko.stream.testkit.{ ScriptedTest, StreamSpec } +import pekko.stream.testkit.scaladsl.TestSink class FlowGroupedAdjacentByWeightedSpec extends StreamSpec(""" pekko.stream.materializer.initial-input-buffer-size = 2 diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSwitchSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSwitchSpec.scala index cc21ee2ea4..2d88ab9a1b 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSwitchSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSwitchSpec.scala @@ -13,6 +13,9 @@ package org.apache.pekko.stream.scaladsl +import scala.concurrent.Await +import scala.concurrent.duration.DurationInt + import org.apache.pekko import pekko.NotUsed import pekko.stream.Attributes @@ -29,9 +32,6 @@ import pekko.stream.testkit.scaladsl.TestSource import org.scalatest.exceptions.TestFailedException -import scala.concurrent.Await -import scala.concurrent.duration.DurationInt - class FlowSwitchSpec extends StreamSpec { import FlowSwitchSpec._ diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowWithContextSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowWithContextSpec.scala index 3fb0252dfe..ecaad1c3a3 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowWithContextSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowWithContextSpec.scala @@ -13,15 +13,14 @@ package org.apache.pekko.stream.scaladsl +import scala.collection.mutable.ListBuffer +import scala.concurrent.duration._ import scala.util.control.NoStackTrace import org.apache.pekko import pekko.stream.testkit.StreamSpec import pekko.stream.testkit.scaladsl.TestSink -import scala.collection.mutable.ListBuffer -import scala.concurrent.duration._ - class FlowWithContextSpec extends StreamSpec { "A FlowWithContext" must { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SourceWithContextSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SourceWithContextSpec.scala index 3d05bd81ba..11f75baa9b 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SourceWithContextSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SourceWithContextSpec.scala @@ -13,15 +13,14 @@ package org.apache.pekko.stream.scaladsl +import scala.collection.mutable.ListBuffer +import scala.concurrent.duration._ import scala.util.control.NoStackTrace import org.apache.pekko import pekko.stream.testkit.StreamSpec import pekko.stream.testkit.scaladsl.TestSink -import scala.collection.mutable.ListBuffer -import scala.concurrent.duration._ - case class Message(data: String, offset: Long) class SourceWithContextSpec extends StreamSpec { diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/StreamConvertersSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/StreamConvertersSpec.scala index baff85e0c9..4556ea9140 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/StreamConvertersSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/StreamConvertersSpec.scala @@ -14,6 +14,7 @@ package org.apache.pekko.stream.scaladsl import java.util +import java.util.{ Spliterator, Spliterators } import java.util.function.BiConsumer import java.util.function.BinaryOperator import java.util.function.Supplier @@ -22,7 +23,6 @@ import java.util.stream.BaseStream import java.util.stream.Collector import java.util.stream.Collector.Characteristics import java.util.stream.Collectors -import java.util.{ Spliterator, Spliterators } import scala.concurrent.Await import scala.concurrent.duration._ diff --git a/stream-typed-tests/src/test/scala/org/apache/pekko/stream/MapAsyncPartitionedSpec.scala b/stream-typed-tests/src/test/scala/org/apache/pekko/stream/MapAsyncPartitionedSpec.scala index a4261c8c26..906eca8151 100644 --- a/stream-typed-tests/src/test/scala/org/apache/pekko/stream/MapAsyncPartitionedSpec.scala +++ b/stream-typed-tests/src/test/scala/org/apache/pekko/stream/MapAsyncPartitionedSpec.scala @@ -17,6 +17,17 @@ package org.apache.pekko.stream +import java.time.Instant +import java.util.concurrent.Executors + +import scala.annotation.nowarn +import scala.concurrent.{ blocking, ExecutionContext, Future } +import scala.concurrent.duration.{ DurationInt, FiniteDuration } +import scala.util.Random + +import org.scalacheck.{ Arbitrary, Gen } +import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks + import org.apache.pekko import pekko.actor.typed.ActorSystem import pekko.actor.typed.scaladsl.Behaviors @@ -34,20 +45,10 @@ import pekko.stream.scaladsl.{ } import pekko.stream.testkit.scaladsl.TestSink -import org.scalacheck.{ Arbitrary, Gen } import org.scalatest.BeforeAndAfterAll import org.scalatest.concurrent.ScalaFutures import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers -import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks - -import java.time.Instant -import java.util.concurrent.Executors - -import scala.annotation.nowarn -import scala.concurrent.duration.{ DurationInt, FiniteDuration } -import scala.concurrent.{ blocking, ExecutionContext, Future } -import scala.util.Random private object MapAsyncPartitionedSpec { diff --git a/stream-typed/src/main/scala/org/apache/pekko/stream/typed/javadsl/ActorFlow.scala b/stream-typed/src/main/scala/org/apache/pekko/stream/typed/javadsl/ActorFlow.scala index a2f018e5a8..343d016296 100644 --- a/stream-typed/src/main/scala/org/apache/pekko/stream/typed/javadsl/ActorFlow.scala +++ b/stream-typed/src/main/scala/org/apache/pekko/stream/typed/javadsl/ActorFlow.scala @@ -14,6 +14,8 @@ package org.apache.pekko.stream.typed.javadsl import scala.concurrent.duration._ +import scala.jdk.DurationConverters.JavaDurationOps + import org.apache.pekko import pekko.NotUsed import pekko.actor.typed.ActorRef @@ -22,8 +24,6 @@ import pekko.japi.function import pekko.pattern.StatusReply import pekko.stream.javadsl.Flow -import scala.jdk.DurationConverters.JavaDurationOps - /** * Collection of Flows aimed at integrating with typed Actors. */ diff --git a/stream-typed/src/main/scala/org/apache/pekko/stream/typed/scaladsl/ActorFlow.scala b/stream-typed/src/main/scala/org/apache/pekko/stream/typed/scaladsl/ActorFlow.scala index 833d5b085b..2bb082065c 100644 --- a/stream-typed/src/main/scala/org/apache/pekko/stream/typed/scaladsl/ActorFlow.scala +++ b/stream-typed/src/main/scala/org/apache/pekko/stream/typed/scaladsl/ActorFlow.scala @@ -14,11 +14,12 @@ package org.apache.pekko.stream.typed.scaladsl import scala.annotation.implicitNotFound +import scala.concurrent.ExecutionContext import scala.concurrent.Future + import org.apache.pekko import pekko.NotUsed import pekko.actor.typed.ActorRef -import scala.concurrent.ExecutionContext import pekko.pattern.{ AskTimeoutException, StatusReply } import pekko.stream._ import pekko.stream.scaladsl._ diff --git a/stream-typed/src/test/scala/org/apache/pekko/stream/typed/scaladsl/ActorSourceSinkSpec.scala b/stream-typed/src/test/scala/org/apache/pekko/stream/typed/scaladsl/ActorSourceSinkSpec.scala index eed2744f16..4e8de89532 100644 --- a/stream-typed/src/test/scala/org/apache/pekko/stream/typed/scaladsl/ActorSourceSinkSpec.scala +++ b/stream-typed/src/test/scala/org/apache/pekko/stream/typed/scaladsl/ActorSourceSinkSpec.scala @@ -13,8 +13,6 @@ package org.apache.pekko.stream.typed.scaladsl -import org.scalatest.wordspec.AnyWordSpecLike - import org.apache.pekko import pekko.actor.testkit.typed.scaladsl._ import pekko.actor.typed.ActorRef @@ -24,6 +22,8 @@ import pekko.stream.scaladsl.Keep import pekko.stream.scaladsl.Sink import pekko.stream.scaladsl.Source +import org.scalatest.wordspec.AnyWordSpecLike + object ActorSourceSinkSpec { sealed trait AckProto diff --git a/stream-typed/src/test/scala/org/apache/pekko/stream/typed/scaladsl/MaterializerForTypedSpec.scala b/stream-typed/src/test/scala/org/apache/pekko/stream/typed/scaladsl/MaterializerForTypedSpec.scala index 36dcbcbaae..254033e3f2 100644 --- a/stream-typed/src/test/scala/org/apache/pekko/stream/typed/scaladsl/MaterializerForTypedSpec.scala +++ b/stream-typed/src/test/scala/org/apache/pekko/stream/typed/scaladsl/MaterializerForTypedSpec.scala @@ -15,7 +15,7 @@ package org.apache.pekko.stream.typed.scaladsl import scala.concurrent.Future import scala.util.Success -import org.scalatest.wordspec.AnyWordSpecLike + import org.apache.pekko import pekko.Done import pekko.actor.testkit.typed.scaladsl.LogCapturing @@ -26,6 +26,8 @@ import pekko.stream.Materializer import pekko.stream.scaladsl.Sink import pekko.stream.scaladsl.Source +import org.scalatest.wordspec.AnyWordSpecLike + class MaterializerForTypedSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "Materialization in typed" should { diff --git a/stream-typed/src/test/scala/org/apache/pekko/stream/typed/scaladsl/PubSubSpec.scala b/stream-typed/src/test/scala/org/apache/pekko/stream/typed/scaladsl/PubSubSpec.scala index 769b359411..025ce988a5 100644 --- a/stream-typed/src/test/scala/org/apache/pekko/stream/typed/scaladsl/PubSubSpec.scala +++ b/stream-typed/src/test/scala/org/apache/pekko/stream/typed/scaladsl/PubSubSpec.scala @@ -21,6 +21,7 @@ import pekko.actor.typed.pubsub.Topic import pekko.stream.OverflowStrategy import pekko.stream.scaladsl.Source import pekko.stream.testkit.scaladsl.TestSink + import org.scalatest.wordspec.AnyWordSpecLike class PubSubSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { diff --git a/stream/src/main/scala-2.13/org/apache/pekko/stream/javadsl/CollectionUtil.scala b/stream/src/main/scala-2.13/org/apache/pekko/stream/javadsl/CollectionUtil.scala index 8dcbd503c9..56b4a02844 100644 --- a/stream/src/main/scala-2.13/org/apache/pekko/stream/javadsl/CollectionUtil.scala +++ b/stream/src/main/scala-2.13/org/apache/pekko/stream/javadsl/CollectionUtil.scala @@ -19,10 +19,10 @@ package org.apache.pekko.stream package javadsl import scala.collection.immutable +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.annotation.InternalApi -import scala.jdk.CollectionConverters._ /** * INTERNAL API diff --git a/stream/src/main/scala-3/org/apache/pekko/stream/javadsl/CollectionUtil.scala b/stream/src/main/scala-3/org/apache/pekko/stream/javadsl/CollectionUtil.scala index 808cdf0f19..dd130eba5d 100644 --- a/stream/src/main/scala-3/org/apache/pekko/stream/javadsl/CollectionUtil.scala +++ b/stream/src/main/scala-3/org/apache/pekko/stream/javadsl/CollectionUtil.scala @@ -19,10 +19,10 @@ package org.apache.pekko.stream package javadsl import scala.collection.immutable +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.annotation.InternalApi -import scala.jdk.CollectionConverters._ /** * INTERNAL API diff --git a/stream/src/main/scala/org/apache/pekko/stream/Attributes.scala b/stream/src/main/scala/org/apache/pekko/stream/Attributes.scala index 7d56485c0f..28a94b9ca7 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/Attributes.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/Attributes.scala @@ -19,6 +19,8 @@ import java.util.Optional import scala.annotation.tailrec import scala.concurrent.duration.FiniteDuration +import scala.jdk.DurationConverters._ +import scala.jdk.OptionConverters._ import scala.reflect.{ classTag, ClassTag } import scala.util.control.NonFatal @@ -30,9 +32,7 @@ import pekko.event.Logging import pekko.japi.function import pekko.stream.impl.TraversalBuilder import pekko.util.{ ByteString, OptionVal } -import scala.jdk.DurationConverters._ import pekko.util.LineNumbers -import scala.jdk.OptionConverters._ /** * Holds attributes which can be used to alter [[pekko.stream.scaladsl.Flow]] / [[pekko.stream.javadsl.Flow]] diff --git a/stream/src/main/scala/org/apache/pekko/stream/MapAsyncPartitioned.scala b/stream/src/main/scala/org/apache/pekko/stream/MapAsyncPartitioned.scala index c8852c83b8..c50eeb42d2 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/MapAsyncPartitioned.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/MapAsyncPartitioned.scala @@ -18,13 +18,13 @@ package org.apache.pekko.stream import scala.collection.mutable +import scala.concurrent.ExecutionContext import scala.concurrent.Future import scala.util.{ Failure, Success, Try } import scala.util.control.{ NoStackTrace, NonFatal } import org.apache.pekko import pekko.annotation.InternalApi -import scala.concurrent.ExecutionContext import pekko.stream.ActorAttributes.SupervisionStrategy import pekko.stream.stage._ import pekko.util.OptionVal diff --git a/stream/src/main/scala/org/apache/pekko/stream/RestartSettings.scala b/stream/src/main/scala/org/apache/pekko/stream/RestartSettings.scala index e148b0eff9..896aded630 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/RestartSettings.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/RestartSettings.scala @@ -14,13 +14,13 @@ package org.apache.pekko.stream import scala.concurrent.duration.FiniteDuration +import scala.jdk.DurationConverters._ import org.apache.pekko -import pekko.japi.function import pekko.event.Logging import pekko.event.Logging.LogLevel +import pekko.japi.function import pekko.util.ConstantFun -import scala.jdk.DurationConverters._ final class RestartSettings private ( val minBackoff: FiniteDuration, diff --git a/stream/src/main/scala/org/apache/pekko/stream/Shape.scala b/stream/src/main/scala/org/apache/pekko/stream/Shape.scala index 631d9880db..3febf7fd7f 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/Shape.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/Shape.scala @@ -15,11 +15,11 @@ package org.apache.pekko.stream import scala.annotation.unchecked.uncheckedVariance import scala.collection.immutable +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.annotation.InternalApi import pekko.util.Collections.EmptyImmutableSeq -import scala.jdk.CollectionConverters._ /** * An input port of a StreamLayout.Module. This type logically belongs diff --git a/stream/src/main/scala/org/apache/pekko/stream/SystemMaterializer.scala b/stream/src/main/scala/org/apache/pekko/stream/SystemMaterializer.scala index 969c64aab1..a2e6d4a88d 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/SystemMaterializer.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/SystemMaterializer.scala @@ -16,6 +16,7 @@ package org.apache.pekko.stream import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.Promise +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.actor.ActorSystem @@ -29,7 +30,6 @@ import pekko.annotation.InternalApi import pekko.dispatch.Dispatchers import pekko.pattern.ask import pekko.stream.impl.MaterializerGuardian -import scala.jdk.DurationConverters._ import pekko.util.Timeout /** diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/JavaStreamSource.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/JavaStreamSource.scala index d05625fee1..440a17e406 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/JavaStreamSource.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/JavaStreamSource.scala @@ -13,14 +13,14 @@ package org.apache.pekko.stream.impl +import java.util.Spliterator +import java.util.function.Consumer + import org.apache.pekko import pekko.annotation.InternalApi import pekko.stream._ import pekko.stream.stage.{ GraphStage, GraphStageLogic, OutHandler } -import java.util.Spliterator -import java.util.function.Consumer - /** INTERNAL API */ @InternalApi private[stream] final class JavaStreamSource[T, S <: java.util.stream.BaseStream[T, S]]( val open: () => java.util.stream.BaseStream[T, S]) diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/MaybeSource.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/MaybeSource.scala index 56d1d0ebe8..dcd5676b29 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/MaybeSource.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/MaybeSource.scala @@ -13,12 +13,12 @@ package org.apache.pekko.stream.impl +import scala.concurrent.ExecutionContext import scala.concurrent.Promise import scala.util.Try import org.apache.pekko import pekko.annotation.InternalApi -import scala.concurrent.ExecutionContext import pekko.stream._ import pekko.stream.impl.Stages.DefaultAttributes import pekko.stream.stage.{ GraphStageLogic, GraphStageWithMaterializedValue, OutHandler } diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/Sinks.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/Sinks.scala index 3612756991..dacce18e2d 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/Sinks.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/Sinks.scala @@ -17,6 +17,7 @@ import java.util.function.BinaryOperator import scala.collection.immutable import scala.collection.mutable +import scala.concurrent.ExecutionContext import scala.concurrent.Future import scala.concurrent.Promise import scala.util.Failure @@ -28,7 +29,6 @@ import org.apache.pekko import pekko.NotUsed import pekko.annotation.DoNotInherit import pekko.annotation.InternalApi -import scala.concurrent.ExecutionContext import pekko.event.Logging import pekko.stream._ import pekko.stream.ActorAttributes.StreamSubscriptionTimeout diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/UnfoldResourceSourceAsync.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/UnfoldResourceSourceAsync.scala index 0905adb913..b0a74bfcb7 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/UnfoldResourceSourceAsync.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/UnfoldResourceSourceAsync.scala @@ -14,13 +14,13 @@ package org.apache.pekko.stream.impl import scala.concurrent.{ ExecutionContext, Future } +import scala.concurrent.ExecutionContext.parasitic import scala.util.{ Failure, Success, Try } import scala.util.control.NonFatal import org.apache.pekko import pekko.Done import pekko.annotation.InternalApi -import scala.concurrent.ExecutionContext.parasitic import pekko.stream._ import pekko.stream.ActorAttributes.SupervisionStrategy import pekko.stream.Attributes.SourceLocation diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/DropRepeated.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/DropRepeated.scala index 18d54cd4ad..222d55b3a5 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/DropRepeated.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/DropRepeated.scala @@ -17,15 +17,15 @@ package org.apache.pekko.stream.impl.fusing +import scala.util.control.NonFatal + import org.apache.pekko +import pekko.stream.{ Attributes, FlowShape, Inlet, Outlet, Supervision } import pekko.stream.ActorAttributes.SupervisionStrategy import pekko.stream.impl.Stages.DefaultAttributes -import pekko.stream.{ Attributes, FlowShape, Inlet, Outlet, Supervision } import pekko.stream.stage.{ GraphStage, GraphStageLogic, InHandler, OutHandler } import pekko.util.OptionVal -import scala.util.control.NonFatal - private[pekko] final class DropRepeated[T](predicate: (T, T) => Boolean) extends GraphStage[FlowShape[T, T]] { require(predicate != null, "predicate function should not be null") diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FlattenConcat.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FlattenConcat.scala index b6fbfeb549..5cf2bdc827 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FlattenConcat.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FlattenConcat.scala @@ -17,19 +17,19 @@ package org.apache.pekko.stream.impl.fusing -import org.apache.pekko -import pekko.annotation.InternalApi -import pekko.stream.scaladsl.Source -import pekko.stream.{ Attributes, FlowShape, Graph, Inlet, Outlet, SourceShape, SubscriptionWithCancelException } -import pekko.stream.impl.Stages.DefaultAttributes -import pekko.stream.impl.{ Buffer => BufferImpl, FailedSource, JavaStreamSource, TraversalBuilder } -import pekko.stream.impl.fusing.GraphStages.{ FutureSource, SingleSource } -import pekko.stream.stage.{ GraphStage, GraphStageLogic, InHandler, OutHandler } -import pekko.util.OptionVal - import scala.concurrent.Future import scala.util.{ Failure, Try } +import org.apache.pekko +import pekko.annotation.InternalApi +import pekko.stream.{ Attributes, FlowShape, Graph, Inlet, Outlet, SourceShape, SubscriptionWithCancelException } +import pekko.stream.impl.{ Buffer => BufferImpl, FailedSource, JavaStreamSource, TraversalBuilder } +import pekko.stream.impl.Stages.DefaultAttributes +import pekko.stream.impl.fusing.GraphStages.{ FutureSource, SingleSource } +import pekko.stream.scaladsl.Source +import pekko.stream.stage.{ GraphStage, GraphStageLogic, InHandler, OutHandler } +import pekko.util.OptionVal + /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FutureFlow.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FutureFlow.scala index 2333c25c93..0deea88007 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FutureFlow.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FutureFlow.scala @@ -14,12 +14,12 @@ package org.apache.pekko.stream.impl.fusing import scala.concurrent.{ Future, Promise } +import scala.concurrent.ExecutionContext import scala.util.{ Failure, Success, Try } import scala.util.control.NonFatal import org.apache.pekko import pekko.annotation.InternalApi -import scala.concurrent.ExecutionContext import pekko.stream.{ AbruptStageTerminationException, Attributes, diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphStages.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphStages.scala index c54e81f0a9..b95b29f980 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphStages.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphStages.scala @@ -17,6 +17,7 @@ import java.util.concurrent.atomic.{ AtomicBoolean, AtomicReference } import scala.annotation.unchecked.uncheckedVariance import scala.concurrent.{ Future, Promise } +import scala.concurrent.ExecutionContext import scala.concurrent.duration.FiniteDuration import scala.util.Try @@ -24,7 +25,6 @@ import org.apache.pekko import pekko.Done import pekko.actor.Cancellable import pekko.annotation.InternalApi -import scala.concurrent.ExecutionContext import pekko.event.Logging import pekko.stream.{ Shape, _ } import pekko.stream.FlowMonitorState._ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GroupedAdjacentByWeighted.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GroupedAdjacentByWeighted.scala index adb395b141..36739ff524 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GroupedAdjacentByWeighted.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GroupedAdjacentByWeighted.scala @@ -17,15 +17,15 @@ package org.apache.pekko.stream.impl.fusing +import scala.collection.immutable + import org.apache.pekko import pekko.annotation.InternalApi -import pekko.stream.impl.Stages.DefaultAttributes import pekko.stream.{ Attributes, FlowShape, Inlet, Outlet } +import pekko.stream.impl.Stages.DefaultAttributes import pekko.stream.stage.{ GraphStage, GraphStageLogic, InHandler, OutHandler } import pekko.util.OptionVal -import scala.collection.immutable - /** * INTERNAL API */ diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/LazyFutureSource.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/LazyFutureSource.scala index cd543d4ce7..360e6f0a40 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/LazyFutureSource.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/LazyFutureSource.scala @@ -17,11 +17,11 @@ package org.apache.pekko.stream.impl.fusing +import scala.concurrent.ExecutionContext import scala.concurrent.Future import scala.util.Try import org.apache.pekko -import scala.concurrent.ExecutionContext import pekko.stream.Attributes import pekko.stream.Attributes.SourceLocation import pekko.stream.Outlet diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala index ea8c833f25..f758d2a76a 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala @@ -24,6 +24,7 @@ import scala.concurrent.duration.{ FiniteDuration, _ } import scala.util.{ Failure, Success, Try } import scala.util.control.{ NoStackTrace, NonFatal } import scala.util.control.Exception.Catcher + import org.apache.pekko import pekko.actor.{ ActorRef, Terminated } import pekko.annotation.InternalApi diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala index 90ebf65215..5b6c82745f 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala @@ -19,6 +19,7 @@ import java.util.concurrent.atomic.AtomicReference import scala.annotation.{ nowarn, tailrec } import scala.collection.immutable import scala.concurrent.duration.FiniteDuration +import scala.jdk.CollectionConverters._ import scala.util.control.NonFatal import org.apache.pekko @@ -39,7 +40,6 @@ import pekko.stream.impl.fusing.GraphStages.SingleSource import pekko.stream.scaladsl._ import pekko.stream.stage._ import pekko.util.OptionVal -import scala.jdk.CollectionConverters._ /** * INTERNAL API diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Switch.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Switch.scala index 358c6c7a75..1bcd953ec6 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Switch.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Switch.scala @@ -18,7 +18,6 @@ package org.apache.pekko.stream.impl.fusing import org.apache.pekko -import pekko.stream.impl.TraversalBuilder import pekko.annotation.InternalApi import pekko.stream.Attributes import pekko.stream.FlowShape @@ -27,6 +26,7 @@ import pekko.stream.Inlet import pekko.stream.Outlet import pekko.stream.SourceShape import pekko.stream.impl.Stages.DefaultAttributes +import pekko.stream.impl.TraversalBuilder import pekko.stream.scaladsl.Source import pekko.stream.stage.GraphStage import pekko.stream.stage.GraphStageLogic diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/io/FileOutputStage.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/io/FileOutputStage.scala index c0e561d5a8..fd665b51a6 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/io/FileOutputStage.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/io/FileOutputStage.scala @@ -18,6 +18,7 @@ import java.nio.file.{ OpenOption, Path } import scala.collection.immutable import scala.concurrent.{ Future, Promise } +import scala.jdk.CollectionConverters._ import scala.util.Success import scala.util.control.NonFatal @@ -34,7 +35,6 @@ import pekko.stream.{ import pekko.stream.impl.Stages.DefaultAttributes import pekko.stream.stage.{ GraphStageLogic, GraphStageWithMaterializedValue, InHandler } import pekko.util.ByteString -import scala.jdk.CollectionConverters._ /** * INTERNAL API diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/io/TcpStages.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/io/TcpStages.scala index e7b87b1b8c..38ff183441 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/io/TcpStages.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/io/TcpStages.scala @@ -20,13 +20,13 @@ import java.util.concurrent.atomic.{ AtomicBoolean, AtomicLong } import scala.annotation.nowarn import scala.collection.immutable import scala.concurrent.{ Future, Promise } +import scala.concurrent.ExecutionContext import scala.concurrent.duration.{ Duration, FiniteDuration } import org.apache.pekko import pekko.{ Done, NotUsed } import pekko.actor.{ ActorRef, Terminated } import pekko.annotation.InternalApi -import scala.concurrent.ExecutionContext import pekko.io.Inet.SocketOption import pekko.io.Tcp import pekko.io.Tcp._ diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/DelayStrategy.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/DelayStrategy.scala index 8eb32d5be8..993b0c81a2 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/DelayStrategy.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/DelayStrategy.scala @@ -14,11 +14,11 @@ package org.apache.pekko.stream.javadsl import scala.concurrent.duration.FiniteDuration +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.annotation.InternalApi import pekko.stream.scaladsl -import scala.jdk.DurationConverters._ /** * Allows to manage delay and can be stateful to compute delay for any sequence of elements, diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/FileIO.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/FileIO.scala index 1339122c36..0deca90a7c 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/FileIO.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/FileIO.scala @@ -17,12 +17,13 @@ import java.nio.file.{ OpenOption, Path } import java.util import java.util.concurrent.CompletionStage +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.stream.{ javadsl, scaladsl, IOResult } import pekko.stream.scaladsl.SinkToCompletionStage import pekko.stream.scaladsl.SourceToCompletionStage import pekko.util.ByteString -import scala.jdk.CollectionConverters._ /** * Java API: Factories to create sinks and sources from files diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala index 941b5d0df3..48d7e992f6 100755 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala @@ -17,9 +17,13 @@ import java.util.Comparator import java.util.Optional import java.util.concurrent.CompletionStage -import scala.annotation.varargs import scala.annotation.unchecked.uncheckedVariance +import scala.annotation.varargs import scala.collection.immutable +import scala.concurrent.ExecutionContext +import scala.jdk.DurationConverters._ +import scala.jdk.FutureConverters._ +import scala.jdk.OptionConverters._ import scala.reflect.ClassTag import org.apache.pekko @@ -27,7 +31,6 @@ import pekko.Done import pekko.NotUsed import pekko.actor.ActorRef import pekko.actor.ClassicActorSystemProvider -import scala.concurrent.ExecutionContext import pekko.event.{ LogMarker, LoggingAdapter, MarkerLoggingAdapter } import pekko.japi.Pair import pekko.japi.function @@ -35,11 +38,9 @@ import pekko.japi.function.Creator import pekko.stream.{ javadsl, _ } import pekko.stream.impl.fusing.{ StatefulMapConcat, ZipWithIndexJava } import pekko.util.ConstantFun -import scala.jdk.FutureConverters._ -import scala.jdk.DurationConverters._ -import scala.jdk.OptionConverters._ import pekko.util.Timeout import pekko.util.unused + import org.reactivestreams.Processor object Flow { diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/FlowWithContext.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/FlowWithContext.scala index 8ad41493b8..2aeb298b16 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/FlowWithContext.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/FlowWithContext.scala @@ -17,6 +17,10 @@ import java.util.Optional import java.util.concurrent.CompletionStage import scala.annotation.unchecked.uncheckedVariance +import scala.jdk.CollectionConverters._ +import scala.jdk.DurationConverters._ +import scala.jdk.FutureConverters._ +import scala.jdk.OptionConverters._ import org.apache.pekko import pekko.annotation.ApiMayChange @@ -24,10 +28,6 @@ import pekko.event.{ LogMarker, LoggingAdapter, MarkerLoggingAdapter } import pekko.japi.{ function, Pair } import pekko.stream._ import pekko.util.ConstantFun -import scala.jdk.FutureConverters._ -import scala.jdk.DurationConverters._ -import scala.jdk.OptionConverters._ -import scala.jdk.CollectionConverters._ object FlowWithContext { diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Graph.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Graph.scala index 54010b6081..fce10e9665 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Graph.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Graph.scala @@ -17,6 +17,7 @@ import java.util import java.util.Comparator import scala.annotation.unchecked.uncheckedVariance +import scala.jdk.CollectionConverters._ import org.apache.pekko import pekko.NotUsed @@ -24,7 +25,6 @@ import pekko.japi.{ function, Pair } import pekko.stream._ import pekko.stream.scaladsl.GenericGraph import pekko.util.ConstantFun -import scala.jdk.CollectionConverters._ import pekko.util.unused /** diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Hub.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Hub.scala index 3a3f34ce56..1a45707a1d 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Hub.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Hub.scala @@ -16,9 +16,9 @@ package org.apache.pekko.stream.javadsl import java.util.function.ToLongBiFunction import org.apache.pekko -import pekko.japi.function import pekko.NotUsed import pekko.annotation.DoNotInherit +import pekko.japi.function import pekko.util.unused /** diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/MergeLatest.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/MergeLatest.scala index ae7716bd7d..a896cbf11d 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/MergeLatest.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/MergeLatest.scala @@ -13,10 +13,11 @@ package org.apache.pekko.stream.javadsl +import scala.jdk.CollectionConverters._ + import org.apache.pekko import pekko.stream.{ scaladsl, UniformFanInShape } import pekko.stream.stage.GraphStage -import scala.jdk.CollectionConverters._ /** * MergeLatest joins elements from N input streams into stream of lists of size N. diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Queue.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Queue.scala index 6f50d06524..43ae19a8af 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Queue.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Queue.scala @@ -16,14 +16,14 @@ package org.apache.pekko.stream.javadsl import java.util.Optional import java.util.concurrent.CompletionStage +import scala.concurrent.ExecutionContext import scala.concurrent.Future +import scala.jdk.FutureConverters._ +import scala.jdk.OptionConverters._ import org.apache.pekko import pekko.Done -import scala.concurrent.ExecutionContext import pekko.stream.QueueOfferResult -import scala.jdk.FutureConverters._ -import scala.jdk.OptionConverters._ /** * This trait allows to have a queue as a data source for some stream. diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/RetryFlow.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/RetryFlow.scala index 429d8c0247..f45a2129b6 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/RetryFlow.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/RetryFlow.scala @@ -15,12 +15,13 @@ package org.apache.pekko.stream.javadsl import java.util.Optional +import scala.jdk.DurationConverters._ +import scala.jdk.OptionConverters._ + import org.apache.pekko import pekko.annotation.ApiMayChange import pekko.japi.Pair import pekko.stream.scaladsl -import scala.jdk.DurationConverters._ -import scala.jdk.OptionConverters._ object RetryFlow { diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Sink.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Sink.scala index 67954cf39f..092ca7e35b 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Sink.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Sink.scala @@ -19,20 +19,20 @@ import java.util.stream.Collector import scala.annotation.unchecked.uncheckedVariance import scala.collection.immutable +import scala.concurrent.ExecutionContext +import scala.jdk.FutureConverters._ +import scala.jdk.OptionConverters._ import scala.util.Try import org.apache.pekko import pekko._ import pekko.actor.{ ActorRef, ClassicActorSystemProvider, Status } -import scala.concurrent.ExecutionContext import pekko.japi.function import pekko.japi.function.Creator import pekko.stream._ import pekko.stream.impl.LinearTraversalBuilder import pekko.stream.scaladsl.SinkToCompletionStage import pekko.util.ConstantFun.scalaAnyToUnit -import scala.jdk.FutureConverters._ -import scala.jdk.OptionConverters._ import org.reactivestreams.{ Publisher, Subscriber } diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala index 35f8dfded5..e2c047927a 100755 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala @@ -17,16 +17,20 @@ import java.util import java.util.Optional import java.util.concurrent.{ CompletableFuture, CompletionStage } -import scala.annotation.varargs import scala.annotation.unchecked.uncheckedVariance +import scala.annotation.varargs import scala.collection.immutable import scala.concurrent.{ Future, Promise } +import scala.concurrent.ExecutionContext +import scala.jdk.CollectionConverters._ +import scala.jdk.DurationConverters._ +import scala.jdk.FutureConverters._ +import scala.jdk.OptionConverters._ import scala.reflect.ClassTag import org.apache.pekko import pekko.{ Done, NotUsed } import pekko.actor.{ ActorRef, Cancellable, ClassicActorSystemProvider } -import scala.concurrent.ExecutionContext import pekko.event.{ LogMarker, LoggingAdapter, MarkerLoggingAdapter } import pekko.japi.{ function, JavaPartialFunction, Pair } import pekko.japi.function.Creator @@ -34,10 +38,6 @@ import pekko.stream._ import pekko.stream.impl.{ LinearTraversalBuilder, UnfoldAsyncJava, UnfoldJava } import pekko.stream.impl.fusing.{ ArraySource, StatefulMapConcat, ZipWithIndexJava } import pekko.util.{ unused, _ } -import scala.jdk.FutureConverters._ -import scala.jdk.DurationConverters._ -import scala.jdk.OptionConverters._ -import scala.jdk.CollectionConverters._ import org.reactivestreams.{ Publisher, Subscriber } diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/SourceWithContext.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/SourceWithContext.scala index 8db5182432..2dca6c6efc 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/SourceWithContext.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/SourceWithContext.scala @@ -17,6 +17,10 @@ import java.util.Optional import java.util.concurrent.CompletionStage import scala.annotation.unchecked.uncheckedVariance +import scala.jdk.CollectionConverters._ +import scala.jdk.DurationConverters._ +import scala.jdk.FutureConverters._ +import scala.jdk.OptionConverters._ import org.apache.pekko import pekko.actor.ClassicActorSystemProvider @@ -26,10 +30,6 @@ import pekko.japi.Pair import pekko.japi.function import pekko.stream._ import pekko.util.ConstantFun -import scala.jdk.FutureConverters._ -import scala.jdk.DurationConverters._ -import scala.jdk.OptionConverters._ -import scala.jdk.CollectionConverters._ object SourceWithContext { diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/StatefulMapConcatAccumulator.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/StatefulMapConcatAccumulator.scala index 72d1e94fad..52d7b17f03 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/StatefulMapConcatAccumulator.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/StatefulMapConcatAccumulator.scala @@ -17,12 +17,13 @@ package org.apache.pekko.stream.javadsl +import java.util.Collections + +import scala.annotation.unchecked.uncheckedVariance + import org.apache.pekko import pekko.japi.function -import java.util.Collections -import scala.annotation.unchecked.uncheckedVariance - /** * A special accumulator for `StatefulMapConcat` operator that allows to emit elements when the upstream has completed. * diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/StreamConverters.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/StreamConverters.scala index 189e27f627..8303f6687f 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/StreamConverters.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/StreamConverters.scala @@ -17,6 +17,8 @@ import java.io.{ InputStream, OutputStream } import java.util.concurrent.CompletionStage import java.util.stream.Collector +import scala.jdk.DurationConverters._ + import org.apache.pekko import pekko.NotUsed import pekko.japi.function @@ -25,7 +27,6 @@ import pekko.stream.IOResult import pekko.stream.scaladsl.SinkToCompletionStage import pekko.stream.scaladsl.SourceToCompletionStage import pekko.util.ByteString -import scala.jdk.DurationConverters._ /** * Converters for interacting with the blocking `java.io` streams APIs and Java 8 Streams diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/SubFlow.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/SubFlow.scala index 7f3b9eb980..1a03e0921d 100755 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/SubFlow.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/SubFlow.scala @@ -16,9 +16,13 @@ package org.apache.pekko.stream.javadsl import java.util.{ Comparator, Optional } import java.util.concurrent.CompletionStage -import scala.annotation.varargs import scala.annotation.unchecked.uncheckedVariance +import scala.annotation.varargs import scala.collection.immutable +import scala.jdk.CollectionConverters._ +import scala.jdk.DurationConverters._ +import scala.jdk.FutureConverters._ +import scala.jdk.OptionConverters._ import scala.reflect.ClassTag import org.apache.pekko @@ -28,10 +32,6 @@ import pekko.japi.{ function, Pair } import pekko.stream._ import pekko.stream.impl.fusing.{ StatefulMapConcat, ZipWithIndexJava } import pekko.util.ConstantFun -import scala.jdk.FutureConverters._ -import scala.jdk.DurationConverters._ -import scala.jdk.OptionConverters._ -import scala.jdk.CollectionConverters._ object SubFlow { diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/SubSource.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/SubSource.scala index 669f349b1c..5a2abfec29 100755 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/SubSource.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/SubSource.scala @@ -16,9 +16,13 @@ package org.apache.pekko.stream.javadsl import java.util.{ Comparator, Optional } import java.util.concurrent.CompletionStage -import scala.annotation.varargs import scala.annotation.unchecked.uncheckedVariance +import scala.annotation.varargs import scala.collection.immutable +import scala.jdk.CollectionConverters._ +import scala.jdk.DurationConverters._ +import scala.jdk.FutureConverters._ +import scala.jdk.OptionConverters._ import scala.reflect.ClassTag import org.apache.pekko @@ -28,10 +32,6 @@ import pekko.japi.{ function, Pair } import pekko.stream._ import pekko.stream.impl.fusing.{ StatefulMapConcat, ZipWithIndexJava } import pekko.util.ConstantFun -import scala.jdk.FutureConverters._ -import scala.jdk.DurationConverters._ -import scala.jdk.OptionConverters._ -import scala.jdk.CollectionConverters._ /** * * Upcast a stream of elements to a stream of supertypes of that element. Useful in combination with diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Tcp.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Tcp.scala index 9a2335d0ac..dd4a64a99f 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Tcp.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Tcp.scala @@ -21,6 +21,9 @@ import javax.net.ssl.SSLEngine import javax.net.ssl.SSLSession import scala.concurrent.duration._ +import scala.jdk.DurationConverters._ +import scala.jdk.FutureConverters._ +import scala.jdk.OptionConverters._ import scala.util.Failure import scala.util.Success @@ -39,9 +42,6 @@ import pekko.stream.SystemMaterializer import pekko.stream.TLSClosing import pekko.stream.scaladsl import pekko.util.ByteString -import scala.jdk.FutureConverters._ -import scala.jdk.DurationConverters._ -import scala.jdk.OptionConverters._ object Tcp extends ExtensionId[Tcp] with ExtensionIdProvider { @@ -141,10 +141,10 @@ object Tcp extends ExtensionId[Tcp] with ExtensionIdProvider { } class Tcp(system: ExtendedActorSystem) extends pekko.actor.Extension { - import Tcp._ - import scala.concurrent.ExecutionContext.parasitic + import Tcp._ + private lazy val delegate: scaladsl.Tcp = scaladsl.Tcp(system) /** diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/FlowWithContext.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/FlowWithContext.scala index 71ba23fe10..c579266fc3 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/FlowWithContext.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/FlowWithContext.scala @@ -16,8 +16,8 @@ package org.apache.pekko.stream.scaladsl import scala.annotation.unchecked.uncheckedVariance import org.apache.pekko -import pekko.annotation.ApiMayChange import pekko.NotUsed +import pekko.annotation.ApiMayChange import pekko.japi.Pair import pekko.stream._ diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/FlowWithContextOps.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/FlowWithContextOps.scala index f568602337..90c5eb6be4 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/FlowWithContextOps.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/FlowWithContextOps.scala @@ -15,13 +15,13 @@ package org.apache.pekko.stream.scaladsl import scala.annotation.unchecked.uncheckedVariance import scala.collection.immutable +import scala.concurrent.ExecutionContext import scala.concurrent.Future import scala.concurrent.duration.FiniteDuration import org.apache.pekko import pekko.NotUsed import pekko.annotation.ApiMayChange -import scala.concurrent.ExecutionContext import pekko.event.{ LogMarker, LoggingAdapter, MarkerLoggingAdapter } import pekko.stream._ import pekko.stream.impl.Throttle diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala index e62290f8f5..563b630e98 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala @@ -18,22 +18,24 @@ import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.atomic.{ AtomicLong, AtomicReference } import java.util.concurrent.atomic.AtomicInteger import java.util.concurrent.atomic.AtomicReferenceArray + import scala.annotation.tailrec import scala.collection.immutable import scala.collection.immutable.Queue import scala.collection.mutable.LongMap import scala.concurrent.{ Future, Promise } import scala.util.{ Failure, Success, Try } + import org.apache.pekko import pekko.NotUsed import pekko.annotation.DoNotInherit import pekko.annotation.InternalApi import pekko.dispatch.AbstractNodeQueue -import pekko.util.ConstantFun import pekko.stream._ import pekko.stream.Attributes.LogLevels import pekko.stream.impl.ActorPublisher import pekko.stream.stage._ +import pekko.util.ConstantFun /** * A MergeHub is a special streaming hub that is able to collect streamed elements from a dynamic set of diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Queue.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Queue.scala index 877b68f6cd..7071c5f5a7 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Queue.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Queue.scala @@ -16,15 +16,15 @@ package org.apache.pekko.stream.scaladsl import java.util.Optional import java.util.concurrent.CompletionStage +import scala.concurrent.ExecutionContext import scala.concurrent.Future +import scala.jdk.FutureConverters._ +import scala.jdk.OptionConverters._ import org.apache.pekko import pekko.Done import pekko.annotation.InternalApi -import scala.concurrent.ExecutionContext import pekko.stream.QueueOfferResult -import scala.jdk.FutureConverters._ -import scala.jdk.OptionConverters._ /** * This trait allows to have a queue as a data source for some stream. diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Sink.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Sink.scala index ccc65b115d..a58ec833f0 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Sink.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Sink.scala @@ -16,6 +16,7 @@ package org.apache.pekko.stream.scaladsl import scala.annotation.tailrec import scala.annotation.unchecked.uncheckedVariance import scala.collection.immutable +import scala.concurrent.ExecutionContext import scala.concurrent.Future import scala.util.{ Failure, Success, Try } @@ -23,7 +24,6 @@ import org.apache.pekko import pekko.{ util, Done, NotUsed } import pekko.actor.ActorRef import pekko.annotation.InternalApi -import scala.concurrent.ExecutionContext import pekko.stream._ import pekko.stream.impl._ import pekko.stream.impl.Stages.DefaultAttributes diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Source.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Source.scala index 334c821885..97b5acbfa0 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Source.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Source.scala @@ -20,6 +20,7 @@ import scala.annotation.unchecked.uncheckedVariance import scala.collection.{ immutable, AbstractIterator } import scala.concurrent.{ Future, Promise } import scala.concurrent.duration.FiniteDuration +import scala.jdk.FutureConverters._ import scala.util.control.NonFatal import org.apache.pekko @@ -33,7 +34,6 @@ import pekko.stream.impl.fusing.{ GraphStages, IterableSource, LazyFutureSource, import pekko.stream.impl.fusing.GraphStages._ import pekko.stream.stage.GraphStageWithMaterializedValue import pekko.util.ConstantFun -import scala.jdk.FutureConverters._ import org.reactivestreams.{ Publisher, Subscriber } diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/SubFlow.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/SubFlow.scala index 68566851b4..ab2bc07f07 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/SubFlow.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/SubFlow.scala @@ -13,12 +13,12 @@ package org.apache.pekko.stream.scaladsl +import scala.annotation.unchecked.uncheckedVariance + import org.apache.pekko import pekko.annotation.DoNotInherit import pekko.stream._ -import scala.annotation.unchecked.uncheckedVariance - /** * A “stream of streams” sub-flow of data elements, e.g. produced by `groupBy`. * SubFlows cannot contribute to the super-flow’s materialized value since they diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Tcp.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Tcp.scala index 8a857c2e08..3113f60b56 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Tcp.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Tcp.scala @@ -23,6 +23,7 @@ import scala.collection.immutable import scala.concurrent.Future import scala.concurrent.duration.Duration import scala.concurrent.duration.FiniteDuration +import scala.jdk.DurationConverters._ import scala.util.Success import scala.util.Try import scala.util.control.NoStackTrace @@ -42,7 +43,6 @@ import pekko.stream.impl.io.ConnectionSourceStage import pekko.stream.impl.io.OutgoingConnectionStage import pekko.stream.impl.io.TcpIdleTimeout import pekko.util.ByteString -import scala.jdk.DurationConverters._ import pekko.util.unused object Tcp extends ExtensionId[Tcp] with ExtensionIdProvider { diff --git a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/package.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/package.scala index 4f60c996b2..a1b02caa0b 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/scaladsl/package.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/package.scala @@ -16,7 +16,6 @@ package org.apache.pekko.stream import java.util.concurrent.CompletionStage import scala.concurrent.Future - import scala.jdk.FutureConverters._ /** diff --git a/stream/src/main/scala/org/apache/pekko/stream/stage/GraphStage.scala b/stream/src/main/scala/org/apache/pekko/stream/stage/GraphStage.scala index 8ec5aa2d00..6be4276095 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/stage/GraphStage.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/stage/GraphStage.scala @@ -13,6 +13,7 @@ package org.apache.pekko.stream.stage +import java.util.Spliterator import java.util.concurrent.{ CompletionStage, ConcurrentHashMap } import java.util.concurrent.atomic.AtomicReference @@ -36,8 +37,6 @@ import pekko.stream.stage.ConcurrentAsyncCallbackState.{ NoPendingEvents, State import pekko.util.OptionVal import pekko.util.unused -import java.util.Spliterator - /** * Scala API: A GraphStage represents a reusable graph stream processing operator. * diff --git a/testkit/src/main/scala/org/apache/pekko/testkit/CallingThreadDispatcher.scala b/testkit/src/main/scala/org/apache/pekko/testkit/CallingThreadDispatcher.scala index 272670a64c..8a34ecb0d4 100644 --- a/testkit/src/main/scala/org/apache/pekko/testkit/CallingThreadDispatcher.scala +++ b/testkit/src/main/scala/org/apache/pekko/testkit/CallingThreadDispatcher.scala @@ -22,8 +22,6 @@ import scala.concurrent.duration._ import scala.concurrent.duration.Duration import scala.util.control.NonFatal -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.{ ActorCell, @@ -48,6 +46,8 @@ import pekko.dispatch.{ import pekko.dispatch.sysmsg.{ Resume, Suspend, SystemMessage } import pekko.util.Switch +import com.typesafe.config.Config + /* * Locking rules: * diff --git a/testkit/src/main/scala/org/apache/pekko/testkit/ExplicitlyTriggeredScheduler.scala b/testkit/src/main/scala/org/apache/pekko/testkit/ExplicitlyTriggeredScheduler.scala index 516923036b..dd2fb1a8a9 100644 --- a/testkit/src/main/scala/org/apache/pekko/testkit/ExplicitlyTriggeredScheduler.scala +++ b/testkit/src/main/scala/org/apache/pekko/testkit/ExplicitlyTriggeredScheduler.scala @@ -20,17 +20,17 @@ import java.util.concurrent.atomic.AtomicLong import scala.annotation.tailrec import scala.concurrent.ExecutionContext import scala.concurrent.duration.{ Duration, FiniteDuration } +import scala.jdk.CollectionConverters._ import scala.util.Try -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.Cancellable import pekko.actor.Scheduler import pekko.event.LoggingAdapter -import scala.jdk.CollectionConverters._ import pekko.util.unused +import com.typesafe.config.Config + /** * For testing: scheduler that does not look at the clock, but must be * progressed manually by calling `timePasses`. diff --git a/testkit/src/main/scala/org/apache/pekko/testkit/TestActorRef.scala b/testkit/src/main/scala/org/apache/pekko/testkit/TestActorRef.scala index b12f13043f..9fa56ee363 100644 --- a/testkit/src/main/scala/org/apache/pekko/testkit/TestActorRef.scala +++ b/testkit/src/main/scala/org/apache/pekko/testkit/TestActorRef.scala @@ -15,11 +15,10 @@ package org.apache.pekko.testkit import java.util.concurrent.atomic.AtomicLong +import scala.annotation.nowarn import scala.concurrent.Await import scala.reflect.ClassTag -import scala.annotation.nowarn - import org.apache.pekko import pekko.actor._ import pekko.dispatch._ diff --git a/testkit/src/main/scala/org/apache/pekko/testkit/TestKit.scala b/testkit/src/main/scala/org/apache/pekko/testkit/TestKit.scala index e8b0de22ec..d228ebd640 100644 --- a/testkit/src/main/scala/org/apache/pekko/testkit/TestKit.scala +++ b/testkit/src/main/scala/org/apache/pekko/testkit/TestKit.scala @@ -17,6 +17,7 @@ import java.util.concurrent._ import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.AtomicInteger +import scala.annotation.nowarn import scala.annotation.tailrec import scala.collection.immutable import scala.concurrent.Await @@ -24,8 +25,6 @@ import scala.concurrent.duration._ import scala.reflect.ClassTag import scala.util.control.NonFatal -import scala.annotation.nowarn - import org.apache.pekko import pekko.actor._ import pekko.actor.DeadLetter diff --git a/testkit/src/main/scala/org/apache/pekko/testkit/TestKitExtension.scala b/testkit/src/main/scala/org/apache/pekko/testkit/TestKitExtension.scala index 01d9871f8d..95dec7e877 100644 --- a/testkit/src/main/scala/org/apache/pekko/testkit/TestKitExtension.scala +++ b/testkit/src/main/scala/org/apache/pekko/testkit/TestKitExtension.scala @@ -15,13 +15,13 @@ package org.apache.pekko.testkit import scala.concurrent.duration.FiniteDuration -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.{ ActorSystem, ExtendedActorSystem, Extension, ExtensionId } import pekko.actor.ClassicActorSystemProvider import pekko.util.Timeout +import com.typesafe.config.Config + object TestKitExtension extends ExtensionId[TestKitSettings] { override def get(system: ActorSystem): TestKitSettings = super.get(system) override def get(system: ClassicActorSystemProvider): TestKitSettings = super.get(system) diff --git a/testkit/src/main/scala/org/apache/pekko/testkit/javadsl/TestKit.scala b/testkit/src/main/scala/org/apache/pekko/testkit/javadsl/TestKit.scala index 154497cf1b..f2e0398f01 100644 --- a/testkit/src/main/scala/org/apache/pekko/testkit/javadsl/TestKit.scala +++ b/testkit/src/main/scala/org/apache/pekko/testkit/javadsl/TestKit.scala @@ -18,13 +18,13 @@ import java.util.function.{ Function => JFunction, Supplier } import scala.annotation.varargs import scala.concurrent.duration._ +import scala.jdk.CollectionConverters._ +import scala.jdk.DurationConverters._ import org.apache.pekko import pekko.actor._ import pekko.annotation.InternalApi import pekko.testkit.{ TestActor, TestDuration, TestProbe } -import scala.jdk.DurationConverters._ -import scala.jdk.CollectionConverters._ /** * Java API: Test kit for testing actors. Inheriting from this class enables diff --git a/testkit/src/test/scala/org/apache/pekko/testkit/DefaultTimeoutSpec.scala b/testkit/src/test/scala/org/apache/pekko/testkit/DefaultTimeoutSpec.scala index fb6796ae8c..34f08d1836 100644 --- a/testkit/src/test/scala/org/apache/pekko/testkit/DefaultTimeoutSpec.scala +++ b/testkit/src/test/scala/org/apache/pekko/testkit/DefaultTimeoutSpec.scala @@ -13,12 +13,12 @@ package org.apache.pekko.testkit +import org.apache.pekko.actor.ActorSystem + import org.scalatest.BeforeAndAfterAll import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import org.apache.pekko.actor.ActorSystem - class DefaultTimeoutSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll with TestKitBase with DefaultTimeout { implicit lazy val system: ActorSystem = ActorSystem("PekkoCustomSpec") diff --git a/testkit/src/test/scala/org/apache/pekko/testkit/ImplicitSenderSpec.scala b/testkit/src/test/scala/org/apache/pekko/testkit/ImplicitSenderSpec.scala index dc0be66f26..5549ec15d3 100644 --- a/testkit/src/test/scala/org/apache/pekko/testkit/ImplicitSenderSpec.scala +++ b/testkit/src/test/scala/org/apache/pekko/testkit/ImplicitSenderSpec.scala @@ -13,12 +13,12 @@ package org.apache.pekko.testkit +import org.apache.pekko.actor.ActorSystem + import org.scalatest.BeforeAndAfterAll import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import org.apache.pekko.actor.ActorSystem - class ImplicitSenderSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll with TestKitBase with ImplicitSender { implicit lazy val system: ActorSystem = ActorSystem("PekkoCustomSpec") diff --git a/testkit/src/test/scala/org/apache/pekko/testkit/PekkoSpec.scala b/testkit/src/test/scala/org/apache/pekko/testkit/PekkoSpec.scala index faab9b989d..ff0baaa2d3 100644 --- a/testkit/src/test/scala/org/apache/pekko/testkit/PekkoSpec.scala +++ b/testkit/src/test/scala/org/apache/pekko/testkit/PekkoSpec.scala @@ -13,18 +13,13 @@ package org.apache.pekko.testkit +import java.nio.file.{ Path, Paths } + import scala.concurrent.Future import scala.concurrent.duration._ -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory + import org.scalactic.CanEqual import org.scalactic.TypeCheckedTripleEquals -import org.scalatest.BeforeAndAfterAll -import org.scalatest.concurrent.ScalaFutures -import org.scalatest.matchers.should.Matchers -import org.scalatest.time.Millis -import org.scalatest.time.Span -import org.scalatest.wordspec.AnyWordSpecLike import org.apache.pekko import pekko.actor.ActorSystem @@ -33,7 +28,15 @@ import pekko.event.Logging import pekko.event.LoggingAdapter import pekko.testkit.TestEvent._ -import java.nio.file.{ Path, Paths } +import org.scalatest.BeforeAndAfterAll +import org.scalatest.concurrent.ScalaFutures +import org.scalatest.matchers.should.Matchers +import org.scalatest.time.Millis +import org.scalatest.time.Span +import org.scalatest.wordspec.AnyWordSpecLike + +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory object PekkoSpec { val testConf: Config = ConfigFactory.parseString(""" diff --git a/testkit/src/test/scala/org/apache/pekko/testkit/PekkoSpecSpec.scala b/testkit/src/test/scala/org/apache/pekko/testkit/PekkoSpecSpec.scala index 84f1c9a537..e353d09fd8 100644 --- a/testkit/src/test/scala/org/apache/pekko/testkit/PekkoSpecSpec.scala +++ b/testkit/src/test/scala/org/apache/pekko/testkit/PekkoSpecSpec.scala @@ -13,14 +13,9 @@ package org.apache.pekko.testkit +import scala.annotation.nowarn import scala.concurrent.Await import scala.concurrent.duration._ -import scala.annotation.nowarn - -import com.typesafe.config.ConfigFactory - -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec import org.apache.pekko import pekko.actor._ @@ -28,6 +23,11 @@ import pekko.actor.DeadLetter import pekko.pattern.ask import pekko.util.Timeout +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + +import com.typesafe.config.ConfigFactory + @nowarn class PekkoSpecSpec extends AnyWordSpec with Matchers { diff --git a/testkit/src/test/scala/org/apache/pekko/testkit/TestActorRefSpec.scala b/testkit/src/test/scala/org/apache/pekko/testkit/TestActorRefSpec.scala index bacbf571f7..dc4d3800a8 100644 --- a/testkit/src/test/scala/org/apache/pekko/testkit/TestActorRefSpec.scala +++ b/testkit/src/test/scala/org/apache/pekko/testkit/TestActorRefSpec.scala @@ -16,14 +16,14 @@ package org.apache.pekko.testkit import scala.concurrent.{ Await, Promise } import scala.concurrent.duration._ -import org.scalatest.BeforeAndAfterEach - import org.apache.pekko import pekko.actor._ import pekko.dispatch.Dispatcher import pekko.event.Logging.Warning import pekko.pattern.ask +import org.scalatest.BeforeAndAfterEach + /** * Test whether TestActorRef behaves as an ActorRef should, besides its own spec. */ diff --git a/testkit/src/test/scala/org/apache/pekko/testkit/TestProbeSpec.scala b/testkit/src/test/scala/org/apache/pekko/testkit/TestProbeSpec.scala index 6ad662f40f..0ce191cc70 100644 --- a/testkit/src/test/scala/org/apache/pekko/testkit/TestProbeSpec.scala +++ b/testkit/src/test/scala/org/apache/pekko/testkit/TestProbeSpec.scala @@ -19,12 +19,12 @@ import scala.concurrent.Await import scala.concurrent.duration._ import scala.util.Try -import org.scalatest.concurrent.Eventually - import org.apache.pekko import pekko.actor._ import pekko.pattern.ask +import org.scalatest.concurrent.Eventually + class TestProbeSpec extends PekkoSpec with DefaultTimeout with Eventually { "A TestProbe" must { diff --git a/testkit/src/test/scala/org/apache/pekko/testkit/WithLogCapturing.scala b/testkit/src/test/scala/org/apache/pekko/testkit/WithLogCapturing.scala index bd695bbecf..acfd6df21d 100644 --- a/testkit/src/test/scala/org/apache/pekko/testkit/WithLogCapturing.scala +++ b/testkit/src/test/scala/org/apache/pekko/testkit/WithLogCapturing.scala @@ -15,13 +15,13 @@ package org.apache.pekko.testkit import java.io.{ OutputStream, PrintStream } -import org.scalatest.{ Outcome, SuiteMixin, TestSuite } - import org.apache.pekko import pekko.actor.ActorSystem import pekko.event.Logging import pekko.event.Logging._ +import org.scalatest.{ Outcome, SuiteMixin, TestSuite } + /** * Mixin this trait to a test to make log lines appear only when the test failed. */ diff --git a/testkit/src/test/scala/org/apache/pekko/testkit/metrics/FileDescriptorMetricSet.scala b/testkit/src/test/scala/org/apache/pekko/testkit/metrics/FileDescriptorMetricSet.scala index e6ef642b49..0cb8f9179d 100644 --- a/testkit/src/test/scala/org/apache/pekko/testkit/metrics/FileDescriptorMetricSet.scala +++ b/testkit/src/test/scala/org/apache/pekko/testkit/metrics/FileDescriptorMetricSet.scala @@ -16,12 +16,12 @@ package org.apache.pekko.testkit.metrics import java.lang.management.{ ManagementFactory, OperatingSystemMXBean } import java.util +import scala.jdk.CollectionConverters._ + import com.codahale.metrics.{ Gauge, Metric, MetricSet } import com.codahale.metrics.MetricRegistry._ import com.codahale.metrics.jvm.FileDescriptorRatioGauge -import scala.jdk.CollectionConverters._ - /** * MetricSet exposing number of open and maximum file descriptors used by the JVM process. */ diff --git a/testkit/src/test/scala/org/apache/pekko/testkit/metrics/MetricsKit.scala b/testkit/src/test/scala/org/apache/pekko/testkit/metrics/MetricsKit.scala index cdb2c5f867..bdfefe42b6 100644 --- a/testkit/src/test/scala/org/apache/pekko/testkit/metrics/MetricsKit.scala +++ b/testkit/src/test/scala/org/apache/pekko/testkit/metrics/MetricsKit.scala @@ -22,12 +22,14 @@ import scala.reflect.ClassTag import scala.util.matching.Regex import com.codahale.metrics._ -import com.typesafe.config.Config -import org.scalatest.Notifying import org.apache.pekko import pekko.testkit.metrics.reporter.PekkoConsoleReporter +import org.scalatest.Notifying + +import com.typesafe.config.Config + /** * Allows to easily measure performance / memory / file descriptor use in tests. * @@ -40,10 +42,10 @@ import pekko.testkit.metrics.reporter.PekkoConsoleReporter private[pekko] trait MetricsKit extends MetricsKitOps { this: Notifying => - import MetricsKit._ - import scala.jdk.CollectionConverters._ + import MetricsKit._ + private var reporters: List[ScheduledReporter] = Nil /** diff --git a/testkit/src/test/scala/org/apache/pekko/testkit/metrics/MetricsKitOps.scala b/testkit/src/test/scala/org/apache/pekko/testkit/metrics/MetricsKitOps.scala index a50a5dfd42..f18a1f3fed 100644 --- a/testkit/src/test/scala/org/apache/pekko/testkit/metrics/MetricsKitOps.scala +++ b/testkit/src/test/scala/org/apache/pekko/testkit/metrics/MetricsKitOps.scala @@ -18,6 +18,7 @@ import java.util import com.codahale.metrics._ import com.codahale.metrics.jvm import com.codahale.metrics.jvm.MemoryUsageGaugeSet + import org.scalatest.Notifying /** diff --git a/testkit/src/test/scala/org/apache/pekko/testkit/metrics/MetricsKitSpec.scala b/testkit/src/test/scala/org/apache/pekko/testkit/metrics/MetricsKitSpec.scala index 6a8fc2b13e..b840210070 100644 --- a/testkit/src/test/scala/org/apache/pekko/testkit/metrics/MetricsKitSpec.scala +++ b/testkit/src/test/scala/org/apache/pekko/testkit/metrics/MetricsKitSpec.scala @@ -13,11 +13,12 @@ package org.apache.pekko.testkit.metrics -import com.typesafe.config.ConfigFactory import org.scalatest._ import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec +import com.typesafe.config.ConfigFactory + class MetricsKitSpec extends AnyWordSpec with Matchers with BeforeAndAfter with BeforeAndAfterAll with MetricsKit { import scala.concurrent.duration._