Search in sources :

Example 16 with Props

use of org.sonar.process.Props in project sonarqube by SonarSource.

the class TomcatConnectorsTest method different_thread_pools_for_connectors.

@Test
public void different_thread_pools_for_connectors() {
    Properties p = new Properties();
    p.setProperty("sonar.web.http.minThreads", "2");
    Props props = new Props(p);
    TomcatConnectors.configure(tomcat, props);
    verifyHttpConnector(DEFAULT_PORT, ImmutableMap.of("minSpareThreads", 2));
}
Also used : Properties(java.util.Properties) Props(org.sonar.process.Props) Test(org.junit.Test)

Example 17 with Props

use of org.sonar.process.Props in project sonarqube by SonarSource.

the class TomcatConnectorsTest method test_max_http_header_size_for_http_connection.

@Test
public void test_max_http_header_size_for_http_connection() {
    TomcatConnectors.configure(tomcat, new Props(new Properties()));
    verifyHttpConnector(DEFAULT_PORT, ImmutableMap.of("maxHttpHeaderSize", TomcatConnectors.MAX_HTTP_HEADER_SIZE_BYTES));
}
Also used : Props(org.sonar.process.Props) Properties(java.util.Properties) Test(org.junit.Test)

Example 18 with Props

use of org.sonar.process.Props in project sonarqube by SonarSource.

the class TomcatContextsTest method root_context_path_must_be_blank.

@Test
public void root_context_path_must_be_blank() {
    props.setProperty("sonar.web.context", "/");
    assertThat(TomcatContexts.getContextPath(new Props(props))).isEqualTo("");
}
Also used : Props(org.sonar.process.Props) Test(org.junit.Test)

Example 19 with Props

use of org.sonar.process.Props in project sonarqube by SonarSource.

the class TomcatContextsTest method configure_root_webapp.

@Test
public void configure_root_webapp() throws Exception {
    props.setProperty("foo", "bar");
    StandardContext context = mock(StandardContext.class);
    when(tomcat.addWebapp(anyString(), anyString())).thenReturn(context);
    underTest.configure(tomcat, new Props(props));
    // configure webapp with properties
    verify(context).addParameter("foo", "bar");
}
Also used : StandardContext(org.apache.catalina.core.StandardContext) Props(org.sonar.process.Props) Test(org.junit.Test)

Example 20 with Props

use of org.sonar.process.Props in project sonarqube by SonarSource.

the class TomcatContextsTest method default_context_path_is_root.

@Test
public void default_context_path_is_root() {
    String context = TomcatContexts.getContextPath(new Props(new Properties()));
    assertThat(context).isEqualTo("");
}
Also used : Matchers.anyString(org.mockito.Matchers.anyString) Props(org.sonar.process.Props) Properties(java.util.Properties) ProcessProperties(org.sonar.process.ProcessProperties) Test(org.junit.Test)

Aggregations

Props (org.sonar.process.Props)39 Test (org.junit.Test)32 Properties (java.util.Properties)20 File (java.io.File)11 ProcessProperties (org.sonar.process.ProcessProperties)9 Settings (org.elasticsearch.common.settings.Settings)7 InetAddress (java.net.InetAddress)3 Connector (org.apache.catalina.connector.Connector)3 ArgumentMatcher (org.mockito.ArgumentMatcher)3 ProcessEntryPoint (org.sonar.process.ProcessEntryPoint)3 ConnectException (java.net.ConnectException)1 URL (java.net.URL)1 Date (java.util.Date)1 StandardContext (org.apache.catalina.core.StandardContext)1 Tomcat (org.apache.catalina.startup.Tomcat)1 NoNodeAvailableException (org.elasticsearch.client.transport.NoNodeAvailableException)1 InetSocketTransportAddress (org.elasticsearch.common.transport.InetSocketTransportAddress)1 Matchers.anyString (org.mockito.Matchers.anyString)1 MutablePicoContainer (org.picocontainer.MutablePicoContainer)1 CoreProperties (org.sonar.api.CoreProperties)1