Author: julien(a)jboss.com
Date: 2007-10-13 08:13:10 -0400 (Sat, 13 Oct 2007)
New Revision: 8627
Modified:
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/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
Log:
preliminary support for runtime parameter override
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-13
01:34:14 UTC (rev 8626)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerContext.java 2007-10-13
12:13:10 UTC (rev 8627)
@@ -33,6 +33,8 @@
Map<String,String> getProperties();
+ Map<String,String> getParameters();
+
TestFilter getFilter();
TestRunnerEventListener getEventListener();
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-13
01:34:14 UTC (rev 8626)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerContextSupport.java 2007-10-13
12:13:10 UTC (rev 8627)
@@ -40,6 +40,9 @@
private Map<String,String> properties;
/** . */
+ private Map<String,String> parameters;
+
+ /** . */
private TestFilter filter;
/** . */
@@ -48,17 +51,18 @@
public TestRunnerContextSupport(TestRunnerEventListener eventListener)
{
- this(new HashMap<String, String>(), NullFilter.getInstance(),
eventListener);
+ this(new HashMap<String, String>(), new HashMap<String, String>(),
NullFilter.getInstance(), eventListener);
}
public TestRunnerContextSupport()
{
- this(new HashMap<String, String>(), NullFilter.getInstance(), new
TestRunnerEventBroadcaster());
+ this(new HashMap<String, String>(), new HashMap<String, String>(),
NullFilter.getInstance(), new TestRunnerEventBroadcaster());
}
- public TestRunnerContextSupport(Map<String, String> properties, TestFilter
filter, TestRunnerEventListener eventListener)
+ public TestRunnerContextSupport(Map<String, String> properties, Map<String,
String> parameters, TestFilter filter, TestRunnerEventListener eventListener)
{
this.properties = properties;
+ this.parameters = parameters;
this.filter = filter;
this.eventListener = eventListener;
}
@@ -68,6 +72,11 @@
return properties;
}
+ public Map<String, String> getParameters()
+ {
+ return parameters;
+ }
+
public TestFilter getFilter()
{
return filter;
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-13
01:34:14 UTC (rev 8626)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java 2007-10-13
12:13:10 UTC (rev 8627)
@@ -55,7 +55,7 @@
// Setup intermediate event filtering
TestRunnerEventBroadcaster tmp = new TestRunnerEventBroadcaster();
tmp.addListener(new TestRunnerLifeCycleFilter(context.getEventListener()));
- TestRunnerContextSupport nestedContext = new
TestRunnerContextSupport(context.getProperties(), context.getFilter(), tmp);
+ TestRunnerContextSupport nestedContext = new
TestRunnerContextSupport(context.getProperties(), context.getParameters(),
context.getFilter(), tmp);
for (TestRunner runner : runners)
{
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-13
01:34:14 UTC (rev 8626)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java 2007-10-13
12:13:10 UTC (rev 8627)
@@ -61,7 +61,7 @@
// Setup intermediate event filtering
TestRunnerEventBroadcaster tmp = new TestRunnerEventBroadcaster();
tmp.addListener(new TestRunnerLifeCycleFilter(context.getEventListener()));
- TestRunnerContextSupport nestedContext = new
TestRunnerContextSupport(context.getProperties(), context.getFilter(), tmp);
+ TestRunnerContextSupport nestedContext = new
TestRunnerContextSupport(context.getProperties(), context.getParameters(),
context.getFilter(), tmp);
//
try
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-13
01:34:14 UTC (rev 8626)
+++
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/pojo/POJOTestRunner.java 2007-10-13
12:13:10 UTC (rev 8627)
@@ -62,7 +62,7 @@
// Setup intermediate event filtering
TestRunnerEventBroadcaster tmp = new TestRunnerEventBroadcaster();
tmp.addListener(new TestRunnerLifeCycleFilter(context.getEventListener()));
- TestRunnerContextSupport nestedContext = new
TestRunnerContextSupport(context.getProperties(), context.getFilter(), tmp);
+ TestRunnerContextSupport nestedContext = new
TestRunnerContextSupport(context.getProperties(), context.getParameters(),
context.getFilter(), tmp);
//
for (TestClassDef testClass : suite.getTestClasses())
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-13 01:34:14
UTC (rev 8626)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java 2007-10-13 12:13:10
UTC (rev 8627)
@@ -158,7 +158,7 @@
public void execute()
{
- TestRunnerContextSupport runnerContext = new TestRunnerContextSupport(properties,
mainFilter, broadcaster);
+ TestRunnerContextSupport runnerContext = new TestRunnerContextSupport(properties,
new HashMap<String, String>(), mainFilter, broadcaster);
runner.run(runnerContext);
}