Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Async TestKit] Convert Akka.Remote.Tests to async - Serialization.SerializationTransportInformationSpec #5904

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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