I think that I would like to be able to pass parameters to a plugin, but I'm not sure if this is the best approach.

In addition to normal unit tests, we have several different other types of functional tests for a project that we want to keep logically separate (integration, upgrade, webbrowser, etc.). We keep the source under separate trees (like src/test-integration/java) and have separate sets of configurations and tasks.

Currently all of this is just injected from a root project, but I would like to extract it to a plugin. To do this I think I need to be able to pass a few parameters to it (like which type of test). With this in mind it seemed to make sense to allow Project.usePlugin to take a Map.

Then I could:
   usePlugin(FunctionalTest, type:'integration', group:'Integration Tests')
   usePlugin(FunctionalTest, type:'upgrade')

One problem with this approach is that the plugin infrastructure expects to only ever have a single plugin of a given class (or id). I would like to be able to use multiple of these FunctionalTest plugins with differing parameters. I could make sure that the plugin container would not add duplicates with the same plugin ID and parameters, but would allow duplicate IDs with differing parameters. This would require changing the signature of ProjectPluginsContainer to return a Collection of plugins with a given id.

Does anyone else find this useful? I can certainly just keep calling helper classes in my buildSrc to do this, but it seemed like something others might need too.
--
Steve Appling
Automated Logic Research Team

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to