/**
* Test execute fail.
*/
public void testExecuteFail() {
StartMojo startMojo = new StartMojo();
Command command = new Command(null);
command.setVerbose(true);
Exception exception = new RuntimeException("test mock exception");
EasyMock.expect(log.isInfoEnabled()).andReturn(false).once();
EasyMock.expect(clownfishFactory.createClownfish(
command, clownfishHelper, progressListenerFactory,
maven2WrapperLog))
.andReturn(clownfish);
EasyMock.expect(clownfish.start()).andThrow(exception);
log.error("Exception thrown while starting", exception);
clownfish.destroy();
EasyMock.replay(log);
EasyMock.replay(clownfish);
EasyMock.replay(clownfishFactory);
EasyMock.replay(clownfishHelper);
startMojo.setClownfishFactory(clownfishFactory);
startMojo.setClownfishHelper(clownfishHelper);
startMojo.setProgressListenerFactory(progressListenerFactory);
startMojo.setCommand(command);
startMojo.setMaven2WrapperLog(maven2WrapperLog);
startMojo.setLog(log);
try {
startMojo.execute();
fail("execute should fail "
+ "- should throw MojoExecutionException");
} catch (MojoExecutionException e) {
// do-nothing
}