chore: sort imports (#2235)

This commit is contained in:
He-Pin(kerr) 2025-09-20 11:30:05 +08:00 committed by GitHub
parent 4d89553471
commit 870d4499cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
1161 changed files with 3370 additions and 2786 deletions

View file

@ -15,14 +15,15 @@ package org.apache.pekko.actor.testkit.typed
import java.util.Optional import java.util.Optional
import org.slf4j.Marker import scala.jdk.OptionConverters._
import org.slf4j.event.Level
import org.apache.pekko import org.apache.pekko
import pekko.annotation.InternalApi import pekko.annotation.InternalApi
import scala.jdk.OptionConverters._
import pekko.util.OptionVal 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]] * Representation of a Log Event issued by a [[pekko.actor.typed.Behavior]]
* when testing with [[pekko.actor.testkit.typed.scaladsl.BehaviorTestKit]] * when testing with [[pekko.actor.testkit.typed.scaladsl.BehaviorTestKit]]

View file

@ -14,12 +14,12 @@
package org.apache.pekko.actor.testkit.typed package org.apache.pekko.actor.testkit.typed
import scala.concurrent.duration.FiniteDuration import scala.concurrent.duration.FiniteDuration
import scala.jdk.DurationConverters._
import org.apache.pekko import org.apache.pekko
import pekko.actor.typed.{ ActorRef, Behavior, Props } import pekko.actor.typed.{ ActorRef, Behavior, Props }
import pekko.annotation.{ DoNotInherit, InternalApi } import pekko.annotation.{ DoNotInherit, InternalApi }
import pekko.util.FunctionConverters._ import pekko.util.FunctionConverters._
import scala.jdk.DurationConverters._
import pekko.util.unused import pekko.util.unused
/** /**

View file

@ -15,12 +15,12 @@ package org.apache.pekko.actor.testkit.typed
import java.util.Optional import java.util.Optional
import org.slf4j.Marker
import org.slf4j.event.Level
import scala.jdk.CollectionConverters._ import scala.jdk.CollectionConverters._
import scala.jdk.OptionConverters._ import scala.jdk.OptionConverters._
import org.slf4j.Marker
import org.slf4j.event.Level
object LoggingEvent { object LoggingEvent {
/** /**

View file

@ -14,16 +14,16 @@
package org.apache.pekko.actor.testkit.typed package org.apache.pekko.actor.testkit.typed
import scala.concurrent.duration.{ Duration, FiniteDuration } import scala.concurrent.duration.{ Duration, FiniteDuration }
import scala.jdk.DurationConverters._
import com.typesafe.config.Config
import org.apache.pekko import org.apache.pekko
import pekko.actor.typed.ActorSystem import pekko.actor.typed.ActorSystem
import pekko.actor.typed.Extension import pekko.actor.typed.Extension
import pekko.actor.typed.ExtensionId import pekko.actor.typed.ExtensionId
import scala.jdk.DurationConverters._
import pekko.util.Timeout import pekko.util.Timeout
import com.typesafe.config.Config
object TestKitSettings { object TestKitSettings {
/** /**

View file

@ -14,11 +14,11 @@
package org.apache.pekko.actor.testkit.typed.internal package org.apache.pekko.actor.testkit.typed.internal
import java.util.concurrent.{ CompletionStage, ThreadFactory } import java.util.concurrent.{ CompletionStage, ThreadFactory }
import scala.concurrent._
import scala.annotation.nowarn import scala.annotation.nowarn
import com.typesafe.config.{ Config, ConfigFactory } import scala.concurrent._
import org.slf4j.Logger import scala.jdk.FutureConverters._
import org.slf4j.LoggerFactory
import org.apache.pekko import org.apache.pekko
import pekko.{ actor => classic } import pekko.{ actor => classic }
import pekko.Done import pekko.Done
@ -37,7 +37,11 @@ import pekko.actor.typed.internal.ActorRefImpl
import pekko.actor.typed.internal.InternalRecipientRef import pekko.actor.typed.internal.InternalRecipientRef
import pekko.actor.typed.receptionist.Receptionist import pekko.actor.typed.receptionist.Receptionist
import pekko.annotation.InternalApi import pekko.annotation.InternalApi
import scala.jdk.FutureConverters._
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import com.typesafe.config.{ Config, ConfigFactory }
/** /**
* INTERNAL API * INTERNAL API

View file

@ -17,19 +17,20 @@ import java.util
import scala.annotation.tailrec import scala.annotation.tailrec
import scala.collection.immutable import scala.collection.immutable
import scala.jdk.CollectionConverters._
import scala.reflect.ClassTag import scala.reflect.ClassTag
import scala.util.control.Exception.Catcher import scala.util.control.Exception.Catcher
import scala.util.control.NonFatal import scala.util.control.NonFatal
import org.apache.pekko import org.apache.pekko
import pekko.actor.ActorPath import pekko.actor.ActorPath
import pekko.actor.testkit.typed.{ CapturedLogEvent, Effect } import pekko.actor.testkit.typed.{ CapturedLogEvent, Effect }
import pekko.actor.testkit.typed.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.{ ActorRef, Behavior, BehaviorInterceptor, PostStop, Signal, TypedActorContext }
import pekko.actor.typed.internal.AdaptWithRegisteredMessageAdapter
import pekko.actor.typed.receptionist.Receptionist import pekko.actor.typed.receptionist.Receptionist
import pekko.actor.typed.scaladsl.Behaviors import pekko.actor.typed.scaladsl.Behaviors
import pekko.annotation.InternalApi import pekko.annotation.InternalApi
import scala.jdk.CollectionConverters._
/** /**
* INTERNAL API * INTERNAL API

View file

@ -15,17 +15,17 @@ package org.apache.pekko.actor.testkit.typed.internal
import java.util.concurrent.ConcurrentLinkedQueue import java.util.concurrent.ConcurrentLinkedQueue
import org.apache.pekko
import pekko.actor.testkit.typed.Effect
import pekko.actor.testkit.typed.Effect._
import pekko.actor.typed.internal.TimerSchedulerCrossDslSupport
import pekko.actor.typed.{ ActorRef, Behavior, Props }
import pekko.actor.{ ActorPath, Cancellable }
import pekko.annotation.InternalApi
import scala.concurrent.duration.FiniteDuration import scala.concurrent.duration.FiniteDuration
import scala.reflect.ClassTag import scala.reflect.ClassTag
import org.apache.pekko
import pekko.actor.{ ActorPath, Cancellable }
import pekko.actor.testkit.typed.Effect
import pekko.actor.testkit.typed.Effect._
import pekko.actor.typed.{ ActorRef, Behavior, Props }
import pekko.actor.typed.internal.TimerSchedulerCrossDslSupport
import pekko.annotation.InternalApi
/** /**
* INTERNAL API * INTERNAL API
*/ */

View file

@ -13,11 +13,12 @@
package org.apache.pekko.actor.testkit.typed.internal package org.apache.pekko.actor.testkit.typed.internal
import org.slf4j.LoggerFactory import scala.annotation.tailrec
import org.slf4j.event.Level
import org.apache.pekko.annotation.InternalApi import org.apache.pekko.annotation.InternalApi
import scala.annotation.tailrec import org.slf4j.LoggerFactory
import org.slf4j.event.Level
/** /**
* INTERNAL API * INTERNAL API

View file

@ -19,8 +19,6 @@ import scala.concurrent.duration.Duration
import scala.reflect.ClassTag import scala.reflect.ClassTag
import scala.util.matching.Regex import scala.util.matching.Regex
import org.slf4j.event.Level
import org.apache.pekko import org.apache.pekko
import pekko.actor.testkit.typed.LoggingEvent import pekko.actor.testkit.typed.LoggingEvent
import pekko.actor.testkit.typed.TestKitSettings import pekko.actor.testkit.typed.TestKitSettings
@ -30,6 +28,8 @@ import pekko.actor.typed.ActorSystem
import pekko.annotation.InternalApi import pekko.annotation.InternalApi
import pekko.testkit.TestKit import pekko.testkit.TestKit
import org.slf4j.event.Level
/** /**
* INTERNAL API * INTERNAL API
*/ */

View file

