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.

Another item used by the RPM plugin which may need a little refactoring
is the Plexus CommandLine object.  It is not found by an expression in a
parameter like the Archiver, but just built using "new CommandLine".  I
know that if the Archiver is mocked so that it doesn't actually try to
assemble the RPM contents the command to build the RPM will fail.  For
the test to work, we need to be able to inject a mock object of the
CommandLine which only returns the proper status.

I would be happy to start testing out samples of a test harness with the
RPM plugin.  I have been dreading trying to build tests for it, since I
have been having a hard time trying to figure out how to verify that it
assembled the RPM correctly.  If the Archiver and CommandLine can be
simulated, the unit tests would be fairly easy to build.

-----Original Message-----
From: Brett Porter [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 30, 2006 18:50
To: Maven Developers List
Subject: unit testing vs integration testing plugins


Hi,

I wanted to get some feedback from other devs on this topic.
Historically, I think we've done very little of both and would like to
change that. But most of the tests cropping up seem to be integration
tests, because they are probably an easier mechanism than to setup the
preconditions of the plugin. However, they are much larger in terms of
creation, checkout space and time to run.

I'd like to see that we "unit test" to the greatest extent possible.
IMO, the only reason to go to integration tests is to test lifecycle
interactions and interactions with other plugins.

What we probably require to do this is convenience methods to construct
a decent project and settings object and an expression populator based
on the project and settings.

Thoughts?

- Brett

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


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

Reply via email to