@Test
public void testAllPropertiesSet() {
SpringApplication app = new SpringApplication(TestConfiguration.class);
app.setWebEnvironment(false);
ConfigurableApplicationContext context = app
.run(new String[] { "--spring.config.name=SpringYarnAppmasterLaunchContextPropertiesTests" });
SpringYarnAppmasterLaunchContextProperties properties = context.getBean(SpringYarnAppmasterLaunchContextProperties.class);
assertThat(properties, notNullValue());
assertThat(properties.getArchiveFile(), is("archiveFileFoo"));
Map<String, String> arguments = properties.getArguments();
assertThat(arguments, notNullValue());
assertThat(arguments.size(), is(2));
assertThat(arguments.get("argumentsKeyFoo1"), is("argumentsValFoo1"));
assertThat(arguments.get("argumentsKeyFoo2"), is("argumentsValFoo2"));
List<String> argumentsList = properties.getArgumentsList();
assertThat(argumentsList, notNullValue());
assertThat(argumentsList.size(), is(2));
assertThat(argumentsList, contains("argumentsListFoo1", "argumentsListFoo2"));
List<String> classpath = properties.getContainerAppClasspath();
assertThat(classpath, notNullValue());
assertThat(classpath.size(), is(2));
assertThat(classpath.get(0), is("classpath1Foo"));
assertThat(classpath.get(1), is("classpath2Foo"));
assertThat(properties.getRunnerClass(), is("runnerClassFoo"));
List<String> options = properties.getOptions();
assertThat(options, notNullValue());
assertThat(options.size(), is(2));
assertThat(options.get(0), is("options1Foo"));
assertThat(options.get(1), is("options2Foo"));
assertThat(properties.isLocality(), is(true));
assertThat(properties.isUseYarnAppClasspath(), is(true));
assertThat(properties.isUseMapreduceAppClasspath(), is(true));
assertThat(properties.isIncludeBaseDirectory(), is(false));
assertThat(properties.isIncludeLocalSystemEnv(), is(true));
assertThat(properties.getPathSeparator(), is(":"));
context.close();
}