On Tue, 2006-01-31 at 05:26 -0600, Allison, Bob wrote:
> I also see a need for being able to inject mock objects of Plexus
> components (the RPM plugin uses a Plexus Archiver).  The unit test will
> need to construct these mock objects and set their expectations before
> they are injected into the plugin being tested.

This is already possible, all you got to do is to make a components.xml
file called the same as your test case, e.g. FooTest.java =>
FooTest.xml. This test file will be merged in after the normal bootstrap
so you can override all the components you'd like in there.

Take a look at [1] and [2] for an example.

[1]:
http://svn.plexus.codehaus.org/trunk/plexus-components/plexus-formica-web/src/test/resources/org/codehaus/plexus/formica/action
[2]:
http://svn.plexus.codehaus.org/trunk/plexus-components/plexus-formica-web/src/test/java/org/codehaus/plexus/formica/action/

--
Trygve


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to