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 6ee53a77092..f06aa35711c 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,14 @@ package org.apache.pekko.actor.testkit.typed import java.util.Optional -import org.slf4j.Marker -import org.slf4j.event.Level - import org.apache.pekko import pekko.annotation.InternalApi import pekko.util.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/LoggingEvent.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/LoggingEvent.scala index 1e540d81255..8f7b0b09ed9 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 org.apache.pekko -import pekko.util.ccompat.JavaConverters._ import pekko.util.OptionConverters._ +import pekko.util.ccompat.JavaConverters._ + +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 8de5d2b9e41..aba005c0fc3 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 @@ -15,8 +15,6 @@ package org.apache.pekko.actor.testkit.typed import scala.concurrent.duration.{ Duration, FiniteDuration } -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.typed.ActorSystem import pekko.actor.typed.Extension @@ -24,6 +22,8 @@ import pekko.actor.typed.ExtensionId import pekko.util.JavaDurationConverters._ 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 ad122712bc8..edbfeb785e4 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,10 @@ 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 org.apache.pekko import pekko.{ actor => classic } import pekko.Done @@ -39,6 +38,11 @@ import pekko.actor.typed.receptionist.Receptionist import pekko.annotation.InternalApi import pekko.util.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 c2ce9f96fac..3621740f763 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 @@ -20,12 +20,13 @@ import scala.collection.immutable 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 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 67e24c75e4d..ed2b47bea57 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 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.internal.TimerSchedulerCrossDslSupport import pekko.actor.typed.{ ActorRef, Behavior, Props } -import pekko.actor.{ ActorPath, Cancellable } +import pekko.actor.typed.internal.TimerSchedulerCrossDslSupport import pekko.annotation.InternalApi -import scala.concurrent.duration.FiniteDuration -import scala.reflect.ClassTag - /** * 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 4e7cd82f318..d0c2c538e37 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 06e4499665e..6019643c0db 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 cc2bce60207..e13541129c2 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 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.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 - /** * 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 45c193041c7..3e6c3d1ec07 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/javadsl/ActorTestKit.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKit.scala index 6b067707564..e88afeeebef 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,8 +15,6 @@ package org.apache.pekko.actor.testkit.typed.javadsl import java.time.Duration -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.DeadLetter import pekko.actor.Dropped @@ -32,6 +30,8 @@ import pekko.actor.typed.Scheduler import pekko.util.JavaDurationConverters._ 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 385b6549e2f..20909fc06b5 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,15 +13,16 @@ package org.apache.pekko.actor.testkit.typed.javadsl +import java.util.concurrent.ThreadLocalRandom + 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.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 -import java.util.concurrent.ThreadLocalRandom +import com.typesafe.config.Config object BehaviorTestKit { 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 ac3ae80e6e9..cb6558b013d 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 57028154c03..e8b670504fa 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 e4fd37c41eb..01586dc9837 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 63432d9e962..d8a7723722d 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 99d526c869f..164df797fa1 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 @@ -17,13 +17,13 @@ import java.time.Duration import scala.annotation.varargs -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.typed.ActorSystem import pekko.actor.typed.internal.adapter.SchedulerAdapter import pekko.util.JavaDurationConverters._ +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/TestKitJUnit5Extension.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala index 50d63af7609..9dc544b0b03 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 ad7e445b6bb..3c240c662f0 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 1d7bf621221..b93c6f321de 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 ffad923a50d..2d1fb7be35f 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 a9f6b1afe57..357f3c5f7bc 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 a69b05778b6..9dd5efe8215 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,17 +13,19 @@ package org.apache.pekko.actor.testkit.typed.scaladsl +import java.util.concurrent.ThreadLocalRandom + +import scala.collection.immutable +import scala.reflect.ClassTag + 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.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 -import java.util.concurrent.ThreadLocalRandom -import scala.collection.immutable -import scala.reflect.ClassTag +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 9241c9fdcb4..334fceb7143 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 26c2ed13da6..23d238c0b6e 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 2499cb683e8..7074941447d 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 ee244dff23e..cfa2a492489 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 c3cdc0eb79b..5061ca4fe5a 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 f41be488a81..d5497952b1e 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.{ CapturedLogEvent, Effect } 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.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 15bc751dad4..46b6e8ba692 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 d695dff73b8..45cf33530e8 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,10 +13,11 @@ package org.apache.pekko.actor.testkit.typed.scaladsl +import org.apache.pekko.actor.testkit.typed.LoggingEvent + import org.scalatest.wordspec.AnyWordSpecLike -import org.slf4j.event.Level -import org.apache.pekko.actor.testkit.typed.LoggingEvent +import org.slf4j.event.Level class LoggingTestKitSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { 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 10ea14dc4cb..cbfa24cf41e 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,10 +17,11 @@ import java.util.concurrent.atomic.AtomicInteger import scala.concurrent.Future +import org.apache.pekko.actor.testkit.typed.TestException + import org.scalatest.wordspec.AnyWordSpecLike -import org.slf4j.LoggerFactory -import org.apache.pekko.actor.testkit.typed.TestException +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 c74509c757b..4935d54a15e 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 591b9e168ba..98f7f213d79 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 1d4ca6db941..550f34ef907 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 583f9118775..406730c2331 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 3050d70db5d..2c8266c6fa9 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 79439d1cb44..8a0ec42f9a9 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 6bcd2a1c44e..cf47b35b544 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 d09e9221913..606e6f22f16 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 24f4bd18c81..9ae6d2480ea 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 99222249ff8..2d49a608d17 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 82620268eb0..26593792f04 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 0e9f7e29f76..8b51fe9e2ed 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 f179d807d3b..bcc8c37e7fb 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 25526c80b5b..c31c81c294a 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 d2d75544212..f2ec94d4638 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,27 +13,29 @@ 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.dispatch.ExecutionContexts -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 22a777057bf..3d6b03945a5 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 2b05e6199c9..a05548c8835 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 835f277f3ea..60b15f3d173 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 1a49950f885..511823bb4c5 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 a5b6ca78ec4..bfaee05f3da 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 e04ebdaa4e2..649522cae21 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 11ddaf7acd9..c897f26df19 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 58767473856..b0fe725657f 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 745094fee6e..efc3b8d9f56 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 3fd012f5548..891a5f29959 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 f9e30481f96..9d6cc95a15e 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 edbee054938..8e7daa5ce74 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 e115f4a10bf..d46996ef49f 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 9df4e76f159..ee97967c382 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 faf1968b0ab..0a293532103 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 102e01448f3..b77db2a800f 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 f505b3a3ef8..8d8407c6be4 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 46ad5c8d36f..1466d4fcfa0 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 ac1b443b325..716452157e3 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 b4dbcd31ef4..ce79405f8cc 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 90cc700fdbd..264ff45ee6a 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 465f4041e88..2e00f0195bf 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 bce7b584fa8..4816990c5d7 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 d9e26a4d86f..223cf259aba 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 088446bcc9e..765a1ecdf15 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 740afaea675..ebcdd0f501d 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,13 +16,13 @@ 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.dispatch.internal.SameThreadExecutionContext 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 9289409e4a8..943b28fd914 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 ce93d925689..bdffc760fb4 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 ac19fb1c182..476135829e8 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 409027a5e9c..6cb61dd31b9 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 d89e8af6d77..287e7f5fdb7 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 @@ -16,15 +16,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 org.apache.pekko import pekko.actor._ import pekko.testkit._ import pekko.util.ccompat.JavaConverters._ +import org.scalatest.BeforeAndAfterAll +import org.scalatest.wordspec.AnyWordSpec + +import com.typesafe.config.ConfigFactory + object LoggingReceiveSpec { class TestLogActor extends Actor { override val supervisorStrategy = 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 e1a478c3865..4360018f415 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 1c654892143..abf3f1608fe 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 499b8ed0218..f7e3b857fe1 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/UdpConnectedIntegrationSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/io/UdpConnectedIntegrationSpec.scala index 18ea067e9c9..d509c559582 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 e716d329f19..957b7828e8f 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 1f7e658b580..0aed5bc0aa5 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 74509863c57..c658106a23f 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 066f27fb395..38ecff57396 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 @@ -17,19 +17,21 @@ import scala.concurrent.duration._ 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 pekko.util.ccompat.JavaConverters._ +import org.scalatest.concurrent.Eventually + +import com.typesafe.config.Config + abstract class DockerBindDnsService(config: Config) extends PekkoSpec(config) with Eventually { val dockerConfig: DockerClientConfig = DefaultDockerClientConfig 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 2c504f6bca8..51b51d88eb0 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 11c4910de9a..8c8e9bb4de3 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 18b10d4843b..cffbd246ab3 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 e79024c34d1..b34e001f1c0 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 f17bff441b2..f25635be664 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 6e9ab97419c..1ae76002e2f 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 72f3691d586..b64e0a9e59e 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 2123862d05c..b74d5442dae 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 e18148d849c..04111fee200 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 26b78b37a9f..bc7168876cb 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 cc0cffb91c0..364dc8529d5 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 8049e3d60da..518f233e9ad 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 cbd6b97c898..d12addc3197 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 1e7a4ab77b4..198b7144cf1 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 eed7e6bb81f..90ca2eaec17 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 5f503528cd9..14f7bd46d89 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 baebb5a8fa6..0fdbdd44d56 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 9b8aac0896f..0b4a59bd79a 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 cb379ee8541..88e55170336 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 720c84e2675..ef189a231c4 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 1302cae07a7..c6c3a4e16cf 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 @@ -22,6 +22,12 @@ import scala.concurrent.{ Await, ExecutionContext, ExecutionContextExecutor, Fut import scala.util.control.Exception import org.scalactic.source.Position + +import org.apache.pekko +import pekko.testkit.TimingTest +import pekko.util.DefaultExecutionContext._ +import pekko.util.ccompat.JavaConverters._ + 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 pekko.util.ccompat.JavaConverters._ - 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 29e430362a4..56fc8ca7e50 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 8dcdf626efd..a463030c2bc 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 3398c6b5409..b3dbe1837b5 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 942042feb8d..1e6b112884d 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 741782e66b3..d08c3d6c904 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 fa3404c3933..1fdafb5de24 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 0e7eb071537..0e4766f91d8 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/Scala212CompatTest.scala b/actor-tests/src/test/scala/org/apache/pekko/util/Scala212CompatTest.scala index 2380197b225..bb9b3f18e45 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/util/Scala212CompatTest.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/util/Scala212CompatTest.scala @@ -17,12 +17,13 @@ package org.apache.pekko.util -import org.apache.pekko -import pekko.util.OptionConverters._ - import java.util._ + import scala.annotation.nowarn +import org.apache.pekko +import pekko.util.OptionConverters._ + /** * These tests are here to ensure that methods from [[org.apache.pekko.util.FutureConverters]], [[org.apache.pekko.util.OptionConverters]] * and [[org.apache.pekko.util.FunctionConverters]] that used within Pekko ecosystem but not Pekko core properly cross compile on Scala 2.12 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 ebfe64e5fdc..99aaa560ddb 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 bd7f7203be3..2fec6495762 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 8f53e102678..bda008a2869 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 ae1376300a5..3e4771bfe68 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 fb2dbade399..55653d218e5 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 cfd411d59ba..2cab64f2d8e 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 0a6b650dd08..a03dee28414 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 03980e4ed36..9f9cba1715f 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 ac714959807..6600bdf3f2e 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 17bfa5d4ce2..8a6eff66fbc 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 3f786e36b81..208258315ef 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 dd8b9dc05c1..c2a05fd6c82 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 0787193474f..f8d865bc1b4 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 e90eab5909b..36a029a6345 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 70f37e565ff..53cd0297b64 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 3727268d9f3..ac46eef74bb 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 75a88c93514..bf14b2ee609 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 8732279f451..6038f3eb06b 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 9950127d5c3..76368df75fe 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,27 +19,29 @@ import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.atomic.AtomicInteger +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.LoggingTestKit 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 -import scala.concurrent.Future -import scala.concurrent.duration._ -import scala.util.Failure -import scala.util.Success -import scala.util.control.NoStackTrace +import org.slf4j.event.Level object SupervisionSpec { 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 6552d2ccd3e..4709337899e 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 056db0b9ca7..f47e8d69c92 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 290ba148c40..9999d868851 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 5bddfc6da73..ee29aaf85aa 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 3014042166d..f647146e773 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 4989bd0d7ef..5edfec293d2 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 7fa2245f66c..a442ddb2826 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 9c8a2047e88..9483a46c4ce 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 d637b7850b6..fee91853d70 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 617e27c9f1e..264e4e64eb4 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 e62de6ce8d8..77fb97e9ffb 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 99ec8e49c93..0aa75315c18 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 616f1878905..66f2d57cfd4 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 fd565d095f1..0164d68c66f 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 0510b66b366..f028d454142 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 1a29952d87e..bf384c439d7 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 b47c81769f4..2bac08ea458 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 f47998052b8..922768cc5d9 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 c51891668c3..0ac9739d460 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 38a181640db..a7f603f8455 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.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 pekko.actor.testkit.typed.TestKitSettings +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 417e8bc6e23..659fe51e1c2 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 d463f23c44c..e0a2236d2a2 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 0409add0214..16ba38012b2 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 c7ee0aa4924..3fde4ee16f8 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 2cc5111b54b..fd197c38ad1 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 93270fc1489..d59ea1cb5f5 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 08198f23dca..0d658409b21 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 42341dea040..b8e8ab731ed 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 28aa1d6354a..7c5a2391322 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 1282f63caa1..29b21b396c1 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 769855a14c1..b8c7d9792df 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 f13ddd45f1b..8f79e5ff230 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 a9cc64e1e54..2a8aa0c1aaa 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 62dcd12c5e4..9f8160647a7 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 dcbce750953..d3ad36b3c87 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 4bea708d6a9..b4775e4f1bf 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 0f9b6a42c7b..32f549bc5b1 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 a45a03e875f..d05d42e02e4 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 570c77491b2..6c81d4178a1 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 45545ebc12e..9553e94f639 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 a332ccf4a64..40f867d5c7c 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 9841a09ab6b..05e4a597a15 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 cfe803dd039..496e4d1f5e1 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 ef73035499c..770f1d71640 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 0118fd2aacd..8bc0fbb73c7 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 a2a14118ede..294ea4d081f 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 d60d91077ee..4610e563c0e 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 0534e8d7452..b9c0db1d1a7 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/SupervisorStrategy.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/SupervisorStrategy.scala index 8cd65236e6d..e91894580c9 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 @@ -16,13 +16,13 @@ package org.apache.pekko.actor.typed import scala.concurrent.duration.Duration import scala.concurrent.duration.FiniteDuration -import org.slf4j.event.Level - import org.apache.pekko import pekko.annotation.DoNotInherit import pekko.annotation.InternalApi import pekko.util.JavaDurationConverters._ +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 3ff6e20801b..6f5be03d5ba 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 @@ -17,8 +17,6 @@ import java.time.{ Duration => JavaDuration } import scala.concurrent.duration._ -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.DeadLetterSuppression import pekko.actor.typed.ActorRef @@ -35,6 +33,8 @@ import pekko.annotation.DoNotInherit import pekko.annotation.InternalApi import pekko.util.JavaDurationConverters._ +import com.typesafe.config.Config + /** * `ConsumerController` and [[ProducerController]] or [[WorkPullingProducerController]] are used * together. See the descriptions in those classes or the Pekko reference documentation for 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 65e525d0a1f..0843fd52301 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 @@ -19,8 +19,6 @@ import java.util.Optional import scala.concurrent.duration._ import scala.reflect.ClassTag -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.actor.typed.ActorSystem @@ -30,11 +28,13 @@ 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 pekko.util.Helpers.toRootLowerCase import pekko.util.JavaDurationConverters._ import pekko.util.OptionConverters._ +import com.typesafe.config.Config + /** * Point-to-point reliable delivery between a single producer actor sending messages and a single consumer * actor receiving the messages. Used together with [[ConsumerController]]. 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 bbe094f3c21..4f2247edc3e 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 @@ -18,8 +18,6 @@ import java.util.Optional import scala.concurrent.duration.FiniteDuration import scala.reflect.ClassTag -import com.typesafe.config.Config - import org.apache.pekko import pekko.Done import pekko.actor.typed.ActorRef @@ -32,6 +30,8 @@ import pekko.annotation.ApiMayChange import pekko.util.JavaDurationConverters._ import pekko.util.OptionConverters._ +import com.typesafe.config.Config + /** * Work pulling is a pattern where several worker actors pull tasks in their own pace from * a shared work manager instead of that the manager pushes work to the workers blindly 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 9b39cfd1b9d..2772dfb339a 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 ec875b6d2d9..09295652a43 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,12 +18,14 @@ import java.time.Duration import java.util.ArrayList import java.util.Optional import java.util.concurrent.CompletionStage + +import scala.annotation.{ nowarn, switch } import scala.concurrent.{ ExecutionContextExecutor, Future } import scala.reflect.ClassTag +import scala.util.Failure +import scala.util.Success import scala.util.Try -import scala.annotation.{ nowarn, switch } -import org.slf4j.Logger -import org.slf4j.LoggerFactory + import org.apache.pekko import pekko.actor.Address import pekko.actor.typed.internal.adapter.ActorSystemAdapter @@ -35,8 +37,8 @@ import pekko.util.JavaDurationConverters._ 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 a89855cb0f7..0b9b68cff85 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 20485d885f2..7fa5c7c83d1 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/InterceptorImpl.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/InterceptorImpl.scala index 0763b224873..4838105e3c2 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 029c924962c..d94480e0dd8 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 bbc4366cb26..56e0ca8d573 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 b9b09d76052..aaa60f836d8 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.duration.FiniteDuration + import org.apache.pekko import pekko.actor.{ Cancellable, NotInfluenceReceiveTimeout } import pekko.actor.typed.scaladsl.{ ActorContext, LoggerOps } import pekko.annotation.InternalApi import pekko.dispatch.ExecutionContexts 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 cf7b371e243..5f1ea08f53d 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 039da8f7be1..b1c11ae5c7c 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 @@ -17,8 +17,6 @@ import java.util.concurrent.CompletionStage import scala.concurrent.ExecutionContextExecutor -import org.slf4j.{ Logger, LoggerFactory } - import org.apache.pekko import pekko.{ actor => classic } import pekko.Done @@ -44,6 +42,8 @@ import pekko.actor.typed.scaladsl.Behaviors import pekko.annotation.InternalApi import pekko.util.FutureConverters._ +import org.slf4j.{ Logger, LoggerFactory } + /** * INTERNAL API. Lightweight wrapper for presenting a classic ActorSystem to a Behavior (via the context). * Therefore it does not have a lot of vals, only the whenTerminated Future is cached after 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 8789052ad62..a8c016fde50 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 7dab2e674f8..dac41e86be1 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/ReceiveBuilder.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/ReceiveBuilder.scala index ec60a85f74d..1b72e8cab4a 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 d7367220c70..0bdbf7e3f04 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 f63d7d5c17c..1ddf7f4b815 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/scaladsl/ActorContext.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/ActorContext.scala index b8448cc2a75..4e7a9d3328e 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 709d7a730ff..c1e5993a379 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 93c71616c78..b0e8927c1e8 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,6 +15,7 @@ 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.internal._ 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 f121810e2eb..95e4e4ea00d 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 412ae84c099..ae56c30df06 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 5db8d7e45cd..277960a4b50 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-2.13/org/apache/pekko/util/FutureConverters.scala b/actor/src/main/scala-2.13/org/apache/pekko/util/FutureConverters.scala index 9a8a19829f6..903d8de1481 100644 --- a/actor/src/main/scala-2.13/org/apache/pekko/util/FutureConverters.scala +++ b/actor/src/main/scala-2.13/org/apache/pekko/util/FutureConverters.scala @@ -17,11 +17,12 @@ package org.apache.pekko.util -import org.apache.pekko.annotation.InternalStableApi - import java.util.concurrent.CompletionStage + import scala.concurrent.Future +import org.apache.pekko.annotation.InternalStableApi + /** * INTERNAL API * diff --git a/actor/src/main/scala-2.13/org/apache/pekko/util/OptionConverters.scala b/actor/src/main/scala-2.13/org/apache/pekko/util/OptionConverters.scala index 97eab8a0da5..d23c8279d13 100644 --- a/actor/src/main/scala-2.13/org/apache/pekko/util/OptionConverters.scala +++ b/actor/src/main/scala-2.13/org/apache/pekko/util/OptionConverters.scala @@ -17,11 +17,12 @@ package org.apache.pekko.util -import org.apache.pekko.annotation.InternalStableApi - import java.util._ + import scala.jdk.OptionShape +import org.apache.pekko.annotation.InternalStableApi + /** * INTERNAL API * diff --git a/actor/src/main/scala-3/org/apache/pekko/util/FutureConverters.scala b/actor/src/main/scala-3/org/apache/pekko/util/FutureConverters.scala index 45abd4a6fe7..2f14d27b0a6 100644 --- a/actor/src/main/scala-3/org/apache/pekko/util/FutureConverters.scala +++ b/actor/src/main/scala-3/org/apache/pekko/util/FutureConverters.scala @@ -9,11 +9,12 @@ package org.apache.pekko.util -import org.apache.pekko.annotation.InternalStableApi - import java.util.concurrent.CompletionStage + import scala.concurrent.Future +import org.apache.pekko.annotation.InternalStableApi + /** * INTERNAL API * diff --git a/actor/src/main/scala-3/org/apache/pekko/util/OptionConverters.scala b/actor/src/main/scala-3/org/apache/pekko/util/OptionConverters.scala index eb977d25187..8cc108c58ea 100644 --- a/actor/src/main/scala-3/org/apache/pekko/util/OptionConverters.scala +++ b/actor/src/main/scala-3/org/apache/pekko/util/OptionConverters.scala @@ -9,11 +9,12 @@ package org.apache.pekko.util -import org.apache.pekko.annotation.InternalStableApi - import java.util._ + import scala.jdk.OptionShape +import org.apache.pekko.annotation.InternalStableApi + /** * INTERNAL API * 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 ae3e9559820..4fa0d2dbe1b 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 f2509559c52..4a2c3a06fef 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/ActorPath.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/ActorPath.scala @@ -15,11 +15,10 @@ 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 org.apache.pekko import pekko.util.ccompat.JavaConverters._ 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 e20602b447b..354c38ce308 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/ActorSelection.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/ActorSelection.scala @@ -16,6 +16,7 @@ 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.Future @@ -24,8 +25,6 @@ import scala.concurrent.duration._ import scala.language.implicitConversions import scala.util.Success -import scala.annotation.nowarn - import org.apache.pekko import pekko.dispatch.ExecutionContexts import pekko.pattern.ask 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 7a3d68e9a52..7e3e46b4dc7 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/ActorSystem.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/ActorSystem.scala @@ -26,8 +26,6 @@ import scala.concurrent.duration.Duration 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 @@ -41,10 +39,12 @@ import pekko.japi.Util.immutableSeq import pekko.serialization.SerializationExtension import pekko.util._ import pekko.util.FutureConverters._ -import pekko.util.OptionConverters._ import pekko.util.Helpers.toRootLowerCase +import pekko.util.OptionConverters._ import pekko.util.ccompat.JavaConverters._ +import com.typesafe.config.{ Config, ConfigFactory } + object BootstrapSetup { /** 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 088b212568c..245bbf428fc 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/CoordinatedShutdown.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/CoordinatedShutdown.scala @@ -26,18 +26,18 @@ import scala.concurrent.duration.FiniteDuration 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.dispatch.ExecutionContexts import pekko.event.Logging import pekko.pattern.after +import pekko.util.FutureConverters._ import pekko.util.OptionConverters._ import pekko.util.OptionVal -import pekko.util.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 c4e5c03a556..4cc7a76b8e2 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 5e400981ef9..eb62f5ff8ad 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/FaultHandling.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/FaultHandling.scala @@ -13,22 +13,23 @@ package org.apache.pekko.actor -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 pekko.util.JavaDurationConverters._ - -import java.lang.reflect.InvocationTargetException 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.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 pekko.util.JavaDurationConverters._ + /** * 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 48dad83575d..0094a1d7aba 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 912ef5512cd..a818dc5d50b 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 96e821812d9..122cce4d336 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/dungeon/Children.scala b/actor/src/main/scala/org/apache/pekko/actor/dungeon/Children.scala index 89f5d9dfc60..8f9cdec6cf0 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 1d07d3d0be0..99ef72718d5 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/dispatch/BatchingExecutor.scala b/actor/src/main/scala/org/apache/pekko/dispatch/BatchingExecutor.scala index 6b2ccea8211..d0f0ec0fa1f 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 7479aba61c8..85b9afb36d1 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 96b82f9a5c5..951cd75d21b 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 00597f62f24..8608d9efa27 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 15aef6536b6..7aa1aeabdd8 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 e2b0e979591..8114dd3cdaf 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 66fd12eb5e9..5522ec4bee8 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 de6c1377f44..093c5645f13 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 0396aad36eb..6b3532ba993 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 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 +import org.apache.pekko +import pekko.annotation.InternalApi +import pekko.util.JavaVersion + @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 cefd5ab063a..5a6a80a38d1 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 21644fe05e0..35d10b36ca0 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 d8dbcc5c95d..e9f85a8f560 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 9c380d3c6fa..b99b73f12d2 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 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 c112540bcc1..1915c1e58dd 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 7e74dbfd7e1..f6102e28324 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 f6dfdd58331..db0bd4ace6c 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 f7692278b86..62a24818462 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 2e171972c9b..94ca9b1e68c 100644 --- a/actor/src/main/scala/org/apache/pekko/io/Tcp.scala +++ b/actor/src/main/scala/org/apache/pekko/io/Tcp.scala @@ -18,12 +18,10 @@ 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 org.apache.pekko import pekko.actor._ import pekko.annotation.InternalApi @@ -33,6 +31,8 @@ import pekko.util.Helpers.Requiring import pekko.util.JavaDurationConverters._ import pekko.util.ccompat.JavaConverters._ +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 7b66d5a9519..ae0c535a55e 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 21e96314c49..5adb59024ae 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 a137bf738db..ed2a17bca8a 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. * 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 e1912df49f8..bb8ec63afbb 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 6049a120a5d..bdc3d36fa62 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/DnsSettings.scala b/actor/src/main/scala/org/apache/pekko/io/dns/DnsSettings.scala index 6fe0e095eab..8526d4b2ee5 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 @@ -37,8 +37,6 @@ import scala.collection.immutable import scala.concurrent.duration.FiniteDuration import scala.util.{ Failure, Success, Try } -import com.typesafe.config.{ Config, ConfigValueType } - import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.annotation.InternalApi @@ -51,6 +49,8 @@ import pekko.util.Helpers.Requiring import pekko.util.JavaDurationConverters._ import pekko.util.ccompat.JavaConverters._ +import com.typesafe.config.{ Config, ConfigValueType } + /** INTERNAL API */ @InternalApi private[dns] final class DnsSettings(system: ExtendedActorSystem, c: Config) { 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 68856aa40b8..598d41dafa9 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 e016eba3146..28e904b508b 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 853980be88c..aced67214c9 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 07566dff922..07290c8d6af 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 1e176f898ad..a94f0d621cb 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/TcpDnsClient.scala b/actor/src/main/scala/org/apache/pekko/io/dns/internal/TcpDnsClient.scala index 07fa1ad9482..6d32da28c86 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 669e634800e..1a5c03ad40e 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/BackoffOptions.scala b/actor/src/main/scala/org/apache/pekko/pattern/BackoffOptions.scala index 56f7bcfc9a4..6892d1f4a44 100644 --- a/actor/src/main/scala/org/apache/pekko/pattern/BackoffOptions.scala +++ b/actor/src/main/scala/org/apache/pekko/pattern/BackoffOptions.scala @@ -13,14 +13,14 @@ package org.apache.pekko.pattern +import scala.concurrent.duration.{ Duration, FiniteDuration } + import org.apache.pekko import pekko.actor.{ ActorRef, OneForOneStrategy, Props, SupervisorStrategy } import pekko.annotation.{ DoNotInherit, InternalApi } import pekko.pattern.internal.{ BackoffOnRestartSupervisor, BackoffOnStopSupervisor } import pekko.util.JavaDurationConverters._ -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 f9e73f7b7a0..f18e37f5c0d 100644 --- a/actor/src/main/scala/org/apache/pekko/pattern/CircuitBreaker.scala +++ b/actor/src/main/scala/org/apache/pekko/pattern/CircuitBreaker.scala @@ -18,6 +18,7 @@ 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.TimeoutException @@ -25,12 +26,13 @@ import scala.concurrent.duration._ 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 pekko.annotation.InternalApi import pekko.dispatch.ExecutionContexts.parasitic import pekko.pattern.internal.{ CircuitBreakerNoopTelemetry, CircuitBreakerTelemetry } -import pekko.annotation.InternalApi import pekko.util.FutureConverters._ import pekko.util.JavaDurationConverters._ 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 ca4ba220453..201744fb913 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,9 @@ package org.apache.pekko.pattern import java.util.concurrent.ConcurrentHashMap + import scala.concurrent.duration.{ DurationLong, MILLISECONDS } + import org.apache.pekko import pekko.actor.{ ActorSystem, 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 de4dd2fab28..eeca4905597 100644 --- a/actor/src/main/scala/org/apache/pekko/pattern/Patterns.scala +++ b/actor/src/main/scala/org/apache/pekko/pattern/Patterns.scala @@ -16,6 +16,7 @@ package org.apache.pekko.pattern import java.util.Optional import java.util.concurrent.{ Callable, CompletionStage, TimeUnit } +import scala.annotation.nowarn import scala.concurrent.ExecutionContext import org.apache.pekko @@ -23,8 +24,6 @@ import pekko.actor.{ ActorSelection, ClassicActorSystemProvider, Scheduler } import pekko.util.FutureConverters._ import pekko.util.JavaDurationConverters._ -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 5582d360cda..0884b71f8ed 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 93c739d12b2..32dc57ff0dd 100644 --- a/actor/src/main/scala/org/apache/pekko/pattern/StatusReply.scala +++ b/actor/src/main/scala/org/apache/pekko/pattern/StatusReply.scala @@ -18,6 +18,7 @@ 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 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 286c96177e5..f87a0e40d01 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 b1f61cbfe8a..b94496205af 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 c207a5c579b..f4d50b527f8 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 3967d264e3d..cf25ab7cc2d 100644 --- a/actor/src/main/scala/org/apache/pekko/routing/OptimalSizeExploringResizer.scala +++ b/actor/src/main/scala/org/apache/pekko/routing/OptimalSizeExploringResizer.scala @@ -20,13 +20,14 @@ import scala.collection.immutable import scala.concurrent.duration._ import OptimalSizeExploringResizer._ -import com.typesafe.config.Config import org.apache.pekko import pekko.actor._ import pekko.annotation.InternalApi import pekko.util.JavaDurationConverters._ +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 9da3b228d01..4603f095842 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 d055b59a4dc..0addb8c6d81 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 ddf279a69b7..df967371fd3 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 ec689d88c04..1332645f508 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 5a24ae78a0e..e27363ece09 100644 --- a/actor/src/main/scala/org/apache/pekko/routing/ScatterGatherFirstCompleted.scala +++ b/actor/src/main/scala/org/apache/pekko/routing/ScatterGatherFirstCompleted.scala @@ -20,8 +20,6 @@ import scala.concurrent.Future import scala.concurrent.Promise import scala.concurrent.duration.FiniteDuration -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ActorSystem @@ -35,6 +33,8 @@ import pekko.util.Helpers.ConfigOps import pekko.util.JavaDurationConverters._ 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 a549d66bd5a..60f50940e17 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 5343bdd1768..e6b6e7a187a 100644 --- a/actor/src/main/scala/org/apache/pekko/routing/TailChopping.scala +++ b/actor/src/main/scala/org/apache/pekko/routing/TailChopping.scala @@ -20,8 +20,6 @@ import scala.concurrent.{ ExecutionContext, Promise } import scala.concurrent.duration._ import scala.util.Random -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor._ import pekko.dispatch.Dispatchers @@ -31,6 +29,8 @@ import pekko.util.Helpers.ConfigOps import pekko.util.JavaDurationConverters._ 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 e76d6e5de23..0fa987236eb 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/util/ConstantFun.scala b/actor/src/main/scala/org/apache/pekko/util/ConstantFun.scala index cf5007f0908..0a686df677f 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 7ada6789a1c..bf2c79b22c1 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 f6718cd7ff3..9f66fc9e597 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 e54cf1a0b59..5351de7db74 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 681e150faec..a5ce72ea9cf 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 8b93060302d..1c7bc597584 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/ManifestInfo.scala b/actor/src/main/scala/org/apache/pekko/util/ManifestInfo.scala index b77b46bfade..1692c0c630b 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 9087349ba52..c7708d50e2e 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 c3fc143d013..0e5320720bc 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 d6348d83b22..8d3e9a74d50 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 b69f7ac504d..af04cf6a76e 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 c0b2d94d50f..4d3c3b7dfc0 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 d5c51a3e6c6..76c6c5d95c4 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 16ec75c1fe0..1d0d398c05b 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 2e48e72050f..86718f21f78 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 dba7df6c60d..7e293236350 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 683c6b90ede..ee477beb047 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 7cc04807799..722fcbf8dee 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 56049bc876d..1760a013e5d 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 f0b7854ee2d..b986a355ea0 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 0651949efb0..d8704548d70 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 9d8c898f6a2..f2e1569fc2f 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 0275cc49f51..bd2ea0261e7 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 b08ddbe34b5..bf80a0cf67e 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 e6980417c7e..a6fcf21457a 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 551d9ea6607..e129d0f5a18 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 a1cb3a85619..d60f1dafc17 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 9bf95b8350a..e1b904017e7 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 15ce77c23a9..6ad899dbbca 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 939cbad12c3..b4a3719d1f3 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 0b007953238..33e9c379ee7 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 4cc2113b64a..a6722c34244 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 f8c0d49d5d6..83723c9305c 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 5ab9a14c9f8..f689aa2095d 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 269b120dbec..5c05601f5ca 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 1b0dd9d0bd7..fd7425525f6 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 2f66fcd84ba..30724ab7751 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 390dfa3bca5..21f8f7e2ef7 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 88f59d606d6..3442b2a426c 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 40d25b51cc4..40be60fe91b 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 87d69bce58c..218751f5753 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 061c9759983..9c1dde4c6e8 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 af2467a588c..d8cd0c60f8a 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 c7dac617217..3dd27b0a6ca 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 a5dd5d39e07..a92b0defdd7 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 57f5bcc6a09..c5f5f576b24 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 785266d0bae..0150118bd21 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 2d6712cae47..a5ba07243c2 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 53fbd8f1906..91b59034054 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 8a713a5355e..fc926af6409 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 8c68d854f06..465769d7003 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 2f9d712f833..ec767454b78 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,10 @@ 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 org.apache.pekko import pekko.actor.{ Address, ExtendedActorSystem } import pekko.cluster.metrics._ 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 ec417fa8a88..f7a32b13965 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 41417bcd145..093a328a905 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 3a317f16917..347fb8ff4d4 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 2336a7dd4d2..329ef2944bb 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 3513f577fa9..4f04fc77ee8 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 d0ddc108ef3..e8cc7089790 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 42b512085cf..a08e4b5e9ce 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 a3adf58d24e..893bde2550c 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 9f3d37071e8..af0b6a61f80 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 07014b01fae..a9fb3028ee2 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/ClusterShardingSettings.scala b/cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/ClusterShardingSettings.scala index f9658c34d48..48a08691927 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 @@ -16,8 +16,6 @@ package org.apache.pekko.cluster.sharding.typed import scala.collection.immutable import scala.concurrent.duration._ -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.typed.ActorSystem import pekko.annotation.{ ApiMayChange, InternalApi } @@ -30,6 +28,8 @@ import pekko.coordination.lease.LeaseUsageSettings import pekko.japi.Util.immutableSeq import pekko.util.JavaDurationConverters._ +import com.typesafe.config.Config + object ClusterShardingSettings { /** Scala API: Creates new cluster sharding settings object */ 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 cf99fc3ce7d..b33032d7f1b 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,21 +13,21 @@ 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 java.util.{ Set => JSet } import scala.collection.immutable import scala.reflect.ClassTag -import pekko.util.ccompat.JavaConverters._ -import java.util.{ Set => JSet } +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 +import pekko.util.ccompat.JavaConverters._ object ReplicatedEntityProvider { 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 9a21c890793..7340770f78b 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 40f97680bbf..435fe1bcc04 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 @@ -17,13 +17,13 @@ import java.time.Duration import scala.concurrent.duration.FiniteDuration -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.typed.ActorSystem import pekko.annotation.InternalApi import pekko.util.JavaDurationConverters._ +import com.typesafe.config.Config + object ShardedDaemonProcessSettings { /** Scala API: Create default settings for system */ 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 1e58675bc00..ab29606f759 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 d0e22becd20..51f4d4092c7 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 @@ -18,8 +18,6 @@ import java.util.Optional import scala.concurrent.duration.FiniteDuration import scala.reflect.ClassTag -import com.typesafe.config.Config - import org.apache.pekko import pekko.Done import pekko.actor.typed.ActorRef @@ -35,6 +33,8 @@ import pekko.cluster.sharding.typed.delivery.internal.ShardingProducerController import pekko.util.JavaDurationConverters._ import pekko.util.OptionConverters._ +import com.typesafe.config.Config + /** * Reliable delivery between a producer actor sending messages to sharded consumer * actors receiving the messages. 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 0037bee6abd..60f1ea91f84 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 45ebce4fc6f..3221e2ea1e4 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,26 +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 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 pekko.util.ccompat.JavaConverters._ +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 9107e1eede0..f8fd3951eb6 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,11 @@ package org.apache.pekko.cluster.sharding.typed.internal -import java.util.function.IntFunction import java.util.Optional +import java.util.function.IntFunction 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/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 3d064b94d21..7fd5eff0924 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 06d4b36fbaf..752312b369d 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,7 @@ import java.time.Duration import java.util.concurrent.CompletionStage import scala.concurrent.Future + import org.apache.pekko import pekko.actor.ActorRefProvider import pekko.actor.typed.ActorRef 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 450a075e580..4af8646dad2 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,7 @@ import java.util.Optional import java.util.concurrent.CompletionStage import scala.annotation.nowarn + import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.actor.typed.ActorSystem 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 8389e1c5c39..4644666ca3e 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 ed1908bd7e0..b701597da99 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 d979a93fae6..d89b330ee51 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 50c9456c3ba..fdbb55e811b 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 28980233f58..7973f789545 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 565cdf6ea1a..22d544f1f6e 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 0a670b05aa3..95831d243ac 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 6556c807de3..af0fb05aa9e 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 2a744558a3f..0fa92bd494e 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 b2b8183ec75..9430c300a1c 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 b011d7ca7da..5187664168d 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 741106c1c0b..a722c65175b 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.time.Span 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 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 4d52cd50bb6..003a6d91907 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 42331cb7309..48bd8b5962c 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 1127e78a85b..d0365f2986d 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 6db786ec010..f8a7204a0fd 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 7f8cd731978..a44a4412e7c 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 b65a0a3a056..aa5eaf3497a 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 3848dfe6bda..37487af6502 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 c00cc208a73..e414ccd0322 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 89ee775e73c..cf58630c753 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 8ae65d4a5fb..e5adea23a0f 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/ClusterShardingHealthCheck.scala b/cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterShardingHealthCheck.scala index cf11c08ae2c..beba69fe555 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 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.JavaDurationConverters._ import pekko.util.Timeout -import pekko.annotation.InternalApi -import pekko.pattern.AskTimeoutException import pekko.util.ccompat.JavaConverters._ -import pekko.util.JavaDurationConverters._ -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 114b04350d4..18e521d8799 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,9 @@ package org.apache.pekko.cluster.sharding +import scala.collection.immutable +import scala.concurrent.duration._ + import org.apache.pekko import pekko.actor.ActorSystem import pekko.actor.NoSerializationVerificationNeeded @@ -23,10 +26,8 @@ import pekko.coordination.lease.LeaseUsageSettings import pekko.japi.Util.immutableSeq import pekko.util.Helpers.toRootLowerCase import pekko.util.JavaDurationConverters._ -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 767e7d69b61..208f2a7612c 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 9f52a161f70..4b4d5273a57 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 0db8722c516..c10947bb1a8 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 b94a7e2cfb7..055e11c6fbe 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,17 @@ package org.apache.pekko.cluster.sharding +import scala.annotation.nowarn import scala.collection.immutable 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,14 +32,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 pekko.cluster.sharding.internal.AbstractLeastShardAllocationStrategy +import pekko.cluster.sharding.internal.AbstractLeastShardAllocationStrategy.RegionEntry +import pekko.cluster.sharding.internal.EventSourcedRememberEntitiesCoordinatorStore.MigrationMarker import pekko.dispatch.ExecutionContexts import pekko.event.{ BusLogging, Logging } import pekko.pattern.{ pipe, AskTimeoutException } 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 217f48c5a7f..d1d558dbf52 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 bf2fb5a78b9..da509b69983 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 @@ -38,8 +38,8 @@ import pekko.cluster.sharding.ShardCoordinator import pekko.cluster.sharding.ShardRegion.ShardId import pekko.event.Logging import pekko.pattern.AskTimeoutException -import pekko.util.Timeout import pekko.util.JavaDurationConverters._ +import pekko.util.Timeout object ExternalShardAllocationStrategy { 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 29a1ece3658..433bbbd49ae 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 5d7c4475b9d..afcdaf6c3c4 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 f51df8aa4d5..e0573315063 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 495e7c696bf..59318768c89 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 f4519aea8de..1f93b890230 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 22069ddddeb..984b82f9709 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 57fbb189eb1..8403161e819 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 0a62af78d23..b7e084893f9 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 @@ -29,14 +29,14 @@ 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 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 4ea4860f742..2c30e0647ae 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 39ca53bb23c..395ec70356c 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 9bd9bba49fc..986ca2b9690 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 72bcf5bbaf0..2da7b6d4e70 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 7d1b954c4ba..6c19bb2c2b2 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 edc4d7649e4..b6d1e23ae03 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 ba7cb5cea56..5702b2cdd0f 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 c1bf753a370..67308ed37af 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 b86fb8c1258..651910cc89c 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 79d89177c47..7fb37f33baa 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 1614d401458..53d344a0d96 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 368214fec17..8d46a92911d 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 b8eff24c858..65e16bd4dc7 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 a8731aa3848..b939a1b4c93 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 571edb5f363..6413c822232 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 d180ab05388..fca967bbcb6 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 e49a149dd4a..2abb0202a54 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 8d50340cf9b..8b12b62fd8f 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 06cc32fb4a5..6333b70a1a9 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 ce188dd0ce6..56cf7aca0eb 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 749d75e56f6..7a56163758c 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 de1642d0a5f..659b8709746 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 43055355ff7..56fecd542ed 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 0858585d6e3..37463335bc3 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 a51b7ab3dac..7b1a09c9d61 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 263e9ff4be6..964b4cdf354 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 15cf865702c..d9c45886749 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 7010278bff3..d0f22bac41d 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 a72f964f4d7..68e398318ac 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 17635886999..44da6b3fa40 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 2c20e1cf3c7..abe10c610a0 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,16 +14,17 @@ 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, ActorSystem, Props } -import pekko.cluster.sharding.ShardRegion.CurrentRegions 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 } -import scala.concurrent.Await -import scala.concurrent.duration._ +import com.typesafe.config.{ Config, ConfigFactory } /** * Test migration from old persistent shard coordinator with remembered 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 3509d28a1f2..2163074c529 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 b98d21da6a0..9cf7d65077f 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 f4a07fc5b4c..336d666d3c9 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 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 45dbacf1511..f73a0e1a4ac 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 15435c26700..3f28df0261b 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 95a7df4296b..93fde80e903 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 57c751afc62..800d1ffcf90 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 4d0e0e89655..96684ff6b1a 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 1075cfae030..f51ff09da78 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 744c31e5d27..a1c02374490 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 1d67644938a..18921dcfb49 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 096ba2430b0..29590a1e8af 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 7080bc64063..a2e77c3a619 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 71ce5c00f3e..bc203bf094f 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 caf55ffd4b8..158fb21d854 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 d8d08803e5f..3b52bdb04e0 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 49dbd789b83..66164a3fec5 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 c9203a4049d..259bf8d8812 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 1842e8a590e..621f854b590 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 82a7122ef38..e4a01373958 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 56a52121226..f5d14742d2b 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 org.apache.pekko import pekko.japi.Util.immutableSeq import pekko.util.ccompat.JavaConverters._ -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 4950841a6b6..3ae69d08116 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 97dc6867d7e..63a70b65a24 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 5956af5c688..a8f7fae2059 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 @@ -19,8 +19,6 @@ import scala.collection.immutable import scala.collection.immutable.{ HashMap, HashSet } import scala.concurrent.duration._ -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.Actor import pekko.actor.ActorIdentity @@ -53,6 +51,8 @@ import pekko.routing.MurmurHash import pekko.util.MessageBuffer import pekko.util.ccompat.JavaConverters._ +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", since = "Akka 2.6.0") 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 608ba412586..661ff524244 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 865c573ad9c..eba6e6e56f2 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,10 @@ 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 org.apache.pekko import pekko.actor.{ Address, ExtendedActorSystem } import pekko.actor.ActorRef 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 62e86945ca8..d73f1f765e4 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 @@ -18,10 +18,10 @@ import scala.concurrent.Future import scala.concurrent.Promise import scala.concurrent.duration._ 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 @@ -50,6 +50,8 @@ import pekko.pattern.pipe import pekko.util.JavaDurationConverters._ 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 97db57c9bb3..9c973798e6e 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 7057f7df9d1..35de79f37e1 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 d5b1be40d84..3304caa81aa 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 6af92d89a7e..ccba3d8763e 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 599aed999ba..4c07ccdc12d 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 fa1b0846244..edebf5cc5aa 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 e2b58be7f7e..2c28cf8b672 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 c3bbb8754a1..db0bfd67606 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 1107bd90a98..386b88f984c 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 3740745cf19..580d36ce89e 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 8c624802b9e..f77bd3cc6b9 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 efcf08ad29b..b0e8a8dcbc4 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 08bc389b2fb..0969b573ea9 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 15a78fa9136..9ca8b6f2fd5 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 ac622507639..0b2806cd602 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 12d5561adc2..36fd0003279 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 8873fd5107f..c0eafdfa64e 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 75b3e971d93..82a19e606d3 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 8ddbe58759a..97da3bc9e07 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 ce10330e5fa..9e213c2a327 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 5ab67e494a2..2804d36c71a 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/javadsl/ReplicatorMessageAdapter.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorMessageAdapter.scala index d6cf1e39d7e..d777c9cae8f 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,11 +16,10 @@ package org.apache.pekko.cluster.ddata.typed.javadsl import java.time.Duration import java.util.function.{ Function => JFunction } +import scala.annotation.nowarn 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 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 4370d150877..4b2ca8ceeae 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 b3ef6aaf697..3098a03d435 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 @@ -15,8 +15,6 @@ package org.apache.pekko.cluster.ddata.typed.scaladsl import scala.concurrent.duration.FiniteDuration -import org.slf4j.LoggerFactory - import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.actor.typed.{ ActorRef, ActorSystem, Extension, ExtensionId, Props } @@ -30,6 +28,8 @@ import pekko.cluster.ddata.ReplicatedData import pekko.cluster.ddata.SelfUniqueAddress import pekko.util.JavaDurationConverters._ +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 aa0449d9db0..6931ce3ff50 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 c8ad70ce8b8..4e5f6f6e292 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 @@ -26,6 +26,7 @@ import pekko.cluster.singleton.{ import pekko.cluster.typed.internal.AdaptedClusterSingletonImpl import pekko.coordination.lease.LeaseUsageSettings import pekko.util.JavaDurationConverters._ + 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 a5069214387..e0eefc354cb 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 02eee4050a0..1344f0b8c26 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,7 @@ package org.apache.pekko.cluster.typed.internal.delivery import java.io.NotSerializableException + import org.apache.pekko import pekko.actor.typed.ActorRefResolver import pekko.actor.typed.delivery.ConsumerController @@ -25,14 +26,14 @@ 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 pekko.util.ccompat.JavaConverters._ -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 9c0aae89068..e2475e1f5d6 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 76a8231a7d0..b0f41a38a75 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 a1e080680b9..4567555a23a 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 4c0c3c2ffea..4637f1fe950 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 57b2f7b5fbd..d65f925e889 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 ececf0dd45a..d3459fdebe7 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 b48972186df..3ea3eb1401b 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 f43c4002b48..2bdf781b536 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 aca789802bb..72df6731f58 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 bd97dd7bdfb..ae5e9d66dab 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 f32d43e194c..be00ec61982 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 619fbfaebe4..1fa3167452a 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 240830526e2..4da500475b6 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 11e60b17d0f..d094c6ee280 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 09b4451029c..be93a5e84e1 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 449489f2c52..9c64b806181 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 9b1255d5726..f978b6e8bb7 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 ed0d7d8e3f4..b58083968a1 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 fb802f2b015..69d5205d695 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 8b53bcbbf77..9c16d3fb433 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 23b645c4f77..341f993f68a 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 03f1ab39523..15408b56ee6 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.GHExcludeAeronTest import pekko.testkit.LongRunningTest + import org.scalatest.concurrent.ScalaFutures +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -import pekko.testkit.GHExcludeAeronTest +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 843d72056b7..dd748193616 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 2acb1b4f444..99153e8790a 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 1884bfc4d98..63d746c51e6 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 4f04cb1f904..da0a73d8bd9 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/ClusterRemoteWatcher.scala b/cluster/src/main/scala/org/apache/pekko/cluster/ClusterRemoteWatcher.scala index 7e6696b3488..a5b5bc0d753 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 da0db6a54c5..cb3ffe03ab6 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/ClusterSettings.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/ClusterSettings.scala @@ -16,9 +16,6 @@ package org.apache.pekko.cluster import scala.collection.immutable import scala.concurrent.duration._ -import com.typesafe.config.Config -import com.typesafe.config.ConfigObject - import org.apache.pekko import pekko.actor.Address import pekko.actor.AddressFromURIString @@ -27,6 +24,9 @@ import pekko.util.Helpers.{ toRootLowerCase, ConfigOps, Requiring } import pekko.util.Version import pekko.util.ccompat.JavaConverters._ +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 553f4d5737f..8839402c8a3 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 1f5ff051da9..3c58ddbdbad 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 2946f2c1aa2..97f55b65ac2 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 1f303e784ca..c808d65684d 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/JoinConfigCompatChecker.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/JoinConfigCompatChecker.scala @@ -15,13 +15,13 @@ package org.apache.pekko.cluster import scala.collection.{ immutable => im } -import com.typesafe.config.{ Config, ConfigFactory, ConfigValue } - import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.annotation.{ DoNotInherit, InternalApi } import pekko.util.ccompat.JavaConverters._ +import com.typesafe.config.{ Config, ConfigFactory, ConfigValue } + abstract class JoinConfigCompatChecker { /** The configuration keys that are required for this checker */ 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 23219ba63ca..3f55d96e32c 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 8ae9181eafa..eb3cfd0b26c 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,11 @@ 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 org.apache.pekko import pekko.actor.{ Address, ExtendedActorSystem } import pekko.annotation.InternalApi @@ -33,6 +34,8 @@ import pekko.serialization._ import pekko.util.Version import pekko.util.ccompat.JavaConverters._ +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 023ffef05e6..8cdd51b049e 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,10 @@ 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 org.apache.pekko import pekko.actor._ import pekko.cluster.Cluster @@ -40,6 +40,9 @@ import pekko.routing.RoutingLogic import pekko.util.HashCode import pekko.util.ccompat.JavaConverters._ +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory + object ClusterRouterGroupSettings { @varargs 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 6269a6fa3a1..4de96915bf0 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 7c5f039583d..ce1e9f21d47 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 0cea354ffd0..fa988b28aa6 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 32f6f535141..695ee51342e 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 f72df20774a..c69e026b6aa 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 2cf93336438..a2193c1c9e5 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 4a25a476f6d..20209e6d269 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 e9060669b80..79aff6f0629 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 40e5c095840..9feb8341445 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 1ad6e5ba772..0e882f2bd9f 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 7ab6aa253ba..3a315c524d4 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 b9b4288ea19..3a27cbc54cb 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 55bcd1eba66..f3fe52a6b33 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 ee36e3bb53d..d4cc583baae 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 812d5f1bf17..5f24f4bf2f0 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 95cdf8c460f..3f051422b45 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 bec2420c205..717875de820 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 854efbecebe..73cccc0afb1 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 fcdcc7a5eb1..51f485ba9f2 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 ee83181da93..49f8f5ecefc 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 e2c84eb1215..9a57467f428 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 86312fcc28a..63fe5c12570 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 5d800bb6e64..3a61ef46433 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 ad20ee816ec..91f7328155d 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 a0316c44d6f..19042e401ab 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 7e99aa757e8..cb1da91ee8e 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 95c38aa013d..1eaa7c10e5e 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 a144f07eb90..223bc66a7a4 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 a8edcf9ae9d..353206fd5cd 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 be2416303ab..6b5c83c31d0 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 79613664ab1..061961a58f7 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 0ee7e4bbb0e..a3ef92b0407 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 6e0d89b5b91..e5066528f12 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 a9264b83844..f503a1f6059 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 c7e2be84ba4..3f5a54d24ed 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 5c19d769f92..cd910f0e9c1 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 734418c83e1..d2add1125cf 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 5450717b7d2..d4c89fa51af 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 70505f300fa..514a82ba750 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 3a75d77775f..8a83c680c5f 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 a7cbf70c9ab..8d2ea41cd9b 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 f5271a4c4c9..576ef28ea4b 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 @@ -18,8 +18,6 @@ import scala.concurrent.duration._ 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 } @@ -39,6 +37,8 @@ import pekko.stream.testkit.scaladsl.TestSink import pekko.testkit._ import pekko.util.JavaDurationConverters._ +import com.typesafe.config.ConfigFactory + object StreamRefSpec extends MultiNodeConfig { val first = role("first") val second = role("second") 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 0e9ad19534b..86baa5352f3 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 d818c87c722..635fb3a0074 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 62f170e2359..980985de8ed 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 81163068a91..eb5da1690ab 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 75c93abb0dc..f7935362380 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 506be433a31..a11f317de4b 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 a88e0b9f3be..347c629ae28 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 ed60042e03d..4f2e0dd1d2e 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 3080c4676ad..6933a74571c 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 f7db6ad718b..4bc82800cc7 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 9fcef4f41a8..0e99cecaa25 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 f566116f67b..6369e11f4dd 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 ef44ce59484..a06a205d2fb 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.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 -import pekko.cluster.MultiNodeClusterSpec -import pekko.coordination.lease.TestLease -import pekko.coordination.lease.TestLeaseExt +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 64e617155b7..e19c65361c4 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 397ab77a149..0d2b86f2e63 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 a94aa8d56fe..b86a4650a30 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 87c52511a98..ca3955727fa 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 b2cb1308d84..17dcca2b871 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.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec + import org.apache.pekko.actor.Address + import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec 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 936ed353580..d949181f791 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 a1c5bdb8967..2c392814884 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 8dd0cdf01e9..7f67537809e 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 2c501712297..b5903cf3149 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 04c1f4b0d4c..c756f458988 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 7b2fff218b7..415ab838321 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 3619fb2488f..7cb64b96ef6 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 26b5f65fb81..99f2385a663 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 4085d4a4788..7dd03d942c5 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 6bbb29969a1..85ebf1210ee 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 57f46129c1f..4f0f6e03433 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 dc2e4fc3335..5f7ae82cf37 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 d84c6467082..3c33283ec91 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 67e62ae1acb..1338df82ae6 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 3fdff1a557a..d141074590b 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 b66bf5f602d..767014f20d8 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 7c1d8829326..ca370cf6d7a 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 1047ce6fc83..578fafecc99 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 bbf97126516..fc74fc7dbdf 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 f8f096c3141..0bd65653b24 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 2162124da8e..dbff559c663 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 fc68d1564dd..398f0c6d6cc 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 7615de9585c..2e9f6952952 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 59283001e0d..1aa8cce1c4a 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 93a1c5344d7..360bfb3028b 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/TimeoutSettings.scala b/coordination/src/main/scala/org/apache/pekko/coordination/lease/TimeoutSettings.scala index fe21bb6a5dc..93350728f4e 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 @@ -15,10 +15,10 @@ package org.apache.pekko.coordination.lease import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigValueType } - import org.apache.pekko.util.JavaDurationConverters._ +import com.typesafe.config.{ Config, ConfigValueType } + object TimeoutSettings { def apply(config: Config): TimeoutSettings = { val heartBeatTimeout = config.getDuration("heartbeat-timeout").asScala 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 a43367d146e..d16301d9315 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 @@ -19,8 +19,6 @@ import java.util.concurrent.atomic.AtomicReference import scala.concurrent.Future import scala.concurrent.Promise -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.actor.ActorSystem import pekko.actor.ClassicActorSystemProvider @@ -33,6 +31,8 @@ import pekko.event.Logging import pekko.testkit.TestProbe import pekko.util.ccompat.JavaConverters._ +import com.typesafe.config.ConfigFactory + object TestLeaseExt extends ExtensionId[TestLeaseExt] with ExtensionIdProvider { override def get(system: ActorSystem): TestLeaseExt = super.get(system) override def get(system: ClassicActorSystemProvider): 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 ee2497cf9b3..bce9eccef3a 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 469ad33673b..2114e39a880 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/aggregate/AggregateServiceDiscovery.scala b/discovery/src/main/scala/org/apache/pekko/discovery/aggregate/AggregateServiceDiscovery.scala index d6d293a9a3c..058ced0d3eb 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 @@ -17,8 +17,6 @@ import scala.concurrent.Future import scala.concurrent.duration.FiniteDuration import scala.util.control.NonFatal -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.annotation.InternalApi @@ -30,6 +28,8 @@ import pekko.event.Logging import pekko.util.Helpers.Requiring import pekko.util.ccompat.JavaConverters._ +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 b4ccd90c307..effd8903c57 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 @@ -16,8 +16,6 @@ package org.apache.pekko.discovery.config import scala.concurrent.Future import scala.concurrent.duration.FiniteDuration -import com.typesafe.config.{ Config, ConfigUtil } - import org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.annotation.InternalApi @@ -26,6 +24,8 @@ import pekko.discovery.ServiceDiscovery.{ Resolved, ResolvedTarget } import pekko.event.Logging import pekko.util.ccompat.JavaConverters._ +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 1e0224248bb..7cedaf46bf9 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 c89928d8852..00fd779b7ea 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 5b2a4184445..226e75486d4 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,17 @@ package org.apache.pekko.discovery.config import scala.collection.immutable import scala.concurrent.duration._ -import com.typesafe.config.{ Config, ConfigFactory } +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 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 e21a5a02c35..9a32594fdf3 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 01e82576584..73a9115c27f 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 43196a5eaa0..d5a1c0e2159 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 efced43cdf5..d9d636135f6 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 @@ -21,7 +21,6 @@ import scala.concurrent.duration._ 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 @@ -45,6 +44,8 @@ import pekko.util.ByteString import pekko.util.OptionVal import pekko.util.ccompat.JavaConverters._ +import com.typesafe.config.Config + /** * An actor implementing the durable store for the Distributed Data `Replicator` * has to implement the protocol with the messages defined here. 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 df9a774291c..8a6f80a6be1 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,6 +19,7 @@ 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 @@ -31,9 +32,6 @@ 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 @@ -70,6 +68,8 @@ import pekko.util.ByteString import pekko.util.Helpers.toRootLowerCase import pekko.util.JavaDurationConverters._ +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 3c62b7fe071..bc9712bb8d6 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,11 @@ 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 org.apache.pekko import pekko.actor.ActorRef import pekko.actor.ExtendedActorSystem 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 20172b1f26b..f10e1e68a05 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,13 @@ 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 org.apache.pekko import pekko.actor.Address import pekko.actor.ExtendedActorSystem 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 421b6a65e08..6a4ec1da3ff 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,10 @@ 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 org.apache.pekko import pekko.actor.ActorRef import pekko.actor.Address 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 1bde6f2d8d6..a06e7a22dbe 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 9ceb5966320..7e66be81425 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 6674c52df25..3d3e55bdd79 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 8dd2c4d2ec2..b36bc121343 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 c59c755d666..cc0187e67a9 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 6d076cbfd28..fa8923857ff 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 a2a9bf4d96b..eaae981aced 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 993a4f181e2..061c5a4f3a5 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 638feb968d2..2ad05a63d41 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 a9445e04d83..477ce85b431 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 47cd9177c65..7e0e52a1913 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 e1c4ce0aca1..cac02ef8bee 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 e58535c0119..7879ee501c5 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 f0f8a74525d..c3afff16617 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 639d1b1c4bb..1b0f3ba04f4 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 5042544890a..398dcb76ad1 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 af8675ddfed..da1fc197c21 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 e9ec2691df8..7e5fc41eb75 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 165788c8e97..d75e4377f98 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 ceb966f5455..3f7d66abe76 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 723e5ed9143..7e5bb5b0298 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 cb280c203a3..152840c726b 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 db0aa3fd337..e8c8b343b6f 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 feed93496f2..d56f02db717 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 d0961e70e3a..57ad7fde6a4 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 6bcb2de347c..f46ddd3e3ca 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 87e64098864..be3b714d5d1 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 e183e38b221..17b02d371f2 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 ad1e871d45e..c8c726979ca 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 66116ed1939..481b199a0db 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 c1a0212e0dc..bdc84a55e13 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/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 92e7e2ea672..303e09b8c9f 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 65edfc11052..ae2d0a38adf 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 cf64170b2e3..9fead03ea59 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 148bd8f9536..443f3609e48 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 db5fc700667..ae9504934bd 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 c344647c652..b7069fd8e0c 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 12536c0326d..fbcbe7fd36d 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/OsgiActorSystemFactory.scala b/osgi/src/main/scala/org/apache/pekko/osgi/OsgiActorSystemFactory.scala index 5b5c319e876..ec2ac267f1d 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 2b73242f16f..9ea5d3f924b 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 970a238de7d..4ecc7decb1a 100644 --- a/osgi/src/test/scala/org/apache/pekko/osgi/PojoSRTestSupport.scala +++ b/osgi/src/test/scala/org/apache/pekko/osgi/PojoSRTestSupport.scala @@ -26,10 +26,11 @@ 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 org.apache.pekko.util.ccompat.JavaConverters._ +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 4218744884d..65a0a050dcd 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 02325bdd8a5..89ea9cca073 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 51b0ec2ccb0..f024f50aaf3 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 826840403cc..54a63f259a3 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/EventsByPersistenceIdStage.scala b/persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByPersistenceIdStage.scala index 2bc7f10ca60..cfd30c388df 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 5d514ae5752..32261327e9e 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 82bc6909804..b15a4aa6c4e 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 9d1651a4b4a..496f90cd025 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 13155bf65a5..aae8c84354d 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 0b7f3b6fe7c..778c85cef0e 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 d4f3a3913a4..44e3323ef23 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 f3c8a6783d4..be349b166e8 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 a4d29950b68..1489bc291f4 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 4c8e7d422c6..e05887c9289 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 c3fc0651e67..3364cfef336 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 149eaed5be4..7d891bf1efe 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 bbadb24f9d9..ae49b5dbfba 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 053c9ef28d2..3948c17222f 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 2cfd91b4e6b..dd93ac43819 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 1826a26699c..1ea0b4865cf 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 35a0c7b02db..de63e3326bd 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 5ba0d1c1e8d..fc1b45261a7 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 e72b540ccb7..67e468e20ce 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 dd6e216b317..9505e31f70f 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 ed95760fc34..72cc4202df4 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 fe6371b7303..67b5bce226a 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 9f985ee505e..464bb84d0b4 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 fc15db9d915..c2750e01ed8 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 6917d3b9758..ff2e35703f0 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 c3e2b96dece..b3559153dba 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 092656d3156..ba9b181492d 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,13 +13,13 @@ package org.apache.pekko.persistence.testkit -import org.apache.pekko -import pekko.NotUsed import java.util.{ List => JList } import scala.collection.immutable 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 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 b7cd867871b..ddedd36ba4b 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 1d7c0bc0215..ea11b131994 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 0a4d9b1ac26..438a9df6876 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 fb95f406361..654408a7ee8 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 3846ebd6492..d529e254f45 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 b185557139a..fa86080279e 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 ba36b054483..827edd4a53d 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 e42d3b68d7a..d3fb3ce652e 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,13 @@ 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.reflect.ClassTag -import com.typesafe.config.Config + import org.apache.pekko import pekko.actor.typed.ActorRef import pekko.actor.typed.ActorSystem @@ -28,7 +29,7 @@ import pekko.annotation.DoNotInherit import pekko.persistence.testkit.scaladsl import pekko.util.ccompat.JavaConverters._ -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/query/PersistenceTestKitReadJournalProvider.scala b/persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/PersistenceTestKitReadJournalProvider.scala index 74a12af037f..c64c315338f 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 24dc79811ed..b3c94efb783 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 f2ca34c6cb0..301e26433f1 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 92fb8f083e9..9060d13427d 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.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.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 com.typesafe.config.Config + import org.slf4j.LoggerFactory -import pekko.persistence.Persistence -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.query.internal.EventsBySliceStage -import scala.collection.immutable +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 4e73dff87df..65d1ef6bf93 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 51aff3d7576..d3f084cbe83 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 070f5d15159..f716becb5e3 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 ea95141fc66..5797162996c 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,10 @@ package org.apache.pekko.persistence.testkit.state.javadsl import java.util.Optional import java.util.concurrent.{ CompletableFuture, CompletionStage } + 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 } 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 2e72027a4fb..0ced17de1ec 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 7be70a96f35..c8824eac935 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 1743480c28f..3787ac0bf8a 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,8 +13,6 @@ package org.apache.pekko.persistence.testkit.javadsl -import org.scalatest.matchers.should.Matchers._ - import org.apache.pekko import pekko.actor.Props import pekko.actor.typed.javadsl.Adapter @@ -24,6 +22,8 @@ import pekko.persistence.testkit._ import pekko.testkit.EventFilter import pekko.util.ccompat.JavaConverters._ +import org.scalatest.matchers.should.Matchers._ + trait CommonSnapshotTests extends JavaDslUtils { final lazy val testKit = new SnapshotTestKit(system) 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 d3b1d27d5b4..d704431ebb6 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,8 +13,6 @@ package org.apache.pekko.persistence.testkit.javadsl -import org.scalatest.matchers.should.Matchers._ - import org.apache.pekko import pekko.actor.Props import pekko.actor.typed.javadsl.Adapter @@ -23,6 +21,8 @@ import pekko.persistence.testkit._ import pekko.testkit.EventFilter import pekko.util.ccompat.JavaConverters._ +import org.scalatest.matchers.should.Matchers._ + trait CommonTestKitTests extends JavaDslUtils { final lazy val testKit = new PersistenceTestKit(system) 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 4e2ed9f19ca..ab40bf9412f 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 bfcba39caf6..26ab4c83f99 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 bf2eb166f35..fefa91e6b08 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 9141a9acfff..18bbade2429 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 3eb63431c0c..7cb21233ffd 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 ea555f695cf..4fc9a47d44a 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 8b7703af3e1..e506abe1a37 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 716658a09ad..c6b8a8cfc88 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 98e38ebf4c8..5c8c4781bf5 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 fad11915280..455ae80c802 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 644df55d07f..3c5f18bcd39 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 faf69d35536..bc3b46a2521 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 87862657c2b..e503a510782 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 8e646e04ff3..bca952a8caf 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 e0150b6bfa0..70153f29949 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 e93826eee0a..7faab3f63c3 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 10c8a07ebc4..71702f92a6d 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 928ed902d43..50257807dbc 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 55a8fae5f43..02415370931 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 c918b016eed..5f06dc49908 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 b2e646a4613..2ef3da3f598 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 9b029f404e5..080666d8b68 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 688aa171a96..890964c1cfd 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 3adb76484cc..00f96346159 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 e9cf19b1778..c89d83d844b 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 bba7de2f3ec..45ca777021b 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 b97314721b1..ce996c1a07e 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 10a611d4cc4..a5429116a29 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 fe5e92221a6..a9e6eee6d22 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 db4d88f47cc..29a29b63695 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 d5176e5fd00..bb0421986c5 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 a03fb972842..e764d2805d5 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 16883b014d5..0f05cdf0164 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 158654a7d6f..1dee8d80f82 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 17250d4e737..9b8418f5593 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.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 0c8ec10a50c..d654265d70e 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 47262847532..73d0516e99b 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 88573dfc20f..35ec3a37b81 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 34f15089e65..0040ce65567 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 1231d252a03..8fa974ad6f3 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.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 4696f272a5e..d55d4e3305c 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 a52cfd98908..b4dd5ca5e7b 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 a8b181576fb..a5057e1411c 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 7f76ce277f5..3c3a30758fb 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 958128cb111..424c0b405ac 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 e152a2721d9..051197386fd 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 6773be9edc4..272ea65be05 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 603f84bc785..2437d59388f 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 b8c9b0cfad7..0a77d5f6464 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 ada975be5bb..dfbf1ed3e7e 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 ddbd3bfb526..2f8848f84d4 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 b396e4537f4..28f0c5b755f 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 1a61bc71ef3..b00b60c8fef 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 d8024102245..7bd7689a229 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 8640508621b..a2612e849de 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 8af725db33c..9973844dcd1 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 @@ -17,8 +17,6 @@ import java.time.{ Duration => JavaDuration } import scala.concurrent.duration._ -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.typed.ActorSystem import pekko.actor.typed.Behavior @@ -34,6 +32,8 @@ import pekko.persistence.typed.scaladsl.EventSourcedBehavior import pekko.persistence.typed.scaladsl.RetentionCriteria import pekko.util.JavaDurationConverters._ +import com.typesafe.config.Config + /** * [[pekko.actor.typed.delivery.DurableProducerQueue]] that can be used with [[pekko.actor.typed.delivery.ProducerController]] * for reliable delivery of messages. It is implemented with Event Sourcing and stores one 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 101c04e5898..54bc2043568 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 938fe5187b9..f3ed31a280c 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 6ab4dcf661f..cdc1e94bfef 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 304e3a0d2b0..5cfde884f30 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 8407bb4f5c7..955e2575a3d 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 cf94e9f480f..866a7e49bf2 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/Running.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala index 23d3cbc8b9b..2aff1b37ad0 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 d8a2ab99e2b..f79bbb24d6b 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/EventHandler.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventHandler.scala index 973682fd480..b2ed2e322b1 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 d342589d989..f6457ea21b9 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,6 @@ package org.apache.pekko.persistence.typed.javadsl import java.util.Collections import java.util.Optional -import com.typesafe.config.Config import org.apache.pekko import pekko.actor.typed import pekko.actor.typed.BackoffSupervisorStrategy @@ -30,6 +29,8 @@ import pekko.persistence.typed.internal._ import pekko.util.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/ReplicatedEventSourcing.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/ReplicatedEventSourcing.scala index 1adf34c10fd..7809d43b785 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,9 @@ 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 org.apache.pekko import pekko.annotation.DoNotInherit 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 03ba7714d1b..5563e8f084f 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 4b94d3b36ab..55464acb97c 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,13 @@ 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 org.apache.pekko import pekko.actor.ExtendedActorSystem import pekko.annotation.InternalApi @@ -24,19 +28,15 @@ 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 pekko.util.ccompat.JavaConverters._ -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 924f03e5f44..c74421ab208 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 b87589e68fb..89497c45db1 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 4d1d4727949..df66eaeb39f 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 c4449d6215b..a8b592ff3c5 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 657a82f5a72..67d5103f2d2 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 7aebd4422bc..bfe61836fca 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 17fd83947df..3cccde5bf62 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 998c0dbcdf8..b623f366329 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 e0209d6e3fc..90e0bae0a00 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 fde922f0857..fd93908bad7 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 fed313043f1..21c868594de 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 2886264f324..db73aa10d4e 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 70edc77aa06..c048cf1453a 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 165213a1595..404746b9b3b 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 02dca35216f..470f67a2804 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 221a2d537e9..802f255dd76 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 cc4de0f1a49..ca428d4c452 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 fcd3e6bcd2a..6eae8d0fd4f 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 c4f1e332c52..d8a903ab4e1 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 80b710a8ddf..3695d9692d1 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 909a09de51f..a7d76389648 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 69d9a0d432c..1bb7ca59d43 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 5547db73f53..32d8b72fa2a 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 eea04cff761..b20934245be 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 e9e04d08989..01d07e35138 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 46d5412398a..e125a96ca11 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 df69333fe9b..239999d84d8 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 f0af99c83dc..2d56b3aa9d1 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 @@ -30,6 +28,8 @@ import pekko.persistence.fsm.PersistentFSM.FSMState import pekko.persistence.serialization.Message import pekko.util.JavaDurationConverters +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 3fcae3717de..cf50f2d11ba 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 @@ -19,8 +19,8 @@ import scala.concurrent.duration.FiniteDuration 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 pekko.util.JavaDurationConverters._ 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 2ad060a6947..fcd96f2e759 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 3878ed869cf..3711e063034 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 ec0c5352d5d..4888a6f7897 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/leveldb/LeveldbJournal.scala b/persistence/src/main/scala/org/apache/pekko/persistence/journal/leveldb/LeveldbJournal.scala index 2021f111209..fbc36b3fff7 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 79fda7ff3c0..1247346d67c 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 @@ -21,7 +21,6 @@ import scala.concurrent.Future import scala.util._ import scala.util.control.NonFatal -import com.typesafe.config.{ Config, ConfigFactory, ConfigObject } import org.iq80.leveldb._ import org.apache.pekko @@ -32,6 +31,8 @@ import pekko.persistence.journal.WriteJournalBase import pekko.serialization.SerializationExtension import pekko.util.ccompat.JavaConverters._ +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 4d62c4d2d4f..3a5592205c1 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 07bd76c683b..8dc8bdfa2ae 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/local/LocalSnapshotStore.scala b/persistence/src/main/scala/org/apache/pekko/persistence/snapshot/local/LocalSnapshotStore.scala index ffd45cdb56b..f2aff5d56b0 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 7d8558e0c32..874a6ec7cc6 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/test/scala/org/apache/pekko/persistence/AtLeastOnceDeliveryFailureSpec.scala b/persistence/src/test/scala/org/apache/pekko/persistence/AtLeastOnceDeliveryFailureSpec.scala index 4471fe1db9a..72daa025648 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 0babafe0526..f1fc8bb47fe 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 100463f7fdf..1467ac1b304 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 dc5e2132dfc..91a351cf9b2 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 856c80a57aa..d8d70070d25 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 577a1a2b656..bbba51c7451 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 f75ce5fc286..1a80465b821 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 67c5f4437d3..d952cd59492 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 f09d5dd430b..1b580a14bc5 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 71f25e9554b..711037f6a50 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 a16934b678c..248c34a7d99 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 00ee94c3367..75d666bbd74 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 a6be948f2ba..c9b3936f27b 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 7515afc3acf..bf4a91f98b7 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 5bd3f60b296..7fa9b0e4939 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 f52fa18c210..b912761755f 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 0ee3f0cba7c..c2d27086705 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 a0faa633c01..c7c9efa58e5 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 174eea4d508..3807fcfb2fb 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 75d6fd1ddd8..6b2c46e3352 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 65f6529dd04..04d8c9d9fb8 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 952df9ed9c0..edc1e263a19 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 bab9ede5504..695e23e2213 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 6dc0d1502f0..ac018561b49 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 0d6dcd7a540..bac0b475a98 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 50d5a3db72f..342cfd79261 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 33b69666b02..02100d41e97 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 599d92e3600..fa862c6ee54 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 f6bdb7ea5b2..ae840a77f6a 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 7d72676f984..58beaf88b2e 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 8833f161155..1a5feec9d2b 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 5d1a4dcc4c7..1aea319afca 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 8b7c1b9262e..d68e6de9f67 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 73bea9484b7..a2e1642f523 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 c556ed8df62..b8bc7c0a8a9 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 a33b8f9e1aa..5dd4f9cf390 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 e08b6535dc7..843aed0d453 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 7d4fb84fc8b..0201060b9bf 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 ba383730ec6..b4b4af80020 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 c4d7cba6f2f..93dfc812739 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 77bd679993b..786bed49804 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 a272a1dedf8..2346910ab09 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 747e7c2ad37..e59b4083de5 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 ba0ac9c2e01..bf4be955827 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 0ee81052da7..5a788df1a47 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 dffea04a02a..4f1520d8b95 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 b6afb048485..8bcbc6464a6 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 1bc6643f610..814530cca36 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 2d812b721d6..d3615b5f2e7 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 768c7447f1a..ff6540eb67b 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 4ac3632387d..2864cef677f 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 1af66cfa3c4..9e78a90f3cb 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 c015ed19b6f..1e7e19ce4f8 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 bbd4f747984..55d187cfb5c 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 04a69451249..145672924e9 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 b38695b0f38..009871487b2 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 bfe1e69b972..54d8ab3c006 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 98fc82c8de1..acc2ca273ff 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 1b11dc204e1..4fb030145ff 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 eee8ef87db4..4f745e26a40 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 19fbe1bfd64..103e2cb6187 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 b610c708e9a..ddd88843260 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 ed2bd089017..18867c0cf1e 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 4d4440e6b48..e6c58bfa82f 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 15cf6bc8b38..51e4319c493 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 d9120ec4cb6..3b3facfce6b 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 b006f7844aa..d06aa856ef7 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 c6373019484..171a2d41168 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 6493c606faa..aed93af2b47 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 58fb687cfff..9d1245be07f 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 688c65fbe97..c6eefa3ee90 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/RemoteDeployer.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/RemoteDeployer.scala @@ -13,8 +13,6 @@ package org.apache.pekko.remote -import com.typesafe.config._ - import org.apache.pekko import pekko.ConfigurationException import pekko.actor._ @@ -23,6 +21,8 @@ import pekko.routing._ import pekko.routing.Pool import pekko.util.ccompat.JavaConverters._ +import com.typesafe.config._ + @SerialVersionUID(1L) final case class RemoteScope(node: Address) extends Scope { def withFallback(other: Scope): Scope = this 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 63f2545193d..529a8d3b40f 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 1d4e3e6c294..cf49f085496 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,6 +28,8 @@ import pekko.remote.artery.ArterySettings import pekko.util.Helpers.{ toRootLowerCase, ConfigOps, Requiring } import pekko.util.Timeout +import com.typesafe.config.Config + final class RemoteSettings(val config: Config) { import config._ 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 6c0b39eb08d..93da52c9da7 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 f283c1c6c7a..ac2088c92b5 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 51a7deae0f9..5d471a484e1 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 012483f3c98..17852b22cce 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 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 pekko.util.ccompat.JavaConverters._ -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 ae7b3a091e9..4d4aff0d50d 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 0d40b416cbd..b49f4897ce3 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 90f14f7c46e..e790ad59959 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 3ad099e3d8f..306ce5fbbdb 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 67610f6b224..210376b7fef 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/RemoteInstrument.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/RemoteInstrument.scala index f61940865e5..c0a3043468c 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/TestStage.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/TestStage.scala index a8829637d27..1d1b56d5a4e 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 eca77f416ea..3fd09f6d6d7 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 23d554ef124..2f26b27c65a 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 8a87688f025..78f9d1b7711 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 21b26105bad..09c0db8fb67 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 4b400ebba10..62f3064998c 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 cc9cc702116..411c0ee47a2 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 org.apache.pekko import pekko.annotation.InternalApi import pekko.util.ccompat.JavaConverters._ -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 b2c14d935e0..5edaf7e6e67 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 6cfa9583832..ae2a25440b8 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,10 +15,10 @@ package org.apache.pekko.remote.artery.tcp.ssl import java.security.cert.X509Certificate import java.util +import javax.naming.ldap.LdapName import org.apache.pekko import pekko.annotation.InternalApi -import javax.naming.ldap.LdapName import pekko.util.ccompat.JavaConverters._ /** 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 ddbc53a0e89..74746c23079 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,6 @@ package org.apache.pekko.remote.routing import java.util.concurrent.atomic.AtomicInteger import scala.annotation.nowarn -import com.typesafe.config.ConfigFactory import org.apache.pekko import pekko.actor.ActorCell @@ -36,6 +35,8 @@ import pekko.routing.RouterActor import pekko.routing.RouterConfig import pekko.util.ccompat.JavaConverters._ +import com.typesafe.config.ConfigFactory + /** * [[pekko.routing.RouterConfig]] implementation for remote deployment on defined * target nodes. Delegates other duties to the local [[pekko.routing.Pool]], 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 5fe8b53bd10..0bcd908e1f5 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 303f68ff523..ea8b588dc96 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,9 @@ package org.apache.pekko.remote.serialization import scala.collection.immutable -import com.typesafe.config.{ Config, ConfigFactory } import util.{ Failure, Success } + import org.apache.pekko import pekko.actor.{ Deploy, ExtendedActorSystem, NoScopeGiven, Props, Scope } import pekko.protobufv3.internal.ByteString @@ -27,6 +27,8 @@ import pekko.routing.{ NoRouter, RouterConfig } import pekko.serialization.{ BaseSerializer, SerializationExtension, SerializerWithStringManifest } import pekko.util.ccompat.JavaConverters._ +import com.typesafe.config.{ Config, ConfigFactory } + /** * Serializes Pekko's internal DaemonMsgCreate using protobuf * for the core structure of DaemonMsgCreate, Props and Deploy. 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 484f2af6ec0..8b862083ec7 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 70c6c925916..d9890c551ec 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,7 @@ import java.util.Optional import java.util.concurrent.TimeUnit import scala.concurrent.duration.{ FiniteDuration, TimeUnit } -import com.typesafe.config.{ Config, ConfigFactory, ConfigRenderOptions } + import org.apache.pekko import pekko.{ Done, NotUsed } import pekko.actor._ @@ -32,6 +32,8 @@ import pekko.routing._ import pekko.serialization.{ BaseSerializer, Serialization, SerializationExtension, SerializerWithStringManifest } import pekko.util.ccompat.JavaConverters._ +import com.typesafe.config.{ Config, ConfigFactory, ConfigRenderOptions } + class MiscMessageSerializer(val system: ExtendedActorSystem) extends SerializerWithStringManifest with BaseSerializer { // WARNING! This must lazy otherwise it will deadlock the ActorSystem creation 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 eadcafc96ee..3624ad172d8 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 a17da99b72d..3c4ebe889e4 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 c8420d6479b..a83381fad9e 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 168d80af033..cba06c4ccf6 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 2fd25082437..7321ec366ce 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 c6a044d1fbf..18282c00494 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,6 +16,7 @@ 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 } @@ -24,8 +25,6 @@ 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 } @@ -35,7 +34,6 @@ 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 d8635aed9fd..83f4570f6cd 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 421ce5e782c..262fb007d75 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 @@ -15,7 +15,6 @@ package org.apache.pekko.remote.transport.netty import scala.annotation.nowarn -import com.typesafe.config.Config import org.apache.pekko import pekko.util.ccompat.JavaConverters._ @@ -23,6 +22,8 @@ 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 4110daca3f3..d9a39c5f94a 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 f0a8e66267e..f9b1cdd1186 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 60494a661b9..ecc09f2e06c 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 eac1642be74..719dc291911 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/DaemonicSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/DaemonicSpec.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.{ ActorSystem, Address } import pekko.testkit._ import pekko.util.ccompat.JavaConverters._ +import com.typesafe.config.ConfigFactory + class DaemonicSpec extends PekkoSpec { "Remoting configured with daemonic = on" must { 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 462d7aebc19..476a28929c1 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 daff38b8379..d3486ea23db 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 99f4928bfec..c3f3ca8949b 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 9821e301720..85e25942870 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 44edd851189..d840b01709f 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 78a50a3ecaf..2c67cab2bc7 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 a5e457e1d6b..612e95e034d 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 8e045fd6bfd..84ff2206dcf 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 001906e21f7..7f9ef200855 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 1d2cb64d106..c7fe08ee8a3 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 1a732a80e69..1be9747afc8 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 58a6c222b7d..c4b4f746d00 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 d48f56d113e..1ad9220b704 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 1a0d0e6677a..a7eb5652be0 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 25869cacf46..2a57a0e1ef5 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 44e1e5e0f39..0c05767f98d 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 7e953754e4e..f29e04a2f67 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 407bd7c2717..cbce270c206 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 eae4dd97a97..8b3dba1fddb 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 f3757910b56..dd862885f2f 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 cd1cef18923..d6d49b07494 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 98a705fe132..29277d3b9b8 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 5f2861c7069..7f036dbc7d3 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 b3f8fd1006d..972a0c19266 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 81719c8916a..e59d8d994f5 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 4a1a39a1e71..8be04dc9bcd 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 8846c40f447..8569262c35c 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 c6ad0f3aece..d3f7aa17d91 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 4e27852c85f..0fe7dfa3b5f 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 13c5fd9a7e6..34583b0485c 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 fb76ecb83f8..e03e31cc956 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 f1df9dc9df3..470e923824c 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 c94a66bdbb8..0e23268cff0 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 f1fd7986a1e..b0ce4190bf8 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 4871b3022f5..69590cab692 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 f8cc5fbf21d..a51eafdf87d 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 ac45bf070ea..9f57b567223 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 062d1358dd1..9df0c93e973 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 86c4682d496..90c81b6ea7c 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 22d520e7e4b..face22258b7 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 bbbb2b8c173..aa85b363a28 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 @@ -19,8 +19,6 @@ import java.util.concurrent.ThreadLocalRandom import scala.concurrent.Future -import com.typesafe.config.ConfigFactory - import org.apache.pekko import pekko.Done import pekko.actor.ActorRef @@ -31,6 +29,8 @@ 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 2151f7a6248..4abf7b1d0d5 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 f118c7922cf..1533db83f6a 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 34e9975b8ab..84c50cf0af4 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 0e5ab6857e5..cfd8f9d0473 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 e64e7c885c3..7e5da9765bc 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 df171c7e499..2f845f96b22 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 8de36833414..5a22054bfdd 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 3d8b842f68a..d9061a5b2aa 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 90c9bce52d6..750be49d0d1 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 2049515614f..f55a7b7cea3 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 0c3b2680a98..14ad6a00fbb 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 74c216a6714..16243b9be8a 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,14 +16,14 @@ 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.util.Try import scala.util.control.NonFatal import org.apache.pekko.util.ccompat.JavaConverters._ +import org.scalatest.matchers.must.Matchers +import org.scalatest.wordspec.AnyWordSpec + /** */ class TlsResourcesSpec extends AnyWordSpec with Matchers { 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 2a9dd698d05..13d8bd3277d 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 c448719f3e6..4a2c4647c38 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 458057f7358..d884caa534d 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 25c13db072c..550ca0570b9 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 @@ -18,14 +18,15 @@ import scala.collection.mutable.Set import scala.concurrent.duration._ import scala.util.control.NonFatal -import com.typesafe.config.ConfigFactory +import org.apache.pekko +import pekko.actor.ActorSystem +import pekko.util.ccompat.JavaConverters._ + 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 pekko.util.ccompat.JavaConverters._ +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 b2dee383db2..8ffd3161466 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 f0569189eca..c913711e796 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 a85b28f0a9e..335af689dd8 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 c4c74213a79..376b7e2d7a1 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 e16f82fdce0..7c1f564ffd2 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 6f24e12aaf2..f869337eede 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 9e0bf6bceaa..0f0f0392fae 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 4c05610b35b..1e62fec8c3d 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 d2abe6f9801..b2c0eaff594 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 1acffea7122..3a7f6916f5f 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 8b553c63808..5b0996cad70 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 bc01ea2e787..7810e6acc90 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 1773f9c5a09..7bdbaa574b8 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 5a062742d9d..f66de88a05f 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 946f87abcea..4daf7b5c780 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 31b4c4fdf60..3bda09a4918 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 436994de582..fa3d3bddbdf 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/JacksonObjectMapperProvider.scala b/serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala index a371dce8810..8e27eea1930 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,9 +15,11 @@ 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.util.{ Failure, Success } + import com.fasterxml.jackson.annotation.{ JsonAutoDetect, JsonCreator, PropertyAccessor } import com.fasterxml.jackson.core.{ JsonFactory, @@ -41,7 +43,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, @@ -55,8 +57,10 @@ import pekko.actor.{ import pekko.actor.setup.Setup import pekko.annotation.InternalStableApi import pekko.event.{ Logging, LoggingAdapter } -import pekko.util.unused import pekko.util.OptionConverters._ +import pekko.util.unused + +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 1c4d46fb1a7..3d170bd6757 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 d1a853d24c3..9192ee4927a 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 60fab76c931..e4c15686d49 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 7fbc1fae372..3e2591e7873 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 ecc699cce17..616aefc9610 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 53e0ff07361..e2ee0816a5a 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/javadsl/StreamTestKit.scala b/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/javadsl/StreamTestKit.scala index 306082a7573..314425a9746 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 929917b3341..1745ea3b667 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,10 +17,11 @@ package org.apache.pekko.stream.testkit +import java.util.concurrent.TimeUnit + import org.apache.pekko.testkit.TestKitBase -import org.scalatest.time.{ Millis, Span } -import java.util.concurrent.TimeUnit +import org.scalatest.time.{ Millis, Span } trait StreamConfiguration extends TestKitBase { case class StreamConfig(allStagesStoppedTimeout: Span = Span({ 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 2fc883026aa..6032e57c8f6 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 135bd376675..158a2796b32 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 a24ab2d9715..407e92b8dc1 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 0d77dae4133..a241640f328 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 406d2e0e055..576f87824ad 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 951cccfc2d1..bd66c47e31b 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 bdc64f881c3..0c53ebbbe50 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 e9083d675ad..d8f577af666 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 5c9a3ad539f..3bfbc6e767b 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 437c07f6e49..27e1dfd2dd6 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 234929cfea4..4e23641b5d8 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 6cab3c76177..c4f19d9bcaa 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 9be1b43314a..1cdb45a2df9 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 4f857c6edd6..85190f5b166 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 cc27d9052d5..8935defd211 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 55e78c3e93e..bc54abba439 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 a15d1e63b7f..61daca038cd 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 f4a21911a22..a87a1648ee2 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 e8940000432..098f0584c67 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 e1ee6f24f8a..606d69466d9 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 85a754c17e4..d1649dd087e 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,14 +15,16 @@ package org.apache.pekko.stream.tck import scala.collection.immutable -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory +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 org.scalatestplus.testng.TestNGSuiteLike -import org.apache.pekko.stream.testkit.TestPublisher +import com.typesafe.config.Config +import com.typesafe.config.ConfigFactory abstract class PekkoPublisherVerification[T](val env: TestEnvironment, publisherShutdownTimeout: Long) extends PublisherVerification[T](env, publisherShutdownTimeout) 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 b02799c9bc1..3de993f8398 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 41afa40bc07..1b70dfd1e38 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 0397d1a2692..765f673319d 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 4b29185f7ed..77c30881017 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 e6cd76a4d1b..7da16df48b4 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 2c88f80ff6d..572b3846e2e 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 31251371a48..33f48068d7e 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/TraversalBuilderSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/impl/TraversalBuilderSpec.scala index 5bac7f5a3cf..36e91364fea 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 61420f2a8ca..c6bf5831c74 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 8c8bd2ef5a0..f38a905b134 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 a4973e35f91..3b3917cf59a 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 40f50329ab7..0848b77d02b 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 30995d31d2c..689ab0334cb 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 org.apache.pekko -import pekko.pattern.FutureTimeoutSupport -import pekko.NotUsed -import pekko.stream._ -import pekko.stream.testkit.{ ScriptedTest, StreamSpec } -import pekko.stream.testkit.scaladsl.TestSink - +import java.util.Collections 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.concurrent.duration.DurationInt import scala.util.control.NoStackTrace +import org.apache.pekko +import pekko.NotUsed +import pekko.pattern.FutureTimeoutSupport +import pekko.stream._ +import pekko.stream.testkit.{ ScriptedTest, StreamSpec } +import pekko.stream.testkit.scaladsl.TestSink + 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 b6b53fdf18b..785612d9088 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 cc21ee2ea4f..2d88ab9a1b1 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 3fb0252dfe6..ecaad1c3a39 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 3d05bd81ba3..11f75baa9b6 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 baff85e0c9a..4556ea91401 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 a4261c8c26b..906eca81514 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 8873facb454..cbbc068f7cc 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,7 @@ package org.apache.pekko.stream.typed.javadsl import scala.concurrent.duration._ + import org.apache.pekko import pekko.NotUsed import pekko.actor.typed.ActorRef 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 1d4ddb99064..f66b86a74a5 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 @@ -15,6 +15,7 @@ package org.apache.pekko.stream.typed.scaladsl import scala.annotation.implicitNotFound import scala.concurrent.Future + import org.apache.pekko import pekko.NotUsed import pekko.actor.typed.ActorRef 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 eed2744f162..4e8de89532b 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 36dcbcbaaed..254033e3f2a 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 769b3594118..025ce988a52 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/org/apache/pekko/stream/RestartSettings.scala b/stream/src/main/scala/org/apache/pekko/stream/RestartSettings.scala index 8fda40de431..374fc52505d 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/RestartSettings.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/RestartSettings.scala @@ -16,9 +16,9 @@ package org.apache.pekko.stream import scala.concurrent.duration.FiniteDuration 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 pekko.util.JavaDurationConverters._ 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 d05625fee13..440a17e4066 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/fusing/DropRepeated.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/DropRepeated.scala index 18d54cd4ada..222d55b3a51 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 dfaae6d4341..7f2af4dc595 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 scala.concurrent.Future +import scala.util.{ Failure, Try } + 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.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 -import scala.concurrent.Future -import scala.util.{ Failure, Try } - /** * INTERNAL API */ 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 adb395b141d..36739ff5247 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/Ops.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala index 63f83777f94..5f97bbffd77 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/Switch.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Switch.scala index 358c6c7a758..1bcd953ec6f 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/javadsl/Flow.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala index 197223a46b2..0a097612b68 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,8 +17,8 @@ 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.reflect.ClassTag @@ -40,6 +40,7 @@ import pekko.util.JavaDurationConverters._ import pekko.util.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/Hub.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Hub.scala index 3a3f34ce563..1a45707a1d7 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/Source.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala index 1f141629089..dfdfdb8a252 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,8 +17,8 @@ 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.reflect.ClassTag 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 72d1e94fade..52d7b17f036 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 org.apache.pekko -import pekko.japi.function - import java.util.Collections + import scala.annotation.unchecked.uncheckedVariance +import org.apache.pekko +import pekko.japi.function + /** * 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/SubFlow.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/SubFlow.scala index f55a58caa39..e40026f3eb0 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,8 +16,8 @@ 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.reflect.ClassTag 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 d09c74fdf1b..33036f37407 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,8 +16,8 @@ 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.reflect.ClassTag 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 71ba23fe108..c579266fc38 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/Hub.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala index e62290f8f53..563b630e984 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/SubFlow.scala b/stream/src/main/scala/org/apache/pekko/stream/scaladsl/SubFlow.scala index 68566851b4d..ab2bc07f075 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/stage/GraphStage.scala b/stream/src/main/scala/org/apache/pekko/stream/stage/GraphStage.scala index 75a34504e1d..a031bc502c2 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 272670a64cd..8a34ecb0d4a 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 d9f745ee213..5d58666972f 100644 --- a/testkit/src/main/scala/org/apache/pekko/testkit/ExplicitlyTriggeredScheduler.scala +++ b/testkit/src/main/scala/org/apache/pekko/testkit/ExplicitlyTriggeredScheduler.scala @@ -22,8 +22,6 @@ import scala.concurrent.ExecutionContext import scala.concurrent.duration.{ Duration, FiniteDuration } import scala.util.Try -import com.typesafe.config.Config - import org.apache.pekko import pekko.actor.Cancellable import pekko.actor.Scheduler @@ -31,6 +29,8 @@ import pekko.event.LoggingAdapter import pekko.util.ccompat.JavaConverters._ 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 b12f13043fb..9fa56ee363f 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 a097c4f0edd..35f0e2dc43d 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 01d9871f8d9..95dec7e8775 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/test/scala/org/apache/pekko/testkit/DefaultTimeoutSpec.scala b/testkit/src/test/scala/org/apache/pekko/testkit/DefaultTimeoutSpec.scala index fb6796ae8c4..34f08d18365 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 dc0be66f265..5549ec15d3f 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 70263b213e0..4870451182d 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 38820635e16..0116ba24d4b 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 bacbf571f74..dc4d3800a80 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 6ad662f40fb..0ce191cc702 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 bd695bbecf6..acfd6df21d6 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/MetricsKit.scala b/testkit/src/test/scala/org/apache/pekko/testkit/metrics/MetricsKit.scala index 25766d341fc..5bcbd82614e 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. * 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 73ea03bdeee..d23241b204e 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 6a8fc2b13e1..b840210070a 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._