@Test public void testRun() throws Exception { final SingleTaskRunnerBuilder builder = spy(SingleTaskRunnerBuilder.class); final SingleTaskRunner taskRunner = mock(SingleTaskRunner.class); doReturn(taskRunner).when(builder).createSingleTaskRunner(); final SingleTaskRunnerMain runnerMain = new SingleTaskRunnerMain(builder); runnerMain.run(SingleTaskRunnerMainArgumentsDataProvider.getArgs()); verify(builder).setClusterConfigFilePath(TEST_CLUSTER_CONF); verify(builder).setJobId(TEST_JOB_ID); verify(builder).setWorkUnitFilePath(TEST_WORKUNIT); verify(taskRunner).run(); }
void run(final String[] args) throws IOException, InterruptedException { final OutputStreamWriter streamWriter = new OutputStreamWriter(System.out, Charsets.UTF_8); final PrintWriter writer = new PrintWriter(streamWriter, true); final SingleTaskRunnerMainOptions options = new SingleTaskRunnerMainOptions(args, writer); final SingleTaskRunner runner = this.builder.setClusterConfigFilePath(options.getClusterConfigFilePath()) .setJobId(options.getJobId()) .setWorkUnitFilePath(options.getWorkUnitFilePath()) .createSingleTaskRunner(); runner.run(); }
SingleTaskRunnerMain { void run(final String[] args) throws IOException, InterruptedException { final OutputStreamWriter streamWriter = new OutputStreamWriter(System.out, Charsets.UTF_8); final PrintWriter writer = new PrintWriter(streamWriter, true); final SingleTaskRunnerMainOptions options = new SingleTaskRunnerMainOptions(args, writer); final SingleTaskRunner runner = this.builder.setClusterConfigFilePath(options.getClusterConfigFilePath()) .setJobId(options.getJobId()) .setWorkUnitFilePath(options.getWorkUnitFilePath()) .createSingleTaskRunner(); runner.run(); } }
SingleTaskRunnerMain { void run(final String[] args) throws IOException, InterruptedException { final OutputStreamWriter streamWriter = new OutputStreamWriter(System.out, Charsets.UTF_8); final PrintWriter writer = new PrintWriter(streamWriter, true); final SingleTaskRunnerMainOptions options = new SingleTaskRunnerMainOptions(args, writer); final SingleTaskRunner runner = this.builder.setClusterConfigFilePath(options.getClusterConfigFilePath()) .setJobId(options.getJobId()) .setWorkUnitFilePath(options.getWorkUnitFilePath()) .createSingleTaskRunner(); runner.run(); } SingleTaskRunnerMain(final SingleTaskRunnerBuilder builder); }
SingleTaskRunnerMain { void run(final String[] args) throws IOException, InterruptedException { final OutputStreamWriter streamWriter = new OutputStreamWriter(System.out, Charsets.UTF_8); final PrintWriter writer = new PrintWriter(streamWriter, true); final SingleTaskRunnerMainOptions options = new SingleTaskRunnerMainOptions(args, writer); final SingleTaskRunner runner = this.builder.setClusterConfigFilePath(options.getClusterConfigFilePath()) .setJobId(options.getJobId()) .setWorkUnitFilePath(options.getWorkUnitFilePath()) .createSingleTaskRunner(); runner.run(); } SingleTaskRunnerMain(final SingleTaskRunnerBuilder builder); static void main(final String[] args); }
SingleTaskRunnerMain { void run(final String[] args) throws IOException, InterruptedException { final OutputStreamWriter streamWriter = new OutputStreamWriter(System.out, Charsets.UTF_8); final PrintWriter writer = new PrintWriter(streamWriter, true); final SingleTaskRunnerMainOptions options = new SingleTaskRunnerMainOptions(args, writer); final SingleTaskRunner runner = this.builder.setClusterConfigFilePath(options.getClusterConfigFilePath()) .setJobId(options.getJobId()) .setWorkUnitFilePath(options.getWorkUnitFilePath()) .createSingleTaskRunner(); runner.run(); } SingleTaskRunnerMain(final SingleTaskRunnerBuilder builder); static void main(final String[] args);  }