Search in sources :

Example 1 with CommitSearchResult

use of org.eclipse.egit.ui.internal.search.CommitSearchResult in project egit by eclipse.

the class CommitSearchQueryTest method validateResult.

private void validateResult(RevCommit expectedCommit, Repository expectedRepository, ISearchResult result) {
    assertNotNull(result);
    assertTrue(result instanceof CommitSearchResult);
    CommitSearchResult commitResult = (CommitSearchResult) result;
    assertEquals(1, commitResult.getMatchCount());
    Object[] elements = commitResult.getElements();
    assertNotNull(elements);
    assertEquals(1, elements.length);
    assertTrue(elements[0] instanceof RepositoryCommit);
    RepositoryCommit repoCommit = (RepositoryCommit) elements[0];
    assertEquals(expectedRepository.getDirectory(), repoCommit.getRepository().getDirectory());
    assertEquals(expectedCommit, repoCommit.getRevCommit());
}
Also used : RepositoryCommit(org.eclipse.egit.ui.internal.commit.RepositoryCommit) CommitSearchResult(org.eclipse.egit.ui.internal.search.CommitSearchResult)

Example 2 with CommitSearchResult

use of org.eclipse.egit.ui.internal.search.CommitSearchResult in project egit by eclipse.

the class CommitSearchQueryTest method validateEmpty.

private void validateEmpty(ISearchResult result) {
    assertNotNull(result);
    assertTrue(result instanceof CommitSearchResult);
    CommitSearchResult commitResult = (CommitSearchResult) result;
    assertEquals(0, commitResult.getMatchCount());
    Object[] elements = commitResult.getElements();
    assertNotNull(elements);
    assertEquals(0, elements.length);
}
Also used : CommitSearchResult(org.eclipse.egit.ui.internal.search.CommitSearchResult)

Aggregations

CommitSearchResult (org.eclipse.egit.ui.internal.search.CommitSearchResult)2 RepositoryCommit (org.eclipse.egit.ui.internal.commit.RepositoryCommit)1