Author: julien(a)jboss.com
Date: 2007-10-12 10:28:31 -0400 (Fri, 12 Oct 2007)
New Revision: 8619
Added:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerEventFilter.java
Removed:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerEventBroadcaster.java
Modified:
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/CompositeTestRunnerTests.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/TestDriverRunnerTests.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/event/TestRunnerEventBroadcasterSupportTests.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/event/TestRunnerLifeCycleFilterTests.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/AbstractTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerContext.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerContextSupport.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerEventBroadcasterSupport.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerLifeCycleFilter.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/driver/TestDriverRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/event/EventDrivenTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/pojo/POJOTestRunner.java
Log:
simplified a bit and removed TestRunnerEventBroadcaster interface
Modified:
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/CompositeTestRunnerTests.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/CompositeTestRunnerTests.java 2007-10-12
14:11:01 UTC (rev 8618)
+++
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/CompositeTestRunnerTests.java 2007-10-12
14:28:31 UTC (rev 8619)
@@ -26,7 +26,7 @@
import org.jboss.unit.runner.AbstractTestRunner;
import org.jboss.unit.runner.TestRunnerEvent;
import org.jboss.unit.runner.TestRunnerContext;
-import org.jboss.unit.runner.TestRunnerEventBroadcaster;
+import org.jboss.unit.runner.TestRunnerEventListener;
import org.jboss.unit.runner.impl.composite.CompositeTestRunner;
import org.jboss.unit.runner.impl.TestRunnerContextSupport;
@@ -46,9 +46,9 @@
private static List<TestRunnerEvent> events = new
ArrayList<TestRunnerEvent>();
- private static TestRunnerEventBroadcaster listener = new TestRunnerEventBroadcaster()
+ private static TestRunnerEventListener listener = new TestRunnerEventListener()
{
- public void fireEvent(TestRunnerEvent event) throws IllegalArgumentException
+ public void onEvent(TestRunnerEvent event)
{
events.add(event);
}
@@ -180,7 +180,7 @@
protected void internalRun(TestRunnerContext context)
{
invoked = true;
- context.getEventBroadcaster().fireEvent(event);
+ context.getEventListener().onEvent(event);
}
}
Modified:
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/TestDriverRunnerTests.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/TestDriverRunnerTests.java 2007-10-12
14:11:01 UTC (rev 8618)
+++
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/TestDriverRunnerTests.java 2007-10-12
14:28:31 UTC (rev 8619)
@@ -24,18 +24,16 @@
import org.jboss.unit.runner.impl.driver.TestDriverRunner;
import org.jboss.unit.runner.impl.TestRunnerContextSupport;
-import org.jboss.unit.runner.TestRunnerEventListener;
import org.jboss.unit.runner.TestRunnerEvent;
import org.jboss.unit.runner.TestResult;
import org.jboss.unit.runner.ParametrizationSet;
-import org.jboss.unit.runner.TestRunnerEventBroadcaster;
+import org.jboss.unit.runner.TestRunnerEventListener;
import org.jboss.unit.runner.results.TestFailure;
import org.jboss.unit.runner.results.TestSuccess;
import org.jboss.unit.runner.event.EndTestEvent;
import org.jboss.unit.runner.event.StartTestEvent;
import org.jboss.unit.runner.event.StartRunnerEvent;
import org.jboss.unit.runner.event.EndRunnerEvent;
-import org.jboss.unit.driver.TestDriver;
import org.jboss.unit.driver.DriverResponse;
import org.jboss.unit.driver.DriverCommand;
import org.jboss.unit.driver.AbstractTestDriver;
@@ -438,13 +436,13 @@
assertInstanceOf(event, EndRunnerEvent.class);
}
- private static class EventList implements TestRunnerEventBroadcaster
+ private static class EventList implements TestRunnerEventListener
{
/** . */
private final List<TestRunnerEvent> events = new
ArrayList<TestRunnerEvent>();
- public void fireEvent(TestRunnerEvent event) throws IllegalArgumentException
+ public void onEvent(TestRunnerEvent event)
{
events.add(event);
}
Modified:
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/event/TestRunnerEventBroadcasterSupportTests.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/event/TestRunnerEventBroadcasterSupportTests.java 2007-10-12
14:11:01 UTC (rev 8618)
+++
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/event/TestRunnerEventBroadcasterSupportTests.java 2007-10-12
14:28:31 UTC (rev 8619)
@@ -87,7 +87,7 @@
{
try
{
- support.fireEvent(null);
+ support.onEvent(null);
fail("Was expecting an IAE");
}
catch (IllegalArgumentException expected)
@@ -100,7 +100,7 @@
MyEvent event = new MyEvent();
support.addListener(listener1);
support.addListener(listener1);
- support.fireEvent(event);
+ support.onEvent(event);
assertEquals(list(event), listener1.events);
}
@@ -108,7 +108,7 @@
{
MyEvent event = new MyEvent();
support.addListener(listener1);
- support.fireEvent(event);
+ support.onEvent(event);
assertEquals(list(event), listener1.events);
}
@@ -117,7 +117,7 @@
MyEvent event = new MyEvent();
support.addListener(listener1);
support.removeListener(listener1);
- support.fireEvent(event);
+ support.onEvent(event);
assertEquals(0, listener1.events.size());
}
@@ -126,7 +126,7 @@
MyEvent event = new MyEvent();
support.addListener(listener1);
support.addListener(listener2);
- support.fireEvent(event);
+ support.onEvent(event);
assertEquals(list(event), listener1.events);
assertEquals(list(event), listener2.events);
}
@@ -139,7 +139,7 @@
//
listener1.throwable = new RuntimeException();
- support.fireEvent(event);
+ support.onEvent(event);
assertEquals(list(event), listener2.events);
//
@@ -147,7 +147,7 @@
listener2.events.clear();
listener1.throwable = null;
listener2.throwable = new RuntimeException();
- support.fireEvent(event);
+ support.onEvent(event);
assertEquals(list(event), listener1.events);
//
@@ -160,7 +160,7 @@
listener2.throwable = null;
try
{
- support.fireEvent(event);
+ support.onEvent(event);
fail("Was expecting an error");
}
catch (Error expected)
@@ -176,7 +176,7 @@
listener2.throwable = new Error();
try
{
- support.fireEvent(event);
+ support.onEvent(event);
fail("Was expecting an error");
}
catch (Error expected)
Modified:
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/event/TestRunnerLifeCycleFilterTests.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/event/TestRunnerLifeCycleFilterTests.java 2007-10-12
14:11:01 UTC (rev 8618)
+++
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/event/TestRunnerLifeCycleFilterTests.java 2007-10-12
14:28:31 UTC (rev 8619)
@@ -25,7 +25,7 @@
import static org.jboss.unit.api.Assert.assertNull;
import static org.jboss.unit.api.Assert.assertSame;
import org.jboss.unit.runner.TestRunnerEvent;
-import org.jboss.unit.runner.TestRunnerEventBroadcaster;
+import org.jboss.unit.runner.TestRunnerEventListener;
import org.jboss.unit.runner.impl.TestRunnerLifeCycleFilter;
import org.jboss.unit.runner.event.EndRunnerEvent;
import org.jboss.unit.runner.event.StartRunnerEvent;
@@ -42,9 +42,9 @@
public static void main(String[] args)
{
- TestRunnerEventBroadcaster broadcaster = new TestRunnerEventBroadcaster()
+ TestRunnerEventListener broadcaster = new TestRunnerEventListener()
{
- public void fireEvent(TestRunnerEvent event)
+ public void onEvent(TestRunnerEvent event)
{
TestRunnerLifeCycleFilterTests.event = event;
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/AbstractTestRunner.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/runner/AbstractTestRunner.java 2007-10-12
14:11:01 UTC (rev 8618)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/AbstractTestRunner.java 2007-10-12
14:28:31 UTC (rev 8619)
@@ -38,10 +38,10 @@
public final void run(TestRunnerContext context)
{
- TestRunnerEventBroadcaster broadcaster = context.getEventBroadcaster();
- broadcaster.fireEvent(new StartRunnerEvent());
+ TestRunnerEventListener broadcaster = context.getEventListener();
+ broadcaster.onEvent(new StartRunnerEvent());
internalRun(context);
- broadcaster.fireEvent(new EndRunnerEvent());
+ broadcaster.onEvent(new EndRunnerEvent());
}
protected abstract void internalRun(TestRunnerContext context);
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerContext.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerContext.java 2007-10-12
14:11:01 UTC (rev 8618)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerContext.java 2007-10-12
14:28:31 UTC (rev 8619)
@@ -35,6 +35,6 @@
TestFilter getFilter();
- TestRunnerEventBroadcaster getEventBroadcaster();
+ TestRunnerEventListener getEventListener();
}
Deleted:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerEventBroadcaster.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerEventBroadcaster.java 2007-10-12
14:11:01 UTC (rev 8618)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerEventBroadcaster.java 2007-10-12
14:28:31 UTC (rev 8619)
@@ -1,40 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.unit.runner;
-
-/**
- * A test runner event broadcaster.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface TestRunnerEventBroadcaster
-{
- /**
- * Fire an event through the broadcaster.
- *
- * @param event the event to fire
- * @throws IllegalArgumentException if the event object is null
- */
- void fireEvent(TestRunnerEvent event) throws IllegalArgumentException;
-}
Added: modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerEventFilter.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerEventFilter.java
(rev 0)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerEventFilter.java 2007-10-12
14:28:31 UTC (rev 8619)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.unit.runner;
+
+/**
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class TestRunnerEventFilter implements TestRunnerEventListener
+{
+
+ /** . */
+ private final TestRunnerEventListener broadcaster;
+
+ protected TestRunnerEventFilter(TestRunnerEventListener broadcaster)
+ {
+ if (broadcaster == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.broadcaster = broadcaster;
+ }
+
+ public void onEvent(TestRunnerEvent event)
+ {
+ if (!filter(event))
+ {
+ broadcaster.onEvent(event);
+ }
+ }
+
+ protected abstract boolean filter(TestRunnerEvent event);
+}
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerContextSupport.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerContextSupport.java 2007-10-12
14:11:01 UTC (rev 8618)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerContextSupport.java 2007-10-12
14:28:31 UTC (rev 8619)
@@ -24,9 +24,7 @@
import org.jboss.unit.runner.TestRunnerContext;
import org.jboss.unit.runner.TestFilter;
-import org.jboss.unit.runner.TestRunnerEventBroadcaster;
-import org.jboss.unit.runner.impl.TestRunnerEventBroadcasterSupport;
-import org.jboss.unit.runner.impl.NullFilter;
+import org.jboss.unit.runner.TestRunnerEventListener;
import java.util.Map;
import java.util.HashMap;
@@ -45,12 +43,12 @@
private TestFilter filter;
/** . */
- private TestRunnerEventBroadcaster eventBroadcaster;
+ private TestRunnerEventListener eventListener;
- public TestRunnerContextSupport(TestRunnerEventBroadcaster eventBroadcaster)
+ public TestRunnerContextSupport(TestRunnerEventListener eventListener)
{
- this(new HashMap<String, String>(), NullFilter.getInstance(),
eventBroadcaster);
+ this(new HashMap<String, String>(), NullFilter.getInstance(),
eventListener);
}
public TestRunnerContextSupport()
@@ -58,11 +56,11 @@
this(new HashMap<String, String>(), NullFilter.getInstance(), new
TestRunnerEventBroadcasterSupport());
}
- public TestRunnerContextSupport(Map<String, String> properties, TestFilter
filter, TestRunnerEventBroadcaster eventBroadcaster)
+ public TestRunnerContextSupport(Map<String, String> properties, TestFilter
filter, TestRunnerEventListener eventListener)
{
this.properties = properties;
this.filter = filter;
- this.eventBroadcaster = eventBroadcaster;
+ this.eventListener = eventListener;
}
public Map<String, String> getProperties()
@@ -75,8 +73,8 @@
return filter;
}
- public TestRunnerEventBroadcaster getEventBroadcaster()
+ public TestRunnerEventListener getEventListener()
{
- return eventBroadcaster;
+ return eventListener;
}
}
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerEventBroadcasterSupport.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerEventBroadcasterSupport.java 2007-10-12
14:11:01 UTC (rev 8618)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerEventBroadcasterSupport.java 2007-10-12
14:28:31 UTC (rev 8619)
@@ -24,7 +24,6 @@
import org.jboss.unit.runner.TestRunnerEventListener;
import org.jboss.unit.runner.TestRunnerEvent;
-import org.jboss.unit.runner.TestRunnerEventBroadcaster;
import java.util.List;
import java.util.ArrayList;
@@ -37,7 +36,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class TestRunnerEventBroadcasterSupport implements TestRunnerEventBroadcaster
+public class TestRunnerEventBroadcasterSupport implements TestRunnerEventListener
{
/** . */
@@ -79,7 +78,7 @@
}
}
- public void fireEvent(TestRunnerEvent event)
+ public void onEvent(TestRunnerEvent event)
{
if (event == null)
{
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerLifeCycleFilter.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerLifeCycleFilter.java 2007-10-12
14:11:01 UTC (rev 8618)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerLifeCycleFilter.java 2007-10-12
14:28:31 UTC (rev 8619)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.unit.runner.impl;
-import org.jboss.unit.runner.TestRunnerEventBroadcaster;
import org.jboss.unit.runner.TestRunnerEvent;
+import org.jboss.unit.runner.TestRunnerEventFilter;
import org.jboss.unit.runner.TestRunnerEventListener;
import org.jboss.unit.runner.event.StartRunnerEvent;
import org.jboss.unit.runner.event.EndRunnerEvent;
@@ -32,23 +32,16 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class TestRunnerLifeCycleFilter implements TestRunnerEventListener
+public class TestRunnerLifeCycleFilter extends TestRunnerEventFilter
{
- /** . */
- private final TestRunnerEventBroadcaster broadcaster;
-
- public TestRunnerLifeCycleFilter(TestRunnerEventBroadcaster broadcaster)
+ public TestRunnerLifeCycleFilter(TestRunnerEventListener listener)
{
- this.broadcaster = broadcaster;
+ super(listener);
}
- public void onEvent(TestRunnerEvent event)
+ protected boolean filter(TestRunnerEvent event)
{
- if (event instanceof StartRunnerEvent || event instanceof EndRunnerEvent)
- {
- return;
- }
- broadcaster.fireEvent(event);
+ return event instanceof StartRunnerEvent || event instanceof EndRunnerEvent;
}
}
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java 2007-10-12
14:11:01 UTC (rev 8618)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java 2007-10-12
14:28:31 UTC (rev 8619)
@@ -54,7 +54,7 @@
{
// Setup intermediate event filtering
TestRunnerEventBroadcasterSupport tmp = new TestRunnerEventBroadcasterSupport();
- tmp.addListener(new TestRunnerLifeCycleFilter(context.getEventBroadcaster()));
+ tmp.addListener(new TestRunnerLifeCycleFilter(context.getEventListener()));
TestRunnerContextSupport nestedContext = new
TestRunnerContextSupport(context.getProperties(), context.getFilter(), tmp);
for (TestRunner runner : runners)
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/driver/TestDriverRunner.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/driver/TestDriverRunner.java 2007-10-12
14:11:01 UTC (rev 8618)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/driver/TestDriverRunner.java 2007-10-12
14:28:31 UTC (rev 8619)
@@ -103,7 +103,7 @@
{
if (testId == null)
{
- context.getEventBroadcaster().fireEvent(new
RunnerFailureEvent(Failure.createErrorFailure("No test id specified")));
+ context.getEventListener().onEvent(new
RunnerFailureEvent(Failure.createErrorFailure("No test id specified")));
}
else
{
@@ -114,7 +114,7 @@
}
catch (Exception e)
{
- context.getEventBroadcaster().fireEvent(new
RunnerFailureEvent(Failure.createErrorFailure("Was not able to start the test driver
properly", e)));
+ context.getEventListener().onEvent(new
RunnerFailureEvent(Failure.createErrorFailure("Was not able to start the test driver
properly", e)));
return;
}
@@ -163,7 +163,7 @@
TestCaseInfo testCaseInfo = (TestCaseInfo)testInfo;
for (Map<String,String> parametrization :
parametrizationSet.enumerate(testCaseInfo.getParameters().keySet()))
{
- context.getEventBroadcaster().fireEvent(new StartTestEvent(testId,
testCaseInfo));
+ context.getEventListener().onEvent(new StartTestEvent(testId,
testCaseInfo));
//
StartTestCommand command = new StartTestCommand(parametrization);
@@ -200,7 +200,7 @@
}
//
- context.getEventBroadcaster().fireEvent(new EndTestEvent(testId,
result));
+ context.getEventListener().onEvent(new EndTestEvent(testId, result));
}
}
}
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/event/EventDrivenTestRunner.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/event/EventDrivenTestRunner.java 2007-10-12
14:11:01 UTC (rev 8618)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/event/EventDrivenTestRunner.java 2007-10-12
14:28:31 UTC (rev 8619)
@@ -24,7 +24,6 @@
import org.jboss.unit.runner.AbstractTestRunner;
import org.jboss.unit.runner.TestRunnerEvent;
-import org.jboss.unit.runner.TestFilter;
import org.jboss.unit.runner.TestRunnerContext;
import java.util.Collection;
@@ -54,7 +53,7 @@
{
for (TestRunnerEvent event : events)
{
- context.getEventBroadcaster().fireEvent(event);
+ context.getEventListener().onEvent(event);
}
}
}
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java 2007-10-12
14:11:01 UTC (rev 8618)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java 2007-10-12
14:28:31 UTC (rev 8619)
@@ -60,7 +60,7 @@
// Setup intermediate event filtering
TestRunnerEventBroadcasterSupport tmp = new TestRunnerEventBroadcasterSupport();
- tmp.addListener(new TestRunnerLifeCycleFilter(context.getEventBroadcaster()));
+ tmp.addListener(new TestRunnerLifeCycleFilter(context.getEventListener()));
TestRunnerContextSupport nestedContext = new
TestRunnerContextSupport(context.getProperties(), context.getFilter(), tmp);
//
@@ -93,7 +93,7 @@
}
catch (Exception e)
{
- nestedContext.getEventBroadcaster().fireEvent(new
RunnerFailureEvent(Failure.createErrorFailure("Cannot execute test class " +
className,e)));
+ nestedContext.getEventListener().onEvent(new
RunnerFailureEvent(Failure.createErrorFailure("Cannot execute test class " +
className,e)));
}
}
}
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/pojo/POJOTestRunner.java
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/pojo/POJOTestRunner.java 2007-10-12
14:11:01 UTC (rev 8618)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/pojo/POJOTestRunner.java 2007-10-12
14:28:31 UTC (rev 8619)
@@ -61,7 +61,7 @@
{
// Setup intermediate event filtering
TestRunnerEventBroadcasterSupport tmp = new TestRunnerEventBroadcasterSupport();
- tmp.addListener(new TestRunnerLifeCycleFilter(context.getEventBroadcaster()));
+ tmp.addListener(new TestRunnerLifeCycleFilter(context.getEventListener()));
TestRunnerContextSupport nestedContext = new
TestRunnerContextSupport(context.getProperties(), context.getFilter(), tmp);
//
@@ -106,7 +106,7 @@
}
catch (Exception e)
{
- nestedContext.getEventBroadcaster().fireEvent(new
RunnerFailureEvent(Failure.createErrorFailure("Cannot execute test class " +
className,e)));
+ nestedContext.getEventListener().onEvent(new
RunnerFailureEvent(Failure.createErrorFailure("Cannot execute test class " +
className,e)));
}
}
}