Package org.gitective.core.filter.commit

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


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


   *
   * @throws Exception
   */
  @Test
  public void singleLongestMessage() throws Exception {
    ShortestMessageFilter filter = new ShortestMessageFilter();
    RevCommit shortest = add("test.txt", "test1", "a");
    add("test.txt", "test2", "ab");
    add("test.txt", "test3", "abcd");
    add("test.txt", "test4", "abc");
    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 multipleLongestMessages() throws Exception {
    ShortestMessageFilter filter = new ShortestMessageFilter();
    add("test.txt", "test1", "abc");
    add("test.txt", "test2", "ab");
    RevCommit shortest1 = add("test.txt", "test3", "a");
    add("test.txt", "test4", "abcde");
    RevCommit shortest2 = add("test.txt", "test5", "b");
    new CommitFinder(testRepo).setFilter(filter).find();
    assertEquals(1, 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.ShortestMessageFilter

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.