aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/test/java
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2017-08-17 14:24:01 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2017-08-17 14:24:01 +0200
commit4f79e3f566e90290434c860c828508e34b46b05f (patch)
tree236f4bdd62c0892f8d7599a7afa41d001acece58 /tests/src/test/java
parentcdd64591259fd683889be330ace758876efb364b (diff)
downloadsonarqube-4f79e3f566e90290434c860c828508e34b46b05f.tar.gz
sonarqube-4f79e3f566e90290434c860c828508e34b46b05f.zip
SONAR-7493 add integration test on max length of db column issues.message
Diffstat (limited to 'tests/src/test/java')
-rw-r--r--tests/src/test/java/org/sonarqube/tests/issue/IssueCreationTest.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/src/test/java/org/sonarqube/tests/issue/IssueCreationTest.java b/tests/src/test/java/org/sonarqube/tests/issue/IssueCreationTest.java
index b6afaf17304..81d2cd4a51b 100644
--- a/tests/src/test/java/org/sonarqube/tests/issue/IssueCreationTest.java
+++ b/tests/src/test/java/org/sonarqube/tests/issue/IssueCreationTest.java
@@ -19,6 +19,7 @@
*/
package org.sonarqube.tests.issue;
+import org.apache.commons.lang.StringUtils;
import org.junit.Before;
import org.junit.Test;
import org.sonar.wsclient.issue.Issue;
@@ -75,4 +76,23 @@ public class IssueCreationTest extends AbstractIssueTest {
assertThat(issue.severity()).isEqualTo("BLOCKER");
}
}
+
+ /**
+ * Test the maximum size of DB column issues.message, even if UTF8 characters
+ * are 3-bytes long
+ *
+ * SONAR-7493
+ */
+ @Test
+ public void issue_message_should_support_4000_utf8_characters() {
+ ORCHESTRATOR.getServer().provisionProject(SAMPLE_PROJECT_KEY, SAMPLE_PROJECT_KEY);
+ ItUtils.restoreProfile(ORCHESTRATOR, getClass().getResource("/issue/IssueCreationTest/with-custom-message.xml"));
+ ORCHESTRATOR.getServer().associateProjectToQualityProfile(SAMPLE_PROJECT_KEY, "xoo", "with-custom-message");
+
+ String longMessage = StringUtils.repeat("を", 4_000);
+ runProjectAnalysis(ORCHESTRATOR, "shared/xoo-sample", "sonar.customMessage.message", longMessage);
+
+ Issue issue = issueClient().find(IssueQuery.create()).list().get(0);
+ assertThat(issue.message()).isEqualTo(longMessage);
+ }
}