> -----Original Message-----
> From: Brett Porter [mailto:[EMAIL PROTECTED]
> Sent: dimanche 17 avril 2005 01:52
> To: Maven Developers List
> Subject: Re: [M2] Testing a m2 plugin
> 
> Yes, I have a JIRA in to turn that into an m2 plugin itself.
> 
> Not sure that's exactly what you want, as it forks m2 to run the goals.
> 
> Really, an integration test should not be needed - if the plugin is in
> Java, you should be able to test with junit. 

Funny that you should say this when I've been unable to find a single unit
test in all the plugins that currently exist for m2! :-)

That said I would be happy if you can show me how to write a significant
unit test for http://rafb.net/paste/results/u2dtsf30.html

> At least up until the point
> that multiple goals need to occur inside the lifecycle.

What is needed is a test project using the plugin because I need source dirs
and output dirs to test that Clover works. Of course I also need to validate
that all the plugin's magic (all the javadoc tags) works. 
 
> I think the best thing to do would be to put together the tests you need
> and single out the things you don't think are covered by juni, and we
> can all discuss what we can provide for plugin writers - whether it be a
> way to completely run m2, or a test suite that provides APIs to help
> test with junit, or testing implementations of some of the m2 components.

I think we need to have a separate m2 project that tests the plugin
(functional tests). I can already do this but in the same manner that we
have asserts in the m1 plugin plugin we'll probably need helper APIs. I
thought this was what you were doing in the it tests with the
expected-results.txt and goals.txt files. The problem is that it was easy in
m1 to have a maven.xml file to define the test setup, decide which goals to
run and perform the assertions. Here's it's not doable easily (correct me if
it is) so we'll probably need support for this (this is what you're doing
with the txt files it seems).

> Just to double check too - you're going to run your ideas for the plugin
> past here as well? I assume you are planning now, and using test first,
> so testing was the first thing :)

Yep, almost :-)

I have spoken with Jason on IRC yesterday and he said I should speak to you
too but you were sleeping so I thought I might as well start something...
:-)

My first ideas are:
1) Bind the plugin to the generate-sources phase
2) Modify the project source roots to replace the main source root with the
one generated by Clover

I have not thought at all about the reports, just about executing Clover for
now.

> Whether the clover plugin is written as part of the m2 project or not,
> the plugin API is currently being finalised and any reporting coming out
> of it should help form the m2 API's for that along with the other
> plugins getting developed, so I want to make sure everyone is helping
> each other out :)

Definitely!

Thanks
-Vincent

> 
> Thanks,
> Brett
> 
> Vincent Massol wrote:
> 
> >Hi,
> >
> >I'm writing a Clover plugin and I'd like to write tests for it as I
> >progress. Obviously most tests will have to be integration tests.
> >
> >I've seen that the m2 team has developed an integration test system in
> >maven-components/maven-core-it-verifier with tests in
> >maven-components/maven-core-it.
> >
> >I was wondering if this tester is made available in the form of a m2
> plugin
> >for external plugin writers?
> >
> >Thanks
> >-Vincent




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

Reply via email to