diff options
author | michelou <michelou@epfl.ch> | 2003-10-14 09:10:35 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2003-10-14 09:10:35 +0000 |
commit | 46781834bf5794bc610074ce0a8bf842196db05f (patch) | |
tree | 9ab539b546af2f1f9a1bb22746c7e1fa15c68a35 | |
parent | cc2a5f03994399f05845b32d37969f04b0c953e2 (diff) | |
download | scala-46781834bf5794bc610074ce0a8bf842196db05f.tar.gz scala-46781834bf5794bc610074ce0a8bf842196db05f.tar.bz2 scala-46781834bf5794bc610074ce0a8bf842196db05f.zip |
- removed class Command (now in separate file)
-rw-r--r-- | sources/scala/tools/scalatest/Test.java | 68 |
1 files changed, 1 insertions, 67 deletions
diff --git a/sources/scala/tools/scalatest/Test.java b/sources/scala/tools/scalatest/Test.java index 88a42cfa0f..b2d2bfa65a 100644 --- a/sources/scala/tools/scalatest/Test.java +++ b/sources/scala/tools/scalatest/Test.java @@ -8,78 +8,12 @@ package scala.tools.scalatest; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.PrintWriter; import java.util.List; import java.util.ListIterator; -abstract class Command { - private Console console; - - Command(Console console) { - this.console = console; - } - - private void redirect(BufferedReader rd, OutputStream out) throws IOException { - String s = rd.readLine(); - if (s != null) { - if (out == null) /* no redirection */ - do { - console.println(s); - } while ((s = rd.readLine()) != null); - else { - PrintWriter pw = new PrintWriter(out); - do { - pw.println(s); - } while ((s = rd.readLine()) != null); - pw.close(); - } - } - } - - protected boolean execute(String cmdline, OutputStream out, OutputStream err) { - boolean ok = true; - try { - // see http://www.devdaily.com/java/edu/pj/pj010016/pj010016.shtml - Process p = Runtime.getRuntime().exec(cmdline); - BufferedReader stdOutput = new BufferedReader( - new InputStreamReader(p.getInputStream())); - BufferedReader stdError = new BufferedReader( - new InputStreamReader(p.getErrorStream())); - - // read any output from the attempted command - redirect(stdOutput, out); - - // read any errors from the attempted command - redirect(stdError, err); - - p.destroy(); - } catch (IOException e) { - System.err.println(e.getMessage()); - } - return ok; - } - - protected boolean execute(String cmdline, OutputStream out) { - return execute(cmdline, out, null); - } - - protected boolean execute(String cmdline) { - return execute(cmdline, null, null); - } - - public abstract boolean run(String arg); - -} - - public abstract class Test { + private List/*String*/[] groups; protected static Console console; |