=all #3448 Newer Scalariform running on more files
This commit is contained in:
parent
b9f91b176b
commit
28b5f1039d
22 changed files with 63 additions and 48 deletions
|
|
@ -131,7 +131,7 @@ class ActorLifeCycleSpec extends AkkaSpec("akka.actor.serialize-messages=off") w
|
|||
case class Become(recv: ActorContext ⇒ Receive)
|
||||
val a = system.actorOf(Props(new Actor {
|
||||
def receive = {
|
||||
case Become(beh) ⇒ context.become(beh(context), discardOld = false); sender ! "ok"
|
||||
case Become(beh) ⇒ { context.become(beh(context), discardOld = false); sender ! "ok" }
|
||||
case x ⇒ sender ! 42
|
||||
}
|
||||
}))
|
||||
|
|
|
|||
|
|
@ -201,8 +201,13 @@ object FSMTimingSpec {
|
|||
case Initial -> TestSingleTimerResubmit ⇒ setTimer("blah", Tick, 500.millis.dilated, false)
|
||||
}
|
||||
when(TestSingleTimerResubmit) {
|
||||
case Event(Tick, _) ⇒ tester ! Tick; setTimer("blah", Tock, 500.millis.dilated, false); stay()
|
||||
case Event(Tock, _) ⇒ tester ! Tock; goto(Initial)
|
||||
case Event(Tick, _) ⇒
|
||||
tester ! Tick
|
||||
setTimer("blah", Tock, 500.millis.dilated, false)
|
||||
stay()
|
||||
case Event(Tock, _) ⇒
|
||||
tester ! Tock
|
||||
goto(Initial)
|
||||
}
|
||||
when(TestCancelTimer) {
|
||||
case Event(Tick, _) ⇒
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class DispatcherActorSpec extends AkkaSpec(DispatcherActorSpec.config) with Defa
|
|||
val slowOne = system.actorOf(
|
||||
Props(new Actor {
|
||||
def receive = {
|
||||
case "hogexecutor" ⇒ sender ! "OK"; start.await
|
||||
case "hogexecutor" ⇒ { sender ! "OK"; start.await }
|
||||
case "ping" ⇒ if (works.get) latch.countDown()
|
||||
}
|
||||
}).withDispatcher(throughputDispatcher))
|
||||
|
|
@ -120,8 +120,8 @@ class DispatcherActorSpec extends AkkaSpec(DispatcherActorSpec.config) with Defa
|
|||
val slowOne = system.actorOf(
|
||||
Props(new Actor {
|
||||
def receive = {
|
||||
case "hogexecutor" ⇒ ready.countDown(); start.await
|
||||
case "ping" ⇒ works.set(false); context.stop(self)
|
||||
case "hogexecutor" ⇒ { ready.countDown(); start.await }
|
||||
case "ping" ⇒ { works.set(false); context.stop(self) }
|
||||
}
|
||||
}).withDispatcher(throughputDispatcher))
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ object EventStreamSpec {
|
|||
bus.subscribe(context.self, classOf[SetTarget])
|
||||
bus.subscribe(context.self, classOf[UnhandledMessage])
|
||||
sender ! Logging.LoggerInitialized
|
||||
case SetTarget(ref) ⇒ dst = ref; dst ! "OK"
|
||||
case SetTarget(ref) ⇒ { dst = ref; dst ! "OK" }
|
||||
case e: Logging.LogEvent ⇒ dst ! e
|
||||
case u: UnhandledMessage ⇒ dst ! u
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,8 +170,8 @@ private[akka] trait FaultHandling { this: ActorCell ⇒
|
|||
suspendNonRecursive()
|
||||
// suspend children
|
||||
val skip: Set[ActorRef] = currentMessage match {
|
||||
case Envelope(Failed(_, _, _), child) ⇒ setFailed(child); Set(child)
|
||||
case _ ⇒ setFailed(self); Set.empty
|
||||
case Envelope(Failed(_, _, _), child) ⇒ { setFailed(child); Set(child) }
|
||||
case _ ⇒ { setFailed(self); Set.empty }
|
||||
}
|
||||
suspendChildren(exceptFor = skip ++ childrenNotToSuspend)
|
||||
t match {
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class SslTlsSupport(engine: SSLEngine) extends PipelineStage[HasLogging, Command
|
|||
// to shutdown the connection when getting CLOSED in encrypt
|
||||
closeEngine()
|
||||
|
||||
case x: Tcp.WriteCommand =>
|
||||
case x: Tcp.WriteCommand ⇒
|
||||
throw new IllegalArgumentException(
|
||||
"SslTlsSupport doesn't support Tcp.WriteCommands of type " + x.getClass.getSimpleName)
|
||||
|
||||
|
|
|
|||
|
|
@ -370,8 +370,8 @@ object Tcp extends ExtensionId[TcpExt] with ExtensionIdProvider {
|
|||
def next(): SimpleWriteCommand =
|
||||
current match {
|
||||
case null ⇒ Iterator.empty.next()
|
||||
case CompoundWrite(h, t) ⇒ current = t; h
|
||||
case x: SimpleWriteCommand ⇒ current = null; x
|
||||
case CompoundWrite(h, t) ⇒ { current = t; h }
|
||||
case x: SimpleWriteCommand ⇒ { current = null; x }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,11 +50,11 @@ private[io] class TcpManager(tcp: TcpExt)
|
|||
def receive = workerForCommandHandler {
|
||||
case c: Connect ⇒
|
||||
val commander = sender // cache because we create a function that will run asyncly
|
||||
registry ⇒ Props(classOf[TcpOutgoingConnection], tcp, registry, commander, c)
|
||||
(registry ⇒ Props(classOf[TcpOutgoingConnection], tcp, registry, commander, c))
|
||||
|
||||
case b: Bind ⇒
|
||||
val commander = sender // cache because we create a function that will run asyncly
|
||||
registry ⇒ Props(classOf[TcpListener], selectorPool, tcp, registry, commander, b)
|
||||
(registry ⇒ Props(classOf[TcpListener], selectorPool, tcp, registry, commander, b))
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,11 +48,11 @@ private[io] class UdpManager(udp: UdpExt) extends SelectionHandler.SelectorBased
|
|||
def receive = workerForCommandHandler {
|
||||
case b: Bind ⇒
|
||||
val commander = sender // cache because we create a function that will run asyncly
|
||||
registry ⇒ Props(classOf[UdpListener], udp, registry, commander, b)
|
||||
(registry ⇒ Props(classOf[UdpListener], udp, registry, commander, b))
|
||||
|
||||
case SimpleSender(options) ⇒
|
||||
val commander = sender // cache because we create a function that will run asyncly
|
||||
registry ⇒ Props(classOf[UdpSender], udp, registry, commander, options)
|
||||
(registry ⇒ Props(classOf[UdpSender], udp, registry, commander, options))
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,8 +27,11 @@ object DataflowSpec {
|
|||
|
||||
class TestDelayActor(await: TestLatch) extends Actor {
|
||||
def receive = {
|
||||
case "Hello" ⇒ Await.ready(await, TestLatch.DefaultTimeout); sender ! "World"
|
||||
case "NoReply" ⇒ Await.ready(await, TestLatch.DefaultTimeout)
|
||||
case "Hello" ⇒
|
||||
Await.ready(await, TestLatch.DefaultTimeout)
|
||||
sender ! "World"
|
||||
case "NoReply" ⇒
|
||||
Await.ready(await, TestLatch.DefaultTimeout)
|
||||
case "Failure" ⇒
|
||||
Await.ready(await, TestLatch.DefaultTimeout)
|
||||
sender ! Status.Failure(new RuntimeException("Expected exception; to test fault-tolerance"))
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class Channel private (_channelId: Option[String]) extends Actor with Stash {
|
|||
}
|
||||
|
||||
private val buffering: Actor.Receive = {
|
||||
case DeliveredResolved | DeliveredUnresolved ⇒ context.unbecome(); unstashAll() // TODO: optimize
|
||||
case DeliveredResolved | DeliveredUnresolved ⇒ { context.unbecome(); unstashAll() } // TODO: optimize
|
||||
case _: Deliver ⇒ stash()
|
||||
}
|
||||
|
||||
|
|
@ -232,9 +232,9 @@ private trait ResolvedDelivery extends Actor {
|
|||
|
||||
def receive = {
|
||||
case DeliverResolved ⇒ context.actorSelection(path) ! Identify(1)
|
||||
case ActorIdentity(1, Some(ref)) ⇒ onResolveSuccess(ref); shutdown(DeliveredResolved)
|
||||
case ActorIdentity(1, None) ⇒ onResolveFailure(); shutdown(DeliveredUnresolved)
|
||||
case ReceiveTimeout ⇒ onResolveFailure(); shutdown(DeliveredUnresolved)
|
||||
case ActorIdentity(1, Some(ref)) ⇒ { onResolveSuccess(ref); shutdown(DeliveredResolved) }
|
||||
case ActorIdentity(1, None) ⇒ { onResolveFailure(); shutdown(DeliveredUnresolved) }
|
||||
case ReceiveTimeout ⇒ { onResolveFailure(); shutdown(DeliveredUnresolved) }
|
||||
}
|
||||
|
||||
def shutdown(message: Any) {
|
||||
|
|
|
|||
|
|
@ -50,10 +50,18 @@ private[persistence] class InmemStore extends Actor {
|
|||
var messages = Map.empty[String, Vector[PersistentImpl]]
|
||||
|
||||
def receive = {
|
||||
case Write(p) ⇒ add(p); success()
|
||||
case WriteBatch(pb) ⇒ pb.foreach(add); success()
|
||||
case Delete(p) ⇒ update(p.processorId, p.sequenceNr)(_.copy(deleted = true)); success()
|
||||
case Confirm(pid, snr, cid) ⇒ update(pid, snr)(p ⇒ p.copy(confirms = cid +: p.confirms)); success()
|
||||
case Write(p) ⇒
|
||||
add(p)
|
||||
success()
|
||||
case WriteBatch(pb) ⇒
|
||||
pb.foreach(add)
|
||||
success()
|
||||
case Delete(p) ⇒
|
||||
update(p.processorId, p.sequenceNr)(_.copy(deleted = true))
|
||||
success()
|
||||
case Confirm(pid, snr, cid) ⇒
|
||||
update(pid, snr)(p ⇒ p.copy(confirms = cid +: p.confirms))
|
||||
success()
|
||||
case Replay(pid, fromSnr, toSnr, callback) ⇒ {
|
||||
for {
|
||||
ms ← messages.get(pid)
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ object ProcessorStashSpec {
|
|||
var state: List[String] = Nil
|
||||
|
||||
val behaviorA: Actor.Receive = {
|
||||
case Persistent("a", snr) ⇒ update("a", snr); context.become(behaviorB)
|
||||
case Persistent("a", snr) ⇒ { update("a", snr); context.become(behaviorB) }
|
||||
case Persistent("b", snr) ⇒ update("b", snr)
|
||||
case Persistent("c", snr) ⇒ update("c", snr); unstashAll()
|
||||
case Persistent("c", snr) ⇒ { update("c", snr); unstashAll() }
|
||||
case "x" ⇒ update("x")
|
||||
case "boom" ⇒ throw new TestException("boom")
|
||||
case Persistent("boom", _) ⇒ throw new TestException("boom")
|
||||
|
|
@ -24,7 +24,7 @@ object ProcessorStashSpec {
|
|||
}
|
||||
|
||||
val behaviorB: Actor.Receive = {
|
||||
case Persistent("b", _) ⇒ stash(); context.become(behaviorA)
|
||||
case Persistent("b", _) ⇒ { stash(); context.become(behaviorA) }
|
||||
case "x" ⇒ stash()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import scala.concurrent.duration._
|
|||
import com.typesafe.config.ConfigFactory
|
||||
import akka.actor._
|
||||
import akka.remote.testconductor.RoleName
|
||||
import akka.remote.transport.ThrottlerTransportAdapter.{ForceDisassociate, Direction}
|
||||
import akka.remote.transport.ThrottlerTransportAdapter.{ ForceDisassociate, Direction }
|
||||
import akka.remote.testkit.MultiNodeConfig
|
||||
import akka.remote.testkit.MultiNodeSpec
|
||||
import akka.remote.testkit.STMultiNodeSpec
|
||||
|
|
@ -35,8 +35,8 @@ object RemoteNodeShutdownAndComesBackSpec extends MultiNodeConfig {
|
|||
|
||||
class Subject extends Actor {
|
||||
def receive = {
|
||||
case "shutdown" => context.system.shutdown()
|
||||
case msg ⇒ sender ! msg
|
||||
case "shutdown" ⇒ context.system.shutdown()
|
||||
case msg ⇒ sender ! msg
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ class RemoteNodeShutdownAndComesBackMultiJvmNode2 extends RemoteNodeShutdownAndC
|
|||
|
||||
abstract class RemoteNodeShutdownAndComesBackSpec
|
||||
extends MultiNodeSpec(RemoteNodeShutdownAndComesBackSpec)
|
||||
with STMultiNodeSpec with ImplicitSender {
|
||||
with STMultiNodeSpec with ImplicitSender {
|
||||
|
||||
import RemoteNodeShutdownAndComesBackSpec._
|
||||
|
||||
|
|
@ -137,7 +137,6 @@ abstract class RemoteNodeShutdownAndComesBackSpec
|
|||
""").withFallback(system.settings.config))
|
||||
freshSystem.actorOf(Props[Subject], "subject")
|
||||
|
||||
|
||||
freshSystem.awaitTermination(30.seconds)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ package akka.remote.testconductor
|
|||
|
||||
import language.postfixOps
|
||||
import com.typesafe.config.ConfigFactory
|
||||
import akka.actor.{Props, Actor, ActorIdentity, Identify, Deploy}
|
||||
import akka.actor.{ Props, Actor, ActorIdentity, Identify, Deploy }
|
||||
import scala.concurrent.Await
|
||||
import scala.concurrent.Awaitable
|
||||
import scala.concurrent.duration._
|
||||
|
|
|
|||
|
|
@ -79,8 +79,8 @@ abstract class StatsSampleSingleMasterSpec extends MultiNodeSpec(StatsSampleSing
|
|||
|
||||
Cluster(system) join firstAddress
|
||||
|
||||
receiveN(3).collect { case MemberUp(m) => m.address }.toSet must be (
|
||||
Set(firstAddress, secondAddress, thirdAddress))
|
||||
receiveN(3).collect { case MemberUp(m) ⇒ m.address }.toSet must be(
|
||||
Set(firstAddress, secondAddress, thirdAddress))
|
||||
|
||||
Cluster(system).unsubscribe(testActor)
|
||||
|
||||
|
|
|
|||
|
|
@ -96,8 +96,8 @@ abstract class StatsSampleSpec extends MultiNodeSpec(StatsSampleSpecConfig)
|
|||
system.actorOf(Props[StatsWorker], "statsWorker")
|
||||
system.actorOf(Props[StatsService], "statsService")
|
||||
|
||||
receiveN(3).collect { case MemberUp(m) => m.address }.toSet must be (
|
||||
Set(firstAddress, secondAddress, thirdAddress))
|
||||
receiveN(3).collect { case MemberUp(m) ⇒ m.address }.toSet must be(
|
||||
Set(firstAddress, secondAddress, thirdAddress))
|
||||
|
||||
Cluster(system).unsubscribe(testActor)
|
||||
|
||||
|
|
|
|||
|
|
@ -81,8 +81,8 @@ abstract class StatsSampleJapiSpec extends MultiNodeSpec(StatsSampleJapiSpecConf
|
|||
system.actorOf(Props[StatsWorker], "statsWorker")
|
||||
system.actorOf(Props[StatsService], "statsService")
|
||||
|
||||
receiveN(3).collect { case MemberUp(m) => m.address }.toSet must be (
|
||||
Set(firstAddress, secondAddress, thirdAddress))
|
||||
receiveN(3).collect { case MemberUp(m) ⇒ m.address }.toSet must be(
|
||||
Set(firstAddress, secondAddress, thirdAddress))
|
||||
|
||||
Cluster(system).unsubscribe(testActor)
|
||||
|
||||
|
|
|
|||
|
|
@ -78,13 +78,13 @@ abstract class StatsSampleSingleMasterJapiSpec extends MultiNodeSpec(StatsSample
|
|||
|
||||
Cluster(system) join firstAddress
|
||||
|
||||
receiveN(3).collect { case MemberUp(m) => m.address }.toSet must be (
|
||||
Set(firstAddress, secondAddress, thirdAddress))
|
||||
receiveN(3).collect { case MemberUp(m) ⇒ m.address }.toSet must be(
|
||||
Set(firstAddress, secondAddress, thirdAddress))
|
||||
|
||||
Cluster(system).unsubscribe(testActor)
|
||||
|
||||
system.actorOf(ClusterSingletonManager.defaultProps(
|
||||
Props[StatsService],
|
||||
Props[StatsService],
|
||||
singletonName = "statsService",
|
||||
terminationMessage = PoisonPill,
|
||||
role = null), name = "singleton")
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ object MultiNodeSampleConfig extends MultiNodeConfig {
|
|||
//#spec
|
||||
import akka.remote.testkit.MultiNodeSpec
|
||||
import akka.testkit.ImplicitSender
|
||||
import akka.actor.{Props, Actor}
|
||||
import akka.actor.{ Props, Actor }
|
||||
|
||||
class MultiNodeSampleSpecMultiJvmNode1 extends MultiNodeSample
|
||||
class MultiNodeSampleSpecMultiJvmNode2 extends MultiNodeSample
|
||||
|
|
@ -46,7 +46,7 @@ class MultiNodeSample extends MultiNodeSpec(MultiNodeSampleConfig)
|
|||
runOn(node2) {
|
||||
system.actorOf(Props(new Actor {
|
||||
def receive = {
|
||||
case "ping" => sender ! "pong"
|
||||
case "ping" ⇒ sender ! "pong"
|
||||
}
|
||||
}), "ponger")
|
||||
enterBarrier("deployed")
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ object SnapshotExample extends App {
|
|||
case Persistent(s, snr) ⇒ state = state.update(s"${s}-${snr}")
|
||||
case SaveSnapshotSuccess(metadata) ⇒ // ...
|
||||
case SaveSnapshotFailure(metadata, reason) ⇒ // ...
|
||||
case SnapshotOffer(_, s: ExampleState) ⇒ println("offered state = " + s); state = s
|
||||
case SnapshotOffer(_, s: ExampleState) ⇒ { println("offered state = " + s); state = s }
|
||||
case "print" ⇒ println("current state = " + state)
|
||||
case "snap" ⇒ saveSnapshot(state)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ private[zeromq] class ConcurrentSocketActor(params: immutable.Seq[SocketOption])
|
|||
}
|
||||
|
||||
private def handleConnectOption(msg: SocketConnectOption): Unit = msg match {
|
||||
case Connect(endpoint) ⇒ socket.connect(endpoint); notifyListener(Connecting)
|
||||
case Connect(endpoint) ⇒ { socket.connect(endpoint); notifyListener(Connecting) }
|
||||
case Bind(endpoint) ⇒ socket.bind(endpoint)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue