Package org.gitective.core.filter.tree

Examples of org.gitective.core.filter.tree.TypeCountFilter


   * @throws Exception
   */
  @Test
  public void zeroDirectories() throws Exception {
    add("f.txt", "content");
    TypeCountFilter filter = TypeCountFilter.tree();
    new CommitFinder(testRepo).setFilter(new CommitTreeFilter(filter))
        .find();
    assertEquals(0, filter.getCount());
  }
View Full Code Here


   */
  @Test
  public void oneDirectory() throws Exception {
    add(testRepo, Arrays.asList("a/b.txt", "a/c.txt"),
        Arrays.asList("f1", "f2"), "commit");
    TypeCountFilter filter = TypeCountFilter.tree();
    new CommitFinder(testRepo).setFilter(new CommitTreeFilter(filter))
        .find();
    assertEquals(1, filter.getCount());
  }
View Full Code Here

   */
  @Test
  public void twoDirectories() throws Exception {
    add(testRepo, Arrays.asList("a/b.txt", "c/d.txt"),
        Arrays.asList("f1", "f2"), "commit");
    TypeCountFilter filter = TypeCountFilter.tree();
    new CommitFinder(testRepo).setFilter(new CommitTreeFilter(filter))
        .find();
    assertEquals(2, filter.getCount());
  }
View Full Code Here

   */
  @Test
  public void nestedDirectories() throws Exception {
    add(testRepo, Arrays.asList("a/b.txt", "a/g/h.txt", "a/u/x.txt"),
        Arrays.asList("f1", "f2", "f3"), "commit");
    TypeCountFilter filter = TypeCountFilter.tree();
    new CommitFinder(testRepo).setFilter(new CommitTreeFilter(filter))
        .find();
    assertEquals(3, filter.getCount());
  }
View Full Code Here

   * @throws Exception
   */
  @Test
  public void resetFilter() throws Exception {
    add("a/b.txt", "content");
    TypeCountFilter filter = TypeCountFilter.tree();
    new CommitFinder(testRepo).setFilter(new CommitTreeFilter(filter))
        .find();
    assertEquals(1, filter.getCount());
    filter.reset();
    assertEquals(0, filter.getCount());
  }
View Full Code Here

   *
   * @throws Exception
   */
  @Test
  public void cloneFilter() throws Exception {
    TypeCountFilter filter = TypeCountFilter.tree();
    TreeFilter clone = filter.clone();
    assertNotNull(clone);
    assertNotSame(filter, clone);
    assertTrue(clone instanceof TypeCountFilter);
    assertEquals(filter.getType(), ((TypeCountFilter) clone).getType());
  }
View Full Code Here

   * @throws Exception
   */
  @Test
  public void oneFile() throws Exception {
    add("file.txt", "content");
    TypeCountFilter filter = TypeCountFilter.file();
    new CommitFinder(testRepo).setFilter(new CommitTreeFilter(filter))
        .find();
    assertEquals(1, filter.getCount());
  }
View Full Code Here

   */
  @Test
  public void twoFiles() throws Exception {
    add(testRepo, Arrays.asList("a.txt", "c/b.txt"),
        Arrays.asList("c1", "c2"), "message");
    TypeCountFilter filter = TypeCountFilter.file();
    new CommitFinder(testRepo).setFilter(new CommitTreeFilter(filter))
        .find();
    assertEquals(2, filter.getCount());
  }
View Full Code Here

   * @throws Exception
   */
  @Test
  public void resetFilter() throws Exception {
    add("f.txt", "content");
    TypeCountFilter filter = TypeCountFilter.file();
    new CommitFinder(testRepo).setFilter(new CommitTreeFilter(filter))
        .find();
    assertEquals(1, filter.getCount());
    filter.reset();
    assertEquals(0, filter.getCount());
  }
View Full Code Here

   *
   * @throws Exception
   */
  @Test
  public void cloneFilter() throws Exception {
    TypeCountFilter filter = TypeCountFilter.file();
    TreeFilter clone = filter.clone();
    assertNotNull(clone);
    assertNotSame(filter, clone);
    assertTrue(filter instanceof TypeCountFilter);
    assertEquals(filter.getType(), ((TypeCountFilter) clone).getType());
  }
View Full Code Here

TOP

Related Classes of org.gitective.core.filter.tree.TypeCountFilter

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.