1 package net.sourceforge.ejtools.management.test; 2 3 import java.io.OutputStream ; 4 import java.io.Writer ; 5 import java.util.Enumeration ; 6 import java.util.Hashtable ; 7 8 import junit.framework.Test; 9 10 import org.apache.log4j.Category; 11 12 17 public class ReportImpl extends ResultSinkImpl implements Report 18 { 19 protected String name = ""; 20 protected String title = ""; 21 22 protected Hashtable infos = new Hashtable (); 23 24 private static Category logger = Category.getInstance(ReportImpl.class); 25 26 32 public void addInfo(Test test, String key, String value) 33 { 34 infos.put(key, value); 35 } 36 37 38 43 public void setName(String name) { } 44 45 public void write(OutputStream stream) { 46 } 47 48 public void dump() { 49 50 logger.info("--------------------"); 51 52 Enumeration keys = infos.keys(); 53 while (keys.hasMoreElements()) { 54 String key = (String ) 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 90 public void write(Writer writer) { } 91 92 93 98 public void setTemplate(String filename) { } 99 100 101 106 public void setTitle(String name) { } 107 108 public void startTest(Test arg0) { } 109 110 public void endTest(Test arg0) 111 { 112 } 113 } 114 | Popular Tags |