Package org.sonar.batch.components

Examples of org.sonar.batch.components.TimeMachineConfiguration


  public static final int VIOLATIONS_ID = 17;
  public static final Metric VIOLATIONS = new Metric("violations").setId(VIOLATIONS_ID);

  @Test
  public void shouldComputeVariations() {
    TimeMachineConfiguration timeMachineConfiguration = mock(TimeMachineConfiguration.class);
    VariationDecorator decorator = new VariationDecorator(mock(PastMeasuresLoader.class), mock(MetricFinder.class), timeMachineConfiguration, mock(RuleFinder.class));

    assertThat(decorator.shouldComputeVariation(new Project("foo"))).isTrue();
    assertThat(decorator.shouldComputeVariation(new File("foo/bar.c"))).isFalse();
  }
View Full Code Here


  @Test
  public void shouldSaveConfigurationInSnapshotsTable() {
    setupData("shared");

    TimeMachineConfiguration timeMachineConfiguration = mock(TimeMachineConfiguration.class);
    PastSnapshot vs1 = new PastSnapshot("days", DateUtils.parseDate("2009-01-25"), getSession().getSingleResult(Snapshot.class, "id", 100))
      .setModeParameter("30").setIndex(1);
    PastSnapshot vs3 = new PastSnapshot("version", DateUtils.parseDate("2008-12-13"), getSession().getSingleResult(Snapshot.class, "id", 300))
      .setModeParameter("1.2.3").setIndex(3);
    when(timeMachineConfiguration.getProjectPastSnapshots()).thenReturn(Arrays.asList(vs1, vs3));
    Snapshot projectSnapshot = getSession().getSingleResult(Snapshot.class, "id", 1000);

    TimeMachineConfigurationPersister persister = new TimeMachineConfigurationPersister(timeMachineConfiguration, projectSnapshot, getSession());
    persister.persistConfiguration();
View Full Code Here

TOP

Related Classes of org.sonar.batch.components.TimeMachineConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.