Skip to content

Commit

Permalink
2: Router: no multiline tokens in select chains
Browse files Browse the repository at this point in the history
  • Loading branch information
Albert Meltzer committed Jun 8, 2020
1 parent 8230793 commit bbf3b98
Show file tree
Hide file tree
Showing 30 changed files with 244 additions and 136 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,35 @@ import akka.event.Logging.Warning

object LoggerSpec {

val defaultConfig =
ConfigFactory.parseString("""
val defaultConfig = ConfigFactory
.parseString("""
akka {
stdout-loglevel = "WARNING"
loglevel = "DEBUG"
loggers = ["akka.event.LoggerSpec$TestLogger1"]
}
""").withFallback(AkkaSpec.testConf)
""")
.withFallback(AkkaSpec.testConf)

val slowConfig =
ConfigFactory.parseString("""
val slowConfig = ConfigFactory
.parseString("""
akka {
stdout-loglevel = "ERROR"
loglevel = "ERROR"
loggers = ["akka.event.LoggerSpec$SlowLogger"]
}
""").withFallback(AkkaSpec.testConf)
""")
.withFallback(AkkaSpec.testConf)

val noLoggingConfig =
ConfigFactory.parseString("""
val noLoggingConfig = ConfigFactory
.parseString("""
akka {
stdout-loglevel = "OFF"
loglevel = "OFF"
loggers = ["akka.event.LoggerSpec$TestLogger1"]
}
""").withFallback(AkkaSpec.testConf)
""")
.withFallback(AkkaSpec.testConf)

val multipleConfig = ConfigFactory
.parseString(
Expand All @@ -57,8 +60,8 @@ object LoggerSpec {
""")
.withFallback(AkkaSpec.testConf)

val ticket3165Config =
ConfigFactory.parseString("""
val ticket3165Config = ConfigFactory
.parseString("""
akka {
stdout-loglevel = "WARNING"
loglevel = "DEBUG"
Expand All @@ -71,10 +74,11 @@ object LoggerSpec {
}
}
}
""").withFallback(AkkaSpec.testConf)
""")
.withFallback(AkkaSpec.testConf)

val ticket3671Config =
ConfigFactory.parseString("""
val ticket3671Config = ConfigFactory
.parseString("""
akka {
stdout-loglevel = "WARNING"
loglevel = "WARNING"
Expand All @@ -83,7 +87,8 @@ object LoggerSpec {
serialize-messages = off
}
}
""").withFallback(AkkaSpec.testConf)
""")
.withFallback(AkkaSpec.testConf)

final case class SetTarget(ref: ActorRef, qualifier: Int)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ import com.typesafe.config.ConfigFactory
@BenchmarkMode(Array(Mode.Throughput))
class HttpBenchmark {

val config = ConfigFactory.parseString("""
val config = ConfigFactory
.parseString("""
akka {
loglevel = "ERROR"
}""".stripMargin).withFallback(ConfigFactory.load())
}""".stripMargin)
.withFallback(ConfigFactory.load())

implicit val system = ActorSystem("HttpBenchmark", config)
implicit val materializer = ActorMaterializer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ private[camel] trait ActorProducerFixture
override lazy val template = mock[ProducerTemplate]
override lazy val context = mock[DefaultCamelContext]
override val settings = new CamelSettings(
ConfigFactory.parseString("""
ConfigFactory
.parseString("""
akka {
camel {
jmx = off
Expand All @@ -394,7 +395,8 @@ private[camel] trait ActorProducerFixture
}
}
}
""").withFallback(config),
""")
.withFallback(config),
sys.dynamicAccess)
}
camel = camelWithMocks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ abstract class RestartNode2SpecSpec
// this is the node that will attempt to re-join, keep gate times low so it can retry quickly
lazy val restartedSeed1System = ActorSystem(
system.name,
ConfigFactory.parseString(s"""
ConfigFactory
.parseString(s"""
akka.remote.netty.tcp.port= ${seedNodes.head.port.get}
#akka.remote.retry-gate-closed-for = 1s
""").withFallback(system.settings.config)
""")
.withFallback(system.settings.config)
)

override def afterAll(): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,14 @@ abstract class UnreachableNodeJoinsAgainSpec
// create new ActorSystem with same host:port
val freshSystem = ActorSystem(
system.name,
ConfigFactory.parseString(s"""
ConfigFactory
.parseString(s"""
akka.remote.netty.tcp {
hostname = ${victimAddress.host.get}
port = ${victimAddress.port.get}
}
""").withFallback(system.settings.config)
""")
.withFallback(system.settings.config)
)

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ object ClusterConsistentHashingRouterMultiJvmSpec extends MultiNodeConfig {
val third = role("third")

commonConfig(
debugConfig(on = false).withFallback(ConfigFactory.parseString(s"""
debugConfig(on = false)
.withFallback(ConfigFactory.parseString(s"""
common-router-settings = {
router = consistent-hashing-pool
cluster {
Expand All @@ -52,7 +53,8 @@ object ClusterConsistentHashingRouterMultiJvmSpec extends MultiNodeConfig {
/router3 = $${common-router-settings}
/router4 = $${common-router-settings}
}
""")).withFallback(MultiNodeClusterSpec.clusterConfig))
"""))
.withFallback(MultiNodeClusterSpec.clusterConfig))

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import com.typesafe.config.ConfigFactory

class InmemEventAdaptersSpec extends AkkaSpec {

val config = ConfigFactory.parseString(s"""
val config = ConfigFactory
.parseString(s"""
|akka.persistence.journal {
| plugin = "akka.persistence.journal.inmem"
|
Expand Down Expand Up @@ -38,7 +39,8 @@ class InmemEventAdaptersSpec extends AkkaSpec {
| }
| }
|}
""".stripMargin).withFallback(ConfigFactory.load())
""".stripMargin)
.withFallback(ConfigFactory.load())

val extendedActorSystem = system.asInstanceOf[ExtendedActorSystem]
val inmemConfig = config.getConfig("akka.persistence.journal.inmem")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,14 @@ abstract class RemoteNodeRestartDeathWatchSpec

val freshSystem = ActorSystem(
system.name,
ConfigFactory.parseString(s"""
ConfigFactory
.parseString(s"""
akka.remote.netty.tcp {
hostname = ${addr.host.get}
port = ${addr.port.get}
}
""").withFallback(system.settings.config)
""")
.withFallback(system.settings.config)
)
freshSystem.actorOf(Props[Subject], "subject")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,15 @@ abstract class RemoteNodeRestartGateSpec

val freshSystem = ActorSystem(
system.name,
ConfigFactory.parseString(s"""
ConfigFactory
.parseString(s"""
akka.remote.retry-gate-closed-for = 0.5 s
akka.remote.netty.tcp {
hostname = ${addr.host.get}
port = ${addr.port.get}
}
""").withFallback(system.settings.config)
""")
.withFallback(system.settings.config)
)

val probe = TestProbe()(freshSystem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,14 @@ abstract class RemoteNodeShutdownAndComesBackSpec

val freshSystem = ActorSystem(
system.name,
ConfigFactory.parseString(s"""
ConfigFactory
.parseString(s"""
akka.remote.netty.tcp {
hostname = ${addr.host.get}
port = ${addr.port.get}
}
""").withFallback(system.settings.config)
""")
.withFallback(system.settings.config)
)
freshSystem.actorOf(Props[Subject], "subject")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,14 @@ abstract class RemoteQuarantinePiercingSpec

val freshSystem = ActorSystem(
system.name,
ConfigFactory.parseString(s"""
ConfigFactory
.parseString(s"""
akka.remote.netty.tcp {
hostname = ${addr.host.get}
port = ${addr.port.get}
}
""").withFallback(system.settings.config)
""")
.withFallback(system.settings.config)
)
freshSystem.actorOf(Props[Subject], "subject")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,15 @@ abstract class RemoteRestartedQuarantinedSpec

val freshSystem = ActorSystem(
system.name,
ConfigFactory.parseString(s"""
ConfigFactory
.parseString(s"""
akka.remote.retry-gate-closed-for = 0.5 s
akka.remote.netty.tcp {
hostname = ${addr.host.get}
port = ${addr.port.get}
}
""").withFallback(system.settings.config)
""")
.withFallback(system.settings.config)
)

val probe = TestProbe()(freshSystem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import scala.util.control.NonFatal
*/
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class RemoteInitErrorSpec extends FlatSpec with Matchers {
val conf =
ConfigFactory.parseString("""
val conf = ConfigFactory
.parseString("""
akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
Expand All @@ -35,7 +35,8 @@ class RemoteInitErrorSpec extends FlatSpec with Matchers {
}
}
}
""").resolve()
""")
.resolve()

def currentThreadIds(): Set[Long] = {
val threads = Thread.getAllStackTraces().keySet()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class RemoteRouterSpec
val port =
system.asInstanceOf[ExtendedActorSystem].provider.getDefaultAddress.port.get
val sysName = system.name
val conf = ConfigFactory.parseString(s"""
val conf = ConfigFactory
.parseString(s"""
akka {
actor.deployment {
/blub {
Expand Down Expand Up @@ -70,7 +71,8 @@ class RemoteRouterSpec
target.nodes = ["akka.tcp://${sysName}@localhost:${port}"]
}
}
}""").withFallback(system.settings.config)
}""")
.withFallback(system.settings.config)
val masterSystem = ActorSystem("Master" + sysName, conf)

override def afterTermination() {
Expand Down

0 comments on commit bbf3b98

Please sign in to comment.