Skip to content

Commit

Permalink
chore: Update import group in scalafix.conf and sort imports of strea…
Browse files Browse the repository at this point in the history
…m and stream-tests
  • Loading branch information
He-Pin committed Jan 15, 2024
1 parent 8760939 commit ae53336
Show file tree
Hide file tree
Showing 119 changed files with 303 additions and 266 deletions.
5 changes: 4 additions & 1 deletion .scalafix.conf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ SortImports.blocks = [
"scala.",
"*",
"com.sun."
"org.apache.pekko."
"re:^(org\\.apache\\.pekko|pekko\\.)\\w*"
"org.reactivestreams."
"io.netty."
"org.scalatest."
"org.slf4j."
"com.typesafe."
]
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ import scala.concurrent.Future
import scala.concurrent.Promise
import scala.concurrent.duration._

import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
import org.scalatest.concurrent.PatienceConfiguration
import org.scalatest.concurrent.PatienceConfiguration.Timeout

import org.apache.pekko
import pekko.Done
import pekko.NotUsed
Expand Down Expand Up @@ -59,6 +54,12 @@ import pekko.testkit.TestProbe
import pekko.testkit.WithLogCapturing
import pekko.util.ByteString

import org.scalatest.concurrent.PatienceConfiguration
import org.scalatest.concurrent.PatienceConfiguration.Timeout

import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory

@nowarn("msg=never used")
class NonResolvingDnsActor(cache: SimpleDnsCache, config: Config) extends Actor {
def receive = {
Expand Down Expand Up @@ -1021,12 +1022,12 @@ class TcpSpec extends StreamSpec("""
import java.security.KeyStore
import javax.net.ssl._

import com.typesafe.sslconfig.pekko.PekkoSSLConfig

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

import com.typesafe.sslconfig.pekko.PekkoSSLConfig

val sslConfig = PekkoSSLConfig(system)

// Don't hardcode your password in actual code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@

package org.apache.pekko.stream.io.compression

import org.scalatest.BeforeAndAfterAll
import org.scalatest.Suite
import org.scalatest.matchers.should.Matchers

import org.apache.pekko
import pekko.actor.ActorSystem
import pekko.testkit.TestKit
import pekko.util.ByteString

import org.scalatest.BeforeAndAfterAll
import org.scalatest.Suite
import org.scalatest.matchers.should.Matchers

trait CodecSpecSupport extends Matchers with BeforeAndAfterAll { self: Suite =>

def readAs(string: String, charset: String = "UTF8") =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ import scala.concurrent.Await
import scala.concurrent.duration._
import scala.util.control.NoStackTrace

import org.scalatest.Inspectors
import org.scalatest.wordspec.AnyWordSpec

import org.apache.pekko
import pekko.NotUsed
import pekko.stream.impl.io.compression.Compressor
import pekko.stream.scaladsl.{ Compression, Flow, Sink, Source }
import pekko.util.ByteString

import org.scalatest.Inspectors
import org.scalatest.wordspec.AnyWordSpec

abstract class CoderSpec(codecName: String) extends AnyWordSpec with CodecSpecSupport with Inspectors {
import CompressionTestingTools._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ package org.apache.pekko.stream.scaladsl
import scala.annotation.nowarn
import scala.concurrent.duration._

import org.reactivestreams.Publisher

import org.apache.pekko
import pekko.Done
import pekko.actor.{ ActorRef, Status }
Expand All @@ -26,6 +24,8 @@ import pekko.stream.testkit._
import pekko.stream.testkit.Utils._
import pekko.stream.testkit.scaladsl._

import org.reactivestreams.Publisher

@nowarn("msg=deprecated")
class ActorRefSourceSpec extends StreamSpec {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ import scala.collection.mutable.ListBuffer
import scala.concurrent.Await
import scala.concurrent.duration._

import com.typesafe.config.{ ConfigFactory, ConfigValueFactory }
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpecLike

import org.apache.pekko
import pekko.actor.ActorSystem
import pekko.stream.OverflowStrategy
import pekko.stream.testkit.{ StreamSpec, TestPublisher, TestSubscriber }
import pekko.testkit.{ ExplicitlyTriggeredScheduler, PekkoSpec }

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

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

class AggregateWithBoundarySpec extends StreamSpec {

"split aggregator by size" in {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,24 @@
package org.apache.pekko.stream.scaladsl

import java.util.concurrent.{ CompletionStage, TimeUnit }

import scala.annotation.nowarn

import com.typesafe.config.ConfigFactory
import org.apache.pekko
import pekko.{ Done, NotUsed }
import pekko.actor.ActorSystem
import pekko.dispatch.Dispatchers
import pekko.stream.ActorAttributes.Dispatcher
import pekko.stream._
import pekko.stream.ActorAttributes.Dispatcher
import pekko.stream.Attributes._
import pekko.stream.javadsl
import pekko.stream.stage._
import pekko.stream.snapshot.MaterializerState
import pekko.stream.stage._
import pekko.stream.testkit._
import pekko.testkit.TestKit

import com.typesafe.config.ConfigFactory

object AttributesSpec {

class AttributesSource(_initialAttributes: Attributes = Attributes.none)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ import scala.util.Success
import scala.util.Try
import scala.xml.Node

import org.reactivestreams.Publisher
import org.reactivestreams.Subscriber
import org.reactivestreams.Subscription
import org.scalatest.Assertion

import org.apache.pekko
import pekko.Done
import pekko.NotUsed
Expand All @@ -32,6 +27,12 @@ import pekko.stream.testkit._
import pekko.stream.testkit.scaladsl.TestSource
import pekko.testkit.TestProbe

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

import org.scalatest.Assertion

class CoupledTerminationFlowSpec extends StreamSpec("""
pekko.stream.materializer.initial-input-buffer-size = 2
""") with ScriptedTest {
Expand Down
Loading

0 comments on commit ae53336

Please sign in to comment.