SLIDER-622 test for failfast execution if file not found

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

Branch: refs/heads/releases/slider-0.60
Commit: f2e63f6e12b017e7c63f473af3060f3dc815fe3c
Parents: e074133
Author: Steve Loughran <[email protected]>
Authored: Mon Nov 10 17:08:13 2014 +0000
Committer: Steve Loughran <[email protected]>
Committed: Mon Nov 10 22:48:09 2014 +0000

----------------------------------------------------------------------
 .../apache/slider/common/tools/TestWindowsSupport.groovy  | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/f2e63f6e/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
----------------------------------------------------------------------
diff --git 
a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
 
b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
index 51c73b2..25b7c57 100644
--- 
a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
+++ 
b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
@@ -25,6 +25,7 @@ import org.apache.hadoop.fs.ChecksumFileSystem
 import org.apache.hadoop.fs.FSDataInputStream
 import org.apache.hadoop.fs.Path
 import org.apache.hadoop.fs.FileSystem as HadoopFS
+import org.apache.hadoop.service.ServiceStateException
 import org.apache.hadoop.util.Shell
 import org.apache.slider.providers.agent.AgentUtils
 import org.apache.slider.server.services.workflow.ForkedProcessService
@@ -120,10 +121,15 @@ class TestWindowsSupport extends SliderTestBase {
   @Test
   public void testExecNonexistentBinary() throws Throwable {
     assume(Shell.WINDOWS, "not windows")
-    exec(2, ["undefined-application", "--version"])
+    try {
+      exec(2, ["undefined-application", "--version"])
+    } catch (ServiceStateException e) {
+      if (!(e.cause instanceof FileNotFoundException)) {
+        throw e;
+      }
+    }
   }
 
-  
   @Test
   public void testEmitKillCommand() throws Throwable {
     killJavaProcesses("regionserver", 9)

Reply via email to