@Test(expected = Exception.class) public void abend() throws Exception { String cmd = command("mock.cmd"); TaskExecutor executor = new BasicCommandTaskExecutor(c -> (command, arguments) -> { return 1; }); executor.execute(context, new BasicCommandTaskInfo("mock", "testing", cmd, Arrays.asList())); }
@Override public void execute(TaskExecutionContext context, TaskInfo task) throws InterruptedException, IOException { CommandTaskInfo mirror = (CommandTaskInfo) task; CommandLauncher launcher = launchers.apply(context); Path command = TaskExecutors.findFrameworkFile(context, mirror.getCommand()).get(); List<String> arguments = TaskExecutors.resolveCommandTokens( context, mirror.getArguments(context.getConfigurations())); execute(context, launcher, command, arguments); }
BasicCommandTaskExecutor implements TaskExecutor { @Override public void execute(TaskExecutionContext context, TaskInfo task) throws InterruptedException, IOException { CommandTaskInfo mirror = (CommandTaskInfo) task; CommandLauncher launcher = launchers.apply(context); Path command = TaskExecutors.findFrameworkFile(context, mirror.getCommand()).get(); List<String> arguments = TaskExecutors.resolveCommandTokens( context, mirror.getArguments(context.getConfigurations())); execute(context, launcher, command, arguments); } }
BasicCommandTaskExecutor implements TaskExecutor { @Override public void execute(TaskExecutionContext context, TaskInfo task) throws InterruptedException, IOException { CommandTaskInfo mirror = (CommandTaskInfo) task; CommandLauncher launcher = launchers.apply(context); Path command = TaskExecutors.findFrameworkFile(context, mirror.getCommand()).get(); List<String> arguments = TaskExecutors.resolveCommandTokens( context, mirror.getArguments(context.getConfigurations())); execute(context, launcher, command, arguments); } BasicCommandTaskExecutor();  BasicCommandTaskExecutor(Function<? super TaskExecutionContext, ? extends CommandLauncher> launchers); }
BasicCommandTaskExecutor implements TaskExecutor { @Override public void execute(TaskExecutionContext context, TaskInfo task) throws InterruptedException, IOException { CommandTaskInfo mirror = (CommandTaskInfo) task; CommandLauncher launcher = launchers.apply(context); Path command = TaskExecutors.findFrameworkFile(context, mirror.getCommand()).get(); List<String> arguments = TaskExecutors.resolveCommandTokens( context, mirror.getArguments(context.getConfigurations())); execute(context, launcher, command, arguments); } BasicCommandTaskExecutor();  BasicCommandTaskExecutor(Function<? super TaskExecutionContext, ? extends CommandLauncher> launchers); @Override boolean isSupported(TaskExecutionContext context, TaskInfo task); @Override void execute(TaskExecutionContext context, TaskInfo task); static CommandLauncher getCommandLauncher(ExecutionContext context); static CommandLauncher getCommandLauncher(
            ExecutionContext context,
            BasicCommandLauncher.OutputConsumer output); static void execute(
            TaskExecutionContext context,
            Path command, List<String> arguments); static void execute(
            TaskExecutionContext context, CommandLauncher launcher,
            Path command, List<String> arguments); }
BasicCommandTaskExecutor implements TaskExecutor { @Override public void execute(TaskExecutionContext context, TaskInfo task) throws InterruptedException, IOException { CommandTaskInfo mirror = (CommandTaskInfo) task; CommandLauncher launcher = launchers.apply(context); Path command = TaskExecutors.findFrameworkFile(context, mirror.getCommand()).get(); List<String> arguments = TaskExecutors.resolveCommandTokens( context, mirror.getArguments(context.getConfigurations())); execute(context, launcher, command, arguments); } BasicCommandTaskExecutor();  BasicCommandTaskExecutor(Function<? super TaskExecutionContext, ? extends CommandLauncher> launchers); @Override boolean isSupported(TaskExecutionContext context, TaskInfo task); @Override void execute(TaskExecutionContext context, TaskInfo task); static CommandLauncher getCommandLauncher(ExecutionContext context); static CommandLauncher getCommandLauncher(
            ExecutionContext context,
            BasicCommandLauncher.OutputConsumer output); static void execute(
            TaskExecutionContext context,
            Path command, List<String> arguments); static void execute(
            TaskExecutionContext context, CommandLauncher launcher,
            Path command, List<String> arguments); static final boolean WINDOWS; }