01: package fat;
02:
03: import fit.*;
04: import java.io.*;
05:
06: /** A fixture that processes other Fit documents. */
07: public class ReferenceFixture extends ColumnFixture {
08: public String Description;
09: public String Location;
10: public String Note;
11:
12: public String Result() {
13: String inputFileName = "../../spec/" + Location;
14: String outputFileName = "output/spec/" + Location;
15: try {
16: FileRunner runner = new FileRunner();
17: runner.args(new String[] { inputFileName, outputFileName });
18: runner.process();
19: runner.output.close();
20:
21: Counts counts = runner.fixture.counts;
22: if ((counts.exceptions == 0) && (counts.wrong == 0)) {
23: return "pass";
24: } else {
25: return "fail: " + counts.right + " right, "
26: + counts.wrong + " wrong, " + counts.exceptions
27: + " exceptions";
28: }
29: } catch (IOException e) {
30: File inputFile = new File(inputFileName);
31: String fileDescription;
32: try {
33: fileDescription = inputFile.getCanonicalPath();
34: } catch (IOException e2) {
35: fileDescription = inputFile.getAbsolutePath();
36: }
37: return "file not found: " + fileDescription;
38: }
39: }
40: }
|