summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sources/scala/tools/scalatest/Test.java68
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;