Package org.gitective.core.filter.commit

Examples of org.gitective.core.filter.commit.ShortestAuthorNameFilter


  /**
   * Verify state when no commits are visited
   */
  @Test
  public void noAuthorCommitsIncluded() {
    ShortestAuthorNameFilter filter = new ShortestAuthorNameFilter();
    assertEquals(-1, filter.getLength());
    assertNotNull(filter.getCommits());
    assertEquals(0, filter.getCommits().size());
  }
View Full Code Here


   *
   * @throws Exception
   */
  @Test
  public void singleShortestAuthorName() throws Exception {
    ShortestAuthorNameFilter filter = new ShortestAuthorNameFilter();
    author = new PersonIdent("abcd", "a@b.com");
    add("test.txt", "test1");
    author = new PersonIdent("abc", "a@b.com");
    add("test.txt", "test2");
    author = new PersonIdent("a", "a@b.com");
    RevCommit shortest = add("test.txt", "test3");
    author = new PersonIdent("ab", "a@b.com");
    add("test.txt", "test4");
    new CommitFinder(testRepo).setFilter(filter).find();
    assertEquals(1, filter.getLength());
    assertNotNull(filter.getCommits());
    assertEquals(1, filter.getCommits().size());
    assertEquals(shortest, filter.getCommits().iterator().next());
  }
View Full Code Here

   *
   * @throws Exception
   */
  @Test
  public void multipleShortestAuthorNames() throws Exception {
    ShortestAuthorNameFilter filter = new ShortestAuthorNameFilter();
    author = new PersonIdent("abcd", "a@b.com");
    add("test.txt", "test1");
    author = new PersonIdent("abc", "a@b.com");
    add("test.txt", "test2");
    author = new PersonIdent("ab", "a@b.com");
    RevCommit shortest1 = add("test.txt", "test3");
    author = new PersonIdent("aef", "a@b.com");
    add("test.txt", "test4");
    author = new PersonIdent("ag", "a@b.net");
    RevCommit shortest2 = add("test.txt", "test5");
    new CommitFinder(testRepo).setFilter(filter).find();
    assertEquals(2, filter.getLength());
    assertNotNull(filter.getCommits());
    assertEquals(2, filter.getCommits().size());
    assertTrue(filter.getCommits().contains(shortest1));
    assertTrue(filter.getCommits().contains(shortest2));
  }
View Full Code Here

TOP

Related Classes of org.gitective.core.filter.commit.ShortestAuthorNameFilter

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.