Scala3: enable akka-cluster-sharding-typed tests (#30892)
* Scala3: enable akka-cluster-sharding-typed tests * typo
This commit is contained in:
parent
596a2a463f
commit
bdb46d16fd
5 changed files with 14 additions and 12 deletions
2
.github/workflows/scala3-build.yml
vendored
2
.github/workflows/scala3-build.yml
vendored
|
|
@ -21,7 +21,7 @@ jobs:
|
|||
- akka-testkit/test akka-actor-tests/test
|
||||
- akka-actor-testkit-typed/test akka-actor-typed-tests/test
|
||||
- akka-bench-jmh/test
|
||||
- akka-cluster/Test/compile akka-cluster-tools/test akka-cluster-typed/test akka-distributed-data/test akka-cluster-metrics/Test akka-cluster-sharding/Test/compile akka-cluster-sharding-typed/compile
|
||||
- akka-cluster/Test/compile akka-cluster-tools/test akka-cluster-typed/test akka-distributed-data/test akka-cluster-metrics/test akka-cluster-sharding/Test/compile akka-cluster-sharding-typed/test
|
||||
- akka-discovery/test akka-coordination/test
|
||||
- akka-persistence/test akka-persistence-shared/test akka-persistence-query/test akka-persistence-typed/test akka-persistence-testkit/test
|
||||
- akka-pki/test akka-slf4j/test
|
||||
|
|
|
|||
2
.github/workflows/scala3-compile.yml
vendored
2
.github/workflows/scala3-compile.yml
vendored
|
|
@ -19,7 +19,7 @@ jobs:
|
|||
- akka-testkit/Test/compile akka-actor-tests/Test/compile
|
||||
- akka-actor-testkit-typed/Test/compile akka-actor-typed-tests/Test/compile
|
||||
- akka-bench-jmh/Test/compile
|
||||
- akka-cluster/Test/compile akka-cluster-tools/Test/compile akka-cluster-typed/Test/compile akka-distributed-data/Test/compile akka-cluster-metrics/Test/compile akka-cluster-sharding/Test/compile akka-cluster-sharding-typed/compile
|
||||
- akka-cluster/Test/compile akka-cluster-tools/Test/compile akka-cluster-typed/Test/compile akka-distributed-data/Test/compile akka-cluster-metrics/Test/compile akka-cluster-sharding/Test/compile akka-cluster-sharding-typed/Test/compile
|
||||
- akka-discovery/Test/compile akka-coordination/Test/compile
|
||||
- akka-persistence/Test/compile akka-persistence-shared/Test/compile akka-persistence-query/Test/compile akka-persistence-typed/Test/compile akka-persistence-testkit/Test/compile
|
||||
- akka-pki/Test/compile akka-slf4j/Test/compile
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ abstract class MultiDcClusterShardingSpec
|
|||
"be able to ask via entity ref" in {
|
||||
implicit val timeout = Timeout(remainingOrDefault)
|
||||
val entityRef = ClusterSharding(typedSystem).entityRefFor(typeKey, entityId)
|
||||
val response = entityRef ? Ping
|
||||
val response = entityRef.ask(Ping.apply)
|
||||
response.futureValue shouldEqual Pong(cluster.selfMember.dataCenter)
|
||||
enterBarrier("ask")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -269,14 +269,14 @@ class ClusterShardingSpec
|
|||
val bobRef = sharding.entityRefFor(typeKeyWithEnvelopes, "bob")
|
||||
val aliceRef = sharding.entityRefFor(typeKeyWithEnvelopes, "alice")
|
||||
|
||||
val reply1 = bobRef ? WhoAreYou
|
||||
val response = reply1.futureValue
|
||||
val reply1 = bobRef.ask(WhoAreYou(_))
|
||||
val response = reply1.futureValue.asInstanceOf[String]
|
||||
response should startWith("I'm bob")
|
||||
// typekey and entity id encoded in promise ref path
|
||||
response should include(s"${typeKeyWithEnvelopes.name}-bob")
|
||||
|
||||
val reply2 = aliceRef.ask(WhoAreYou)
|
||||
reply2.futureValue should startWith("I'm alice")
|
||||
val reply2 = aliceRef.ask(WhoAreYou(_))
|
||||
reply2.futureValue.asInstanceOf[String] should startWith("I'm alice")
|
||||
|
||||
bobRef ! StopPlz()
|
||||
}
|
||||
|
|
@ -287,7 +287,7 @@ class ClusterShardingSpec
|
|||
val p = TestProbe[TheReply]()
|
||||
|
||||
spawn(Behaviors.setup[TheReply] { ctx =>
|
||||
ctx.ask(peterRef, WhoAreYou) {
|
||||
ctx.ask(peterRef, WhoAreYou.apply) {
|
||||
case Success(name) => TheReply(name)
|
||||
case Failure(ex) => TheReply(ex.getMessage)
|
||||
}
|
||||
|
|
@ -326,7 +326,7 @@ class ClusterShardingSpec
|
|||
|
||||
val ref = sharding.entityRefFor(ignorantKey, "sloppy")
|
||||
|
||||
val reply = ref.ask(WhoAreYou)(Timeout(10.millis))
|
||||
val reply = ref.ask(WhoAreYou(_))(Timeout(10.millis))
|
||||
val exc = reply.failed.futureValue
|
||||
exc.getClass should ===(classOf[AskTimeoutException])
|
||||
exc.getMessage should startWith("Ask timed out on")
|
||||
|
|
|
|||
|
|
@ -118,9 +118,11 @@ class AccountExampleSpec
|
|||
|
||||
// Errors are shown in IntelliJ Scala plugin 2019.1.6, but compiles with Scala 2.12.8.
|
||||
// Ok in IntelliJ if using ref.ask[OperationResult].
|
||||
ref.askWithStatus(Deposit(100, _)).futureValue should ===(Done)
|
||||
ref.askWithStatus(Withdraw(10, _)).futureValue should ===(Done)
|
||||
ref.ask(GetBalance(_)).map(_.balance).futureValue should ===(90)
|
||||
val deposited = ref.askWithStatus(Deposit(100, _)).futureValue
|
||||
deposited should ===(Done)
|
||||
val withdrawn = ref.askWithStatus(Withdraw(10, _)).futureValue
|
||||
withdrawn should ===(Done)
|
||||
ref.ask(GetBalance.apply).map(_.balance).futureValue should ===(90)
|
||||
}
|
||||
|
||||
"verifySerialization" in {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue