@Test public void testLaunch() throws Exception { final SystemPropertiesWrapper propertiesWrapper = mock(SystemPropertiesWrapper.class); when(propertiesWrapper.getJavaHome()).thenReturn(JAVAHOME); when(propertiesWrapper.getJavaClassPath()).thenReturn(TEST_CLASS_PATH); final GobblinProcessBuilder processBuilder = mock(GobblinProcessBuilder.class); final Process mockProcess = mock(Process.class); when(processBuilder.start(any())).thenReturn(mockProcess); final Path clusterConfPath = Paths.get(CLUSTER_CONFIG_CONF_PATH); final SingleTaskLauncher launcher = new SingleTaskLauncher(processBuilder, propertiesWrapper, clusterConfPath, ConfigFactory.empty()); final Path workUnitPath = Paths.get(WORK_UNIT_PATH); final Process process = launcher.launch(JOB_ID, workUnitPath); final List<String> expectedInput = new ArrayList<>(Arrays .asList("/javahome/bin/java", "-cp", TEST_CLASS_PATH, "org.apache.gobblin.cluster.SingleTaskRunnerMain", "--cluster_config_file_path", CLUSTER_CONFIG_CONF_PATH, "--job_id", JOB_ID, "--work_unit_file_path", WORK_UNIT_PATH)); verify(processBuilder).start(expectedInput); assertThat(process).isEqualTo(mockProcess); }
Process launch(final String jobId, final Path workUnitFilePath) throws IOException { final SingleTaskLauncher.CmdBuilder cmdBuilder = this.new CmdBuilder(jobId, workUnitFilePath); final List<String> command = cmdBuilder.build(); logger.info("Launching a task process."); final String completeCmdLine = String.join(" ", command); logger.info("cmd line:\n{}", completeCmdLine); final Process taskProcess = this.processBuilder.start(command); return taskProcess; }
SingleTaskLauncher { Process launch(final String jobId, final Path workUnitFilePath) throws IOException { final SingleTaskLauncher.CmdBuilder cmdBuilder = this.new CmdBuilder(jobId, workUnitFilePath); final List<String> command = cmdBuilder.build(); logger.info("Launching a task process."); final String completeCmdLine = String.join(" ", command); logger.info("cmd line:\n{}", completeCmdLine); final Process taskProcess = this.processBuilder.start(command); return taskProcess; } }
SingleTaskLauncher { Process launch(final String jobId, final Path workUnitFilePath) throws IOException { final SingleTaskLauncher.CmdBuilder cmdBuilder = this.new CmdBuilder(jobId, workUnitFilePath); final List<String> command = cmdBuilder.build(); logger.info("Launching a task process."); final String completeCmdLine = String.join(" ", command); logger.info("cmd line:\n{}", completeCmdLine); final Process taskProcess = this.processBuilder.start(command); return taskProcess; } SingleTaskLauncher(final GobblinProcessBuilder processBuilder,
      final SystemPropertiesWrapper propertiesWrapper, final Path clusterConfigFilePath, Config sysConfig); }
SingleTaskLauncher { Process launch(final String jobId, final Path workUnitFilePath) throws IOException { final SingleTaskLauncher.CmdBuilder cmdBuilder = this.new CmdBuilder(jobId, workUnitFilePath); final List<String> command = cmdBuilder.build(); logger.info("Launching a task process."); final String completeCmdLine = String.join(" ", command); logger.info("cmd line:\n{}", completeCmdLine); final Process taskProcess = this.processBuilder.start(command); return taskProcess; } SingleTaskLauncher(final GobblinProcessBuilder processBuilder,
      final SystemPropertiesWrapper propertiesWrapper, final Path clusterConfigFilePath, Config sysConfig);  }
SingleTaskLauncher { Process launch(final String jobId, final Path workUnitFilePath) throws IOException { final SingleTaskLauncher.CmdBuilder cmdBuilder = this.new CmdBuilder(jobId, workUnitFilePath); final List<String> command = cmdBuilder.build(); logger.info("Launching a task process."); final String completeCmdLine = String.join(" ", command); logger.info("cmd line:\n{}", completeCmdLine); final Process taskProcess = this.processBuilder.start(command); return taskProcess; } SingleTaskLauncher(final GobblinProcessBuilder processBuilder,
      final SystemPropertiesWrapper propertiesWrapper, final Path clusterConfigFilePath, Config sysConfig);   }