Package org.gitective.core.stat

Examples of org.gitective.core.stat.CommitHistogram


  /**
   * Test empty histogram
   */
  @Test
  public void emptyHistogram() {
    CommitHistogram histogram = new CommitHistogram();
    assertNull(histogram.getActivity(null));
    assertNotNull(histogram.getUserActivity());
    assertEquals(0, histogram.getUserActivity().length);
  }
View Full Code Here


    RevCommit commit = add("test.txt", "content");
    CommitFinder finder = new CommitFinder(testRepo);
    CommitHistogramFilter filter = new AuthorHistogramFilter();
    finder.setFilter(filter).find();

    CommitHistogram histogram = filter.getHistogram();
    assertNotNull(histogram);

    UserCommitActivity authorActivity = histogram.getActivity(author
        .getEmailAddress());
    assertNotNull(authorActivity);
    assertEquals(author.getName(), authorActivity.getName());
    assertEquals(author.getEmailAddress(), authorActivity.getEmail());
    assertEquals(authorActivity, histogram.getUserActivity()[0]);
    assertEquals(1, authorActivity.getCount());
    assertEquals(commit, authorActivity.getFirst());
    assertEquals(commit, authorActivity.getLast());
    assertEquals(commit.getAuthorIdent().getWhen().getTime(),
        authorActivity.getEarliest());
View Full Code Here

    RevCommit commit = add("test.txt", "content");
    CommitFinder finder = new CommitFinder(testRepo);
    CommitHistogramFilter filter = new CommitterHistogramFilter();
    finder.setFilter(filter).find();

    CommitHistogram histogram = filter.getHistogram();
    assertNotNull(histogram);

    UserCommitActivity committerActivity = histogram.getActivity(committer
        .getEmailAddress());
    assertNotNull(committerActivity);
    assertEquals(committer.getName(), committerActivity.getName());
    assertEquals(committer.getEmailAddress(), committerActivity.getEmail());
    assertEquals(committerActivity, histogram.getUserActivity()[0]);
    assertEquals(1, committerActivity.getCount());
    assertEquals(commit, committerActivity.getFirst());
    assertEquals(commit, committerActivity.getLast());
    assertEquals(commit.getAuthorIdent().getWhen().getTime(),
        committerActivity.getEarliest());
View Full Code Here

    RevCommit commit2 = add("test.txt", "content2");
    CommitFinder finder = new CommitFinder(testRepo);
    CommitHistogramFilter filter = new AuthorHistogramFilter();
    finder.setFilter(filter).find();

    CommitHistogram histogram = filter.getHistogram();
    assertNotNull(histogram);

    UserCommitActivity[] authors = histogram
        .getUserActivity(new LatestComparator());
    assertEquals(commit2, authors[0].getLast());
    assertEquals(commit, authors[1].getLast());
  }
View Full Code Here

    RevCommit commit2 = add("test.txt", "content2");
    CommitFinder finder = new CommitFinder(testRepo);
    CommitHistogramFilter filter = new AuthorHistogramFilter();
    finder.setFilter(filter).find();

    CommitHistogram histogram = filter.getHistogram();
    assertNotNull(histogram);

    UserCommitActivity[] authors = histogram
        .getUserActivity(new EarliestComparator());
    assertEquals(commit, authors[0].getLast());
    assertEquals(commit2, authors[1].getLast());
  }
View Full Code Here

    RevCommit commit2 = add("test.txt", "content2");
    CommitFinder finder = new CommitFinder(testRepo);
    CommitHistogramFilter filter = new AuthorHistogramFilter();
    finder.setFilter(filter).find();

    CommitHistogram histogram = filter.getHistogram();
    assertNotNull(histogram);

    UserCommitActivity[] authors = histogram
        .getUserActivity(new CommitCountComparator());
    assertEquals(commit, authors[0].getFirst());
    assertEquals(commit2, authors[1].getLast());
  }
View Full Code Here

   */
  @Test
  public void resetAuthorFilter() throws Exception {
    add("test.txt", "content");
    CommitHistogramFilter filter = new AuthorHistogramFilter();
    CommitHistogram histogram = filter.getHistogram();
    assertNotNull(histogram);
    new CommitFinder(testRepo).setFilter(filter).find();
    assertSame(histogram, filter.getHistogram());
    filter.reset();
    assertNotNull(filter.getHistogram());
View Full Code Here

TOP

Related Classes of org.gitective.core.stat.CommitHistogram

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.