@ -13,22 +13,24 @@
package org.apache.pekko.actor.testkit.typed.internal package org.apache.pekko.actor.testkit.typed.internal
import org.apache.pekko
import pekko.actor.testkit.typed.CapturedLogEvent
import pekko.actor.typed._
import pekko.actor.typed.internal._
import pekko.actor.{ ActorPath, ActorRefProvider, InvalidMessageException }
import pekko.annotation.InternalApi
import pekko.util.Helpers
import pekko.{ actor => classic }
import org.slf4j.{ Logger, Marker }
import org.slf4j.helpers.{ MessageFormatter, SubstituteLoggerFactory }
import java.util.concurrent.ThreadLocalRandom.{ current => rnd } import java.util.concurrent.ThreadLocalRandom.{ current => rnd }
import scala.collection.immutable.TreeMap import scala.collection.immutable.TreeMap
import scala.concurrent.ExecutionContextExecutor import scala.concurrent.ExecutionContextExecutor
import scala.concurrent.duration.FiniteDuration import scala.concurrent.duration.FiniteDuration
import org.apache.pekko
import pekko.{ actor => classic }
import pekko.actor.{ ActorPath, ActorRefProvider, InvalidMessageException }
import pekko.actor.testkit.typed.CapturedLogEvent
import pekko.actor.typed._
import pekko.actor.typed.internal._
import pekko.annotation.InternalApi
import pekko.util.Helpers
import org.slf4j.{ Logger, Marker }
import org.slf4j.helpers.{ MessageFormatter, SubstituteLoggerFactory }
/** /**
* INTERNAL API * INTERNAL API
* *

View file

@ -13,15 +13,17 @@
package org.apache.pekko.actor.testkit.typed.internal 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.ILoggingEvent
import ch.qos.logback.classic.spi.ThrowableProxy import ch.qos.logback.classic.spi.ThrowableProxy
import ch.qos.logback.core.AppenderBase import ch.qos.logback.core.AppenderBase
import org.slf4j.{ MDC, Marker }
import org.apache.pekko import org.apache.pekko
import pekko.actor.testkit.typed.LoggingEvent import pekko.actor.testkit.typed.LoggingEvent
import pekko.annotation.InternalApi import pekko.annotation.InternalApi
import java.util.Collections import org.slf4j.{ MDC, Marker }
/** /**
* INTERNAL API * INTERNAL API

View file

@ -22,6 +22,8 @@ import java.util.function.Supplier
import scala.annotation.tailrec import scala.annotation.tailrec
import scala.collection.immutable import scala.collection.immutable
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.jdk.CollectionConverters._
import scala.jdk.DurationConverters._
import scala.reflect.ClassTag import scala.reflect.ClassTag
import scala.util.control.NonFatal import scala.util.control.NonFatal
@ -43,9 +45,7 @@ import pekko.actor.typed.scaladsl.Behaviors
import pekko.annotation.InternalApi import pekko.annotation.InternalApi
import pekko.japi.function.Creator import pekko.japi.function.Creator
import pekko.util.BoxedType import pekko.util.BoxedType
import scala.jdk.DurationConverters._
import pekko.util.PrettyDuration._ import pekko.util.PrettyDuration._
import scala.jdk.CollectionConverters._
@InternalApi @InternalApi
private[pekko] object TestProbeImpl { private[pekko] object TestProbeImpl {

View file

@ -15,7 +15,7 @@ package org.apache.pekko.actor.testkit.typed.javadsl
import java.time.Duration import java.time.Duration
import com.typesafe.config.Config import scala.jdk.DurationConverters._
import org.apache.pekko import org.apache.pekko
import pekko.actor.DeadLetter import pekko.actor.DeadLetter
@ -29,9 +29,10 @@ import pekko.actor.typed.ActorSystem
import pekko.actor.typed.Behavior import pekko.actor.typed.Behavior
import pekko.actor.typed.Props import pekko.actor.typed.Props
import pekko.actor.typed.Scheduler import pekko.actor.typed.Scheduler
import scala.jdk.DurationConverters._
import pekko.util.Timeout import pekko.util.Timeout
import com.typesafe.config.Config
object ActorTestKit { object ActorTestKit {
/** /**

View file

@ -13,16 +13,17 @@
package org.apache.pekko.actor.testkit.typed.javadsl package org.apache.pekko.actor.testkit.typed.javadsl
import org.apache.pekko
import pekko.actor.testkit.typed.internal.{ ActorSystemStub, BehaviorTestKitImpl }
import pekko.actor.testkit.typed.{ CapturedLogEvent, Effect }
import pekko.actor.typed.receptionist.Receptionist
import pekko.actor.typed.{ ActorRef, Behavior, Signal }
import pekko.annotation.{ ApiMayChange, DoNotInherit }
import com.typesafe.config.Config
import java.util.concurrent.ThreadLocalRandom import java.util.concurrent.ThreadLocalRandom
import org.apache.pekko
import pekko.actor.testkit.typed.{ CapturedLogEvent, Effect }
import pekko.actor.testkit.typed.internal.{ ActorSystemStub, BehaviorTestKitImpl }
import pekko.actor.typed.{ ActorRef, Behavior, Signal }
import pekko.actor.typed.receptionist.Receptionist
import pekko.annotation.{ ApiMayChange, DoNotInherit }
import com.typesafe.config.Config
object BehaviorTestKit { object BehaviorTestKit {
/** /**

View file

@ -15,9 +15,10 @@ package org.apache.pekko.actor.testkit.typed.javadsl
import java.time.Duration import java.time.Duration
import scala.jdk.DurationConverters._
import org.apache.pekko import org.apache.pekko
import pekko.actor.typed.{ ActorRef, Behavior, Props } import pekko.actor.typed.{ ActorRef, Behavior, Props }
import scala.jdk.DurationConverters._
/** /**
* Factories for behavior effects for [[BehaviorTestKit]], each effect has a suitable equals and can be used to compare * Factories for behavior effects for [[BehaviorTestKit]], each effect has a suitable equals and can be used to compare

View file

@ -18,11 +18,12 @@
package org.apache.pekko.actor.testkit.typed.javadsl package org.apache.pekko.actor.testkit.typed.javadsl
import org.apache.pekko import org.apache.pekko
import com.typesafe.config.Config
import pekko.actor.testkit.typed.internal.TestKitUtils import pekko.actor.testkit.typed.internal.TestKitUtils
import pekko.actor.testkit.typed.scaladsl.ActorTestKit.ApplicationTestConfig import pekko.actor.testkit.typed.scaladsl.ActorTestKit.ApplicationTestConfig
import pekko.actor.typed.ActorSystem import pekko.actor.typed.ActorSystem
import com.typesafe.config.Config
final class JUnit5TestKitBuilder() { final class JUnit5TestKitBuilder() {
var system: Option[ActorSystem[_]] = None var system: Option[ActorSystem[_]] = None

View file

@ -18,10 +18,11 @@ import scala.util.control.NonFatal
import org.junit.rules.TestRule import org.junit.rules.TestRule
import org.junit.runner.Description import org.junit.runner.Description
import org.junit.runners.model.Statement import org.junit.runners.model.Statement
import org.slf4j.LoggerFactory
import org.apache.pekko.actor.testkit.typed.internal.CapturingAppender 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. * JUnit `TestRule` to make log lines appear only when the test failed.
* *

View file

@ -9,13 +9,16 @@
package org.apache.pekko.actor.testkit.typed.javadsl 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.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 org.apache.pekko.actor.testkit.typed.internal.CapturingAppender
import java.lang.reflect.Method import org.slf4j.LoggerFactory
import scala.util.control.NonFatal
final class LogCapturingExtension extends InvocationInterceptor { final class LogCapturingExtension extends InvocationInterceptor {

View file

@ -15,14 +15,14 @@ package org.apache.pekko.actor.testkit.typed.javadsl
import java.util.function.Supplier import java.util.function.Supplier
import org.slf4j.event.Level
import org.apache.pekko import org.apache.pekko
import pekko.actor.testkit.typed.LoggingEvent import pekko.actor.testkit.typed.LoggingEvent
import pekko.actor.testkit.typed.internal.LoggingTestKitImpl import pekko.actor.testkit.typed.internal.LoggingTestKitImpl
import pekko.actor.typed.ActorSystem import pekko.actor.typed.ActorSystem
import pekko.annotation.DoNotInherit import pekko.annotation.DoNotInherit
import org.slf4j.event.Level
/** /**
* Facilities for verifying logs. * Facilities for verifying logs.
* *

View file

@ -16,13 +16,13 @@ package org.apache.pekko.actor.testkit.typed.javadsl
import java.time.Duration import java.time.Duration
import scala.annotation.varargs import scala.annotation.varargs
import scala.jdk.DurationConverters._
import com.typesafe.config.Config
import org.apache.pekko import org.apache.pekko
import pekko.actor.typed.ActorSystem import pekko.actor.typed.ActorSystem
import pekko.actor.typed.internal.adapter.SchedulerAdapter import pekko.actor.typed.internal.adapter.SchedulerAdapter
import scala.jdk.DurationConverters._
import com.typesafe.config.Config
/** /**
* Manual time allows you to do async tests while controlling the scheduler of the system. * Manual time allows you to do async tests while controlling the scheduler of the system.

View file

@ -16,12 +16,12 @@ package org.apache.pekko.actor.testkit.typed.javadsl
import java.util.concurrent.ThreadLocalRandom import java.util.concurrent.ThreadLocalRandom
import scala.collection.immutable import scala.collection.immutable
import scala.jdk.CollectionConverters._
import org.apache.pekko import org.apache.pekko
import pekko.actor.testkit.typed.internal.TestInboxImpl import pekko.actor.testkit.typed.internal.TestInboxImpl
import pekko.actor.typed.ActorRef import pekko.actor.typed.ActorRef
import pekko.annotation.DoNotInherit import pekko.annotation.DoNotInherit
import scala.jdk.CollectionConverters._
object TestInbox { object TestInbox {
import pekko.actor.testkit.typed.scaladsl.TestInbox.address import pekko.actor.testkit.typed.scaladsl.TestInbox.address

View file

@ -17,10 +17,11 @@
package org.apache.pekko.actor.testkit.typed.javadsl 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.jupiter.api.extension.{ AfterAllCallback, BeforeTestExecutionCallback, ExtensionContext }
import org.junit.platform.commons.support.AnnotationSupport import org.junit.platform.commons.support.AnnotationSupport
import org.apache.pekko.actor.testkit.typed.annotations.JUnit5TestKit
final class TestKitJUnit5Extension() extends AfterAllCallback with BeforeTestExecutionCallback { final class TestKitJUnit5Extension() extends AfterAllCallback with BeforeTestExecutionCallback {
var testKit: Option[ActorTestKit] = None var testKit: Option[ActorTestKit] = None

View file

@ -15,8 +15,6 @@ package org.apache.pekko.actor.testkit.typed.javadsl
import java.time.Duration import java.time.Duration
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
import org.junit.Rule import org.junit.Rule
import org.junit.rules.ExternalResource import org.junit.rules.ExternalResource
@ -33,6 +31,9 @@ import pekko.actor.typed.Props
import pekko.actor.typed.Scheduler import pekko.actor.typed.Scheduler
import pekko.util.Timeout 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. * 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. * The testkit will be automatically shut down when the test completes or fails.

View file

@ -18,7 +18,6 @@ import java.util.{ List => JList }
import java.util.function.Supplier import java.util.function.Supplier
import org.apache.pekko import org.apache.pekko
import pekko.japi.function.Creator
import pekko.actor.testkit.typed.FishingOutcome import pekko.actor.testkit.typed.FishingOutcome
import pekko.actor.testkit.typed.TestKitSettings import pekko.actor.testkit.typed.TestKitSettings
import pekko.actor.testkit.typed.internal.TestProbeImpl 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.RecipientRef
import pekko.actor.typed.internal.InternalRecipientRef import pekko.actor.typed.internal.InternalRecipientRef
import pekko.annotation.DoNotInherit import pekko.annotation.DoNotInherit
import pekko.japi.function.Creator
import pekko.util.unused import pekko.util.unused
object FishingOutcomes { object FishingOutcomes {

View file

@ -20,10 +20,6 @@ import scala.concurrent.Await
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.reflect.ClassTag import scala.reflect.ClassTag
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
import org.slf4j.LoggerFactory
import org.apache.pekko import org.apache.pekko
import pekko.actor.DeadLetter import pekko.actor.DeadLetter
import pekko.actor.DeadLetterSuppression import pekko.actor.DeadLetterSuppression
@ -43,6 +39,11 @@ import pekko.actor.typed.scaladsl.adapter._
import pekko.annotation.InternalApi import pekko.annotation.InternalApi
import pekko.util.Timeout import pekko.util.Timeout
import org.slf4j.LoggerFactory
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
object ActorTestKit { object ActorTestKit {
private val testKitGuardianCounter = new AtomicInteger(0) private val testKitGuardianCounter = new AtomicInteger(0)

View file

@ -13,9 +13,6 @@
package org.apache.pekko.actor.testkit.typed.scaladsl package org.apache.pekko.actor.testkit.typed.scaladsl
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
import org.apache.pekko import org.apache.pekko
import pekko.actor.DeadLetter import pekko.actor.DeadLetter
import pekko.actor.Dropped import pekko.actor.Dropped
@ -28,6 +25,9 @@ import pekko.actor.typed.Behavior
import pekko.actor.typed.Props import pekko.actor.typed.Props
import pekko.util.Timeout import pekko.util.Timeout
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
object ActorTestKitBase { object ActorTestKitBase {
@noinline def testNameFromCallStack(): String = TestKitUtils.testNameFromCallStack(classOf[ActorTestKitBase]) @noinline def testNameFromCallStack(): String = TestKitUtils.testNameFromCallStack(classOf[ActorTestKitBase])
} }

View file

@ -13,18 +13,20 @@
package org.apache.pekko.actor.testkit.typed.scaladsl package org.apache.pekko.actor.testkit.typed.scaladsl
import org.apache.pekko
import pekko.actor.testkit.typed.internal.{ ActorSystemStub, BehaviorTestKitImpl }
import pekko.actor.testkit.typed.{ CapturedLogEvent, Effect }
import pekko.actor.typed.receptionist.Receptionist
import pekko.actor.typed.{ ActorRef, Behavior, Signal, TypedActorContext }
import pekko.annotation.{ ApiMayChange, DoNotInherit }
import com.typesafe.config.Config
import java.util.concurrent.ThreadLocalRandom import java.util.concurrent.ThreadLocalRandom
import scala.collection.immutable import scala.collection.immutable
import scala.reflect.ClassTag import scala.reflect.ClassTag
import org.apache.pekko
import pekko.actor.testkit.typed.{ CapturedLogEvent, Effect }
import pekko.actor.testkit.typed.internal.{ ActorSystemStub, BehaviorTestKitImpl }
import pekko.actor.typed.{ ActorRef, Behavior, Signal, TypedActorContext }
import pekko.actor.typed.receptionist.Receptionist
import pekko.annotation.{ ApiMayChange, DoNotInherit }
import com.typesafe.config.Config
@ApiMayChange @ApiMayChange
object BehaviorTestKit { object BehaviorTestKit {

View file

@ -15,12 +15,13 @@ package org.apache.pekko.actor.testkit.typed.scaladsl
import scala.util.control.NonFatal import scala.util.control.NonFatal
import org.apache.pekko.actor.testkit.typed.internal.CapturingAppender
import org.scalatest.BeforeAndAfterAll import org.scalatest.BeforeAndAfterAll
import org.scalatest.Outcome import org.scalatest.Outcome
import org.scalatest.TestSuite 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. * Mixin this trait to a ScalaTest test to make log lines appear only when the test failed.

View file

@ -15,14 +15,14 @@ package org.apache.pekko.actor.testkit.typed.scaladsl
import scala.reflect.ClassTag import scala.reflect.ClassTag
import org.slf4j.event.Level
import org.apache.pekko import org.apache.pekko
import pekko.actor.testkit.typed.LoggingEvent import pekko.actor.testkit.typed.LoggingEvent
import pekko.actor.testkit.typed.internal.LoggingTestKitImpl import pekko.actor.testkit.typed.internal.LoggingTestKitImpl
import pekko.actor.typed.ActorSystem import pekko.actor.typed.ActorSystem
import pekko.annotation.DoNotInherit import pekko.annotation.DoNotInherit
import org.slf4j.event.Level
/** /**
* Facilities for verifying logs. * Facilities for verifying logs.
* *

View file

@ -16,12 +16,12 @@ package org.apache.pekko.actor.testkit.typed.scaladsl
import scala.annotation.varargs import scala.annotation.varargs
import scala.concurrent.duration.{ Duration, FiniteDuration } import scala.concurrent.duration.{ Duration, FiniteDuration }
import com.typesafe.config.{ Config, ConfigFactory }
import org.apache.pekko import org.apache.pekko
import pekko.actor.typed.ActorSystem import pekko.actor.typed.ActorSystem
import pekko.actor.typed.internal.adapter.SchedulerAdapter 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. * Manual time allows you to do async tests while controlling the scheduler of the system.
* *

View file

@ -13,17 +13,18 @@
package org.apache.pekko.actor.testkit.typed.scaladsl package org.apache.pekko.actor.testkit.typed.scaladsl
import com.typesafe.config.Config import org.apache.pekko
import com.typesafe.config.ConfigFactory import pekko.actor.testkit.typed.TestKitSettings
import pekko.actor.typed.ActorSystem
import org.scalatest.{ BeforeAndAfterAll, TestSuite } import org.scalatest.{ BeforeAndAfterAll, TestSuite }
import org.scalatest.concurrent.Eventually import org.scalatest.concurrent.Eventually
import org.scalatest.concurrent.ScalaFutures import org.scalatest.concurrent.ScalaFutures
import org.scalatest.matchers.should.Matchers import org.scalatest.matchers.should.Matchers
import org.scalatest.time.Span import org.scalatest.time.Span
import org.apache.pekko import com.typesafe.config.Config
import pekko.actor.testkit.typed.TestKitSettings import com.typesafe.config.ConfigFactory
import pekko.actor.typed.ActorSystem
/** /**
* A ScalaTest base class for the [[ActorTestKit]], making it possible to have ScalaTest manage the lifecycle of the testkit. * A ScalaTest base class for the [[ActorTestKit]], making it possible to have ScalaTest manage the lifecycle of the testkit.

View file

@ -15,11 +15,6 @@ package org.apache.pekko.actor.testkit.typed.scaladsl
import scala.concurrent.Promise 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 org.apache.pekko
import pekko.Done import pekko.Done
import pekko.actor.Dropped import pekko.actor.Dropped
@ -29,6 +24,12 @@ import pekko.actor.typed.ActorSystem
import pekko.actor.typed.eventstream.EventStream import pekko.actor.typed.eventstream.EventStream
import pekko.actor.typed.scaladsl.Behaviors 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 { class ActorTestKitSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing {
"the Scala testkit" should { "the Scala testkit" should {

View file

@ -13,22 +13,24 @@
package org.apache.pekko.actor.testkit.typed.scaladsl package org.apache.pekko.actor.testkit.typed.scaladsl
import scala.concurrent.duration.{ FiniteDuration, _ }
import scala.reflect.ClassTag
import org.apache.pekko import org.apache.pekko
import pekko.Done import pekko.Done
import pekko.actor.Address import pekko.actor.Address
import pekko.actor.testkit.typed.Effect._
import pekko.actor.testkit.typed.scaladsl.BehaviorTestKitSpec.Parent._
import pekko.actor.testkit.typed.scaladsl.BehaviorTestKitSpec.{ Child, Parent }
import pekko.actor.testkit.typed.{ CapturedLogEvent, Effect } import pekko.actor.testkit.typed.{ CapturedLogEvent, Effect }
import pekko.actor.testkit.typed.Effect._
import pekko.actor.testkit.typed.scaladsl.BehaviorTestKitSpec.{ Child, Parent }
import pekko.actor.testkit.typed.scaladsl.BehaviorTestKitSpec.Parent._
import pekko.actor.typed.{ ActorRef, Behavior, Props, Terminated }
import pekko.actor.typed.receptionist.{ Receptionist, ServiceKey } import pekko.actor.typed.receptionist.{ Receptionist, ServiceKey }
import pekko.actor.typed.scaladsl.Behaviors import pekko.actor.typed.scaladsl.Behaviors
import pekko.actor.typed.{ ActorRef, Behavior, Props, Terminated }
import org.scalatest.matchers.should.Matchers import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec import org.scalatest.wordspec.AnyWordSpec
import org.slf4j.event.Level
import scala.concurrent.duration.{ FiniteDuration, _ } import org.slf4j.event.Level
import scala.reflect.ClassTag
object BehaviorTestKitSpec { object BehaviorTestKitSpec {
object Parent { object Parent {

View file

@ -18,11 +18,13 @@
package org.apache.pekko.actor.testkit.typed.scaladsl package org.apache.pekko.actor.testkit.typed.scaladsl
import org.apache.pekko import org.apache.pekko
import pekko.actor.typed.ActorSystem
import com.typesafe.config.ConfigFactory
import org.apache.pekko.actor.testkit.typed.javadsl.JUnit5TestKitBuilder import org.apache.pekko.actor.testkit.typed.javadsl.JUnit5TestKitBuilder
import pekko.actor.typed.ActorSystem
import org.scalatest.wordspec.AnyWordSpec import org.scalatest.wordspec.AnyWordSpec
import com.typesafe.config.ConfigFactory
class JUnit5TestKitBuilderSpec extends AnyWordSpec { class JUnit5TestKitBuilderSpec extends AnyWordSpec {
"the JUnit5TestKitBuilder" should { "the JUnit5TestKitBuilder" should {

View file

@ -13,11 +13,12 @@
package org.apache.pekko.actor.testkit.typed.scaladsl package org.apache.pekko.actor.testkit.typed.scaladsl
import org.scalatest.wordspec.AnyWordSpecLike
import org.slf4j.event.Level
import org.apache.pekko.actor.testkit.typed.LoggingEvent import org.apache.pekko.actor.testkit.typed.LoggingEvent
import org.scalatest.wordspec.AnyWordSpecLike
import org.slf4j.event.Level
class LoggingTestKitSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { class LoggingTestKitSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing {
private class AnError extends Exception private class AnError extends Exception

View file

@ -17,11 +17,12 @@ import java.util.concurrent.atomic.AtomicInteger
import scala.concurrent.Future import scala.concurrent.Future
import org.scalatest.wordspec.AnyWordSpecLike
import org.slf4j.LoggerFactory
import org.apache.pekko.actor.testkit.typed.TestException import org.apache.pekko.actor.testkit.typed.TestException
import org.scalatest.wordspec.AnyWordSpecLike
import org.slf4j.LoggerFactory
class TestAppenderSpec class TestAppenderSpec
extends ScalaTestWithActorTestKit( extends ScalaTestWithActorTestKit(
""" """

View file

@ -15,10 +15,11 @@ package org.apache.pekko.actor.testkit.typed.scaladsl
import scala.concurrent.duration._ import scala.concurrent.duration._
import com.typesafe.config.ConfigFactory import org.apache.pekko.actor.typed.scaladsl.Behaviors
import org.scalatest.wordspec.AnyWordSpecLike 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 { class TestProbeSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing {

View file

@ -14,6 +14,7 @@
package org.apache.pekko.util package org.apache.pekko.util
import org.scalactic.TypeCheckedTripleEquals import org.scalactic.TypeCheckedTripleEquals
import org.scalatest.matchers.should.Matchers import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec import org.scalatest.wordspec.AnyWordSpec

View file

@ -17,12 +17,12 @@
package org.apache.pekko.dispatch package org.apache.pekko.dispatch
import com.typesafe.config.ConfigFactory
import org.apache.pekko import org.apache.pekko
import pekko.actor.{ Actor, Props } import pekko.actor.{ Actor, Props }
import pekko.testkit.{ ImplicitSender, PekkoSpec } import pekko.testkit.{ ImplicitSender, PekkoSpec }
import com.typesafe.config.ConfigFactory
object ForkJoinPoolVirtualThreadSpec { object ForkJoinPoolVirtualThreadSpec {
val config = ConfigFactory.parseString(""" val config = ConfigFactory.parseString("""
|custom { |custom {

View file

@ -17,11 +17,12 @@
package org.apache.pekko.dispatch package org.apache.pekko.dispatch
import com.typesafe.config.ConfigFactory
import org.apache.pekko import org.apache.pekko
import pekko.actor.{ Actor, Props } import pekko.actor.{ Actor, Props }
import pekko.testkit.{ ImplicitSender, PekkoSpec } import pekko.testkit.{ ImplicitSender, PekkoSpec }
import com.typesafe.config.ConfigFactory
object ThreadPoolVirtualThreadSpec { object ThreadPoolVirtualThreadSpec {
val config = ConfigFactory.parseString(""" val config = ConfigFactory.parseString("""
|custom { |custom {

View file

@ -17,12 +17,12 @@
package org.apache.pekko.dispatch package org.apache.pekko.dispatch
import com.typesafe.config.ConfigFactory
import org.apache.pekko import org.apache.pekko
import pekko.actor.{ Actor, Props } import pekko.actor.{ Actor, Props }
import pekko.testkit.{ ImplicitSender, PekkoSpec } import pekko.testkit.{ ImplicitSender, PekkoSpec }
import com.typesafe.config.ConfigFactory
object VirtualThreadPoolDispatcherSpec { object VirtualThreadPoolDispatcherSpec {
val config = ConfigFactory.parseString(""" val config = ConfigFactory.parseString("""
|virtual-thread-dispatcher { |virtual-thread-dispatcher {

View file

@ -13,11 +13,11 @@
package org.apache.pekko package org.apache.pekko
import org.apache.pekko.actor._
import org.scalatest.matchers.should.Matchers import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec 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. * A spec that verified that the PekkoException has at least a single argument constructor of type String.
* *

View file

@ -15,8 +15,6 @@ package org.apache.pekko.actor
import scala.concurrent.duration._ import scala.concurrent.duration._
import org.scalatest.BeforeAndAfterEach
import org.apache.pekko import org.apache.pekko
import pekko.ConfigurationException import pekko.ConfigurationException
import pekko.routing._ import pekko.routing._
@ -24,6 +22,8 @@ import pekko.testkit._
import pekko.testkit.DefaultTimeout import pekko.testkit.DefaultTimeout
import pekko.testkit.TestEvent._ import pekko.testkit.TestEvent._
import org.scalatest.BeforeAndAfterEach
object ActorConfigurationVerificationSpec { object ActorConfigurationVerificationSpec {
class TestActor extends Actor { class TestActor extends Actor {

View file

@ -16,14 +16,16 @@ package org.apache.pekko.actor
import scala.concurrent.duration._ import scala.concurrent.duration._
import com.codahale.metrics.Histogram import com.codahale.metrics.Histogram
import com.typesafe.config.ConfigFactory
import org.scalatest.BeforeAndAfterAll
import org.apache.pekko import org.apache.pekko
import pekko.testkit.{ ImplicitSender, PekkoSpec, PerformanceTest } import pekko.testkit.{ ImplicitSender, PekkoSpec, PerformanceTest }
import pekko.testkit.metrics._ import pekko.testkit.metrics._
import pekko.testkit.metrics.HeapMemoryUsage import pekko.testkit.metrics.HeapMemoryUsage
import org.scalatest.BeforeAndAfterAll
import com.typesafe.config.ConfigFactory
object ActorCreationPerfSpec { object ActorCreationPerfSpec {
val config = ConfigFactory.parseString(""" val config = ConfigFactory.parseString("""

View file

@ -19,13 +19,13 @@ import java.util.concurrent.atomic._
import scala.concurrent.{ Await, Future } import scala.concurrent.{ Await, Future }
import org.scalatest.BeforeAndAfterEach
import org.apache.pekko import org.apache.pekko
import pekko.actor.Actor._ import pekko.actor.Actor._
import pekko.pattern.ask import pekko.pattern.ask
import pekko.testkit._ import pekko.testkit._
import org.scalatest.BeforeAndAfterEach
object ActorLifeCycleSpec { object ActorLifeCycleSpec {
class LifeCycleTestActor(testActor: ActorRef, id: String, generationProvider: AtomicInteger) extends Actor { class LifeCycleTestActor(testActor: ActorRef, id: String, generationProvider: AtomicInteger) extends Actor {

View file

@ -15,9 +15,6 @@ package org.apache.pekko.actor
import scala.concurrent.duration.{ Duration, FiniteDuration } import scala.concurrent.duration.{ Duration, FiniteDuration }
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
import org.apache.pekko import org.apache.pekko
import pekko.ConfigurationException import pekko.ConfigurationException
import pekko.dispatch._ import pekko.dispatch._
@ -25,6 +22,9 @@ import pekko.testkit._
import pekko.util.Helpers.ConfigOps import pekko.util.Helpers.ConfigOps
import pekko.util.unused import pekko.util.unused
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
object ActorMailboxSpec { object ActorMailboxSpec {
val mailboxConf = ConfigFactory.parseString(s""" val mailboxConf = ConfigFactory.parseString(s"""
unbounded-dispatcher { unbounded-dispatcher {

View file

@ -16,14 +16,14 @@ package org.apache.pekko.actor
import scala.concurrent.ExecutionContext import scala.concurrent.ExecutionContext
import scala.concurrent.duration._ import scala.concurrent.duration._
import com.typesafe.config.ConfigFactory
import org.apache.pekko import org.apache.pekko
import pekko.ConfigurationException import pekko.ConfigurationException
import pekko.actor.setup.ActorSystemSetup import pekko.actor.setup.ActorSystemSetup
import pekko.dispatch.{ Dispatchers, ExecutionContexts } import pekko.dispatch.{ Dispatchers, ExecutionContexts }
import pekko.testkit.{ ImplicitSender, PekkoSpec, TestActors, TestProbe } import pekko.testkit.{ ImplicitSender, PekkoSpec, TestActors, TestProbe }
import com.typesafe.config.ConfigFactory
object ActorSystemDispatchersSpec { object ActorSystemDispatchersSpec {
class SnitchingExecutionContext(testActor: ActorRef, underlying: ExecutionContext) extends ExecutionContext { class SnitchingExecutionContext(testActor: ActorRef, underlying: ExecutionContext) extends ExecutionContext {

View file

@ -16,11 +16,10 @@ package org.apache.pekko.actor
import java.util.concurrent.{ ConcurrentLinkedQueue, RejectedExecutionException } import java.util.concurrent.{ ConcurrentLinkedQueue, RejectedExecutionException }
import java.util.concurrent.atomic.AtomicInteger import java.util.concurrent.atomic.AtomicInteger
import scala.annotation.nowarn
import scala.concurrent.{ Await, Future } import scala.concurrent.{ Await, Future }
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.annotation.nowarn
import com.typesafe.config.{ Config, ConfigFactory }
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import org.apache.pekko import org.apache.pekko
@ -32,6 +31,8 @@ import pekko.testkit.{ TestKit, _ }
import pekko.util.{ Switch, Timeout } import pekko.util.{ Switch, Timeout }
import pekko.util.Helpers.ConfigOps import pekko.util.Helpers.ConfigOps
import com.typesafe.config.{ Config, ConfigFactory }
object ActorSystemSpec { object ActorSystemSpec {
class Waves extends Actor { class Waves extends Actor {

View file

@ -15,9 +15,6 @@ package org.apache.pekko.actor
import scala.concurrent.duration._ import scala.concurrent.duration._
import com.typesafe.config.{ Config, ConfigFactory }
import org.scalatest.BeforeAndAfterEach
import org.apache.pekko import org.apache.pekko
import pekko.actor.ActorSystem.Settings import pekko.actor.ActorSystem.Settings
import pekko.dispatch.BoundedDequeBasedMailbox import pekko.dispatch.BoundedDequeBasedMailbox
@ -26,6 +23,10 @@ import pekko.testkit.DefaultTimeout
import pekko.testkit.TestEvent._ import pekko.testkit.TestEvent._
import pekko.util.unused import pekko.util.unused
import org.scalatest.BeforeAndAfterEach
import com.typesafe.config.{ Config, ConfigFactory }
object ActorWithBoundedStashSpec { object ActorWithBoundedStashSpec {
class StashingActor extends Actor with Stash { class StashingActor extends Actor with Stash {

View file

@ -13,18 +13,18 @@
package org.apache.pekko.actor package org.apache.pekko.actor
import scala.annotation.nowarn
import scala.concurrent.Await import scala.concurrent.Await
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.annotation.nowarn
import org.scalatest.BeforeAndAfterEach
import org.apache.pekko import org.apache.pekko
import pekko.pattern.ask import pekko.pattern.ask
import pekko.testkit._ import pekko.testkit._
import pekko.testkit.DefaultTimeout import pekko.testkit.DefaultTimeout
import pekko.testkit.TestEvent._ import pekko.testkit.TestEvent._
import org.scalatest.BeforeAndAfterEach
object ActorWithStashSpec { object ActorWithStashSpec {
class StashingActor extends Actor with Stash { class StashingActor extends Actor with Stash {

View file

@ -13,26 +13,28 @@
package org.apache.pekko.actor 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 org.apache.pekko
import pekko.ConfigurationException import pekko.ConfigurationException
import pekko.Done import pekko.Done
import pekko.actor.CoordinatedShutdown.Phase import pekko.actor.CoordinatedShutdown.Phase
import pekko.actor.CoordinatedShutdown.UnknownReason import pekko.actor.CoordinatedShutdown.UnknownReason
import pekko.testkit.PekkoSpec
import pekko.testkit.EventFilter import pekko.testkit.EventFilter
import pekko.testkit.PekkoSpec
import pekko.testkit.TestKit import pekko.testkit.TestKit
import pekko.testkit.TestProbe import pekko.testkit.TestProbe
import com.typesafe.config.Config import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory 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 class CoordinatedShutdownSpec
extends PekkoSpec(ConfigFactory.parseString(""" extends PekkoSpec(ConfigFactory.parseString("""
pekko.loglevel=INFO pekko.loglevel=INFO

View file

@ -17,8 +17,8 @@ import scala.concurrent.duration._
import org.apache.pekko import org.apache.pekko
import pekko.event.Logging import pekko.event.Logging
import pekko.testkit.PekkoSpec
import pekko.testkit.ImplicitSender import pekko.testkit.ImplicitSender
import pekko.testkit.PekkoSpec
import pekko.testkit.TestActors import pekko.testkit.TestActors
import pekko.testkit.TestProbe import pekko.testkit.TestProbe

View file

@ -14,9 +14,9 @@
package org.apache.pekko.actor package org.apache.pekko.actor
import org.apache.pekko import org.apache.pekko
import pekko.testkit.PekkoSpec
import pekko.testkit.EventFilter import pekko.testkit.EventFilter
import pekko.testkit.ImplicitSender import pekko.testkit.ImplicitSender
import pekko.testkit.PekkoSpec
import pekko.testkit.TestActors import pekko.testkit.TestActors
object DeadLetterSuspensionSpec { object DeadLetterSuspensionSpec {

View file

@ -13,11 +13,10 @@
package org.apache.pekko.actor package org.apache.pekko.actor
import scala.annotation.nowarn
import scala.concurrent.Await import scala.concurrent.Await
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.annotation.nowarn
import org.apache.pekko import org.apache.pekko
import pekko.actor.Props.EmptyActor import pekko.actor.Props.EmptyActor
import pekko.dispatch.sysmsg.{ DeathWatchNotification, Failed } import pekko.dispatch.sysmsg.{ DeathWatchNotification, Failed }

View file

@ -15,13 +15,13 @@ package org.apache.pekko.actor
import scala.concurrent.duration._ import scala.concurrent.duration._
import com.typesafe.config.ConfigFactory
import com.typesafe.config.ConfigParseOptions
import org.apache.pekko import org.apache.pekko
import pekko.routing._ import pekko.routing._
import pekko.testkit.PekkoSpec import pekko.testkit.PekkoSpec
import com.typesafe.config.ConfigFactory
import com.typesafe.config.ConfigParseOptions
object DeployerSpec { object DeployerSpec {
val deployerConf = ConfigFactory.parseString( val deployerConf = ConfigFactory.parseString(
""" """

View file

@ -17,14 +17,15 @@ import java.util.concurrent.atomic.AtomicInteger
import scala.util.control.NoStackTrace 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 org.apache.pekko
import pekko.testkit.EventFilter import pekko.testkit.EventFilter
import pekko.testkit.TestKit._ 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 { object TestExtension extends ExtensionId[TestExtension] with ExtensionIdProvider {
def lookup = this def lookup = this
def createExtension(s: ExtendedActorSystem) = new TestExtension(s) def createExtension(s: ExtendedActorSystem) = new TestExtension(s)

View file

@ -16,13 +16,13 @@ package org.apache.pekko.actor
import scala.concurrent.Await import scala.concurrent.Await
import scala.concurrent.duration._ import scala.concurrent.duration._
import com.typesafe.config.ConfigFactory
import org.apache.pekko import org.apache.pekko
import pekko.event._ import pekko.event._
import pekko.testkit._ import pekko.testkit._
import pekko.util.{ unused, Timeout } import pekko.util.{ unused, Timeout }
import com.typesafe.config.ConfigFactory
object FSMActorSpec { object FSMActorSpec {
class Latches(implicit system: ActorSystem) { class Latches(implicit system: ActorSystem) {

View file

@ -15,9 +15,9 @@ package org.apache.pekko.actor
import org.apache.pekko import org.apache.pekko
import pekko.actor.dungeon.SerializationCheckFailedException import pekko.actor.dungeon.SerializationCheckFailedException
import pekko.testkit.PekkoSpec
import pekko.testkit.EventFilter import pekko.testkit.EventFilter
import pekko.testkit.ImplicitSender import pekko.testkit.ImplicitSender
import pekko.testkit.PekkoSpec
object FunctionRefSpec { object FunctionRefSpec {

View file

@ -13,14 +13,13 @@
package org.apache.pekko.actor package org.apache.pekko.actor
import scala.annotation.nowarn
import scala.concurrent.Await import scala.concurrent.Await
import scala.concurrent.Future import scala.concurrent.Future
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.util.Failure import scala.util.Failure
import scala.util.Success import scala.util.Success
import scala.annotation.nowarn
import org.apache.pekko import org.apache.pekko
import pekko.testkit._ import pekko.testkit._
import pekko.util.Timeout import pekko.util.Timeout

View file

@ -13,14 +13,14 @@
package org.apache.pekko.actor package org.apache.pekko.actor
import com.typesafe.config.ConfigFactory
import org.apache.pekko import org.apache.pekko
import pekko.actor.ActorSystem.Settings import pekko.actor.ActorSystem.Settings
import pekko.actor.ActorSystem.findClassLoader import pekko.actor.ActorSystem.findClassLoader
import pekko.actor.setup.ActorSystemSetup import pekko.actor.setup.ActorSystemSetup
import pekko.testkit.AbstractSpec import pekko.testkit.AbstractSpec
import com.typesafe.config.ConfigFactory
class ProviderSelectionSpec extends AbstractSpec { class ProviderSelectionSpec extends AbstractSpec {
import ProviderSelection.{ ClusterActorRefProvider, RemoteActorRefProvider } import ProviderSelection.{ ClusterActorRefProvider, RemoteActorRefProvider }

View file

@ -15,16 +15,15 @@ package org.apache.pekko.actor
import java.lang.Thread.sleep import java.lang.Thread.sleep
import scala.annotation.nowarn
import scala.concurrent.Await import scala.concurrent.Await
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.annotation.nowarn
import org.apache.pekko import org.apache.pekko
import pekko.pattern.ask import pekko.pattern.ask
import pekko.testkit.PekkoSpec
import pekko.testkit.DefaultTimeout import pekko.testkit.DefaultTimeout
import pekko.testkit.EventFilter import pekko.testkit.EventFilter
import pekko.testkit.PekkoSpec
import pekko.testkit.TestEvent._ import pekko.testkit.TestEvent._
import pekko.testkit.TestLatch import pekko.testkit.TestLatch

View file

@ -17,6 +17,7 @@ import java.io.Closeable
import java.util.concurrent._ import java.util.concurrent._
import java.util.concurrent.ThreadLocalRandom import java.util.concurrent.ThreadLocalRandom
import scala.annotation.nowarn
import scala.concurrent.{ Await, ExecutionContext, Future } import scala.concurrent.{ Await, ExecutionContext, Future }
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.util.Try import scala.util.Try
@ -24,15 +25,16 @@ import scala.util.control.NoStackTrace
import scala.util.control.NonFatal import scala.util.control.NonFatal
import atomic.{ AtomicInteger, AtomicReference } import atomic.{ AtomicInteger, AtomicReference }
import scala.annotation.nowarn
import com.typesafe.config.{ Config, ConfigFactory }
import org.scalatest.BeforeAndAfterEach
import org.apache.pekko import org.apache.pekko
import pekko.pattern.ask import pekko.pattern.ask
import pekko.testkit._ import pekko.testkit._
import pekko.util.Helpers import pekko.util.Helpers
import org.scalatest.BeforeAndAfterEach
import com.typesafe.config.{ Config, ConfigFactory }
object SchedulerSpec { object SchedulerSpec {
val testConfRevolver = val testConfRevolver =
ConfigFactory.parseString(""" ConfigFactory.parseString("""

View file

@ -19,14 +19,13 @@ import java.util.concurrent.{ CountDownLatch, TimeUnit }
import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.atomic.AtomicInteger import java.util.concurrent.atomic.AtomicInteger
import scala.annotation.nowarn
import scala.concurrent.Await import scala.concurrent.Await
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.util.Random import scala.util.Random
import scala.util.control.NoStackTrace import scala.util.control.NoStackTrace
import SupervisorStrategy.{ Directive, Restart, Resume, Stop } import SupervisorStrategy.{ Directive, Restart, Resume, Stop }
import scala.annotation.nowarn
import com.typesafe.config.{ Config, ConfigFactory }
import org.apache.pekko import org.apache.pekko
import pekko.actor.SupervisorStrategy.seqThrowable2Decider import pekko.actor.SupervisorStrategy.seqThrowable2Decider
@ -39,6 +38,8 @@ import pekko.testkit.LongRunningTest
import pekko.testkit.TestEvent.Mute import pekko.testkit.TestEvent.Mute
import pekko.util.Helpers.ConfigOps import pekko.util.Helpers.ConfigOps
import com.typesafe.config.{ Config, ConfigFactory }
object SupervisorHierarchySpec { object SupervisorHierarchySpec {
class FireWorkerException(msg: String) extends Exception(msg) class FireWorkerException(msg: String) extends Exception(msg)

View file

@ -15,17 +15,16 @@ package org.apache.pekko.actor
import java.util.concurrent.{ CountDownLatch, TimeUnit } import java.util.concurrent.{ CountDownLatch, TimeUnit }
import scala.annotation.nowarn
import scala.concurrent.Await import scala.concurrent.Await
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.util.control.NonFatal import scala.util.control.NonFatal
import scala.annotation.nowarn
import org.apache.pekko import org.apache.pekko
import pekko.pattern.ask import pekko.pattern.ask
import pekko.testkit.{ filterEvents, EventFilter } import pekko.testkit.{ filterEvents, EventFilter }
import pekko.testkit.PekkoSpec
import pekko.testkit.DefaultTimeout import pekko.testkit.DefaultTimeout
import pekko.testkit.PekkoSpec
object SupervisorMiscSpec { object SupervisorMiscSpec {
val config = """ val config = """

View file

@ -18,10 +18,6 @@ import java.util.concurrent.atomic.AtomicInteger
import scala.concurrent.Await import scala.concurrent.Await
import scala.concurrent.duration._ import scala.concurrent.duration._
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
import org.scalatest.BeforeAndAfterEach
import org.apache.pekko import org.apache.pekko
import pekko.{ Die, Ping } import pekko.{ Die, Ping }
import pekko.ConfigurationException import pekko.ConfigurationException
@ -33,6 +29,11 @@ import pekko.testkit._
import pekko.testkit.TestEvent._ import pekko.testkit.TestEvent._
import pekko.util.unused import pekko.util.unused
import org.scalatest.BeforeAndAfterEach
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
object SupervisorSpec { object SupervisorSpec {
val Timeout = 5.seconds val Timeout = 5.seconds

View file

@ -16,14 +16,14 @@ package org.apache.pekko.actor
import scala.concurrent.Await import scala.concurrent.Await
import scala.concurrent.duration._ import scala.concurrent.duration._
import org.scalatest.BeforeAndAfterAll
import org.apache.pekko import org.apache.pekko
import pekko.pattern.ask import pekko.pattern.ask
import pekko.testkit.{ filterEvents, EventFilter } import pekko.testkit.{ filterEvents, EventFilter }
import pekko.testkit.PekkoSpec
import pekko.testkit.DefaultTimeout import pekko.testkit.DefaultTimeout
import pekko.testkit.ImplicitSender import pekko.testkit.ImplicitSender
import pekko.testkit.PekkoSpec
import org.scalatest.BeforeAndAfterAll
class Ticket669Spec extends PekkoSpec with BeforeAndAfterAll with ImplicitSender with DefaultTimeout { class Ticket669Spec extends PekkoSpec with BeforeAndAfterAll with ImplicitSender with DefaultTimeout {
import Ticket669Spec._ import Ticket669Spec._

View file

@ -17,14 +17,11 @@ import java.rmi.RemoteException
import java.util.concurrent.{ ConcurrentHashMap, CountDownLatch, TimeUnit } import java.util.concurrent.{ ConcurrentHashMap, CountDownLatch, TimeUnit }
import java.util.concurrent.atomic.{ AtomicInteger, AtomicLong } import java.util.concurrent.atomic.{ AtomicInteger, AtomicLong }
import scala.annotation.nowarn
import scala.annotation.tailrec import scala.annotation.tailrec
import scala.concurrent.{ Await, Future } import scala.concurrent.{ Await, Future }
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.annotation.nowarn
import com.typesafe.config.Config
import org.scalatest.Assertions._
import org.apache.pekko import org.apache.pekko
import pekko.actor._ import pekko.actor._
import pekko.dispatch._ import pekko.dispatch._
@ -33,6 +30,10 @@ import pekko.pattern.ask
import pekko.testkit._ import pekko.testkit._
import pekko.util.Switch import pekko.util.Switch
import org.scalatest.Assertions._
import com.typesafe.config.Config
object ActorModelSpec { object ActorModelSpec {
sealed trait ActorModelMessage extends NoSerializationVerificationNeeded sealed trait ActorModelMessage extends NoSerializationVerificationNeeded

View file

@ -22,8 +22,8 @@ import scala.concurrent.duration._
import org.apache.pekko import org.apache.pekko
import pekko.actor.{ Actor, Props } import pekko.actor.{ Actor, Props }
import pekko.pattern.ask import pekko.pattern.ask
import pekko.testkit.PekkoSpec
import pekko.testkit.DefaultTimeout import pekko.testkit.DefaultTimeout
import pekko.testkit.PekkoSpec
object DispatcherActorSpec { object DispatcherActorSpec {
val config = """ val config = """

View file

@ -18,9 +18,6 @@ import java.util.concurrent.atomic.AtomicBoolean
import scala.reflect.ClassTag import scala.reflect.ClassTag
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
import org.apache.pekko import org.apache.pekko
import pekko.ConfigurationException import pekko.ConfigurationException
import pekko.actor._ import pekko.actor._
@ -29,6 +26,9 @@ import pekko.routing.FromConfig
import pekko.testkit.{ ImplicitSender, PekkoSpec } import pekko.testkit.{ ImplicitSender, PekkoSpec }
import pekko.util.unused import pekko.util.unused
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
object DispatchersSpec { object DispatchersSpec {
val config = """ val config = """
myapp { myapp {

View file

@ -17,14 +17,14 @@ import java.util.concurrent.{ CountDownLatch, TimeUnit }
import scala.concurrent.Await import scala.concurrent.Await
import org.scalatest.BeforeAndAfterEach
import org.apache.pekko import org.apache.pekko
import pekko.actor.{ Actor, Props } import pekko.actor.{ Actor, Props }
import pekko.pattern.ask import pekko.pattern.ask
import pekko.testkit._ import pekko.testkit._
import pekko.testkit.PekkoSpec import pekko.testkit.PekkoSpec
import org.scalatest.BeforeAndAfterEach
object PinnedActorSpec { object PinnedActorSpec {
val config = """ val config = """
pinned-dispatcher { pinned-dispatcher {

View file

@ -13,13 +13,13 @@
package org.apache.pekko.actor.setup package org.apache.pekko.actor.setup
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import org.apache.pekko import org.apache.pekko
import pekko.actor.ActorSystem import pekko.actor.ActorSystem
import pekko.testkit.TestKit import pekko.testkit.TestKit
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
case class DummySetup(name: String) extends Setup case class DummySetup(name: String) extends Setup
case class DummySetup2(name: String) extends Setup case class DummySetup2(name: String) extends Setup
case class DummySetup3(name: String) extends Setup case class DummySetup3(name: String) extends Setup

View file

@ -17,9 +17,6 @@ import java.util.concurrent.TimeUnit
import scala.concurrent.duration._ import scala.concurrent.duration._
import com.typesafe.config.ConfigFactory
import org.scalatest.Assertions
import org.apache.pekko import org.apache.pekko
import pekko.actor.ActorSystem import pekko.actor.ActorSystem
import pekko.actor.ExtendedActorSystem import pekko.actor.ExtendedActorSystem
@ -27,6 +24,10 @@ import pekko.event.DefaultLoggingFilter
import pekko.event.Logging.DefaultLogger import pekko.event.Logging.DefaultLogger
import pekko.testkit.PekkoSpec import pekko.testkit.PekkoSpec
import org.scalatest.Assertions
import com.typesafe.config.ConfigFactory
class ConfigSpec extends PekkoSpec(ConfigFactory.defaultReference(ActorSystem.findClassLoader())) with Assertions { class ConfigSpec extends PekkoSpec(ConfigFactory.defaultReference(ActorSystem.findClassLoader())) with Assertions {
"The default configuration file (i.e. reference.conf)" must { "The default configuration file (i.e. reference.conf)" must {

View file

@ -18,13 +18,13 @@ import java.lang.management.ManagementFactory
import scala.concurrent.{ Await, Future } import scala.concurrent.{ Await, Future }
import scala.concurrent.duration._ import scala.concurrent.duration._
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import org.apache.pekko import org.apache.pekko
import pekko.actor.ActorSystem import pekko.actor.ActorSystem
import pekko.testkit.TestKit import pekko.testkit.TestKit
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
class DispatcherShutdownSpec extends AnyWordSpec with Matchers { class DispatcherShutdownSpec extends AnyWordSpec with Matchers {
"pekko dispatcher" should { "pekko dispatcher" should {

View file

@ -13,13 +13,13 @@
package org.apache.pekko.dispatch package org.apache.pekko.dispatch
import com.typesafe.config.ConfigFactory
import org.apache.pekko import org.apache.pekko
import pekko.actor.{ Actor, Props } import pekko.actor.{ Actor, Props }
import pekko.testkit.{ ImplicitSender, PekkoSpec } import pekko.testkit.{ ImplicitSender, PekkoSpec }
import pekko.util.JavaVersion import pekko.util.JavaVersion
import com.typesafe.config.ConfigFactory
object ForkJoinPoolStarvationSpec { object ForkJoinPoolStarvationSpec {
val config = ConfigFactory.parseString(""" val config = ConfigFactory.parseString("""
|actorhang { |actorhang {

View file

@ -18,14 +18,15 @@ import java.util.concurrent.{ BlockingQueue, ConcurrentLinkedQueue }
import scala.concurrent.{ Await, ExecutionContext, Future } import scala.concurrent.{ Await, ExecutionContext, Future }
import scala.concurrent.duration._ import scala.concurrent.duration._
import com.typesafe.config.{ Config, ConfigFactory }
import org.scalatest.{ BeforeAndAfterAll, BeforeAndAfterEach }
import org.apache.pekko import org.apache.pekko
import pekko.actor._ import pekko.actor._
import pekko.testkit.{ EventFilter, PekkoSpec } import pekko.testkit.{ EventFilter, PekkoSpec }
import pekko.util.unused import pekko.util.unused
import org.scalatest.{ BeforeAndAfterAll, BeforeAndAfterEach }
import com.typesafe.config.{ Config, ConfigFactory }
abstract class MailboxSpec extends PekkoSpec with BeforeAndAfterAll with BeforeAndAfterEach { abstract class MailboxSpec extends PekkoSpec with BeforeAndAfterAll with BeforeAndAfterEach {
def name: String def name: String

View file

@ -15,13 +15,13 @@ package org.apache.pekko.dispatch
import scala.concurrent.duration._ import scala.concurrent.duration._
import com.typesafe.config.Config
import org.apache.pekko import org.apache.pekko
import pekko.actor.{ Actor, ActorSystem, Props } import pekko.actor.{ Actor, ActorSystem, Props }
import pekko.testkit.{ DefaultTimeout, PekkoSpec } import pekko.testkit.{ DefaultTimeout, PekkoSpec }
import pekko.util.unused import pekko.util.unused
import com.typesafe.config.Config
object PriorityDispatcherSpec { object PriorityDispatcherSpec {
case object Result case object Result

View file

@ -16,12 +16,12 @@ package org.apache.pekko.dispatch
import scala.concurrent.ExecutionContext import scala.concurrent.ExecutionContext
import scala.concurrent.Promise import scala.concurrent.Promise
import org.scalatest.matchers.should.Matchers
import org.apache.pekko import org.apache.pekko
import pekko.Done import pekko.Done
import pekko.testkit.PekkoSpec import pekko.testkit.PekkoSpec
import org.scalatest.matchers.should.Matchers
class SameThreadExecutionContextSpec extends PekkoSpec with Matchers { class SameThreadExecutionContextSpec extends PekkoSpec with Matchers {
"The SameThreadExecutionContext" should { "The SameThreadExecutionContext" should {

View file

@ -15,13 +15,13 @@ package org.apache.pekko.dispatch
import scala.concurrent.duration._ import scala.concurrent.duration._
import com.typesafe.config.Config
import org.apache.pekko import org.apache.pekko
import pekko.actor.{ Actor, ActorSystem, Props } import pekko.actor.{ Actor, ActorSystem, Props }
import pekko.testkit.{ DefaultTimeout, PekkoSpec } import pekko.testkit.{ DefaultTimeout, PekkoSpec }
import pekko.util.unused import pekko.util.unused
import com.typesafe.config.Config
object StablePriorityDispatcherSpec { object StablePriorityDispatcherSpec {
case object Result case object Result

View file

@ -13,14 +13,15 @@
package org.apache.pekko.event package org.apache.pekko.event
import com.typesafe.config.{ Config, ConfigFactory }
import org.scalatest.BeforeAndAfterEach
import org.apache.pekko import org.apache.pekko
import pekko.actor.{ Actor, ActorRef, ActorSystem, PoisonPill, Props } import pekko.actor.{ Actor, ActorRef, ActorSystem, PoisonPill, Props }
import pekko.japi.function.Procedure import pekko.japi.function.Procedure
import pekko.testkit._ import pekko.testkit._
import org.scalatest.BeforeAndAfterEach
import com.typesafe.config.{ Config, ConfigFactory }
object EventBusSpec { object EventBusSpec {
class TestActorWrapperActor(testActor: ActorRef) extends Actor { class TestActorWrapperActor(testActor: ActorRef) extends Actor {
def receive = { def receive = {

View file

@ -15,12 +15,12 @@ package org.apache.pekko.event
import scala.concurrent.duration._ import scala.concurrent.duration._
import com.typesafe.config.ConfigFactory
import org.apache.pekko import org.apache.pekko
import pekko.actor._ import pekko.actor._
import pekko.testkit.{ PekkoSpec, TestProbe } import pekko.testkit.{ PekkoSpec, TestProbe }
import com.typesafe.config.ConfigFactory
object EventStreamSpec { object EventStreamSpec {
val config = ConfigFactory.parseString(""" val config = ConfigFactory.parseString("""

View file

@ -22,10 +22,6 @@ import java.util.concurrent.TimeUnit
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.util.control.NoStackTrace 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 org.apache.pekko
import pekko.actor._ import pekko.actor._
import pekko.event.Logging._ import pekko.event.Logging._
@ -35,6 +31,11 @@ import pekko.serialization.SerializationExtension
import pekko.testkit._ import pekko.testkit._
import pekko.util.Helpers import pekko.util.Helpers
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import com.typesafe.config.{ Config, ConfigFactory }
object LoggerSpec { object LoggerSpec {
val defaultConfig = ConfigFactory.parseString(""" val defaultConfig = ConfigFactory.parseString("""

View file

@ -15,15 +15,16 @@ package org.apache.pekko.event
import scala.annotation.tailrec import scala.annotation.tailrec
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.jdk.CollectionConverters._
import com.typesafe.config.ConfigFactory
import org.scalatest.BeforeAndAfterAll
import org.scalatest.wordspec.AnyWordSpec
import org.apache.pekko import org.apache.pekko
import pekko.actor._ import pekko.actor._
import pekko.testkit._ import pekko.testkit._
import scala.jdk.CollectionConverters._
import org.scalatest.BeforeAndAfterAll
import org.scalatest.wordspec.AnyWordSpec
import com.typesafe.config.ConfigFactory
object LoggingReceiveSpec { object LoggingReceiveSpec {
class TestLogActor extends Actor { class TestLogActor extends Actor {

View file

@ -19,15 +19,15 @@ import java.util.concurrent.atomic.AtomicLong
import scala.collection.immutable import scala.collection.immutable
import scala.concurrent.duration._ import scala.concurrent.duration._
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import org.apache.pekko import org.apache.pekko
import pekko.io.dns.ARecord import pekko.io.dns.ARecord
import pekko.io.dns.CachePolicy.Ttl import pekko.io.dns.CachePolicy.Ttl
import pekko.io.dns.DnsProtocol import pekko.io.dns.DnsProtocol
import pekko.io.dns.DnsProtocol.Ip import pekko.io.dns.DnsProtocol.Ip
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
class SimpleDnsCacheSpec extends AnyWordSpec with Matchers { class SimpleDnsCacheSpec extends AnyWordSpec with Matchers {
"Cache" should { "Cache" should {
"not reply with expired but not yet swept out entries" in { "not reply with expired but not yet swept out entries" in {

View file

@ -30,8 +30,6 @@ import scala.util.Try
import scala.util.control.NonFatal import scala.util.control.NonFatal
import com.google.common.jimfs.{ Configuration, Jimfs } import com.google.common.jimfs.{ Configuration, Jimfs }
import com.typesafe.config.ConfigFactory
import org.scalatest.matchers._
import org.apache.pekko import org.apache.pekko
import pekko.actor._ import pekko.actor._
@ -43,6 +41,10 @@ import pekko.testkit.SocketUtil.temporaryServerAddress
import pekko.testkit.WithLogCapturing import pekko.testkit.WithLogCapturing
import pekko.util.{ ByteString, Helpers } import pekko.util.{ ByteString, Helpers }
import org.scalatest.matchers._
import com.typesafe.config.ConfigFactory
object TcpConnectionSpec { object TcpConnectionSpec {
case class Ack(i: Int) extends Event case class Ack(i: Int) extends Event
object Ack extends Ack(0) object Ack extends Ack(0)

View file

@ -18,8 +18,6 @@ import java.net.{ InetSocketAddress, ServerSocket }
import scala.concurrent.duration._ import scala.concurrent.duration._
import org.scalatest.concurrent.TimeLimits
import org.apache.pekko import org.apache.pekko
import pekko.actor.{ ActorRef, PoisonPill } import pekko.actor.{ ActorRef, PoisonPill }
import pekko.io.Tcp._ import pekko.io.Tcp._
@ -27,6 +25,8 @@ import pekko.testkit.{ PekkoSpec, TestProbe }
import pekko.testkit.WithLogCapturing import pekko.testkit.WithLogCapturing
import pekko.util.ByteString import pekko.util.ByteString
import org.scalatest.concurrent.TimeLimits
class TcpIntegrationSpec extends PekkoSpec(""" class TcpIntegrationSpec extends PekkoSpec("""
pekko.loglevel = debug pekko.loglevel = debug
pekko.loggers = ["org.apache.pekko.testkit.SilenceAllTestEventListener"] pekko.loggers = ["org.apache.pekko.testkit.SilenceAllTestEventListener"]

View file

@ -15,13 +15,13 @@ package org.apache.pekko.io
import scala.annotation.tailrec import scala.annotation.tailrec
import scala.collection.immutable import scala.collection.immutable
import scala.concurrent.ExecutionContext
import Tcp._ import Tcp._
import org.apache.pekko import org.apache.pekko
import pekko.actor.ActorRef import pekko.actor.ActorRef
import pekko.actor.ActorSystem import pekko.actor.ActorSystem
import scala.concurrent.ExecutionContext
import pekko.io.Inet.SocketOption import pekko.io.Inet.SocketOption
import pekko.testkit.{ PekkoSpec, TestProbe } import pekko.testkit.{ PekkoSpec, TestProbe }
import pekko.testkit.SocketUtil.temporaryServerAddress import pekko.testkit.SocketUtil.temporaryServerAddress

View file

@ -19,8 +19,8 @@ import scala.concurrent.duration._
import org.apache.pekko import org.apache.pekko
import pekko.actor.ActorRef import pekko.actor.ActorRef
import pekko.testkit.PekkoSpec
import pekko.testkit.ImplicitSender import pekko.testkit.ImplicitSender
import pekko.testkit.PekkoSpec
import pekko.testkit.SocketUtil.temporaryServerAddresses import pekko.testkit.SocketUtil.temporaryServerAddresses
import pekko.testkit.TestProbe import pekko.testkit.TestProbe
import pekko.testkit.WithLogCapturing import pekko.testkit.WithLogCapturing

View file

@ -15,6 +15,7 @@ package org.apache.pekko.io
import java.net.DatagramSocket import java.net.DatagramSocket
import java.net.InetSocketAddress import java.net.InetSocketAddress
import org.apache.pekko import org.apache.pekko
import pekko.actor.ActorRef import pekko.actor.ActorRef
import pekko.io.Inet._ import pekko.io.Inet._

View file

@ -17,11 +17,8 @@ import java.net.InetAddress
import scala.concurrent.duration._ import scala.concurrent.duration._
import com.typesafe.config.ConfigFactory
import org.scalatest.time.Millis
import org.scalatest.time.Span
import CachePolicy.Ttl import CachePolicy.Ttl
import org.apache.pekko import org.apache.pekko
import pekko.io.{ Dns, IO } import pekko.io.{ Dns, IO }
import pekko.io.dns.DnsProtocol.{ Ip, RequestType, Srv } import pekko.io.dns.DnsProtocol.{ Ip, RequestType, Srv }
@ -31,6 +28,11 @@ import pekko.testkit.SocketUtil.Both
import pekko.testkit.WithLogCapturing import pekko.testkit.WithLogCapturing
import pekko.util.Timeout 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. * These tests rely on a DNS server with 2 zones configured, foo.test and bar.example.
* *

View file

@ -17,12 +17,12 @@ import java.net.InetAddress
import scala.concurrent.duration._ import scala.concurrent.duration._
import com.typesafe.config.ConfigFactory
import org.apache.pekko import org.apache.pekko
import pekko.actor.ExtendedActorSystem import pekko.actor.ExtendedActorSystem
import pekko.testkit.PekkoSpec import pekko.testkit.PekkoSpec
import com.typesafe.config.ConfigFactory
class DnsSettingsSpec extends PekkoSpec { class DnsSettingsSpec extends PekkoSpec {
val eas = system.asInstanceOf[ExtendedActorSystem] val eas = system.asInstanceOf[ExtendedActorSystem]

View file

@ -14,21 +14,23 @@
package org.apache.pekko.io.dns package org.apache.pekko.io.dns
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.jdk.CollectionConverters._
import scala.util.Try import scala.util.Try
import scala.util.control.NonFatal import scala.util.control.NonFatal
import com.typesafe.config.Config
import com.github.dockerjava.api.DockerClient import com.github.dockerjava.api.DockerClient
import com.github.dockerjava.api.async.ResultCallback import com.github.dockerjava.api.async.ResultCallback
import com.github.dockerjava.api.command.CreateContainerCmd import com.github.dockerjava.api.command.CreateContainerCmd
import com.github.dockerjava.api.model._ import com.github.dockerjava.api.model._
import com.github.dockerjava.core.{ DefaultDockerClientConfig, DockerClientConfig, DockerClientImpl } import com.github.dockerjava.core.{ DefaultDockerClientConfig, DockerClientConfig, DockerClientImpl }
import com.github.dockerjava.httpclient5.ApacheDockerHttpClient import com.github.dockerjava.httpclient5.ApacheDockerHttpClient
import org.scalatest.concurrent.Eventually
import org.apache.pekko import org.apache.pekko
import pekko.testkit.PekkoSpec import pekko.testkit.PekkoSpec
import scala.jdk.CollectionConverters._
import org.scalatest.concurrent.Eventually
import com.typesafe.config.Config
abstract class DockerBindDnsService(config: Config) extends PekkoSpec(config) with Eventually { abstract class DockerBindDnsService(config: Config) extends PekkoSpec(config) with Eventually {

View file

@ -18,7 +18,6 @@ import java.net.{ Inet6Address, InetAddress }
import scala.collection.{ immutable => im } import scala.collection.{ immutable => im }
import scala.concurrent.duration._ import scala.concurrent.duration._
import com.typesafe.config.{ Config, ConfigFactory, ConfigValueFactory }
import org.apache.pekko import org.apache.pekko
import pekko.actor.{ ActorRef, ExtendedActorSystem, Props } import pekko.actor.{ ActorRef, ExtendedActorSystem, Props }
import pekko.actor.Status.Failure 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.io.dns.internal.DnsClient.{ Answer, DuplicateId, Question4, Question6, SrvQuestion }
import pekko.testkit.{ PekkoSpec, TestProbe, WithLogCapturing } import pekko.testkit.{ PekkoSpec, TestProbe, WithLogCapturing }
import com.typesafe.config.{ Config, ConfigFactory, ConfigValueFactory }
class AsyncDnsResolverSpec extends PekkoSpec(""" class AsyncDnsResolverSpec extends PekkoSpec("""
pekko.loglevel = DEBUG pekko.loglevel = DEBUG
pekko.loggers = ["org.apache.pekko.testkit.SilenceAllTestEventListener"] pekko.loggers = ["org.apache.pekko.testkit.SilenceAllTestEventListener"]

View file

@ -15,7 +15,9 @@ package org.apache.pekko.io.dns.internal
import java.net.{ InetAddress, InetSocketAddress } import java.net.{ InetAddress, InetSocketAddress }
import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.atomic.AtomicBoolean
import scala.collection.{ immutable => im } import scala.collection.{ immutable => im }
import org.apache.pekko import org.apache.pekko
import org.apache.pekko.actor.Status.Failure import org.apache.pekko.actor.Status.Failure
import pekko.actor.Props import pekko.actor.Props

View file

@ -13,13 +13,13 @@
package org.apache.pekko.io.dns.internal package org.apache.pekko.io.dns.internal
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import org.apache.pekko import org.apache.pekko
import pekko.io.dns.{ RecordClass, RecordType } import pekko.io.dns.{ RecordClass, RecordType }
import pekko.util.ByteString import pekko.util.ByteString
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
class MessageSpec extends AnyWordSpec with Matchers { class MessageSpec extends AnyWordSpec with Matchers {
"The Message" should { "The Message" should {
"parse a response that is truncated mid-message" in { "parse a response that is truncated mid-message" in {

View file

@ -13,10 +13,10 @@
package org.apache.pekko.pattern package org.apache.pekko.pattern
import scala.annotation.nowarn
import scala.concurrent.Await import scala.concurrent.Await
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.util.Failure import scala.util.Failure
import scala.annotation.nowarn
import org.apache.pekko import org.apache.pekko
import pekko.actor._ import pekko.actor._

View file

@ -15,9 +15,8 @@ package org.apache.pekko.pattern
import java.util.concurrent.{ CountDownLatch, TimeUnit } import java.util.concurrent.{ CountDownLatch, TimeUnit }
import scala.concurrent.duration._
import scala.annotation.nowarn import scala.annotation.nowarn
import scala.concurrent.duration._
import org.apache.pekko import org.apache.pekko
import pekko.actor._ import pekko.actor._

View file

@ -16,13 +16,13 @@ package org.apache.pekko.pattern
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.util.control.NoStackTrace import scala.util.control.NoStackTrace
import org.scalatest.concurrent.Eventually
import org.scalatest.prop.TableDrivenPropertyChecks._
import org.apache.pekko import org.apache.pekko
import pekko.actor._ import pekko.actor._
import pekko.testkit._ import pekko.testkit._
import org.scalatest.concurrent.Eventually
import org.scalatest.prop.TableDrivenPropertyChecks._
object BackoffSupervisorSpec { object BackoffSupervisorSpec {
class TestException extends RuntimeException with NoStackTrace class TestException extends RuntimeException with NoStackTrace

View file

@ -22,6 +22,7 @@ import scala.concurrent.duration._
import scala.util.Failure import scala.util.Failure
import scala.util.Success import scala.util.Success
import scala.util.Try import scala.util.Try
import org.apache.pekko import org.apache.pekko
import pekko.actor.{ ActorSystem, ExtendedActorSystem } import pekko.actor.{ ActorSystem, ExtendedActorSystem }
import pekko.testkit._ import pekko.testkit._

View file

@ -24,8 +24,8 @@ import pekko.actor.Actor
import pekko.actor.ActorLogging import pekko.actor.ActorLogging
import pekko.actor.Props import pekko.actor.Props
import pekko.actor.Status.Failure import pekko.actor.Status.Failure
import pekko.testkit.PekkoSpec
import pekko.testkit.ImplicitSender import pekko.testkit.ImplicitSender
import pekko.testkit.PekkoSpec
object CircuitBreakerStressSpec { object CircuitBreakerStressSpec {
case object JobDone case object JobDone

View file

@ -15,6 +15,7 @@ package org.apache.pekko.pattern
import scala.concurrent.{ Await, ExecutionContextExecutor, Future, Promise, TimeoutException } import scala.concurrent.{ Await, ExecutionContextExecutor, Future, Promise, TimeoutException }
import scala.concurrent.duration._ import scala.concurrent.duration._
import org.apache.pekko import org.apache.pekko
import pekko.actor.{ Actor, Props } import pekko.actor.{ Actor, Props }
import pekko.testkit.{ PekkoSpec, TestLatch } import pekko.testkit.{ PekkoSpec, TestLatch }

Some files were not shown because too many files have changed in this diff Show more