Skip to content

Commit

Permalink
Convert Akka.Remote.Tests to async - Serialization.SerializationTrans…
Browse files Browse the repository at this point in the history
…portInformationSpec (#5904)
  • Loading branch information
Arkatufus authored Apr 29, 2022
1 parent 06990ec commit b231fad
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private void VerifyTransportInfo()

public abstract class AbstractSerializationTransportInformationSpec : AkkaSpec
{
public static readonly Config Config = @"
private static readonly Config Config = @"
akka {
loglevel = info
actor
Expand Down Expand Up @@ -151,7 +151,7 @@ protected AbstractSerializationTransportInformationSpec(Config config, ITestOutp
public Address System2Address => RARP.For(System2).Provider.DefaultAddress;

[Fact]
public void Serialization_of_ActorRef_in_remote_message_must_resolve_Address()
public async Task Serialization_of_ActorRef_in_remote_message_must_resolve_Address()
{
System2.ActorOf(act =>
{
Expand All @@ -160,28 +160,28 @@ public void Serialization_of_ActorRef_in_remote_message_must_resolve_Address()

var echoSel = Sys.ActorSelection(new RootActorPath(System2Address) / "user" / "echo");
echoSel.Tell(new Identify(1));
var echo = ExpectMsg<ActorIdentity>().Subject;
var echo = (await ExpectMsgAsync<ActorIdentity>()).Subject;

echo.Tell(new TestMessage(TestActor, echo));
var t1 = ExpectMsg<TestMessage>();
var t1 = await ExpectMsgAsync<TestMessage>();
t1.From.Should().Be(TestActor);
t1.To.Should().Be(echo);

echo.Tell(new JsonSerTestMessage(TestActor, echo));
var t2 = ExpectMsg<JsonSerTestMessage>();
var t2 = await ExpectMsgAsync<JsonSerTestMessage>();
t2.From.Should().Be(TestActor);
t2.To.Should().Be(echo);

echo.Tell(TestActor);
ExpectMsg(TestActor);
await ExpectMsgAsync(TestActor);

echo.Tell(echo);
ExpectMsg(echo);
await ExpectMsgAsync(echo);
}

protected override async Task AfterAllAsync()
{
await ShutdownAsync(System2, verifySystemShutdown: true);
await ShutdownAsync(System2);
await base.AfterAllAsync();
}
}
Expand Down

0 comments on commit b231fad

Please sign in to comment.