This is an automated email from the ASF dual-hosted git repository.

csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new ad7d549  Fix oversight in resolving /_ to namespace. (#3328)
ad7d549 is described below

commit ad7d5495234ced9057360a7156a747a062d6843d
Author: rodric rabbah <rod...@gmail.com>
AuthorDate: Thu Feb 22 16:16:22 2018 -0800

    Fix oversight in resolving /_ to namespace. (#3328)
---
 .../main/scala/whisk/core/entity/FullyQualifiedEntityName.scala  | 2 +-
 tests/src/test/scala/whisk/core/entity/test/SchemaTests.scala    | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git 
a/common/scala/src/main/scala/whisk/core/entity/FullyQualifiedEntityName.scala 
b/common/scala/src/main/scala/whisk/core/entity/FullyQualifiedEntityName.scala
index 0abca40..009e882 100644
--- 
a/common/scala/src/main/scala/whisk/core/entity/FullyQualifiedEntityName.scala
+++ 
b/common/scala/src/main/scala/whisk/core/entity/FullyQualifiedEntityName.scala
@@ -124,7 +124,7 @@ protected[core] object FullyQualifiedEntityName extends 
DefaultJsonProtocol {
             else if (leadingSlash || n == 3) Some(path)
             else Some(namespace.toPath.addPath(path))
           }
-          .map(_.toFullyQualifiedEntityName)
+          .map(_.resolveNamespace(namespace).toFullyQualifiedEntityName)
       case _ => None
     }
   }
diff --git a/tests/src/test/scala/whisk/core/entity/test/SchemaTests.scala 
b/tests/src/test/scala/whisk/core/entity/test/SchemaTests.scala
index b7bfb14..b5cb9f4 100644
--- a/tests/src/test/scala/whisk/core/entity/test/SchemaTests.scala
+++ b/tests/src/test/scala/whisk/core/entity/test/SchemaTests.scala
@@ -326,6 +326,15 @@ class SchemaTests extends FlatSpec with BeforeAndAfter 
with ExecHelpers with Mat
     FullyQualifiedEntityName.resolveName(JsString("a"), EntityName("ns")) 
shouldBe Some(
       EntityPath("ns/a").toFullyQualifiedEntityName)
 
+    FullyQualifiedEntityName.resolveName(JsString("/_/a"), EntityName("ns")) 
shouldBe Some(
+      EntityPath("ns/a").toFullyQualifiedEntityName)
+
+    FullyQualifiedEntityName.resolveName(JsString("_/a"), EntityName("ns")) 
shouldBe Some(
+      EntityPath("ns/_/a").toFullyQualifiedEntityName)
+
+    FullyQualifiedEntityName.resolveName(JsString("/_/a/b"), EntityName("ns")) 
shouldBe Some(
+      EntityPath("ns/a/b").toFullyQualifiedEntityName)
+
     FullyQualifiedEntityName.resolveName(JsString("a/b"), EntityName("ns")) 
shouldBe Some(
       EntityPath("ns/a/b").toFullyQualifiedEntityName)
 

-- 
To stop receiving notification emails like this one, please contact
csantan...@apache.org.

Reply via email to