+act #15956 Allow _ in ActorSystem name

(cherry picked from commit 7ef1334192de6f2c0cffbb81be620cdd56110ad5)
This commit is contained in:
Patrik Nordwall 2014-11-10 15:58:44 +01:00
parent 8cd0286774
commit 96fb339081
3 changed files with 4 additions and 4 deletions

View file

@ -17,7 +17,7 @@ class ActorPathSpec extends WordSpec with Matchers {
}
"support parsing remote paths" in {
val remote = "akka://sys@host:1234/some/ref"
val remote = "akka://my_sys@host:1234/some/ref"
ActorPath.fromString(remote).toString should be(remote)
}

View file

@ -144,8 +144,8 @@ class ActorSystemSpec extends AkkaSpec(ActorSystemSpec.config) with ImplicitSend
"reject invalid names" in {
for (
n Seq(
"hallo_welt",
"-hallowelt",
"_hallowelt",
"hallo*welt",
"hallo@welt",
"hallo#welt",
@ -158,7 +158,7 @@ class ActorSystemSpec extends AkkaSpec(ActorSystemSpec.config) with ImplicitSend
}
"allow valid names" in {
shutdown(ActorSystem("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-"))
shutdown(ActorSystem("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"))
}
"support extensions" in {

View file

@ -521,7 +521,7 @@ abstract class ExtendedActorSystem extends ActorSystem {
private[akka] class ActorSystemImpl(val name: String, applicationConfig: Config, classLoader: ClassLoader, defaultExecutionContext: Option[ExecutionContext]) extends ExtendedActorSystem {
if (!name.matches("""^[a-zA-Z0-9][a-zA-Z0-9-]*$"""))
if (!name.matches("""^[a-zA-Z0-9][a-zA-Z0-9-_]*$"""))
throw new IllegalArgumentException(
"invalid ActorSystem name [" + name +
"], must contain only word characters (i.e. [a-zA-Z0-9] plus non-leading '-')")