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;
}
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;
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;
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;
}
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;
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);
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
}
}));
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
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
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
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);