SLIDER-451. slider install-package could use better error messages

Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/47b4a9c6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/47b4a9c6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/47b4a9c6

Branch: refs/heads/feature/SLIDER-158_slider_diagnostic_option
Commit: 47b4a9c606d6e7064c690f60ab9f456d8ec6ac75
Parents: 94df22c
Author: Sumit Mohanty <[email protected]>
Authored: Tue Sep 23 21:07:55 2014 -0700
Committer: Sumit Mohanty <[email protected]>
Committed: Tue Sep 23 21:07:55 2014 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/slider/client/SliderClient.java   | 6 +++---
 .../slider/agent/actions/TestActionInstallPackage.groovy       | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/47b4a9c6/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
----------------------------------------------------------------------
diff --git 
a/slider-core/src/main/java/org/apache/slider/client/SliderClient.java 
b/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
index 221fc43..129f851 100644
--- a/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
+++ b/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
@@ -623,11 +623,11 @@ public class SliderClient extends 
AbstractSliderLaunchedService implements RunSe
 
     Path srcFile = null;
     if (null == installPkgInfo.name || installPkgInfo.name.length() == 0) {
-      throw new BadCommandArgumentsException("A valid application name is 
required.");
+      throw new BadCommandArgumentsException("A valid application type name is 
required (e.g. HBASE).");
     }
 
     if (null == installPkgInfo.packageURI || 
installPkgInfo.packageURI.length() == 0) {
-      throw new BadCommandArgumentsException("A valid application package is 
required.");
+      throw new BadCommandArgumentsException("A valid application package 
location required.");
     } else {
       File pkgFile = new File(installPkgInfo.packageURI);
       if (!pkgFile.exists() || pkgFile.isDirectory()) {
@@ -646,7 +646,7 @@ public class SliderClient extends 
AbstractSliderLaunchedService implements RunSe
     if (sliderFileSystem.getFileSystem().exists(fileInFs) && 
!installPkgInfo.replacePkg) {
       throw new BadCommandArgumentsException("Pkg exists at " +
                                              fileInFs.toUri().toString() +
-                                             ". Use --replacePkg to 
overwrite.");
+                                             ". Use --replacepkg to 
overwrite.");
     }
 
     sliderFileSystem.getFileSystem().copyFromLocalFile(false, 
installPkgInfo.replacePkg, srcFile, fileInFs);

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/47b4a9c6/slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionInstallPackage.groovy
----------------------------------------------------------------------
diff --git 
a/slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionInstallPackage.groovy
 
b/slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionInstallPackage.groovy
index 88f1298..064c7a9 100644
--- 
a/slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionInstallPackage.groovy
+++ 
b/slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionInstallPackage.groovy
@@ -56,7 +56,7 @@ class TestActionInstallPackage extends 
AgentMiniClusterTestBase {
       )
       fail("expected an exception, got a status code " + 
launcher.serviceExitCode)
     } catch (BadCommandArgumentsException e) {
-      assert e.message.contains("A valid application name is required")
+      assert e.message.contains("A valid application type name is required 
(e.g. HBASE)")
     }
   }
 
@@ -74,7 +74,7 @@ class TestActionInstallPackage extends 
AgentMiniClusterTestBase {
       )
       fail("expected an exception, got a status code " + 
launcher.serviceExitCode)
     } catch (BadCommandArgumentsException e) {
-      assert e.message.contains("A valid application package is required.")
+      assert e.message.contains("A valid application package location 
required")
     }
   }
 
@@ -103,7 +103,7 @@ class TestActionInstallPackage extends 
AgentMiniClusterTestBase {
       )
       fail("expected an exception, got a status code " + 
launcher.serviceExitCode)
     } catch (BadCommandArgumentsException e) {
-      assert e.message.contains("Use --replacePkg to overwrite")
+      assert e.message.contains("Use --replacepkg to overwrite")
     }
   }
 

Reply via email to