openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csantan...@apache.org
Subject [incubator-openwhisk-cli] 31/36: Error when Entity Names are Provided to List Commands (#2075)
Date Mon, 26 Jun 2017 16:00:11 GMT
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-cli.git

commit d1aa6471176d2982faf1248205617c7c19cf05c3
Author: James Dubee <jwdubee@us.ibm.com>
AuthorDate: Tue Jun 20 09:27:38 2017 -0400

    Error when Entity Names are Provided to List Commands (#2075)
    
    * Error when Entity Names are Provided to List Commands
    
    - When entity names are pass to list commands display an appropriate error
    - Share qualified name parsing error messages between commands
---
 .../src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala  | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala b/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
index 83f27d8..be5d36b 100644
--- a/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
+++ b/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
@@ -245,7 +245,7 @@ class WskBasicUsageTests
     it should "reject creating entities with invalid names" in withAssetCleaner(wskprops)
{
         (wp, assetHelper) =>
             val names = Seq(
-                ("", NOT_ALLOWED),
+                ("", ERROR_EXIT),
                 (" ", BAD_REQUEST),
                 ("hi+there", BAD_REQUEST),
                 ("$hola", BAD_REQUEST),
@@ -1194,6 +1194,7 @@ class WskBasicUsageTests
         val apiDeleteReqMsg = "An API base path or API name is required.  An optional API
relative path and operation may also be provided."
         val apiListReqMsg = "Optional parameters are: API base path (or API name), API relative
path and operation."
         val invalidShared = s"Cannot use value '$invalidArg' for shared"
+        val entityNameMsg = s"An entity name, '$invalidArg', was provided instead of a namespace.
Valid namespaces are of the following format: /NAMESPACE."
         val invalidArgs = Seq(
             (Seq("api-experimental", "create"), s"${tooFewArgsMsg} ${apiCreateReqMsg}"),
             (Seq("api-experimental", "create", "/basepath", "/path", "GET", "action", invalidArg),
s"${tooManyArgsMsg}${invalidArg}. ${apiCreateReqMsg}"),
@@ -1241,10 +1242,12 @@ class WskBasicUsageTests
             (Seq("package", "bind", "packageName", "bindingName", invalidArg), s"${tooManyArgsMsg}${invalidArg}."),
             (Seq("package", "list", "namespace", invalidArg),
                 s"${tooManyArgsMsg}${invalidArg}. ${optNamespaceMsg}"),
+            (Seq("package", "list", invalidArg), entityNameMsg),
             (Seq("package", "delete"), s"${tooFewArgsMsg} ${packageNameReqMsg}"),
             (Seq("package", "delete", "namespace", invalidArg), s"${tooManyArgsMsg}${invalidArg}."),
             (Seq("package", "refresh", "namespace", invalidArg),
                 s"${tooManyArgsMsg}${invalidArg}. ${optNamespaceMsg}"),
+            (Seq("package", "refresh", invalidArg), entityNameMsg),
             (Seq("rule", "enable"), s"${tooFewArgsMsg} ${ruleNameReqMsg}"),
             (Seq("rule", "enable", "ruleName", invalidArg), s"${tooManyArgsMsg}${invalidArg}."),
             (Seq("rule", "disable"), s"${tooFewArgsMsg} ${ruleNameReqMsg}"),
@@ -1266,6 +1269,7 @@ class WskBasicUsageTests
             (Seq("rule", "delete"), s"${tooFewArgsMsg} ${ruleNameReqMsg}"),
             (Seq("rule", "delete", "ruleName", invalidArg), s"${tooManyArgsMsg}${invalidArg}."),
             (Seq("rule", "list", "namespace", invalidArg), s"${tooManyArgsMsg}${invalidArg}.
${optNamespaceMsg}"),
+            (Seq("rule", "list", invalidArg), entityNameMsg),
             (Seq("trigger", "fire"), s"${tooFewArgsMsg} ${triggerNameReqMsg} ${optPayloadMsg}"),
             (Seq("trigger", "fire", "triggerName", "triggerPayload", invalidArg),
                 s"${tooManyArgsMsg}${invalidArg}. ${triggerNameReqMsg} ${optPayloadMsg}"),
@@ -1277,7 +1281,8 @@ class WskBasicUsageTests
             (Seq("trigger", "get", "triggerName", "namespace", invalidArg), s"${tooManyArgsMsg}${invalidArg}."),
             (Seq("trigger", "delete"), s"${tooFewArgsMsg} ${triggerNameReqMsg}"),
             (Seq("trigger", "delete", "triggerName", invalidArg), s"${tooManyArgsMsg}${invalidArg}."),
-            (Seq("trigger", "list", "namespace", invalidArg), s"${tooManyArgsMsg}${invalidArg}.
${optNamespaceMsg}"))
+            (Seq("trigger", "list", "namespace", invalidArg), s"${tooManyArgsMsg}${invalidArg}.
${optNamespaceMsg}"),
+            (Seq("trigger", "list", invalidArg), entityNameMsg))
 
         invalidArgs foreach {
             case (cmd, err) =>

-- 
To stop receiving notification emails like this one, please contact
"commits@openwhisk.apache.org" <commits@openwhisk.apache.org>.

Mime
View raw message