* Test execute success.
*/
public void testExecuteSuccess() {
try {
final String artifactTypes = " this, is, a,test ";
ListMojo listMojo = new ListMojo();
listMojo.setArtifactTypes(artifactTypes);
Command command = new Command(null);
command.setVerbose(true);
EasyMock.expect(log.isInfoEnabled()).andReturn(false).times(2);
EasyMock.expect(clownfishHelper.parseString(artifactTypes))
.andReturn(new ArrayList<String>());
EasyMock.expect(clownfishFactory.createClownfish(
command, clownfishHelper, progressListenerFactory,
maven2WrapperLog))
.andReturn(clownfish);
EasyMock.expect(clownfish.list()).andReturn(true);
clownfish.destroy();
EasyMock.replay(log);
EasyMock.replay(clownfish);
EasyMock.replay(clownfishFactory);
EasyMock.replay(clownfishHelper);
listMojo.setClownfishFactory(clownfishFactory);
listMojo.setClownfishHelper(clownfishHelper);
listMojo.setProgressListenerFactory(progressListenerFactory);
listMojo.setCommand(command);
listMojo.setMaven2WrapperLog(maven2WrapperLog);
listMojo.setLog(log);
listMojo.execute();
EasyMock.verify(log);
EasyMock.verify(clownfish);
EasyMock.verify(clownfishFactory);
EasyMock.verify(clownfishHelper);
assertEquals(" this, is, a,test ", listMojo.getArtifactTypes());
} catch (MojoExecutionException e) {
fail(e.getMessage());
}
}