use of org.sonar.process.Props in project sonarqube by SonarSource.
the class TomcatConnectorsTest method configure_defaults.
@Test
public void configure_defaults() {
Props props = new Props(new Properties());
TomcatConnectors.configure(tomcat, props);
verifyHttpConnector(DEFAULT_PORT, ImmutableMap.of("minSpareThreads", 5, "maxThreads", 50, "acceptCount", 25));
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class TomcatContextsTest method context_path.
@Test
public void context_path() {
props.setProperty("sonar.web.context", "/foo");
assertThat(TomcatContexts.getContextPath(new Props(props))).isEqualTo("/foo");
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class FileSystemSettingsTest method relative_paths_are_converted_to_absolute_paths.
@Test
public void relative_paths_are_converted_to_absolute_paths() throws Exception {
Props props = new Props(new Properties());
props.set(PATH_HOME, homeDir.getAbsolutePath());
// relative paths
props.set(PATH_DATA, "data");
props.set(PATH_LOGS, "logs");
props.set(PATH_TEMP, "temp");
// already absolute paths
props.set(PATH_WEB, new File(homeDir, "web").getAbsolutePath());
underTest.accept(props);
assertThat(props.nonNullValue(PATH_DATA)).isEqualTo(new File(homeDir, "data").getAbsolutePath());
assertThat(props.nonNullValue(PATH_LOGS)).isEqualTo(new File(homeDir, "logs").getAbsolutePath());
assertThat(props.nonNullValue(PATH_TEMP)).isEqualTo(new File(homeDir, "temp").getAbsolutePath());
assertThat(props.nonNullValue(PATH_WEB)).isEqualTo(new File(homeDir, "web").getAbsolutePath());
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class JdbcSettingsTest method fail_with_MessageException_when_provider_is_not_supported.
@Test
public void fail_with_MessageException_when_provider_is_not_supported() {
Props props = newProps(JDBC_URL, "jdbc:microsoft:sqlserver://localhost");
expectedException.expect(MessageException.class);
expectedException.expectMessage("Unsupported JDBC driver provider: microsoft");
underTest.resolveProviderAndEnforceNonnullJdbcUrl(props);
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class JdbcSettingsTest method checkAndComplete_sets_driver_path_for_oracle.
@Test
public void checkAndComplete_sets_driver_path_for_oracle() throws Exception {
File driverFile = new File(homeDir, "extensions/jdbc-driver/oracle/ojdbc6.jar");
FileUtils.touch(driverFile);
Props props = newProps(JDBC_URL, "jdbc:oracle:thin:@localhost/XE");
underTest.accept(props);
assertThat(props.nonNullValueAsFile(ProcessProperties.JDBC_DRIVER_PATH)).isEqualTo(driverFile);
}
Aggregations