Package org.gitective.core

Examples of org.gitective.core.CommitFinder.find()


  public void mostImpacting() throws Exception {
    RevCommit commit1 = add("test1.txt", "content2");
    CommitFileImpactFilter filter = new CommitFileImpactFilter(1);
    assertEquals(1, filter.getLimit());
    CommitFinder finder = new CommitFinder(testRepo).setFilter(filter);
    finder.find();
    assertEquals(1, filter.getCommits().size());
    assertEquals(commit1, filter.getCommits().first().getCommit());
    assertEquals(1, filter.getCommits().first().getAdd());
    filter.reset();
    assertTrue(filter.getCommits().isEmpty());
View Full Code Here


    RevCommit commit2 = add(testRepo,
        Arrays.asList("test2.txt", "test3.txt"),
        Arrays.asList("content2", "content3"), "second commit");
    add("test1.txt", "new content");
    delete("test3.txt");
    finder.find();
    assertEquals(1, filter.getCommits().size());
    assertEquals(commit2, filter.getCommits().first().getCommit());
    assertEquals(2, filter.getCommits().first().getAdd());
  }
}
View Full Code Here

    RevCommit commit2 = add("file.txt", "c");
    CommitterFilter filter = new CommitterFilter(findUser);
    CommitListFilter commits = new CommitListFilter();
    CommitFinder service = new CommitFinder(testRepo);
    service.setFilter(new AndCommitFilter(filter, commits));
    service.find();
    assertEquals(2, commits.getCommits().size());
    assertEquals(commit2, commits.getCommits().get(0));
    assertEquals(commit1, commits.getCommits().get(1));
  }
View Full Code Here

    CommitterFilter filter = new CommitterFilter("not the committer",
        "not@committer.org");
    CommitListFilter commits = new CommitListFilter();
    CommitFinder service = new CommitFinder(testRepo);
    service.setFilter(new AndCommitFilter(filter, commits));
    service.find();
    assertEquals(0, commits.getCommits().size());
  }

  /**
   * Test of {@link CommitterSetFilter}
View Full Code Here

    RevCommit commit2 = add("file.txt", "c");
    AuthorFilter filter = new AuthorFilter(findUser);
    CommitListFilter commits = new CommitListFilter();
    CommitFinder service = new CommitFinder(testRepo);
    service.setFilter(new AndCommitFilter(filter, commits));
    service.find();
    assertEquals(2, commits.getCommits().size());
    assertEquals(commit2, commits.getCommits().get(0));
    assertEquals(commit1, commits.getCommits().get(1));
  }
View Full Code Here

    AuthorFilter filter = new AuthorFilter("not the author",
        "not@author.org");
    CommitListFilter commits = new CommitListFilter();
    CommitFinder service = new CommitFinder(testRepo);
    service.setFilter(new AndCommitFilter(filter, commits));
    service.find();
    assertEquals(0, commits.getCommits().size());
  }

  /**
   * Test of {@link AuthorSetFilter}
View Full Code Here

    AuthorSetFilter filter = new AuthorSetFilter();
    assertTrue(filter.getPersons().isEmpty());
    assertFalse(filter.getPersons().contains(findUser));
    CommitFinder service = new CommitFinder(testRepo);
    service.setFilter(filter);
    service.find();
    assertEquals(2, filter.getPersons().size());
    assertTrue(filter.getPersons().contains(findUser));
  }

  /**
 
View Full Code Here

    RevCommit commit3 = add("file.txt", "c");
    AuthorFilter filter = new AuthorFilter("franklin", null);
    CommitListFilter commits = new CommitListFilter();
    CommitFinder service = new CommitFinder(testRepo);
    service.setFilter(new AndCommitFilter().add(filter, commits));
    service.find();
    assertEquals(2, commits.getCommits().size());
    assertTrue(commits.getCommits().contains(commit2));
    assertTrue(commits.getCommits().contains(commit3));
  }
View Full Code Here

    RevCommit commit3 = add("file.txt", "c");
    AuthorFilter filter = new AuthorFilter(null, "test@test.com");
    CommitListFilter commits = new CommitListFilter();
    CommitFinder service = new CommitFinder(testRepo);
    service.setFilter(new AndCommitFilter().add(filter, commits));
    service.find();
    assertEquals(2, commits.getCommits().size());
    assertTrue(commits.getCommits().contains(commit2));
    assertTrue(commits.getCommits().contains(commit3));
  }
View Full Code Here

    AuthorSetFilter filter = new AuthorSetFilter();
    assertTrue(filter.getPersons().isEmpty());
    assertFalse(filter.getPersons().contains(author));
    CommitFinder service = new CommitFinder(testRepo);
    service.setFilter(filter);
    service.find();
    assertEquals(1, filter.getPersons().size());
    assertTrue(filter.getPersons().contains(author));
    filter.reset();
    assertTrue(filter.getPersons().isEmpty());
    assertFalse(filter.getPersons().contains(author));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.