@Test( expected = CommandException.class )
public void testExecute_failure() throws Exception {

	// Simulate an exception
	Mockito
		.doThrow( new IOException( "for test" ))
		.when( this.instancesMngr )
		.addInstance(
				Mockito.any( ManagedApplication.class ),
				Mockito.any( Instance.class ),
				Mockito.any( Instance.class ));
	// Execute the command
	String line = "replicate /" + this.app.getTomcatVm().getName() + " as toto";
	ReplicateCommandExecution executor = buildExecutor( line );
	executor.execute();
}