public void Create_correct_ToString_with_address() { var local = new Address("akka.tcp", "mysys"); var a = new Address("akka.tcp", "mysys", "aaa", 2552); var b = new Address("akka.tcp", "mysys", "bb", 2552); var c = new Address("akka.tcp", "mysys", "cccc", 2552); var d = new Address("akka.tcp", "mysys", "192.168.107.1", 2552); var root = new RootActorPath(local); root.ToStringWithAddress(a).ShouldBe("akka.tcp://mysys@aaa:2552/"); (root / "user").ToStringWithAddress(a).ShouldBe("akka.tcp://mysys@aaa:2552/user"); (root / "user" / "foo").ToStringWithAddress(a).ShouldBe("akka.tcp://mysys@aaa:2552/user/foo"); root.ToStringWithAddress(b).ShouldBe("akka.tcp://mysys@bb:2552/"); (root / "user").ToStringWithAddress(b).ShouldBe("akka.tcp://mysys@bb:2552/user"); (root / "user" / "foo").ToStringWithAddress(b).ShouldBe("akka.tcp://mysys@bb:2552/user/foo"); root.ToStringWithAddress(c).ShouldBe("akka.tcp://mysys@cccc:2552/"); (root / "user").ToStringWithAddress(c).ShouldBe("akka.tcp://mysys@cccc:2552/user"); (root / "user" / "foo").ToStringWithAddress(c).ShouldBe("akka.tcp://mysys@cccc:2552/user/foo"); root.ToStringWithAddress(d).ShouldBe("akka.tcp://[email protected]:2552/"); (root / "user").ToStringWithAddress(d).ShouldBe("akka.tcp://[email protected]:2552/user"); (root / "user" / "foo").ToStringWithAddress(d).ShouldBe("akka.tcp://[email protected]:2552/user/foo"); var rootA = new RootActorPath(a); rootA.ToStringWithAddress(b).ShouldBe("akka.tcp://mysys@aaa:2552/"); (rootA / "user").ToStringWithAddress(b).ShouldBe("akka.tcp://mysys@aaa:2552/user"); (rootA / "user" / "foo").ToStringWithAddress(b).ShouldBe("akka.tcp://mysys@aaa:2552/user/foo"); }
public void CreateCorrectToStringWithAddress() { var local = new Address("akka.tcp", "mysys"); var a = new Address("akka.tcp", "mysys", "aaa", 2552); var b = new Address("akka.tcp", "mysys", "bb", 2552); var c = new Address("akka.tcp", "mysys", "cccc" , 2552); var root = new RootActorPath(local); root.ToStringWithAddress(a).ShouldBe("akka.tcp://mysys@aaa:2552/"); (root / "user").ToStringWithAddress(a).ShouldBe("akka.tcp://mysys@aaa:2552/user"); (root / "user" / "foo").ToStringWithAddress(a).ShouldBe("akka.tcp://mysys@aaa:2552/user/foo"); root.ToStringWithAddress(b).ShouldBe("akka.tcp://mysys@bb:2552/"); (root / "user").ToStringWithAddress(b).ShouldBe("akka.tcp://mysys@bb:2552/user"); (root / "user" / "foo").ToStringWithAddress(b).ShouldBe("akka.tcp://mysys@bb:2552/user/foo"); root.ToStringWithAddress(c).ShouldBe("akka.tcp://mysys@cccc:2552/"); (root / "user").ToStringWithAddress(c).ShouldBe("akka.tcp://mysys@cccc:2552/user"); (root / "user" / "foo").ToStringWithAddress(c).ShouldBe("akka.tcp://mysys@cccc:2552/user/foo"); var rootA = new RootActorPath(a); rootA.ToStringWithAddress(b).ShouldBe("akka.tcp://mysys@aaa:2552/"); (rootA / "user").ToStringWithAddress(b).ShouldBe("akka.tcp://mysys@aaa:2552/user"); (rootA / "user" / "foo").ToStringWithAddress(b).ShouldBe("akka.tcp://mysys@aaa:2552/user/foo"); }
public void RemoteActorRefProvider_should_correctly_resolve_valid_LocalActorRef_from_remote_address() { var actorRef = Sys.ActorOf(BlackHoleActor.Props, "myActor"); var localAddress = RARP.For(Sys).Provider.DefaultAddress; var actorPath = new RootActorPath(localAddress) / "user" / "myActor"; var resolvedActorRef = RARP.For(Sys).Provider.ResolveActorRefWithLocalAddress(actorPath.ToStringWithAddress(), localAddress); Assert.Equal(actorRef, resolvedActorRef); }