Author: julien(a)jboss.com
Date: 2007-10-12 10:29:27 -0400 (Fri, 12 Oct 2007)
New Revision: 8620
Added:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerEventBroadcaster.java
Removed:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerEventBroadcasterSupport.java
Modified:
modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTestTwo.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTests.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/event/TestRunnerEventBroadcasterSupportTests.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/composite/CompositeTestRunner.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
modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java
modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainBuilder.java
Log:
renamed TestEventBroadcasterSupport to TestEventBroadcaster
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTestTwo.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTestTwo.java 2007-10-12
14:28:31 UTC (rev 8619)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTestTwo.java 2007-10-12
14:29:27 UTC (rev 8620)
@@ -28,7 +28,7 @@
import org.jboss.unit.report.impl.writer.PrintListener;
import org.jboss.unit.runner.TestRunner;
import org.jboss.unit.runner.TestRunnerEventListener;
-import org.jboss.unit.runner.impl.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.TestRunnerEventBroadcaster;
import org.jboss.unit.runner.impl.TestRunnerContextSupport;
import org.jboss.unit.runner.model.ModelBuilder;
import org.jboss.unit.runner.model.TestSuiteDef;
@@ -54,7 +54,7 @@
TestRunnerEventListener junitReporter = new JUnitReporter("output",
BlahTestTwo.class.getName());
// add listeners
- TestRunnerEventBroadcasterSupport broadcaster = new
TestRunnerEventBroadcasterSupport();
+ TestRunnerEventBroadcaster broadcaster = new TestRunnerEventBroadcaster();
broadcaster.addListener(junitReporter);
broadcaster.addListener(new PrintListener());
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTests.java 2007-10-12
14:28:31 UTC (rev 8619)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTests.java 2007-10-12
14:29:27 UTC (rev 8620)
@@ -24,7 +24,7 @@
import org.jboss.unit.report.impl.writer.PrintListener;
import org.jboss.unit.runner.TestRunner;
-import org.jboss.unit.runner.impl.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.TestRunnerEventBroadcaster;
import org.jboss.unit.runner.impl.TestRunnerContextSupport;
import org.jboss.unit.runner.model.ModelBuilder;
import org.jboss.unit.runner.model.TestSuiteDef;
@@ -49,7 +49,7 @@
TestRunner runner = suite.createRunner();
- TestRunnerEventBroadcasterSupport broadcaster = new
TestRunnerEventBroadcasterSupport();
+ TestRunnerEventBroadcaster broadcaster = new TestRunnerEventBroadcaster();
broadcaster.addListener(new PrintListener());
runner.run(new TestRunnerContextSupport(broadcaster));
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:28:31 UTC (rev 8619)
+++
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/event/TestRunnerEventBroadcasterSupportTests.java 2007-10-12
14:29:27 UTC (rev 8620)
@@ -25,7 +25,7 @@
import static org.jboss.unit.api.Assert.*;
import org.jboss.unit.runner.TestRunnerEvent;
import org.jboss.unit.runner.TestRunnerEventListener;
-import org.jboss.unit.runner.impl.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.TestRunnerEventBroadcaster;
import static org.jboss.unit.util.CollectionTools.list;
import java.util.ArrayList;
@@ -39,7 +39,7 @@
{
/** . */
- private TestRunnerEventBroadcasterSupport support = new
TestRunnerEventBroadcasterSupport();
+ private TestRunnerEventBroadcaster support = new TestRunnerEventBroadcaster();
/** . */
private MyListener listener1 = new MyListener();
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:28:31 UTC (rev 8619)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerContextSupport.java 2007-10-12
14:29:27 UTC (rev 8620)
@@ -53,7 +53,7 @@
public TestRunnerContextSupport()
{
- this(new HashMap<String, String>(), NullFilter.getInstance(), new
TestRunnerEventBroadcasterSupport());
+ this(new HashMap<String, String>(), NullFilter.getInstance(), new
TestRunnerEventBroadcaster());
}
public TestRunnerContextSupport(Map<String, String> properties, TestFilter
filter, TestRunnerEventListener eventListener)
Copied:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerEventBroadcaster.java
(from rev 8619,
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerEventBroadcasterSupport.java)
===================================================================
---
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerEventBroadcaster.java
(rev 0)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerEventBroadcaster.java 2007-10-12
14:29:27 UTC (rev 8620)
@@ -0,0 +1,99 @@
+/******************************************************************************
+ * 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.impl;
+
+import org.jboss.unit.runner.TestRunnerEventListener;
+import org.jboss.unit.runner.TestRunnerEvent;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * Maintains a set of listeners that will receive events when the
<code>fireEvent(TestRunnerEvent event)</code> method
+ * is invoked. When a listener method is invoked, any exception is caught and logged,
this include checked and unchecked
+ * exception. Any other kind of unchecked throwable will not be handled.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestRunnerEventBroadcaster implements TestRunnerEventListener
+{
+
+ /** . */
+ private List<TestRunnerEventListener> listeners = new
ArrayList<TestRunnerEventListener>();
+
+ /**
+ * Add a listener to the set of listeners.
+ *
+ * @param listener the listener to add
+ * @throws IllegalArgumentException if the listener is null
+ */
+ public void addListener(TestRunnerEventListener listener) throws
IllegalArgumentException
+ {
+ if (listener == null)
+ {
+ throw new IllegalArgumentException("No null listener accepted");
+ }
+ if (!listeners.contains(listener))
+ {
+ listeners.add(listener);
+ }
+ }
+
+ /**
+ * Remove a listener from the set of listeners.
+ *
+ * @param listener the listener to remove
+ * @throws IllegalArgumentException if the listener is null
+ */
+ public void removeListener(TestRunnerEventListener listener)
+ {
+ if (listener == null)
+ {
+ throw new IllegalArgumentException("No null listener accepted");
+ }
+ if (listeners.contains(listener))
+ {
+ listeners.remove(listener);
+ }
+ }
+
+ public void onEvent(TestRunnerEvent event)
+ {
+ if (event == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ for (TestRunnerEventListener listener : listeners)
+ {
+ try
+ {
+ listener.onEvent(event);
+ }
+ catch (Exception e)
+ {
+// e.printStackTrace();
+ }
+ }
+ }
+}
Deleted:
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:28:31 UTC (rev 8619)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerEventBroadcasterSupport.java 2007-10-12
14:29:27 UTC (rev 8620)
@@ -1,99 +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.impl;
-
-import org.jboss.unit.runner.TestRunnerEventListener;
-import org.jboss.unit.runner.TestRunnerEvent;
-
-import java.util.List;
-import java.util.ArrayList;
-
-/**
- * Maintains a set of listeners that will receive events when the
<code>fireEvent(TestRunnerEvent event)</code> method
- * is invoked. When a listener method is invoked, any exception is caught and logged,
this include checked and unchecked
- * exception. Any other kind of unchecked throwable will not be handled.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class TestRunnerEventBroadcasterSupport implements TestRunnerEventListener
-{
-
- /** . */
- private List<TestRunnerEventListener> listeners = new
ArrayList<TestRunnerEventListener>();
-
- /**
- * Add a listener to the set of listeners.
- *
- * @param listener the listener to add
- * @throws IllegalArgumentException if the listener is null
- */
- public void addListener(TestRunnerEventListener listener) throws
IllegalArgumentException
- {
- if (listener == null)
- {
- throw new IllegalArgumentException("No null listener accepted");
- }
- if (!listeners.contains(listener))
- {
- listeners.add(listener);
- }
- }
-
- /**
- * Remove a listener from the set of listeners.
- *
- * @param listener the listener to remove
- * @throws IllegalArgumentException if the listener is null
- */
- public void removeListener(TestRunnerEventListener listener)
- {
- if (listener == null)
- {
- throw new IllegalArgumentException("No null listener accepted");
- }
- if (listeners.contains(listener))
- {
- listeners.remove(listener);
- }
- }
-
- public void onEvent(TestRunnerEvent event)
- {
- if (event == null)
- {
- throw new IllegalArgumentException();
- }
- for (TestRunnerEventListener listener : listeners)
- {
- try
- {
- listener.onEvent(event);
- }
- catch (Exception e)
- {
-// e.printStackTrace();
- }
- }
- }
-}
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:28:31 UTC (rev 8619)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java 2007-10-12
14:29:27 UTC (rev 8620)
@@ -26,7 +26,7 @@
import org.jboss.unit.runner.TestRunner;
import org.jboss.unit.runner.TestRunnerContext;
import org.jboss.unit.runner.impl.TestRunnerContextSupport;
-import org.jboss.unit.runner.impl.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.TestRunnerEventBroadcaster;
import org.jboss.unit.runner.impl.TestRunnerLifeCycleFilter;
import java.util.Collection;
@@ -53,7 +53,7 @@
protected void internalRun(TestRunnerContext context)
{
// Setup intermediate event filtering
- TestRunnerEventBroadcasterSupport tmp = new TestRunnerEventBroadcasterSupport();
+ TestRunnerEventBroadcaster tmp = new TestRunnerEventBroadcaster();
tmp.addListener(new TestRunnerLifeCycleFilter(context.getEventListener()));
TestRunnerContextSupport nestedContext = new
TestRunnerContextSupport(context.getProperties(), context.getFilter(), tmp);
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:28:31 UTC (rev 8619)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java 2007-10-12
14:29:27 UTC (rev 8620)
@@ -27,7 +27,7 @@
import org.jboss.unit.runner.TestRunnerContext;
import org.jboss.unit.runner.impl.TestRunnerLifeCycleFilter;
import org.jboss.unit.runner.event.RunnerFailureEvent;
-import org.jboss.unit.runner.impl.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.TestRunnerEventBroadcaster;
import org.jboss.unit.runner.impl.driver.TestDriverRunner;
import org.jboss.unit.runner.impl.TestRunnerContextSupport;
import org.jboss.unit.runner.model.generic.GenericTestSuiteDef;
@@ -59,7 +59,7 @@
String className = def.getClassName();
// Setup intermediate event filtering
- TestRunnerEventBroadcasterSupport tmp = new TestRunnerEventBroadcasterSupport();
+ TestRunnerEventBroadcaster tmp = new TestRunnerEventBroadcaster();
tmp.addListener(new TestRunnerLifeCycleFilter(context.getEventListener()));
TestRunnerContextSupport nestedContext = new
TestRunnerContextSupport(context.getProperties(), context.getFilter(), tmp);
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:28:31 UTC (rev 8619)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/pojo/POJOTestRunner.java 2007-10-12
14:29:27 UTC (rev 8620)
@@ -27,7 +27,7 @@
import org.jboss.unit.runner.TestRunnerContext;
import org.jboss.unit.runner.impl.driver.TestDriverRunner;
import org.jboss.unit.runner.impl.TestRunnerContextSupport;
-import org.jboss.unit.runner.impl.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.TestRunnerEventBroadcaster;
import org.jboss.unit.runner.impl.TestRunnerLifeCycleFilter;
import org.jboss.unit.runner.event.RunnerFailureEvent;
import org.jboss.unit.runner.model.pojo.POJOTestSuiteDef;
@@ -60,7 +60,7 @@
protected void internalRun(TestRunnerContext context)
{
// Setup intermediate event filtering
- TestRunnerEventBroadcasterSupport tmp = new TestRunnerEventBroadcasterSupport();
+ TestRunnerEventBroadcaster tmp = new TestRunnerEventBroadcaster();
tmp.addListener(new TestRunnerLifeCycleFilter(context.getEventListener()));
TestRunnerContextSupport nestedContext = new
TestRunnerContextSupport(context.getProperties(), context.getFilter(), tmp);
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java 2007-10-12 14:28:31
UTC (rev 8619)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java 2007-10-12 14:29:27
UTC (rev 8620)
@@ -24,7 +24,7 @@
import org.jboss.unit.runner.TestRunner;
import org.jboss.unit.runner.impl.TestRunnerContextSupport;
-import org.jboss.unit.runner.impl.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.TestRunnerEventBroadcaster;
import org.jboss.unit.runner.model.TestSuiteDef;
import org.jboss.unit.tooling.filter.MainTestFilter;
@@ -49,7 +49,7 @@
private final Map<String,String> properties;
- private final TestRunnerEventBroadcasterSupport broadcaster;
+ private final TestRunnerEventBroadcaster broadcaster;
// public static final String JBOSS_UNIT_NAMES = "jboss.unit.names";
//
@@ -122,7 +122,7 @@
options_no_arg = Collections.unmodifiableSet(opts);
}
- public Main(TestRunner runner, MainTestFilter mainFilter,
TestRunnerEventBroadcasterSupport broadcaster, TestSuiteDef suiteDef,
Map<String,String> properties)
+ public Main(TestRunner runner, MainTestFilter mainFilter, TestRunnerEventBroadcaster
broadcaster, TestSuiteDef suiteDef, Map<String,String> properties)
{
if (runner == null)
{
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainBuilder.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainBuilder.java 2007-10-12
14:28:31 UTC (rev 8619)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainBuilder.java 2007-10-12
14:29:27 UTC (rev 8620)
@@ -24,7 +24,7 @@
import org.jboss.unit.runner.TestRunnerEventListener;
import org.jboss.unit.runner.TestRunner;
-import org.jboss.unit.runner.impl.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.TestRunnerEventBroadcaster;
import org.jboss.unit.runner.impl.NullFilter;
import org.jboss.unit.runner.model.ModelBuilder;
import org.jboss.unit.runner.model.TestSuiteDef;
@@ -341,7 +341,7 @@
ModelBuilder builder = new ModelBuilder(source);
TestSuiteDef suite = builder.build();
TestRunner runner = suite.createRunner();
- TestRunnerEventBroadcasterSupport broadcaster = new
TestRunnerEventBroadcasterSupport();
+ TestRunnerEventBroadcaster broadcaster = new TestRunnerEventBroadcaster();
// Add listeners