01: // Copyright (C) 2003,2004,2005 by Object Mentor, Inc. All rights reserved.
02: // Released under the terms of the GNU General Public License version 2 or later.
03: package fitnesse.testutil;
04:
05: import fitnesse.components.CommandRunner;
06:
07: public class MockCommandRunner extends CommandRunner {
08: public MockCommandRunner() {
09: super ("", "");
10: }
11:
12: public MockCommandRunner(String command, int exitCode) {
13: super (command, "");
14: this .exitCode = exitCode;
15: }
16:
17: public void setOutput(String output) {
18: outputBuffer = new StringBuffer(output);
19: }
20:
21: public void setError(String error) {
22: errorBuffer = new StringBuffer(error);
23: }
24:
25: public void addException(Exception e) {
26: exceptions.add(e);
27: }
28:
29: public void setExitCode(int i) {
30: exitCode = i;
31: }
32: }
|