01: /* MockExec.java */
02: package org.quilt.frontend.ant;
03:
04: import java.util.Vector;
05:
06: import org.quilt.framework.QuiltTest;
07: import org.quilt.runner.*;
08:
09: /**
10: * Echoes attributes for a given QuiltTest back to the Ant user.
11: * Useful in finding out how Ant and Quilt interpret your batch.xml.
12: */
13: public class MockExec {
14: private boolean firstRun = true;
15: private MockTestRunner mtr = null;
16: private TaskControl tc2 = null;
17:
18: /** No-arg constructor. */
19: public MockExec() {
20: }
21:
22: /**
23: * Dump the parameters for the task and the test. If the task
24: * parameters have been shown before, this will not be repeated.
25: *
26: * @param qt The test which would have been run.
27: * @param tc Task control information.
28: */
29: public void run(QuiltTest qt, TaskControl tc) {
30:
31: System.out.println("** MockExec **");
32: if (firstRun) {
33: // if it's the first time through, set up the runner ...
34: firstRun = false;
35: mtr = new MockTestRunner();
36: // keep a copy of the task control info ...
37: tc2 = (TaskControl) tc.clone();
38: // then print it out
39: System.out.println("==== TaskControl ====\n" + tc);
40:
41: } else if (!tc.equals(tc2)) {
42: // if the task control info has changed, copy it and dump it
43: System.out.println("==== NEW TASK CONTROL ====\n" + tc);
44: tc2 = (TaskControl) tc.clone();
45: }
46: System.out.println("** " + qt.getName() + " **");
47: }
48: }
|