From: Julien Lancelot Date: Mon, 27 Jun 2016 09:07:27 +0000 (+0200) Subject: SONAR-7759 Java WS are not executed by Rails X-Git-Tag: 6.0-RC1~232 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=22b483458fdd132efe8a717624ea4b47ad37bba6;p=sonarqube.git SONAR-7759 Java WS are not executed by Rails --- diff --git a/it/it-tests/src/test/java/it/component/ProjectSearchTest.java b/it/it-tests/src/test/java/it/component/ProjectSearchTest.java index 0bd21727022..01827629ba1 100644 --- a/it/it-tests/src/test/java/it/component/ProjectSearchTest.java +++ b/it/it-tests/src/test/java/it/component/ProjectSearchTest.java @@ -19,6 +19,9 @@ */ package it.component; +import static org.assertj.core.api.Assertions.assertThat; +import static util.ItUtils.projectDir; + import com.sonar.orchestrator.Orchestrator; import com.sonar.orchestrator.build.SonarRunner; import it.Category4Suite; @@ -35,9 +38,6 @@ import org.junit.Test; import org.junit.experimental.categories.Category; import util.QaOnly; -import static org.assertj.core.api.Assertions.assertThat; -import static util.ItUtils.projectDir; - @Category(QaOnly.class) public class ProjectSearchTest { @@ -58,7 +58,7 @@ public class ProjectSearchTest { SonarRunner build = SonarRunner.create(projectDir("shared/xoo-sample")); orchestrator.executeBuild(build); - String url = orchestrator.getServer().getUrl() + "/api/projects?key=sample&versions=true"; + String url = orchestrator.getServer().getUrl() + "/api/projects/index?key=sample&versions=true"; HttpClient httpclient = new DefaultHttpClient(); try { HttpGet get = new HttpGet(url); diff --git a/server/sonar-server/src/main/java/org/sonar/server/app/TomcatConnectors.java b/server/sonar-server/src/main/java/org/sonar/server/app/TomcatConnectors.java index bcf14fed9ec..986f2a8a4f2 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/app/TomcatConnectors.java +++ b/server/sonar-server/src/main/java/org/sonar/server/app/TomcatConnectors.java @@ -19,6 +19,9 @@ */ package org.sonar.server.app; +import static com.google.common.collect.FluentIterable.from; +import static java.util.Arrays.asList; + import com.google.common.base.Predicates; import java.util.HashSet; import java.util.List; @@ -29,9 +32,6 @@ import org.apache.catalina.connector.Connector; import org.apache.catalina.startup.Tomcat; import org.sonar.process.Props; -import static com.google.common.collect.FluentIterable.from; -import static java.util.Arrays.asList; - /** * Configuration of Tomcat connectors */ @@ -41,6 +41,7 @@ class TomcatConnectors { public static final String HTTP_PROTOCOL = "HTTP/1.1"; public static final String AJP_PROTOCOL = "AJP/1.3"; public static final int MAX_HTTP_HEADER_SIZE_BYTES = 48 * 1024; + private static final int MAX_POST_SIZE = -1; private TomcatConnectors() { // only static stuff @@ -82,6 +83,7 @@ class TomcatConnectors { connector = newConnector(props, HTTP_PROTOCOL, "http"); configureMaxHttpHeaderSize(connector); connector.setPort(port); + connector.setMaxPostSize(MAX_POST_SIZE); } return connector; } diff --git a/server/sonar-server/src/main/java/org/sonar/server/app/TomcatContexts.java b/server/sonar-server/src/main/java/org/sonar/server/app/TomcatContexts.java index abd0dd2df4e..56dcf66f5ff 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/app/TomcatContexts.java +++ b/server/sonar-server/src/main/java/org/sonar/server/app/TomcatContexts.java @@ -19,6 +19,9 @@ */ package org.sonar.server.app; +import static java.lang.String.format; +import static org.apache.commons.lang.StringUtils.isEmpty; + import com.google.common.annotations.VisibleForTesting; import java.io.File; import java.io.IOException; @@ -33,9 +36,6 @@ import org.sonar.api.utils.log.Loggers; import org.sonar.process.ProcessProperties; import org.sonar.process.Props; -import static java.lang.String.format; -import static org.apache.commons.lang.StringUtils.isEmpty; - /** * Configures Tomcat contexts: *