aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-06-21 15:12:11 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2011-06-21 15:13:48 +0200
commit02fdeba8d5cea42b17f0e24bc1d0bdebd9c0d29b (patch)
tree56b6d7bb26a1b842577c75968269ad3ae9e976ef /sonar-plugin-api/src
parent09b9a9586fe2a3a82d79ea2e7c5f1cbe742c8ac5 (diff)
downloadsonarqube-02fdeba8d5cea42b17f0e24bc1d0bdebd9c0d29b.tar.gz
sonarqube-02fdeba8d5cea42b17f0e24bc1d0bdebd9c0d29b.zip
SONAR-2505 support measure variations
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java3
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java4
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/resources/ProjectTest.java5
3 files changed, 12 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java
index 49fa07f4c95..e19a5a3f13b 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java
@@ -159,6 +159,9 @@ public interface CoreProperties {
/* Time machine periods */
String TIMEMACHINE_PERIOD_PREFIX = "sonar.timemachine.period";
String TIMEMACHINE_MODE_PREVIOUS_ANALYSIS = "previous_analysis";
+ String TIMEMACHINE_MODE_DATE = "date";
+ String TIMEMACHINE_MODE_VERSION = "version";
+ String TIMEMACHINE_MODE_DAYS = "days";
String TIMEMACHINE_DEFAULT_PERIOD_1 = TIMEMACHINE_MODE_PREVIOUS_ANALYSIS;
String TIMEMACHINE_DEFAULT_PERIOD_2 = "5";
String TIMEMACHINE_DEFAULT_PERIOD_3 = "30";
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java
index a689a25bb53..dda4c228c52 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java
@@ -111,6 +111,7 @@ public class Project extends Resource {
public Project(String key) {
setKey(key);
+ setEffectiveKey(key);
}
public Project(String key, String branch, String name) {
@@ -121,6 +122,7 @@ public class Project extends Resource {
setKey(key);
this.name = name;
}
+ setEffectiveKey(getKey());
this.branch = branch;
}
@@ -305,6 +307,8 @@ public class Project extends Resource {
return parent;
}
+
+
/**
* For internal use only.
*/
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/resources/ProjectTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/resources/ProjectTest.java
index d52bbd6a746..8df12c56673 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/resources/ProjectTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/resources/ProjectTest.java
@@ -38,6 +38,11 @@ public class ProjectTest {
}
@Test
+ public void effectiveKeyShouldEqualKey() {
+ assertThat(new Project("my:project").getEffectiveKey(), is("my:project"));
+ }
+
+ @Test
public void createFromMavenIds() {
Project project = Project.createFromMavenIds("my", "artifact");
assertThat(project.getKey(), is("my:artifact"));