1 54 55 package junitx.runner.listener; 56 57 import java.util.Properties ; 58 59 import junit.framework.Test; 60 import junit.framework.TestCase; 61 import junit.framework.TestResult; 62 import junitx.runner.engine.RunContext; 63 64 68 public class DebugListener extends AbstractRunListener { 69 70 public DebugListener() { 71 System.out.println("DebugListener: cstor"); 72 } 73 74 public void setRunContext(RunContext context) { 75 System.out.println("DebugListener: setRunContext"); 76 } 77 78 public void init(Properties props) throws Exception { 79 super.init(props); 80 81 System.out.println("DebugListener: init"); 82 } 83 84 public void runStarted(Test test, long time) { 85 System.out.println("DebugListener: run started"); 86 } 87 88 public void runStopped(Test test, long duration) { 89 System.out.println("DebugListener: run stopped"); 90 } 91 92 public void runEnded(Test test, TestResult result, long duration) { 93 System.out.println("DebugListener: run ended"); 94 } 95 96 public void testIgnored(Test test) { 97 } 98 99 public void testStarted(Test test, TestResult result) { 100 TestCase tmp = (TestCase) test; 101 102 System.out.println("DebugListener: test started"); 103 System.out.println(" class : " + tmp.getClass().getName()); 104 System.out.println(" name : " + tmp.getName()); 105 } 106 107 public void testFailure(Test test, TestResult result, Throwable t) { 108 System.out.println("DebugListener: test failure " + test.toString()); 109 } 110 111 public void testError(Test test, TestResult result, Throwable t) { 112 System.out.println("DebugListener: test error " + test.toString()); 113 } 114 115 public void testSuccess(Test test, TestResult result) { 116 TestCase tmp = (TestCase) test; 117 118 System.out.println("DebugListener: test success"); 119 System.out.println(" class : " + tmp.getClass().getName()); 120 System.out.println(" name : " + tmp.getName()); 121 } 122 123 } 124 | Popular Tags |