コード例 #1
0
  @Test
  public void shouldGetPropertyValue() {
    PropertiesConfiguration conf = new PropertiesConfiguration();
    conf.setProperty("sonar.timemachine.period1", "5");

    assertThat(PastSnapshotFinder.getPropertyValue(conf, 1), is("5"));
    assertThat(PastSnapshotFinder.getPropertyValue(conf, 999), nullValue());
  }
コード例 #2
0
  @Test
  public void shouldGetDefaultPropertyValue() {
    PropertiesConfiguration conf = new PropertiesConfiguration();
    conf.setProperty("sonar.timemachine.period1", "5");

    assertThat(
        PastSnapshotFinder.getPropertyValue(conf, 2),
        is(CoreProperties.TIMEMACHINE_DEFAULT_PERIOD_2));
  }