KickJava   Java API By Example, From Geeks To Geeks.

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


1 package net.sourceforge.ejtools.management.test;
2
3 import junit.extensions.jfunc.AssertListener;
4 import junit.framework.AssertionFailedError;
5 import junit.framework.Test;
6
7 import org.apache.log4j.Category;
8
9 /**
10  * @author laurent
11  *
12  * To change this generated comment edit the template variable "typecomment":
13  * Window>Preferences>Java>Templates.
14  * To enable and disable the creation of type comments go to
15  * Window>Preferences>Java>Code Generation.
16  */

17 public class VerboseListener implements AssertListener
18 {
19    /** Description of the Field */
20    private static Category logger = Category.getInstance(VerboseListener.class);
21    
22     /**
23      * Constructor for VerboseListener.
24      */

25     public VerboseListener()
26     {
27         super();
28     }
29
30     /**
31      * @see junit.extensions.jfunc.AssertListener#addAssert(Test, String, boolean)
32      */

33     public void addAssert(Test arg0, String JavaDoc arg1, boolean arg2)
34     {
35         logger.debug("[ ASSERT] (" + arg0 + ") " + arg1 + " = " + arg2);
36     }
37
38     /**
39      * @see junit.framework.TestListener#addError(Test, Throwable)
40      */

41     public void addError(Test arg0, Throwable JavaDoc arg1)
42     {
43         logger.debug("[ ERROR ] (" + arg0 + ") " + arg1.getMessage());
44     }
45
46     /**
47      * @see junit.framework.TestListener#addFailure(Test, AssertionFailedError)
48      */

49     public void addFailure(Test arg0, AssertionFailedError arg1)
50     {
51         logger.debug("[FAILURE] (" + arg0 + ") " + arg1.getMessage());
52     }
53
54     /**
55      * @see junit.framework.TestListener#endTest(Test)
56      */

57     public void endTest(Test arg0)
58     {
59         logger.debug("Test is ending " + arg0);
60     }
61
62     /**
63      * @see junit.framework.TestListener#startTest(Test)
64      */

65     public void startTest(Test arg0)
66     {
67         logger.debug("Test is starting " + arg0);
68     }
69 }
70
Popular Tags