Changing the file names from run.sh/run.bat to runsanity.sh/runsanity.bat to make...
[controller.git] / opendaylight / distribution / sanitytest / src / main / java / org / opendaylight / controller / distribution / Sanity.java
index 33ff8ea..7fc25e2 100644 (file)
@@ -4,6 +4,9 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 
+import java.util.ArrayList;
+import java.util.List;
+
 public class Sanity {
 
     static void copy(InputStream in, OutputStream out) throws IOException {
@@ -20,16 +23,18 @@ public class Sanity {
         System.out.println("Current working directory = " + cwd);
 
         String os = System.getProperty("os.name").toLowerCase();
-        String script = "./run.sh";
+        List<String> script = new ArrayList<String>();
 
         if(os.contains("windows")){
-            System.out.println("Sorry no sanity testing on Windows yet");
-            System.exit(0);
-            return;
+            script.add("cmd.exe");
+            script.add("/c");
+            script.add("runsanity.bat");
+        } else {
+            script.add("./runsanity.sh");
         }
 
         ProcessBuilder processBuilder = new ProcessBuilder();
-        processBuilder.command(script);
+        processBuilder.inheritIO().command(script);
         Process p = processBuilder.start();
 
         copy(p.getInputStream(), System.out);