KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > ejtools > management > test > ReportImpl


1 package net.sourceforge.ejtools.management.test;
2
3 import java.io.OutputStream JavaDoc;
4 import java.io.Writer JavaDoc;
5 import java.util.Enumeration JavaDoc;
6 import java.util.Hashtable JavaDoc;
7
8 import junit.framework.Test;
9
10 import org.apache.log4j.Category;
11
12 /**
13  * @author laurent To change this generated comment edit the template variable "typecomment": Window>Preferences>Java>Templates. To enable and disable the
14  * creation of type comments go to Window>Preferences>Java>Code Generation.
15  * @created 5 août 2002
16  */

17 public class ReportImpl extends ResultSinkImpl implements Report
18 {
19    protected String JavaDoc name = "";
20    protected String JavaDoc title = "";
21    /** Description of the Field */
22    protected Hashtable JavaDoc infos = new Hashtable JavaDoc();
23    /** Description of the Field */
24    private static Category logger = Category.getInstance(ReportImpl.class);
25
26    /**
27     * Adds a feature to the Information attribute of the ReportImpl object
28     *
29     * @param message The feature to be added to the Information attribute
30     * @param status The feature to be added to the Information attribute
31     */

32    public void addInfo(Test test, String JavaDoc key, String JavaDoc value)
33    {
34       infos.put(key, value);
35    }
36
37
38    /**
39     * Sets the name attribute of the ReportImpl object
40     *
41     * @param name The new name value
42     */

43    public void setName(String JavaDoc name) { }
44
45    public void write(OutputStream JavaDoc stream) {
46    }
47
48    public void dump() {
49     
50       logger.info("--------------------");
51       
52             Enumeration JavaDoc keys = infos.keys();
53             while (keys.hasMoreElements()) {
54                 String JavaDoc key = (String JavaDoc) keys.nextElement();
55          logger.info("[ >>> ] " + key + "="+ infos.get(key));
56             }
57       
58       logger.info("--------------------");
59       
60       for (int i = 0; i < passed.size(); i++)
61       {
62          logger.info("[ PASSED ] " + passed.elementAt(i));
63       }
64       for (int i = 0; i < failed.size(); i++)
65       {
66          logger.info("[ FAILED ] " + failed.elementAt(i));
67       }
68       for (int i = 0; i < errors.size(); i++)
69       {
70          logger.info("[ ERROR ] " + errors.elementAt(i));
71       }
72       
73       logger.info("--------------------");
74
75       long total = passed.size() + failed.size() + errors.size();
76       logger.info("Total : " + total);
77       logger.info("Passed : " + passed.size() + "/" + total);
78       logger.info("Failed : " + failed.size() + "/" + total);
79       logger.info("Errors : " + errors.size() + "/" + total);
80
81       logger.info("--------------------");
82    }
83
84
85    /**
86     * Sets the output attribute of the ReportImpl object
87     *
88     * @param writer The new output value
89     */

90    public void write(Writer JavaDoc writer) { }
91
92
93    /**
94     * Sets the template attribute of the ReportImpl object
95     *
96     * @param filename The new template value
97     */

98    public void setTemplate(String JavaDoc filename) { }
99
100
101    /**
102     * Sets the title attribute of the ReportImpl object
103     *
104     * @param name The new title value
105     */

106    public void setTitle(String JavaDoc name) { }
107
108    public void startTest(Test arg0) { }
109    
110    public void endTest(Test arg0)
111    {
112    }
113 }
114
Popular Tags