Repository: incubator-slider
Updated Branches:
  refs/heads/feature/SLIDER-622-windows efc9922be -> 1ea195d2e


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/1ea195d2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/1ea195d2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/1ea195d2

Branch: refs/heads/feature/SLIDER-622-windows
Commit: 1ea195d2e222fa8ddc7669e2f03a472e51031c1a
Parents: efc9922
Author: Steve Loughran <[email protected]>
Authored: Mon Nov 10 17:08:13 2014 +0000
Committer: Steve Loughran <[email protected]>
Committed: Mon Nov 10 17:08:13 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/1ea195d2/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