KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > quilt > frontend > ant > MockExec


1 /* MockExec.java */
2 package org.quilt.frontend.ant;
3
4 import java.util.Vector JavaDoc;
5
6 import org.quilt.framework.QuiltTest;
7 import org.quilt.runner.*;
8
9 /**
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      * Dump the parameters for the task and the test. If the task
23      * parameters have been shown before, this will not be repeated.
24      *
25      * @param qt The test which would have been run.
26      * @param tc Task control information.
27      */

28     public void run (QuiltTest qt, TaskControl tc) {
29
30         System.out.println("** MockExec **");
31         if (firstRun) {
32             // if it's the first time through, set up the runner ...
33
firstRun = false;
34             mtr = new MockTestRunner();
35             // keep a copy of the task control info ...
36
tc2 = (TaskControl) tc.clone();
37             // then print it out
38
System.out.println ("==== TaskControl ====\n" + tc);
39             
40         } else if (!tc.equals(tc2)) {
41             // if the task control info has changed, copy it and dump it
42
System.out.println ("==== NEW TASK CONTROL ====\n" + tc);
43             tc2 = (TaskControl) tc.clone();
44         }
45         System.out.println ("** " + qt.getName() + " **");
46     }
47 }
48
Popular Tags