use of org.eclipse.egit.ui.internal.synchronize.model.GitModelWorkingTree in project egit by eclipse.
the class GitChangeSetSorterTest method workingTreeShouldBeLessThanCacheTree.
/*
* Tests for GitModelWorkingTree
*/
@Test
public void workingTreeShouldBeLessThanCacheTree() {
// given
Viewer viewer = mock(Viewer.class);
GitChangeSetSorter sorter = new GitChangeSetSorter();
GitModelCache cache = mock(GitModelCache.class);
GitModelWorkingTree workingTree = mock(GitModelWorkingTree.class);
// when
int actual = sorter.compare(viewer, workingTree, cache);
// then
assertTrue(actual < 0);
}
use of org.eclipse.egit.ui.internal.synchronize.model.GitModelWorkingTree in project egit by eclipse.
the class GitChangeSetSorterTest method blobShouldBeGreaterThanWorkingTree.
/*
* Tests for GitModelBlob
*/
@Test
public void blobShouldBeGreaterThanWorkingTree() {
// given
Viewer viewer = mock(Viewer.class);
GitChangeSetSorter sorter = new GitChangeSetSorter();
GitModelBlob blob = mock(GitModelBlob.class);
GitModelWorkingTree workingTree = mock(GitModelWorkingTree.class);
// when
int actual = sorter.compare(viewer, blob, workingTree);
// then
assertTrue(actual > 0);
}
use of org.eclipse.egit.ui.internal.synchronize.model.GitModelWorkingTree in project egit by eclipse.
the class GitChangeSetSorterTest method commitTreeShouldBeGreaterThanWorkingTree.
/*
* Tests for GitModelCommit
*/
@Test
public void commitTreeShouldBeGreaterThanWorkingTree() {
// given
Viewer viewer = mock(Viewer.class);
GitChangeSetSorter sorter = new GitChangeSetSorter();
GitModelCommit commit = mock(GitModelCommit.class);
GitModelWorkingTree workingTree = mock(GitModelWorkingTree.class);
// when
int actual = sorter.compare(viewer, commit, workingTree);
// then
assertTrue(actual > 0);
}
use of org.eclipse.egit.ui.internal.synchronize.model.GitModelWorkingTree 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);
}
use of org.eclipse.egit.ui.internal.synchronize.model.GitModelWorkingTree in project egit by eclipse.
the class GitChangeSetDropAdapterAssistant method validateDrop.
@Override
public IStatus validateDrop(Object target, int operationCode, TransferData transferType) {
TreeSelection selection = (TreeSelection) LocalSelectionTransfer.getTransfer().getSelection();
String operation = getOperationType(selection);
if (!UNSUPPORTED_OP.equals(operation)) {
if (target instanceof GitModelWorkingTree) {
if (UNSTAGE_OP.equals(operation))
return Status.OK_STATUS;
} else if (STAGE_OP.equals(operation) && target instanceof GitModelCache)
return Status.OK_STATUS;
}
return Status.CANCEL_STATUS;
}
Aggregations