Package org.sonar.process

Examples of org.sonar.process.Props


  @Test
  public void root_context_path_must_be_blank() throws Exception {
    Properties p = new Properties();
    p.setProperty("sonar.web.context", "/");

    assertThat(Webapp.getContextPath(new Props(p))).isEqualTo("");
  }
View Full Code Here


    assertThat(Webapp.getContextPath(new Props(p))).isEqualTo("");
  }

  @Test
  public void default_context_path_is_root() throws Exception {
    String context = Webapp.getContextPath(new Props(new Properties()));
    assertThat(context).isEqualTo("");
  }
View Full Code Here

  }

  @Test
  public void enable_access_logs_by_Default() throws Exception {
    Tomcat tomcat = mock(Tomcat.class, Mockito.RETURNS_DEEP_STUBS);
    Props props = new Props(new Properties());
    props.set(ProcessConstants.PATH_WEB, temp.newFolder().getAbsolutePath());
    Logging.configure(tomcat, props);

    verify(tomcat.getHost().getPipeline()).addValve(argThat(new ArgumentMatcher<Valve>() {
      @Override
      public boolean matches(Object o) {
View Full Code Here

    properties.setProperty(ProcessConstants.CLUSTER_NAME, clusterName);
    properties.setProperty(ProcessConstants.CLUSTER_NODE_NAME, "test");
    properties.setProperty(ProcessConstants.SEARCH_PORT, clusterPort.toString());
    properties.setProperty(ProcessConstants.PATH_HOME, temp.getRoot().getAbsolutePath());
    try {
      searchServer = new SearchServer(new Props(properties));
    } catch (Exception e) {
      e.printStackTrace();
    }
    searchServer.start();
  }
View Full Code Here

  public void configure_thread_pool() throws Exception {
    Properties p = new Properties();
    p.setProperty("sonar.web.http.minThreads", "2");
    p.setProperty("sonar.web.http.maxThreads", "30");
    p.setProperty("sonar.web.http.acceptCount", "20");
    Props props = new Props(p);

    Connectors.configure(tomcat, props);

    verify(tomcat).setConnector(argThat(new PropertiesMatcher(
      ImmutableMap.<String, Object>of("minSpareThreads", 2, "maxThreads", 30, "acceptCount", 20)
View Full Code Here

      )));
  }

  @Test
  public void configure_default_thread_pool() throws Exception {
    Props props = new Props(new Properties());

    Connectors.configure(tomcat, props);

    verify(tomcat).setConnector(argThat(new PropertiesMatcher(
      ImmutableMap.<String, Object>of("minSpareThreads", 5, "maxThreads", 50, "acceptCount", 25)
View Full Code Here

    Properties p = new Properties();
    p.setProperty("sonar.web.port", "9000");
    p.setProperty("sonar.web.http.minThreads", "2");
    p.setProperty("sonar.web.https.port", "9443");
    p.setProperty("sonar.web.https.minThreads", "5");
    Props props = new Props(p);

    Connectors.configure(tomcat, props);

    verify(tomcat.getService()).addConnector(argThat(new ArgumentMatcher<Connector>() {
      @Override
View Full Code Here

  @Test
  public void fail_if_http_connectors_are_disabled() {
    Properties p = new Properties();
    p.setProperty("sonar.web.port", "-1");
    p.setProperty("sonar.web.https.port", "-1");
    Props props = new Props(p);

    try {
      Connectors.configure(tomcat, props);
      fail();
    } catch (IllegalStateException e) {
View Full Code Here

  @Test
  public void only_https_is_enabled() {
    Properties p = new Properties();
    p.setProperty("sonar.web.port", "-1");
    p.setProperty("sonar.web.https.port", "9443");
    Props props = new Props(p);

    Connectors.configure(tomcat, props);

    verify(tomcat).setConnector(argThat(new ArgumentMatcher<Connector>() {
      @Override
View Full Code Here

  public void all_connectors_are_enabled() {
    Properties p = new Properties();
    p.setProperty("sonar.web.port", "9000");
    p.setProperty("sonar.ajp.port", "9009");
    p.setProperty("sonar.web.https.port", "9443");
    Props props = new Props(p);

    Connectors.configure(tomcat, props);

    verify(tomcat.getService()).addConnector(argThat(new ArgumentMatcher<Connector>() {
      @Override
View Full Code Here

TOP

Related Classes of org.sonar.process.Props

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.