[P-unit-devel] SF.net SVN: p-unit: [261] trunk/punit/src/org/punit
Status: Beta
Brought to you by:
zhanghuangzhu
|
From: <zha...@us...> - 2007-12-25 12:35:01
|
Revision: 261
http://p-unit.svn.sourceforge.net/p-unit/?rev=261&view=rev
Author: zhanghuangzhu
Date: 2007-12-25 04:35:05 -0800 (Tue, 25 Dec 2007)
Log Message:
-----------
Andrew Zhang: introduced VanillaEventListener
Modified Paths:
--------------
trunk/punit/src/org/punit/reporter/TestResult.java
trunk/punit/src/org/punit/reporter/stream/StreamLogger.java
trunk/punit/src/org/punit/watcher/AbstractWatcher.java
Added Paths:
-----------
trunk/punit/src/org/punit/events/VanillaEventListener.java
Added: trunk/punit/src/org/punit/events/VanillaEventListener.java
===================================================================
--- trunk/punit/src/org/punit/events/VanillaEventListener.java (rev 0)
+++ trunk/punit/src/org/punit/events/VanillaEventListener.java 2007-12-25 12:35:05 UTC (rev 261)
@@ -0,0 +1,77 @@
+package org.punit.events;
+
+import java.lang.reflect.*;
+import java.util.*;
+
+import org.punit.runner.*;
+import org.punit.type.*;
+import org.punit.watcher.*;
+
+public class VanillaEventListener implements EventListener {
+
+ private static final long serialVersionUID = -2413131933921801719L;
+
+ public VanillaEventListener() {
+
+ }
+
+ public void onClassEnd(Object testInstance, Throwable t) {
+
+ }
+
+ public void onClassStart(Object testInstance) {
+
+ }
+
+ public void onMethodEnd(Method method, Object testInstance,
+ Object[] params, Throwable t, List Watchers) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void onMethodStart(Method method, Object testInstance,
+ Object[] params) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void onRunnerEnd(Class clazz, Runner runner) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void onRunnerStart(Class clazz, Runner runner) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void onSuiteEnd(TestSuite suite) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void onSuiteStart(TestSuite suite) {
+
+ }
+
+ public void onWatcherEnd(Watcher watcher) {
+
+ }
+
+ public void onWatcherStart(Watcher watcher) {
+
+ }
+
+ public void onWatchersEnd(List watchers) {
+
+ }
+
+ public void onWatchersStart(List watchers) {
+
+ }
+
+ public boolean supportParentRunner() {
+ return false;
+ }
+
+}
Property changes on: trunk/punit/src/org/punit/events/VanillaEventListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/punit/src/org/punit/reporter/TestResult.java
===================================================================
--- trunk/punit/src/org/punit/reporter/TestResult.java 2007-12-25 12:31:15 UTC (rev 260)
+++ trunk/punit/src/org/punit/reporter/TestResult.java 2007-12-25 12:35:05 UTC (rev 261)
@@ -1,16 +1,12 @@
/* (C) Copyright 2007, by Andrew Zhang */
package org.punit.reporter;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
+import java.lang.reflect.*;
+import java.util.*;
-import org.punit.events.EventListener;
-import org.punit.runner.Runner;
-import org.punit.type.TestSuite;
-import org.punit.watcher.Watcher;
+import org.punit.events.*;
-public class TestResult implements EventListener {
+public class TestResult extends VanillaEventListener {
private static final long serialVersionUID = -5770657966003459019L;
@@ -42,61 +38,4 @@
return _failures;
}
- /**
- * A method is required by <code>EventListener</code> interface. It does
- * nothing when a new test class is instantiated.
- */
- public void onClassStart(Object testInstance) {
-
- }
-
- /**
- * A method is required by <code>EventListener</code> interface. It does
- * nothing when a test class execution is completed.
- */
- public void onClassEnd(Object testInstance, Throwable t) {
-
- }
-
- public void onMethodStart(Method method, Object testInstance,
- Object[] params) {
-
- }
-
- public void onRunnerEnd(Class clazz, Runner runner) {
-
- }
-
- public void onRunnerStart(Class clazz, Runner runner) {
-
- }
-
- public void onSuiteEnd(TestSuite suite) {
-
- }
-
- public void onSuiteStart(TestSuite suite) {
-
- }
-
- public void onWatcherEnd(Watcher watcher) {
-
- }
-
- public void onWatcherStart(Watcher watcher) {
-
- }
-
- public void onWatchersEnd(List watchers) {
-
- }
-
- public void onWatchersStart(List watchers) {
-
- }
-
- public boolean supportParentRunner() {
- return false;
- }
-
}
Modified: trunk/punit/src/org/punit/reporter/stream/StreamLogger.java
===================================================================
--- trunk/punit/src/org/punit/reporter/stream/StreamLogger.java 2007-12-25 12:31:15 UTC (rev 260)
+++ trunk/punit/src/org/punit/reporter/stream/StreamLogger.java 2007-12-25 12:35:05 UTC (rev 261)
@@ -2,24 +2,20 @@
package org.punit.reporter.stream;
-import java.io.PrintWriter;
-import java.lang.reflect.Method;
-import java.util.Iterator;
-import java.util.List;
-import java.util.logging.Level;
+import java.io.*;
+import java.lang.reflect.*;
+import java.util.*;
+import java.util.logging.*;
-import org.punit.events.EventListener;
-import org.punit.message.Messages;
-import org.punit.reporter.TestResult;
-import org.punit.runner.Runner;
-import org.punit.type.TestSuite;
-import org.punit.util.ReporterUtil;
-import org.punit.util.Traverser;
-import org.punit.util.TraverserUtil;
-import org.punit.watcher.TimeWatcher;
-import org.punit.watcher.Watcher;
+import org.punit.events.*;
+import org.punit.message.*;
+import org.punit.reporter.*;
+import org.punit.runner.*;
+import org.punit.type.*;
+import org.punit.util.*;
+import org.punit.watcher.*;
-public abstract class StreamLogger implements EventListener {
+public abstract class StreamLogger extends VanillaEventListener {
protected transient PrintWriter _writer;
@@ -30,7 +26,6 @@
private TimeWatcher _timeWatcher;
public StreamLogger() {
-
}
public StreamLogger(PrintWriter writer) {
@@ -112,10 +107,6 @@
logln(testInstance.getClass().getName(), Level.INFO);
}
- public void onClassEnd(Object testInstance, Throwable t) {
- // nothing needs to be done
- }
-
public void onMethodEnd(Method method, Object instance, Object[] params,
Throwable t, List watchers) {
logTestMethodResult(method, params, watchers, t);
@@ -187,27 +178,4 @@
_level = level;
}
- public void onWatchersStart(List watchers) {
- // nothing needs to be done
- }
-
- public void onWatcherStart(Watcher watcher) {
- // nothing needs to be done
- }
-
- public void onWatchersEnd(List watchers) {
- // nothing needs to be done
- }
-
- public void onWatcherEnd(Watcher watcher) {
- // nothing needs to be done
- }
-
- public void onSuiteEnd(TestSuite suite) {
- // nothing needs to be done
- }
-
- public void onMethodStart(Method method, Object instance, Object[] params) {
- // nothing needs to be done
- }
}
\ No newline at end of file
Modified: trunk/punit/src/org/punit/watcher/AbstractWatcher.java
===================================================================
--- trunk/punit/src/org/punit/watcher/AbstractWatcher.java 2007-12-25 12:31:15 UTC (rev 260)
+++ trunk/punit/src/org/punit/watcher/AbstractWatcher.java 2007-12-25 12:35:05 UTC (rev 261)
@@ -4,18 +4,12 @@
import org.punit.exception.ReflectionException;
-abstract class AbstractWatcher implements Watcher {
+public abstract class AbstractWatcher implements Watcher {
transient long _scale = 1;
transient long _value;
- public void start() {
- }
-
- public void stop() {
- }
-
public double value() {
return ((double) _value) / _scale;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|