Package org.gitective.core

Examples of org.gitective.core.CommitFinder


  public void addEditDelete() throws Exception {
    add("test.txt", "content");
    add("test.txt", "content2");
    delete("test.txt");
    DiffFileCountFilter filter = new DiffFileCountFilter();
    new CommitFinder(testRepo).setFilter(filter).find();
    assertEquals(1, filter.getAdded());
    assertEquals(1, filter.getEdited());
    assertEquals(1, filter.getDeleted());
    assertEquals(0, filter.getRenamed());
    assertEquals(0, filter.getCopied());
View Full Code Here


  @Test
  public void singleEditFindBetween() throws Exception {
    RevCommit commit1 = add("test.txt", "content");
    RevCommit commit2 = add("test.txt", "content2");
    DiffFileCountFilter filter = new DiffFileCountFilter();
    new CommitFinder(testRepo).setFilter(filter).findBetween(commit2,
        commit1);
    assertEquals(0, filter.getAdded());
    assertEquals(1, filter.getEdited());
    assertEquals(0, filter.getDeleted());
    assertEquals(0, filter.getRenamed());
View Full Code Here

   * @throws Exception
   */
  @Test
  public void singleAuthorCommit() throws Exception {
    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
View Full Code Here

   * @throws Exception
   */
  @Test
  public void singleCommitterCommit() throws Exception {
    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
View Full Code Here

  public void sortLatestFirst() throws Exception {
    RevCommit commit = add("test.txt", "content");
    author = new PersonIdent("abcd", "a@b.d", new Date(
        System.currentTimeMillis() + 5000), TimeZone.getDefault());
    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
View Full Code Here

  public void sortEarliestFirst() throws Exception {
    RevCommit commit = add("test.txt", "content");
    author = new PersonIdent("abcd", "a@b.d", new Date(
        System.currentTimeMillis() + 5000), TimeZone.getDefault());
    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
View Full Code Here

        System.currentTimeMillis() + 5000));
    add("a", "b.txt");
    author = new PersonIdent("abcd", "a@b.d", new Date(
        System.currentTimeMillis() + 5000), TimeZone.getDefault());
    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
View Full Code Here

  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());
    assertSame(histogram, filter.getHistogram());
  }
View Full Code Here

  public void resetFileFilter() throws Exception {
    add("test.txt", "content");
    FileHistogramFilter filter = new FileHistogramFilter();
    FileHistogram histogram = filter.getHistogram();
    assertNotNull(histogram);
    new CommitFinder(testRepo).setFilter(filter).find();
    assertSame(histogram, filter.getHistogram());
    filter.reset();
    assertNotNull(filter.getHistogram());
    assertNotSame(histogram, filter.getHistogram());
  }
View Full Code Here

   */
  @Test
  public void singleCommitFileActivity() throws Exception {
    add("file.txt", "abcd");
    FileHistogramFilter filter = new FileHistogramFilter();
    CommitFinder finder = new CommitFinder(testRepo);
    finder.setFilter(filter).find();

    FileHistogram histogram = filter.getHistogram();
    assertNotNull(histogram);
    assertNull(histogram.getActivity(null));
    FileCommitActivity activity = histogram.getActivity("file.txt");
View Full Code Here

TOP

Related Classes of org.gitective.core.CommitFinder

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.