use of org.sonar.process.Props in project sonarqube by SonarSource.
the class EsInstallationTest method constructor_fails_with_IAE_if_temp_dir_property_is_not_defined.
@Test
public void constructor_fails_with_IAE_if_temp_dir_property_is_not_defined() throws IOException {
Props props = new Props(new Properties());
props.set(PATH_DATA.getKey(), temp.newFolder().getAbsolutePath());
props.set(PATH_HOME.getKey(), temp.newFolder().getAbsolutePath());
assertThatThrownBy(() -> new EsInstallation(props)).isInstanceOf(IllegalArgumentException.class).hasMessage("Property sonar.path.temp is not set");
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class EsInstallationTest method override_data_dir.
@Test
public void override_data_dir() throws Exception {
File sqHomeDir = temp.newFolder();
File tempDir = temp.newFolder();
File dataDir = temp.newFolder();
Props props = new Props(new Properties());
props.set(PATH_HOME.getKey(), sqHomeDir.getAbsolutePath());
props.set(PATH_TEMP.getKey(), tempDir.getAbsolutePath());
props.set(PATH_LOGS.getKey(), temp.newFolder().getAbsolutePath());
props.set(PATH_DATA.getKey(), dataDir.getAbsolutePath());
EsInstallation underTest = new EsInstallation(props);
assertThat(underTest.getDataDirectory()).isEqualTo(new File(dataDir, "es7"));
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class EsInstallationTest method getJvmOptions_is_in_es_conf_directory.
@Test
public void getJvmOptions_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.getJvmOptions()).isEqualTo(new File(tempDir, "conf/es/jvm.options"));
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class EsInstallationTest method constructor_fails_with_IAE_if_sq_home_property_is_not_defined.
@Test
public void constructor_fails_with_IAE_if_sq_home_property_is_not_defined() {
Props props = new Props(new Properties());
assertThatThrownBy(() -> new EsInstallation(props)).isInstanceOf(IllegalArgumentException.class).hasMessage("Property sonar.path.home is not set");
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class EsInstallationTest method getOutdatedSearchDirectories_returns_all_previously_used_es_data_directory_names.
@Test
public void getOutdatedSearchDirectories_returns_all_previously_used_es_data_directory_names() 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.getOutdatedSearchDirectories()).extracting(File::getName).containsExactlyInAnyOrder("es", "es5", "es6");
}
Aggregations