From 2cc49307a38df6073e85d1c2f9245bb44592f1be Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Mon, 27 Nov 2023 10:52:46 +0100 Subject: [PATCH] add Akka path parsing tests --- .../org/apache/pekko/actor/ActorPathSpec.scala | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorPathSpec.scala b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorPathSpec.scala index 6feec3e307d..a7573979fbf 100644 --- a/actor-tests/src/test/scala/org/apache/pekko/actor/ActorPathSpec.scala +++ b/actor-tests/src/test/scala/org/apache/pekko/actor/ActorPathSpec.scala @@ -32,6 +32,21 @@ class ActorPathSpec extends AnyWordSpec with Matchers { ActorPath.fromString(remote).toString should ===(remote) } + "support parsing remote akka paths" in { + val remote = "akka://my_sys@host:1234/some/ref" + ActorPath.fromString(remote).toString should ===(remote) + } + + "support parsing AddressFromURIString" in { + val remote = "pekko://my_sys@host:1234" + AddressFromURIString(remote) should ===(Address("pekko", "my_sys", Some("host"), Some(1234))) + } + + "support parsing akka AddressFromURIString" in { + val remote = "akka://my_sys@host:1234" + AddressFromURIString(remote) should ===(Address("akka", "my_sys", Some("host"), Some(1234))) + } + "throw exception upon malformed paths" in { intercept[MalformedURLException] { ActorPath.fromString("") } intercept[MalformedURLException] { ActorPath.fromString("://hallo") }