aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins CI <ci@sonarsource.com>2014-07-09 16:29:39 +0200
committerJenkins CI <ci@sonarsource.com>2014-07-09 16:29:39 +0200
commit016723c452f78fa41c1f9098a8a28ccff940c1c4 (patch)
treea09591d5d5825f4d88a4c5b34076e75aca726c4a
parent9078aa7e35bd95a9c9ef75827e61ee2fdbe1a7f6 (diff)
parent46a655cc343aba370396d8af5fbc34d5da668a0a (diff)
downloadsonarqube-016723c452f78fa41c1f9098a8a28ccff940c1c4.tar.gz
sonarqube-016723c452f78fa41c1f9098a8a28ccff940c1c4.zip
Merge commit '46a655cc343aba370396d8af5fbc34d5da668a0a' into HEAD
-rw-r--r--pom.xml11
-rw-r--r--sonar-application/pom.xml7
-rw-r--r--sonar-markdown/pom.xml3
-rw-r--r--sonar-plugin-api/pom.xml3
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/rule/RuleKey.java8
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/rule/RuleKeyTest.java19
-rw-r--r--sonar-server/pom.xml3
-rw-r--r--sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndex.java1
-rw-r--r--sonar-server/src/test/java/org/sonar/server/qualityprofile/RuleActivatorMediumTest.java8
-rw-r--r--sonar-testing-harness/pom.xml3
10 files changed, 42 insertions, 24 deletions
diff --git a/pom.xml b/pom.xml
index 09e5e42e842..0104ee7a813 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.sonar</groupId>
@@ -1361,7 +1360,7 @@
</goals>
</pluginExecutionFilter>
<action>
- <ignore/>
+ <ignore />
</action>
</pluginExecution>
<pluginExecution>
@@ -1374,7 +1373,7 @@
</goals>
</pluginExecutionFilter>
<action>
- <ignore/>
+ <ignore />
</action>
</pluginExecution>
<pluginExecution>
@@ -1388,7 +1387,7 @@
</goals>
</pluginExecutionFilter>
<action>
- <ignore/>
+ <ignore />
</action>
</pluginExecution>
<pluginExecution>
@@ -1401,7 +1400,7 @@
</goals>
</pluginExecutionFilter>
<action>
- <ignore/>
+ <ignore />
</action>
</pluginExecution>
</pluginExecutions>
diff --git a/sonar-application/pom.xml b/sonar-application/pom.xml
index 456e50da0f5..049eb5aa3a6 100644
--- a/sonar-application/pom.xml
+++ b/sonar-application/pom.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -242,8 +241,8 @@
<phase>package</phase>
<configuration>
<target>
- <checksum file="${project.build.directory}/sonarqube-${project.version}.zip" algorithm="md5"/>
- <checksum file="${project.build.directory}/sonarqube-${project.version}.zip" algorithm="sha"/>
+ <checksum file="${project.build.directory}/sonarqube-${project.version}.zip" algorithm="md5" />
+ <checksum file="${project.build.directory}/sonarqube-${project.version}.zip" algorithm="sha" />
</target>
</configuration>
<goals>
diff --git a/sonar-markdown/pom.xml b/sonar-markdown/pom.xml
index 605760f790f..e2ef82f8633 100644
--- a/sonar-markdown/pom.xml
+++ b/sonar-markdown/pom.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
diff --git a/sonar-plugin-api/pom.xml b/sonar-plugin-api/pom.xml
index 39d64959d70..46985b00c84 100644
--- a/sonar-plugin-api/pom.xml
+++ b/sonar-plugin-api/pom.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rule/RuleKey.java b/sonar-plugin-api/src/main/java/org/sonar/api/rule/RuleKey.java
index a474347df74..9d316d5a250 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/rule/RuleKey.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/rule/RuleKey.java
@@ -53,9 +53,11 @@ public class RuleKey implements Serializable {
* if the format is not valid.
*/
public static RuleKey parse(String s) {
- String[] split = s.split(":");
- Preconditions.checkArgument(split.length == 2, "Invalid rule key: " + s);
- return RuleKey.of(split[0], split[1]);
+ int semiColonPos = s.indexOf(":");
+ Preconditions.checkArgument(semiColonPos > 0, "Invalid rule key: " + s);
+ String key = s.substring(0, semiColonPos);
+ String repo = s.substring(semiColonPos + 1);
+ return RuleKey.of(key, repo);
}
/**
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/rule/RuleKeyTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/rule/RuleKeyTest.java
index 150ed5efac9..d5190d941ae 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/rule/RuleKeyTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/rule/RuleKeyTest.java
@@ -25,6 +25,7 @@ import static org.fest.assertions.Assertions.assertThat;
import static org.fest.assertions.Fail.fail;
public class RuleKeyTest {
+
@Test
public void testOf() throws Exception {
RuleKey key = RuleKey.of("squid", "NullDeref");
@@ -33,6 +34,13 @@ public class RuleKeyTest {
}
@Test
+ public void key_can_contain_colons() throws Exception {
+ RuleKey key = RuleKey.of("squid", "Key:With:Some::Colons");
+ assertThat(key.repository()).isEqualTo("squid");
+ assertThat(key.rule()).isEqualTo("Key:With:Some::Colons");
+ }
+
+ @Test
public void repository_must_not_be_null() throws Exception {
try {
RuleKey.of(null, "NullDeref");
@@ -73,7 +81,7 @@ public class RuleKeyTest {
}
@Test
- public void should_encode_and_decode_string() throws Exception {
+ public void encode_and_decode_string() throws Exception {
RuleKey key = RuleKey.of("squid", "NullDeref");
String serialized = key.toString();
assertThat(serialized).isEqualTo("squid:NullDeref");
@@ -84,7 +92,14 @@ public class RuleKeyTest {
}
@Test
- public void should_not_accept_bad_format() throws Exception {
+ public void parse_key_with_colons() throws Exception {
+ RuleKey key = RuleKey.parse("squid:Key:With:Some::Colons");
+ assertThat(key.repository()).isEqualTo("squid");
+ assertThat(key.rule()).isEqualTo("Key:With:Some::Colons");
+ }
+
+ @Test
+ public void not_accept_bad_format() throws Exception {
try {
RuleKey.parse("foo");
fail();
diff --git a/sonar-server/pom.xml b/sonar-server/pom.xml
index 38544646681..f27f4ebb0b4 100644
--- a/sonar-server/pom.xml
+++ b/sonar-server/pom.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.codehaus.sonar</groupId>
diff --git a/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndex.java b/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndex.java
index 1dd442e1ec9..6ce3e100b32 100644
--- a/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndex.java
+++ b/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndex.java
@@ -46,7 +46,6 @@ import org.sonar.server.rule.Rule;
import org.sonar.server.search.*;
import javax.annotation.CheckForNull;
-
import java.io.IOException;
import java.util.*;
diff --git a/sonar-server/src/test/java/org/sonar/server/qualityprofile/RuleActivatorMediumTest.java b/sonar-server/src/test/java/org/sonar/server/qualityprofile/RuleActivatorMediumTest.java
index f913027f385..cf4cd585bff 100644
--- a/sonar-server/src/test/java/org/sonar/server/qualityprofile/RuleActivatorMediumTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/qualityprofile/RuleActivatorMediumTest.java
@@ -988,6 +988,10 @@ public class RuleActivatorMediumTest {
found = true;
assertThat(activeRuleDto.getSeverityString()).isEqualTo(expectedSeverity);
assertThat(activeRuleDto.getInheritance()).isEqualTo(expectedInheritance);
+ // Dates should be set
+ assertThat(activeRuleDto.getCreatedAt()).isNotNull();
+ assertThat(activeRuleDto.getUpdatedAt()).isNotNull();
+
List<ActiveRuleParamDto> paramDtos = db.activeRuleDao().findParamsByActiveRuleKey(dbSession, activeRuleDto.getKey());
assertThat(paramDtos).hasSize(expectedParams.size());
for (Map.Entry<String, String> entry : expectedParams.entrySet()) {
@@ -1008,6 +1012,10 @@ public class RuleActivatorMediumTest {
assertThat(activeRule.severity()).isEqualTo(expectedSeverity);
assertThat(activeRule.inheritance()).isEqualTo(expectedInheritance == null ? ActiveRule.Inheritance.NONE : ActiveRule.Inheritance.valueOf(expectedInheritance));
+ // Dates should be set
+ assertThat(activeRule.createdAt()).isNotNull();
+ assertThat(activeRule.updatedAt()).isNotNull();
+
// verify parameters in es
assertThat(activeRule.params()).hasSize(expectedParams.size());
for (Map.Entry<String, String> entry : expectedParams.entrySet()) {
diff --git a/sonar-testing-harness/pom.xml b/sonar-testing-harness/pom.xml
index 35f832574d8..f1814ab99f5 100644
--- a/sonar-testing-harness/pom.xml
+++ b/sonar-testing-harness/pom.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.codehaus.sonar</groupId>