Skip to content

Commit

Permalink
chore: Sort imports on stream,stream-tests,stream-testkit
Browse files Browse the repository at this point in the history
  • Loading branch information
He-Pin committed Jan 16, 2024
1 parent b2cd306 commit 858b94b
Show file tree
Hide file tree
Showing 128 changed files with 327 additions and 290 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@

package org.apache.pekko.stream.impl.fusing

import scala.annotation.nowarn
import scala.collection.{ Map => SMap }
import scala.concurrent.ExecutionContextExecutor
import scala.concurrent.duration.FiniteDuration

import scala.annotation.nowarn

import org.apache.pekko
import pekko.actor.ActorSystem
import pekko.actor.Cancellable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ package org.apache.pekko.stream.testkit
import scala.collection.immutable
import scala.util.control.NoStackTrace

import org.reactivestreams.Publisher

import org.apache.pekko
import pekko.stream.scaladsl._
import pekko.stream.testkit.scaladsl.StreamTestKit._
import pekko.testkit.PekkoSpec

import org.reactivestreams.Publisher

abstract class BaseTwoStreamsSetup extends PekkoSpec("""
pekko.stream.materializer.initial-input-buffer-size = 2
pekko.stream.materializer.max-input-buffer-size = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package org.apache.pekko.stream.testkit

import scala.annotation.nowarn
import org.reactivestreams.Publisher

import org.apache.pekko
import pekko.NotUsed
Expand All @@ -25,6 +24,8 @@ import pekko.stream.ActorMaterializerSettings
import pekko.stream.Materializer
import pekko.stream.scaladsl._

import org.reactivestreams.Publisher

class ChainSetup[In, Out, M](
stream: Flow[In, In, NotUsed] => Flow[In, Out, M],
val settings: ActorMaterializerSettings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@ package org.apache.pekko.stream.testkit

import java.util.concurrent.ThreadLocalRandom

import scala.annotation.nowarn
import scala.annotation.tailrec
import scala.concurrent.duration._

import scala.annotation.nowarn
import org.reactivestreams.Publisher
import org.scalatest.matchers.should.Matchers

import org.apache.pekko
import pekko.NotUsed
import pekko.actor.ActorSystem
Expand All @@ -34,6 +31,10 @@ import pekko.stream.scaladsl.Source
import pekko.stream.testkit.TestPublisher._
import pekko.stream.testkit.TestSubscriber._

import org.reactivestreams.Publisher

import org.scalatest.matchers.should.Matchers

trait ScriptedTest extends Matchers {

class ScriptException(msg: String) extends RuntimeException(msg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@ package org.apache.pekko.stream.testkit
import scala.concurrent.Future
import scala.concurrent.duration._

import com.typesafe.config.{ Config, ConfigFactory }
import org.scalatest.Failed

import org.apache.pekko
import pekko.actor.{ ActorRef, ActorSystem }
import pekko.stream.Materializer
import pekko.stream.impl.PhasedFusingActorMaterializer
import pekko.stream.impl.StreamSupervisor
import pekko.stream.snapshot.{ MaterializerState, StreamSnapshotImpl }
import pekko.stream.testkit.scaladsl.StreamTestKit.{ assertNoChildren, stopAllChildren }
import pekko.testkit.{ PekkoSpec, TestProbe }
import pekko.testkit.TestKitUtils
import pekko.stream.impl.PhasedFusingActorMaterializer
import pekko.stream.testkit.scaladsl.StreamTestKit.{ assertNoChildren, stopAllChildren }
import pekko.stream.Materializer

import org.scalatest.Failed

import com.typesafe.config.{ Config, ConfigFactory }

abstract class StreamSpec(_system: ActorSystem) extends PekkoSpec(_system) {
def this(config: Config) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

package org.apache.pekko.stream.testkit

import com.typesafe.config.Config

import org.apache.pekko
import pekko.actor.Actor
import pekko.actor.ActorRef
Expand All @@ -26,6 +24,8 @@ import pekko.dispatch.ProducesMessageQueue
import pekko.dispatch.UnboundedMailbox
import pekko.stream.impl.MaterializerGuardian

import com.typesafe.config.Config

/**
* INTERNAL API
* This mailbox is only used in tests to verify that stream actors are using
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@

package org.apache.pekko.stream.testkit

import java.util

import scala.concurrent.duration._

import org.apache.pekko
import pekko.stream.scaladsl.Source
import pekko.stream.testkit.scaladsl.TestSink
import pekko.testkit._
import pekko.testkit.TestEvent.Mute
import pekko.testkit.TestEvent.UnMute

import java.util

class StreamTestKitSpec extends PekkoSpec {

val ex = new Exception("Boom!")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

package org.apache.pekko.stream.testkit

import org.reactivestreams.Subscription

import org.apache.pekko
import pekko.stream.scaladsl.Sink
import pekko.stream.scaladsl.Source
Expand All @@ -23,6 +21,8 @@ import pekko.stream.testkit.TestSubscriber._
import pekko.stream.testkit.scaladsl.StreamTestKit._
import pekko.testkit.PekkoSpec

import org.reactivestreams.Subscription

class TestPublisherSubscriberSpec extends PekkoSpec("""
pekko.stream.materializer.initial-input-buffer-size = 2
pekko.stream.materializer.max-input-buffer-size = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

package org.apache.pekko.stream.testkit

import org.reactivestreams.Publisher

import org.apache.pekko
import pekko.stream._
import pekko.stream.scaladsl._

import org.reactivestreams.Publisher

abstract class TwoStreamsSetup extends BaseTwoStreamsSetup {

abstract class Fixture {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ package org.apache.pekko.stream.testkit

import scala.util.control.NoStackTrace

import com.typesafe.config.ConfigFactory

import org.apache.pekko
import pekko.actor.ActorRef
import pekko.actor.ActorRefWithCell

import com.typesafe.config.ConfigFactory

object Utils {

/** Sets the default-mailbox to the usual [[pekko.dispatch.UnboundedMailbox]] instead of [[StreamTestDefaultMailbox]]. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import scala.concurrent.Future
import scala.concurrent.duration._
import scala.util.{ Failure, Try }

import com.typesafe.config.ConfigFactory

import org.apache.pekko
import pekko.Done
import pekko.actor.{ Actor, ActorSystem, PoisonPill, Props }
Expand All @@ -35,6 +33,8 @@ import pekko.stream.testkit.{ StreamSpec, TestPublisher }
import pekko.testkit.{ ImplicitSender, TestProbe }
import pekko.testkit.TestKit

import com.typesafe.config.ConfigFactory

object IndirectMaterializerCreation extends ExtensionId[IndirectMaterializerCreation] with ExtensionIdProvider {
def createExtension(system: ExtendedActorSystem): IndirectMaterializerCreation =
new IndirectMaterializerCreation(system)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ package org.apache.pekko.stream
import java.lang.reflect.Method
import java.lang.reflect.Modifier

import org.apache.pekko
import scala.annotation.nowarn

import org.apache.pekko

import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package org.apache.pekko.stream

import org.apache.pekko

import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ package org.apache.pekko.stream

import scala.concurrent.Future

import org.scalatest.concurrent.ScalaFutures

import org.apache.pekko
import pekko.stream.scaladsl.Keep
import pekko.stream.scaladsl.Sink
import pekko.stream.scaladsl.Source
import pekko.stream.testkit.StreamSpec

import org.scalatest.concurrent.ScalaFutures

class SystemMaterializerSpec extends StreamSpec with ScalaFutures {

def compileOnly(): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ package org.apache.pekko.stream.impl

import scala.concurrent.duration.Duration

import org.scalatest.concurrent.ScalaFutures

import org.apache.pekko
import pekko.NotUsed
import pekko.stream._
Expand All @@ -27,6 +25,8 @@ import pekko.stream.stage.GraphStageLogic.{ EagerTerminateInput, EagerTerminateO
import pekko.stream.testkit.StreamSpec
import pekko.stream.testkit.scaladsl.TestSink

import org.scalatest.concurrent.ScalaFutures

class GraphStageLogicSpec extends StreamSpec with GraphInterpreterSpecKit with ScalaFutures {

object emit1234 extends GraphStage[FlowShape[Int, Int]] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ package org.apache.pekko.stream.impl

import scala.util.Random

import org.apache.pekko.stream.impl.ResizableMultiReaderRingBuffer._

import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec

import org.apache.pekko.stream.impl.ResizableMultiReaderRingBuffer._

class ResizableMultiReaderRingBufferSpec extends AnyWordSpec with Matchers {

"A ResizableMultiReaderRingBuffer" should {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ import scala.concurrent.Await
import scala.concurrent.Future
import scala.concurrent.duration._

import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpecLike

import org.apache.pekko
import pekko.Done
import pekko.stream._
Expand All @@ -31,6 +28,9 @@ import pekko.stream.testkit.TestPublisher
import pekko.stream.testkit.TestSubscriber
import pekko.stream.testkit.Utils._

import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpecLike

class TimeoutsSpec extends StreamSpec {

"InitialTimeout" must {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ import scala.concurrent.Await
import scala.concurrent.Promise
import scala.concurrent.duration._

import org.reactivestreams.Publisher
import org.reactivestreams.Subscriber
import org.reactivestreams.Subscription

import org.apache.pekko
import pekko.Done
import pekko.stream._
Expand All @@ -40,6 +36,10 @@ import pekko.stream.testkit.Utils._
import pekko.testkit.EventFilter
import pekko.testkit.TestLatch

import org.reactivestreams.Publisher
import org.reactivestreams.Subscriber
import org.reactivestreams.Subscription

class ActorGraphInterpreterSpec extends StreamSpec {
"ActorGraphInterpreter" must {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ package org.apache.pekko.stream.impl.io

import javax.net.ssl.{ SSLContext, SSLEngine, SSLParameters }

import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpecLike

import org.apache.pekko
import pekko.stream.TLSClientAuth
import pekko.stream.TLSProtocol.NegotiateNewSession

import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpecLike

class TLSUtilsSpec extends AnyWordSpecLike with Matchers {

"TlsUtils.applySessionParameters" must {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import scala.concurrent.Future
import scala.concurrent.duration._
import scala.util.Random

import com.typesafe.sslconfig.pekko.PekkoSSLConfig

import org.apache.pekko
import pekko.NotUsed
import pekko.pattern.{ after => later }
Expand All @@ -42,6 +40,8 @@ import pekko.testkit.WithLogCapturing
import pekko.util.ByteString
import pekko.util.JavaVersion

import com.typesafe.sslconfig.pekko.PekkoSSLConfig

object DeprecatedTlsSpec {

val rnd = new Random
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import scala.concurrent.duration._
import scala.util.Success

import com.google.common.jimfs.{ Configuration, Jimfs }
import org.scalatest.concurrent.ScalaFutures

import org.apache.pekko
import pekko.dispatch.ExecutionContexts
Expand All @@ -35,6 +34,8 @@ import pekko.stream.testkit._
import pekko.stream.testkit.Utils._
import pekko.util.ByteString

import org.scalatest.concurrent.ScalaFutures

@nowarn
class FileSinkSpec extends StreamSpec(UnboundedMailboxConfig) with ScalaFutures {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import java.io.OutputStream
import scala.annotation.nowarn
import scala.util.Success

import org.scalatest.concurrent.ScalaFutures

import org.apache.pekko
import pekko.Done
import pekko.stream.{ ActorMaterializer, ActorMaterializerSettings, IOOperationIncompleteException }
Expand All @@ -29,6 +27,8 @@ import pekko.stream.testkit.Utils._
import pekko.testkit.TestProbe
import pekko.util.ByteString

import org.scalatest.concurrent.ScalaFutures

@nowarn
class OutputStreamSinkSpec extends StreamSpec(UnboundedMailboxConfig) with ScalaFutures {

Expand Down
Loading

0 comments on commit 858b94b

Please sign in to comment.