SLIDER-350 windows support

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

Branch: refs/heads/develop
Commit: 93c3c770fed878895e4fb67ac17cbbb098cb4fb3
Parents: 8f9caa9
Author: Steve Loughran <ste...@apache.org>
Authored: Thu Sep 4 14:05:38 2014 +0100
Committer: Steve Loughran <ste...@apache.org>
Committed: Thu Sep 4 14:05:38 2014 +0100

----------------------------------------------------------------------
 .../common/tools/TestWindowsSupport.groovy      | 22 +++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/93c3c770/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 61ede62..6ae683a 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
@@ -109,13 +109,13 @@ class TestWindowsSupport extends SliderTestBase {
   @Test
   public void testHasGawkInstalled() throws Throwable {
     assume(Shell.WINDOWS, "not windows")
-    assert 0 == exec(["gawk", "--version"])
+    exec(0, ["gawk", "--version"])
   }
 
   @Test
   public void testHasXargsInstalled() throws Throwable {
     assume(Shell.WINDOWS, "not windows")
-    assert 0 == exec(["xargs", "--version"])
+    exec(0, ["xargs", "--version"])
   }
 
   
@@ -145,16 +145,28 @@ class TestWindowsSupport extends SliderTestBase {
     File winUtils = new File(winUtilsPath)
     log.debug("Winutils is at $winUtils)")
 
-    ForkedProcessService process = exec([winUtilsPath, "systeminfo"])
-    assert 0 == process.exitCode
+    exec(0, [winUtilsPath, "systeminfo"])
   }
 
 
   /**
    * Exec a set of commands, wait a few seconds for it to finish.
+   * @param status code
    * @param commands
-   * @return
+   * @return the process
    */
+  public ForkedProcessService exec(int status, List<String> commands) {
+    ForkedProcessService process = exec(commands)
+    assert status == process.exitCode
+    return process
+  }
+  
+  /**
+     * Exec a set of commands, wait a few seconds for it to finish.
+     * @param commands
+     * @return
+     */
+  
   public ForkedProcessService exec(List<String> commands) {
     ForkedProcessService process;
     process = new ForkedProcessService(

Reply via email to