format source with scalafmt
This commit is contained in:
parent
0f40491d42
commit
ce404e4f53
1669 changed files with 43208 additions and 35404 deletions
|
|
@ -54,11 +54,11 @@ object DurableDataSpec {
|
|||
if (failStore) reply match {
|
||||
case Some(StoreReply(_, failureMsg, replyTo)) => replyTo ! failureMsg
|
||||
case None =>
|
||||
}
|
||||
else reply match {
|
||||
case Some(StoreReply(successMsg, _, replyTo)) => replyTo ! successMsg
|
||||
case None =>
|
||||
}
|
||||
} else
|
||||
reply match {
|
||||
case Some(StoreReply(successMsg, _, replyTo)) => replyTo ! successMsg
|
||||
case None =>
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -72,7 +72,9 @@ class DurableDataWriteBehindSpecMultiJvmNode1 extends DurableDataSpec(DurableDat
|
|||
class DurableDataWriteBehindSpecMultiJvmNode2 extends DurableDataSpec(DurableDataSpecConfig(writeBehind = true))
|
||||
|
||||
abstract class DurableDataSpec(multiNodeConfig: DurableDataSpecConfig)
|
||||
extends MultiNodeSpec(multiNodeConfig) with STMultiNodeSpec with ImplicitSender {
|
||||
extends MultiNodeSpec(multiNodeConfig)
|
||||
with STMultiNodeSpec
|
||||
with ImplicitSender {
|
||||
import DurableDataSpec._
|
||||
import Replicator._
|
||||
import multiNodeConfig._
|
||||
|
|
@ -95,12 +97,13 @@ abstract class DurableDataSpec(multiNodeConfig: DurableDataSpecConfig)
|
|||
enterBarrier("after-" + testStepCounter)
|
||||
}
|
||||
|
||||
def newReplicator(sys: ActorSystem = system) = sys.actorOf(Replicator.props(
|
||||
ReplicatorSettings(system).withGossipInterval(1.second)), "replicator-" + testStepCounter)
|
||||
def newReplicator(sys: ActorSystem = system) =
|
||||
sys.actorOf(Replicator.props(ReplicatorSettings(system).withGossipInterval(1.second)),
|
||||
"replicator-" + testStepCounter)
|
||||
|
||||
def join(from: RoleName, to: RoleName): Unit = {
|
||||
runOn(from) {
|
||||
cluster join node(to).address
|
||||
cluster.join(node(to).address)
|
||||
}
|
||||
enterBarrier(from.name + "-joined")
|
||||
}
|
||||
|
|
@ -272,10 +275,9 @@ abstract class DurableDataSpec(multiNodeConfig: DurableDataSpecConfig)
|
|||
Await.ready(sys1.terminate(), 10.seconds)
|
||||
}
|
||||
|
||||
val sys2 = ActorSystem(
|
||||
"AdditionalSys",
|
||||
// use the same port
|
||||
ConfigFactory.parseString(s"""
|
||||
val sys2 = ActorSystem("AdditionalSys",
|
||||
// use the same port
|
||||
ConfigFactory.parseString(s"""
|
||||
akka.remote.artery.canonical.port = ${address.port.get}
|
||||
akka.remote.netty.tcp.port = ${address.port.get}
|
||||
""").withFallback(system.settings.config))
|
||||
|
|
@ -310,8 +312,7 @@ abstract class DurableDataSpec(multiNodeConfig: DurableDataSpecConfig)
|
|||
"stop Replicator if Load fails" in {
|
||||
runOn(first) {
|
||||
val r = system.actorOf(
|
||||
Replicator.props(
|
||||
ReplicatorSettings(system).withDurableStoreProps(testDurableStoreProps(failLoad = true))),
|
||||
Replicator.props(ReplicatorSettings(system).withDurableStoreProps(testDurableStoreProps(failLoad = true))),
|
||||
"replicator-" + testStepCounter)
|
||||
watch(r)
|
||||
expectTerminated(r)
|
||||
|
|
@ -322,8 +323,7 @@ abstract class DurableDataSpec(multiNodeConfig: DurableDataSpecConfig)
|
|||
"reply with StoreFailure if store fails" in {
|
||||
runOn(first) {
|
||||
val r = system.actorOf(
|
||||
Replicator.props(
|
||||
ReplicatorSettings(system).withDurableStoreProps(testDurableStoreProps(failStore = true))),
|
||||
Replicator.props(ReplicatorSettings(system).withDurableStoreProps(testDurableStoreProps(failStore = true))),
|
||||
"replicator-" + testStepCounter)
|
||||
r ! Update(KeyA, GCounter(), WriteLocal, request = Some("a"))(_ :+ 1)
|
||||
expectMsg(StoreFailure(KeyA, Some("a")))
|
||||
|
|
@ -332,4 +332,3 @@ abstract class DurableDataSpec(multiNodeConfig: DurableDataSpecConfig)
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue