@Test( expected = CommandException.class ) public void testExecutionFailure1() throws Exception { CommandsExecutor executor = new CommandsExecutor( this.manager, this.app, new File( "inexisting" )); executor.execute(); }
public void execute() throws CommandException { try { CommandsParser parser = new CommandsParser( this.app, this.commandsFile ); if( RoboconfErrorHelpers.containsCriticalErrors( parser.getParsingErrors())) throw new CommandException( "Invalid command file. " + this.commandsFile.getName() + " contains errors." ); for( AbstractCommandInstruction instr : parser.getInstructions()) { if( instr.isDisabled()) { this.logger.fine( "Skipping disabled instruction: " + instr.getClass().getSimpleName()); this.instructionSkipped = true; continue; } AbstractCommandExecution executor = findExecutor( instr ); if( executor == null ) { this.logger.fine( "Skipping non-executable instruction: " + instr.getClass().getSimpleName()); continue; } executor.setExecutionContext( this.executionContext ); executor.execute(); } } catch( CommandException e ) { throw e; } catch( Exception e ) { throw new CommandException( e ); } }
CommandsExecutor { public void execute() throws CommandException { try { CommandsParser parser = new CommandsParser( this.app, this.commandsFile ); if( RoboconfErrorHelpers.containsCriticalErrors( parser.getParsingErrors())) throw new CommandException( "Invalid command file. " + this.commandsFile.getName() + " contains errors." ); for( AbstractCommandInstruction instr : parser.getInstructions()) { if( instr.isDisabled()) { this.logger.fine( "Skipping disabled instruction: " + instr.getClass().getSimpleName()); this.instructionSkipped = true; continue; } AbstractCommandExecution executor = findExecutor( instr ); if( executor == null ) { this.logger.fine( "Skipping non-executable instruction: " + instr.getClass().getSimpleName()); continue; } executor.setExecutionContext( this.executionContext ); executor.execute(); } } catch( CommandException e ) { throw e; } catch( Exception e ) { throw new CommandException( e ); } } }
CommandsExecutor { public void execute() throws CommandException { try { CommandsParser parser = new CommandsParser( this.app, this.commandsFile ); if( RoboconfErrorHelpers.containsCriticalErrors( parser.getParsingErrors())) throw new CommandException( "Invalid command file. " + this.commandsFile.getName() + " contains errors." ); for( AbstractCommandInstruction instr : parser.getInstructions()) { if( instr.isDisabled()) { this.logger.fine( "Skipping disabled instruction: " + instr.getClass().getSimpleName()); this.instructionSkipped = true; continue; } AbstractCommandExecution executor = findExecutor( instr ); if( executor == null ) { this.logger.fine( "Skipping non-executable instruction: " + instr.getClass().getSimpleName()); continue; } executor.setExecutionContext( this.executionContext ); executor.execute(); } } catch( CommandException e ) { throw e; } catch( Exception e ) { throw new CommandException( e ); } } CommandsExecutor( Manager manager, Application app, File commandsFile );  CommandsExecutor(
			Manager manager,
			Application app,
			File commandsFile,
			CommandExecutionContext executionContext ); }
CommandsExecutor { public void execute() throws CommandException { try { CommandsParser parser = new CommandsParser( this.app, this.commandsFile ); if( RoboconfErrorHelpers.containsCriticalErrors( parser.getParsingErrors())) throw new CommandException( "Invalid command file. " + this.commandsFile.getName() + " contains errors." ); for( AbstractCommandInstruction instr : parser.getInstructions()) { if( instr.isDisabled()) { this.logger.fine( "Skipping disabled instruction: " + instr.getClass().getSimpleName()); this.instructionSkipped = true; continue; } AbstractCommandExecution executor = findExecutor( instr ); if( executor == null ) { this.logger.fine( "Skipping non-executable instruction: " + instr.getClass().getSimpleName()); continue; } executor.setExecutionContext( this.executionContext ); executor.execute(); } } catch( CommandException e ) { throw e; } catch( Exception e ) { throw new CommandException( e ); } } CommandsExecutor( Manager manager, Application app, File commandsFile );  CommandsExecutor(
			Manager manager,
			Application app,
			File commandsFile,
			CommandExecutionContext executionContext ); void execute(); boolean wereInstructionSkipped(); }
CommandsExecutor { public void execute() throws CommandException { try { CommandsParser parser = new CommandsParser( this.app, this.commandsFile ); if( RoboconfErrorHelpers.containsCriticalErrors( parser.getParsingErrors())) throw new CommandException( "Invalid command file. " + this.commandsFile.getName() + " contains errors." ); for( AbstractCommandInstruction instr : parser.getInstructions()) { if( instr.isDisabled()) { this.logger.fine( "Skipping disabled instruction: " + instr.getClass().getSimpleName()); this.instructionSkipped = true; continue; } AbstractCommandExecution executor = findExecutor( instr ); if( executor == null ) { this.logger.fine( "Skipping non-executable instruction: " + instr.getClass().getSimpleName()); continue; } executor.setExecutionContext( this.executionContext ); executor.execute(); } } catch( CommandException e ) { throw e; } catch( Exception e ) { throw new CommandException( e ); } } CommandsExecutor( Manager manager, Application app, File commandsFile );  CommandsExecutor(
			Manager manager,
			Application app,
			File commandsFile,
			CommandExecutionContext executionContext ); void execute(); boolean wereInstructionSkipped();  }