aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2010-12-04 19:19:40 +0000
committersimonbrandhof <simon.brandhof@gmail.com>2010-12-04 19:19:40 +0000
commite21bc25776af58ec7983138c909159d2bd8c0bde (patch)
treeeeebea613b3b948dc8a86061ad006d424aa56acd /plugins
parent14271770a03173f464498e1b6ebf527799c7b75e (diff)
downloadsonarqube-e21bc25776af58ec7983138c909159d2bd8c0bde.tar.gz
sonarqube-e21bc25776af58ec7983138c909159d2bd8c0bde.zip
SONAR-249 rename some methods of PastSnapshot so sonar can detect it's a bean
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/PastSnapshot.java6
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/PastSnapshotFinder.java8
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/TimeMachineConfigurationPersister.java12
-rw-r--r--plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/PastSnapshotFinderTest.java16
-rw-r--r--plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/TimeMachineConfigurationPersisterTest.java4
5 files changed, 23 insertions, 23 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/PastSnapshot.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/PastSnapshot.java
index 1193c4294dd..87d803612e8 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/PastSnapshot.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/PastSnapshot.java
@@ -48,15 +48,15 @@ public final class PastSnapshot {
return projectSnapshot.getCreatedAt();
}
- public String getConfigurationMode() {
+ public String getMode() {
return mode;
}
- public String getConfigurationModeParameter() {
+ public String getModeParameter() {
return modeParameter;
}
- public PastSnapshot setConfigurationModeParameter(String s) {
+ public PastSnapshot setModeParameter(String s) {
this.modeParameter = s;
return this;
}
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/PastSnapshotFinder.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/PastSnapshotFinder.java
index 90e7c8bbc6e..92ca2715ec3 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/PastSnapshotFinder.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/PastSnapshotFinder.java
@@ -76,7 +76,7 @@ public class PastSnapshotFinder implements BatchExtension {
if (projectSnapshot != null) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
String date = format.format(projectSnapshot.getCreatedAt());
- return new PastSnapshot(index, LAST__ANALYSIS_MODE, projectSnapshot).setConfigurationModeParameter(date);
+ return new PastSnapshot(index, LAST__ANALYSIS_MODE, projectSnapshot).setModeParameter(date);
}
}
return null;
@@ -88,7 +88,7 @@ public class PastSnapshotFinder implements BatchExtension {
Date date = format.parse(property);
Snapshot projectSnapshot = finderByDate.findByDate(date);
if (projectSnapshot != null) {
- return new PastSnapshot(index, DATE_MODE, projectSnapshot).setConfigurationModeParameter(property);
+ return new PastSnapshot(index, DATE_MODE, projectSnapshot).setModeParameter(property);
}
return null;
@@ -100,7 +100,7 @@ public class PastSnapshotFinder implements BatchExtension {
private PastSnapshot findByVersion(int index, String property) {
Snapshot projectSnapshot = finderByVersion.findVersion(property);
if (projectSnapshot != null) {
- return new PastSnapshot(index, VERSION_MODE, projectSnapshot).setConfigurationModeParameter(property);
+ return new PastSnapshot(index, VERSION_MODE, projectSnapshot).setModeParameter(property);
}
return null;
}
@@ -110,7 +110,7 @@ public class PastSnapshotFinder implements BatchExtension {
int days = Integer.parseInt(property);
Snapshot projectSnapshot = finderByDays.findInDays(days);
if (projectSnapshot != null) {
- return new PastSnapshot(index, DAYS_MODE, projectSnapshot).setConfigurationModeParameter(String.valueOf(days));
+ return new PastSnapshot(index, DAYS_MODE, projectSnapshot).setModeParameter(String.valueOf(days));
}
return null;
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/TimeMachineConfigurationPersister.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/TimeMachineConfigurationPersister.java
index 3fc43b9a784..e6616a784c9 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/TimeMachineConfigurationPersister.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/TimeMachineConfigurationPersister.java
@@ -42,16 +42,16 @@ public final class TimeMachineConfigurationPersister implements BatchExtension {
for (PastSnapshot variationSnapshot : variationSnapshots) {
switch (variationSnapshot.getIndex()) {
case 1:
- projectSnapshot.setVarMode1(variationSnapshot.getConfigurationMode());
- projectSnapshot.setVarLabel1(variationSnapshot.getConfigurationModeParameter());
+ projectSnapshot.setVarMode1(variationSnapshot.getMode());
+ projectSnapshot.setVarLabel1(variationSnapshot.getModeParameter());
break;
case 2:
- projectSnapshot.setVarMode2(variationSnapshot.getConfigurationMode());
- projectSnapshot.setVarLabel2(variationSnapshot.getConfigurationModeParameter());
+ projectSnapshot.setVarMode2(variationSnapshot.getMode());
+ projectSnapshot.setVarLabel2(variationSnapshot.getModeParameter());
break;
case 3:
- projectSnapshot.setVarMode3(variationSnapshot.getConfigurationMode());
- projectSnapshot.setVarLabel3(variationSnapshot.getConfigurationModeParameter());
+ projectSnapshot.setVarMode3(variationSnapshot.getMode());
+ projectSnapshot.setVarLabel3(variationSnapshot.getModeParameter());
break;
default:
throw new IndexOutOfBoundsException("Index of variation configuration is out of range: " + variationSnapshot);
diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/PastSnapshotFinderTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/PastSnapshotFinderTest.java
index 7c1109b7b06..79ae41629c6 100644
--- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/PastSnapshotFinderTest.java
+++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/PastSnapshotFinderTest.java
@@ -61,8 +61,8 @@ public class PastSnapshotFinderTest {
verify(finderByDays).findInDays(30);
assertNotNull(variationSnapshot);
assertThat(variationSnapshot.getIndex(), is(1));
- assertThat(variationSnapshot.getConfigurationMode(), is("days"));
- assertThat(variationSnapshot.getConfigurationModeParameter(), is("30"));
+ assertThat(variationSnapshot.getMode(), is("days"));
+ assertThat(variationSnapshot.getModeParameter(), is("30"));
}
@Test
@@ -91,8 +91,8 @@ public class PastSnapshotFinderTest {
}
}));
assertThat(variationSnapshot.getIndex(), is(2));
- assertThat(variationSnapshot.getConfigurationMode(), is("date"));
- assertThat(variationSnapshot.getConfigurationModeParameter(), is("2010-05-18"));
+ assertThat(variationSnapshot.getMode(), is("date"));
+ assertThat(variationSnapshot.getModeParameter(), is("2010-05-18"));
}
@Test
@@ -117,8 +117,8 @@ public class PastSnapshotFinderTest {
verify(finderByLastAnalysis).findLastAnalysis();
assertThat(variationSnapshot.getIndex(), is(2));
- assertThat(variationSnapshot.getConfigurationMode(), is("last_analysis"));
- assertThat(variationSnapshot.getConfigurationModeParameter(), is("2010-05-18"));
+ assertThat(variationSnapshot.getMode(), is("last_analysis"));
+ assertThat(variationSnapshot.getModeParameter(), is("2010-05-18"));
}
@Test
@@ -140,8 +140,8 @@ public class PastSnapshotFinderTest {
verify(finderByVersion).findVersion("1.2");
assertThat(variationSnapshot.getIndex(), is(2));
- assertThat(variationSnapshot.getConfigurationMode(), is("version"));
- assertThat(variationSnapshot.getConfigurationModeParameter(), is("1.2"));
+ assertThat(variationSnapshot.getMode(), is("version"));
+ assertThat(variationSnapshot.getModeParameter(), is("1.2"));
}
@Test
diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/TimeMachineConfigurationPersisterTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/TimeMachineConfigurationPersisterTest.java
index 5d08a57f163..0e25e21d7a3 100644
--- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/TimeMachineConfigurationPersisterTest.java
+++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/TimeMachineConfigurationPersisterTest.java
@@ -36,9 +36,9 @@ public class TimeMachineConfigurationPersisterTest extends AbstractDbUnitTestCas
TimeMachineConfiguration conf = mock(TimeMachineConfiguration.class);
PastSnapshot vs1 = new PastSnapshot(1, "days", getSession().getSingleResult(Snapshot.class, "id", 100))
- .setConfigurationModeParameter("30");
+ .setModeParameter("30");
PastSnapshot vs3 = new PastSnapshot(3, "version", getSession().getSingleResult(Snapshot.class, "id", 300))
- .setConfigurationModeParameter("1.2.3");
+ .setModeParameter("1.2.3");
when(conf.getProjectPastSnapshots()).thenReturn(Arrays.asList(vs1, vs3));
Snapshot projectSnapshot = getSession().getSingleResult(Snapshot.class, "id", 1000);