Search in sources :

Example 11 with GitModelTree

use of org.eclipse.egit.ui.internal.synchronize.model.GitModelTree in project egit by eclipse.

the class GitChangeSetSorterTest method treeShouldBeLessThanBlob.

@Test
public void treeShouldBeLessThanBlob() {
    // given
    Viewer viewer = mock(Viewer.class);
    GitChangeSetSorter sorter = new GitChangeSetSorter();
    GitModelTree tree = mock(GitModelTree.class);
    GitModelBlob blob = mock(GitModelBlob.class);
    // when
    int actual = sorter.compare(viewer, tree, blob);
    // then
    assertTrue(actual < 0);
}
Also used : GitModelTree(org.eclipse.egit.ui.internal.synchronize.model.GitModelTree) CommonViewer(org.eclipse.ui.navigator.CommonViewer) Viewer(org.eclipse.jface.viewers.Viewer) GitModelBlob(org.eclipse.egit.ui.internal.synchronize.model.GitModelBlob) Test(org.junit.Test)

Example 12 with GitModelTree

use of org.eclipse.egit.ui.internal.synchronize.model.GitModelTree in project egit by eclipse.

the class GitChangeSetSorterTest method treeShouldBeGreaterThanWorkingTree.

/*
	 * Tests for GitModelTree
	 */
@Test
public void treeShouldBeGreaterThanWorkingTree() {
    // given
    Viewer viewer = mock(Viewer.class);
    GitChangeSetSorter sorter = new GitChangeSetSorter();
    GitModelTree tree = mock(GitModelTree.class);
    GitModelWorkingTree workingTree = mock(GitModelWorkingTree.class);
    // when
    int actual = sorter.compare(viewer, tree, workingTree);
    // then
    assertTrue(actual > 0);
}
Also used : GitModelTree(org.eclipse.egit.ui.internal.synchronize.model.GitModelTree) CommonViewer(org.eclipse.ui.navigator.CommonViewer) Viewer(org.eclipse.jface.viewers.Viewer) GitModelWorkingTree(org.eclipse.egit.ui.internal.synchronize.model.GitModelWorkingTree) Test(org.junit.Test)

Aggregations

GitModelTree (org.eclipse.egit.ui.internal.synchronize.model.GitModelTree)12 CommonViewer (org.eclipse.ui.navigator.CommonViewer)9 Test (org.junit.Test)9 Viewer (org.eclipse.jface.viewers.Viewer)8 GitModelBlob (org.eclipse.egit.ui.internal.synchronize.model.GitModelBlob)5 GitModelCache (org.eclipse.egit.ui.internal.synchronize.model.GitModelCache)3 GitModelWorkingTree (org.eclipse.egit.ui.internal.synchronize.model.GitModelWorkingTree)3 IResource (org.eclipse.core.resources.IResource)2 GitModelCommit (org.eclipse.egit.ui.internal.synchronize.model.GitModelCommit)2 GitModelObject (org.eclipse.egit.ui.internal.synchronize.model.GitModelObject)2 File (java.io.File)1 ResourceMapping (org.eclipse.core.resources.mapping.ResourceMapping)1 ResourceTraversal (org.eclipse.core.resources.mapping.ResourceTraversal)1 Commit (org.eclipse.egit.core.synchronize.GitCommitsModelCache.Commit)1 GitHistoryPage (org.eclipse.egit.ui.internal.history.GitHistoryPage)1 RepositoryTreeNode (org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode)1 GitModelWorkbenchAdapter (org.eclipse.egit.ui.internal.synchronize.mapping.GitModelWorkbenchAdapter)1 ILabelProvider (org.eclipse.jface.viewers.ILabelProvider)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 Repository (org.eclipse.jgit.lib.Repository)1