ShellCommandConfig extends MapConfig { public Optional<String> getJavaHome() { return Optional.ofNullable(get(ShellCommandConfig.TASK_JAVA_HOME)); } ShellCommandConfig(Config config); String getCommand(); Optional<String> getTaskOpts(); Optional<String> getJavaHome(); Optional<String> getAdditionalClasspathDir(); static final String ENV_COORDINATOR_SYSTEM_CONFIG; static final String ENV_SUBMISSION_CONFIG; static final String ENV_CONTAINER_ID; static final String ENV_COORDINATOR_URL; static final String ENV_JAVA_OPTS; static final String ENV_JAVA_HOME; static final String ENV_EXECUTION_ENV_CONTAINER_ID; static final String ENV_SPLIT_DEPLOYMENT_ENABLED; static final String ENV_APPLICATION_LIB_DIR; static final String ENV_LOGGED_STORE_BASE_DIR; static final String EXECUTION_PLAN_DIR; static final String ENV_ADDITIONAL_CLASSPATH_DIR; static final String COMMAND_SHELL_EXECUTE; static final String TASK_JVM_OPTS; static final String TASK_JAVA_HOME; static final String ADDITIONAL_CLASSPATH_DIR; }
@Test public void testGetJavaHome() { ShellCommandConfig shellCommandConfig = new ShellCommandConfig(new MapConfig()); assertFalse(shellCommandConfig.getJavaHome().isPresent()); shellCommandConfig = new ShellCommandConfig(new MapConfig(ImmutableMap.of(ShellCommandConfig.TASK_JAVA_HOME, "/location/java"))); assertEquals(Optional.of("/location/java"), shellCommandConfig.getJavaHome()); }