I would use the invoker plugin. If you look at nearly any maven plugin here at Mojo (the source code), you'll see examples of that type of integration testing.
/Anders On Wed, Aug 10, 2011 at 16:09, laredotornado <[email protected]>wrote: > > Hi, > > I'm developing my own custom Mojo. I want to test the case where someone > hasn't entered the correct configuration, so my code has … > > > public class SeleniumTestMojo extends AbstractMojo { > > ... > public void execute() throws MojoExecutionException { > try { > … > // Verify hosts are non-empty. > if (hosts != null && hosts.isEmpty()) { > throw new MojoExecutionException("Plugin execution requires one > or more hosts."); > } > > > I have an XML file that represents the misconfigured plugin, but I have no > idea how to write an integration test to check for this kind of exception. > Any advice or examples about writing integration tests is greatly > appreciated, - Dave > > > -- > View this message in context: > http://old.nabble.com/Integration-testing-for-my-custom-Mojo-tp32234324p32234324.html > Sent from the mojo - user mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > >
