Hi Arnaud, Thanks for you suggestion. Do you integrate the execution of the integration test module in the build process of the plugin itself ? In my current solution, if the code generated by the plugin cannot be compiled or fails to do what it should, the plugin is not installed when "mvn deploy" is called. I'd like to retain this if possible (I have come to appreciate "no-brain approaches", they also work when time is short)
As for the http://maven.apache.org/developers/committer-testing-plugins.html testing methods, I'll look at these when I have got a clear head (nothing for mid-afternoon :-)) Thanks again, Thomas news <[EMAIL PROTECTED]> schrieb am 25.09.2007 21:43:18: > Thomas Fischer <[EMAIL PROTECTED]> writes: > > > Hi all, > > > > we have a maven plugin which generates java code, and we would like to > > unit-test it. One obvious test for such a plugin is to let it generate some > > code, compile that code, and unit-test the generated code. > > > > For this, the following steps need to be executed: > > 1) compile the plugin mojo > > 2) compile the test case which starts the plugin mojo in order to generate > > code > > 3) execute the test case which starts the plugin mojo in order to generate > > code > > 4) compile the generated code > > 5) compile the test cases which test the generated code > > 6) execute the test cases which test the generated code > > > > Hello Thomas, > IMHO, this is not unit testing but functional testing of your plugin's > behavior. In such cases, I usually follow the simple approach of > having a separate integration test module that depends on the plugin > and executes test projects using maven-verifier. There are other > options available at http://maven.apache.org/developers/committer-testing-plugins.html > but I did not find them very satisfying (quite brittle, depends on > snapshots that depend on things...). > > I have learnt to favour large number of modules with small poms: The > dependency mechanism handles the scheduling of plugins executions > better and more clearly than within a pom. I would like to know BTW if > this was intended in maven's design or just a side effect. > > HTH > -- > OQube < software engineering \ génie logiciel > > Arnaud Bailly, Dr. > \web> http://www.oqube.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
