Package org.sonar.batch.components

Examples of org.sonar.batch.components.PastMeasuresLoader


  @Test
  public void shouldCompareAndSaveVariation() {
    Resource dir = new Directory("org/foo");

    PastMeasuresLoader pastMeasuresLoader = mock(PastMeasuresLoader.class);
    PastSnapshot pastSnapshot1 = new PastSnapshot("days", new Date()).setIndex(1);
    PastSnapshot pastSnapshot3 = new PastSnapshot("days", new Date()).setIndex(3);

    // first past analysis
    when(pastMeasuresLoader.getPastMeasures(dir, pastSnapshot1)).thenReturn(Arrays.asList(
      new Object[] {NCLOC_ID, null, null, null, 180.0},
      new Object[] {COVERAGE_ID, null, null, null, 75.0}));

    // second past analysis
    when(pastMeasuresLoader.getPastMeasures(dir, pastSnapshot3)).thenReturn(Arrays.<Object[]>asList(
      new Object[] {NCLOC_ID, null, null, null, 240.0}));

    // current analysis
    DecoratorContext context = mock(DecoratorContext.class);
    Measure currentNcloc = newMeasure(NCLOC, 200.0);
View Full Code Here


    when(ruleFinder.findByKey(rule1.ruleKey())).thenReturn(rule1);
    when(ruleFinder.findByKey(rule2.ruleKey())).thenReturn(rule2);

    Resource dir = new Directory("org/foo");

    PastMeasuresLoader pastMeasuresLoader = mock(PastMeasuresLoader.class);
    PastSnapshot pastSnapshot1 = new PastSnapshot("days", new Date()).setIndex(1);

    // first past analysis
    when(pastMeasuresLoader.getPastMeasures(dir, pastSnapshot1)).thenReturn(Arrays.asList(
      new Object[] {VIOLATIONS_ID, null, null, null, 180.0},// total
      new Object[] {VIOLATIONS_ID, null, null, rule1.getId(), 100.0},// rule 1
      new Object[] {VIOLATIONS_ID, null, null, rule2.getId(), 80.0})); // rule 2

    // current analysis
View Full Code Here

TOP

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

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.