Package org.gitective.core

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


    CommitCountFilter count = new CommitCountFilter();
    CommitFinder finder = new CommitFinder(testRepo);
    finder.setFilter(count);
    finder.setFilter(PathFilterUtils.and("file0.txt"));
    finder.find();
    assertEquals(0, count.getCount());
    finder.setFilter(PathFilterUtils.and("file1.txt"));
    finder.find();
    assertEquals(1, count.getCount());
    count.reset();
View Full Code Here


    finder.setFilter(count);
    finder.setFilter(PathFilterUtils.and("file0.txt"));
    finder.find();
    assertEquals(0, count.getCount());
    finder.setFilter(PathFilterUtils.and("file1.txt"));
    finder.find();
    assertEquals(1, count.getCount());
    count.reset();
    finder.setFilter(PathFilterUtils.and("file2.txt"));
    finder.find();
    assertEquals(2, count.getCount());
View Full Code Here

    finder.setFilter(PathFilterUtils.and("file1.txt"));
    finder.find();
    assertEquals(1, count.getCount());
    count.reset();
    finder.setFilter(PathFilterUtils.and("file2.txt"));
    finder.find();
    assertEquals(2, count.getCount());
    count.reset();
    finder.setFilter(PathFilterUtils.and("file3.txt"));
    finder.find();
    assertEquals(3, count.getCount());
View Full Code Here

    finder.setFilter(PathFilterUtils.and("file2.txt"));
    finder.find();
    assertEquals(2, count.getCount());
    count.reset();
    finder.setFilter(PathFilterUtils.and("file3.txt"));
    finder.find();
    assertEquals(3, count.getCount());
  }

  /**
   * Test or path with null parameter
View Full Code Here

    add("file.txt", "abcd");

    CommitCountFilter count = new CommitCountFilter();
    CommitFinder service = new CommitFinder(testRepo);
    service.setFilter(new AndCommitFilter(new ParentCountFilter(1), count));
    service.find();
    assertEquals(1, count.getCount());
  }

  /**
   * Test non-match
View Full Code Here

    add("file.txt", "abc");

    CommitCountFilter count = new CommitCountFilter();
    CommitFinder service = new CommitFinder(testRepo);
    service.setFilter(new AndCommitFilter(new ParentCountFilter(), count));
    service.find();
    assertEquals(0, count.getCount());
  }

  /**
   * Test of {@link ParentCountFilter#clone()}
View Full Code Here

    CommitListFilter commits = new CommitListFilter();
    CommitFinder service = new CommitFinder(testRepo);
    ParentCountFilter parents = new ParentCountFilter(1);
    service.setFilter(new AndCommitFilter(parents, commits));
    service.find();
    assertEquals(commit2, commits.getCommits().get(0));

    RevFilter clone = parents.clone();
    assertNotNull(clone);
    assertNotSame(parents, clone);
View Full Code Here

        new CommitParentTreeFilter(PathFilterUtils.andSuffix(".java")),
        javaBugCommits);

    CommitFinder finder = new CommitFinder(testRepo);
    finder.setFilter(new AllCommitFilter(bugFilters, javaBugFilters));
    finder.find();
    assertEquals(2, javaBugCommits.getCommits().size());
    assertTrue(javaBugCommits.getCommits().contains(commit4));
    assertTrue(javaBugCommits.getCommits().contains(commit5));
    assertEquals(4, bugCommits.getCommits().size());
    assertTrue(bugCommits.getCommits().contains(commit2));
View Full Code Here

    RevCommit commit = add("bar.java", "b");
    LastCommitFilter matcher = new LastCommitFilter();
    CommitFinder finder = new CommitFinder(testRepo);
    finder.setFilter(PathFilterUtils.andSuffix(".java"));
    finder.setFilter(matcher);
    finder.find();
    assertEquals(commit, matcher.getLast());
  }

  /**
   * Test matching two suffixes
View Full Code Here

    add("file1.txt", "a");
    CommitFinder service = new CommitFinder(testRepo);
    CommitCountFilter count = new CommitCountFilter();
    CommitLimitFilter limit = new CommitLimitFilter(2);
    service.setFilter(new AndCommitFilter(limit, count));
    service.find();
    assertEquals(1, count.getCount());
    service.find();
    assertEquals(2, count.getCount());
    service.find();
    assertEquals(2, count.getCount());
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.