use of org.sonar.process.Props in project sonarqube by SonarSource.
the class EsInstallationTest method conf_directory_is_conf_es_subdirectory_of_sq_temp_directory.
@Test
public void conf_directory_is_conf_es_subdirectory_of_sq_temp_directory() throws IOException {
File tempDir = temp.newFolder();
Props props = new Props(new Properties());
props.set(PATH_DATA.getKey(), temp.newFolder().getAbsolutePath());
props.set(PATH_HOME.getKey(), temp.newFolder().getAbsolutePath());
props.set(PATH_TEMP.getKey(), tempDir.getAbsolutePath());
props.set(PATH_LOGS.getKey(), temp.newFolder().getAbsolutePath());
EsInstallation underTest = new EsInstallation(props);
assertThat(underTest.getConfDirectory()).isEqualTo(new File(tempDir, "conf/es"));
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class EsInstallationTest method getLog4j2Properties_is_in_es_conf_directory.
@Test
public void getLog4j2Properties_is_in_es_conf_directory() throws IOException {
File tempDir = temp.newFolder();
Props props = new Props(new Properties());
props.set(PATH_DATA.getKey(), temp.newFolder().getAbsolutePath());
props.set(PATH_HOME.getKey(), temp.newFolder().getAbsolutePath());
props.set(PATH_TEMP.getKey(), tempDir.getAbsolutePath());
props.set(PATH_LOGS.getKey(), temp.newFolder().getAbsolutePath());
EsInstallation underTest = new EsInstallation(props);
assertThat(underTest.getLog4j2PropertiesLocation()).isEqualTo(new File(tempDir, "conf/es/log4j2.properties"));
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class EsInstallationTest method getElasticsearchYml_is_in_es_conf_directory.
@Test
public void getElasticsearchYml_is_in_es_conf_directory() throws IOException {
File tempDir = temp.newFolder();
Props props = new Props(new Properties());
props.set(PATH_DATA.getKey(), temp.newFolder().getAbsolutePath());
props.set(PATH_HOME.getKey(), temp.newFolder().getAbsolutePath());
props.set(PATH_TEMP.getKey(), tempDir.getAbsolutePath());
props.set(PATH_LOGS.getKey(), temp.newFolder().getAbsolutePath());
EsInstallation underTest = new EsInstallation(props);
assertThat(underTest.getElasticsearchYml()).isEqualTo(new File(tempDir, "conf/es/elasticsearch.yml"));
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class EsInstallationTest method getLogDirectory_is_configured_with_non_nullable_PATH_LOG_variable.
@Test
public void getLogDirectory_is_configured_with_non_nullable_PATH_LOG_variable() throws IOException {
File sqHomeDir = temp.newFolder();
File logDir = temp.newFolder();
Props props = new Props(new Properties());
props.set(PATH_DATA.getKey(), temp.newFolder().getAbsolutePath());
props.set(PATH_HOME.getKey(), sqHomeDir.getAbsolutePath());
props.set(PATH_TEMP.getKey(), temp.newFolder().getAbsolutePath());
props.set(PATH_LOGS.getKey(), logDir.getAbsolutePath());
EsInstallation underTest = new EsInstallation(props);
assertThat(underTest.getLogDirectory()).isEqualTo(logDir);
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class EsLoggingTest method newProps.
private static Props newProps(String... propertyKeysAndValues) {
assertThat(propertyKeysAndValues.length % 2).describedAs("Number of parameters must be even").isZero();
Properties properties = new Properties();
for (int i = 0; i < propertyKeysAndValues.length; i++) {
properties.put(propertyKeysAndValues[i++], propertyKeysAndValues[i]);
}
return new Props(properties);
}
Aggregations