use of org.eclipse.egit.ui.internal.synchronize.model.GitModelCommit in project egit by eclipse.
the class GitChangeSetSorterTest method cacheTreeShouldBeLessThanCommit.
@Test
public void cacheTreeShouldBeLessThanCommit() {
// given
Viewer viewer = mock(Viewer.class);
GitChangeSetSorter sorter = new GitChangeSetSorter();
GitModelCache cache = mock(GitModelCache.class);
GitModelCommit commit = mock(GitModelCommit.class);
// when
int actual = sorter.compare(viewer, cache, commit);
// then
assertTrue(actual < 0);
}
use of org.eclipse.egit.ui.internal.synchronize.model.GitModelCommit in project egit by eclipse.
the class GitChangeSetSorterTest method treeShouldBeGreaterThanCommit.
@Test
public void treeShouldBeGreaterThanCommit() {
// given
Viewer viewer = mock(Viewer.class);
GitChangeSetSorter sorter = new GitChangeSetSorter();
GitModelTree tree = mock(GitModelTree.class);
GitModelCommit commit = mock(GitModelCommit.class);
// when
int actual = sorter.compare(viewer, tree, commit);
// then
assertTrue(actual > 0);
}
use of org.eclipse.egit.ui.internal.synchronize.model.GitModelCommit in project egit by eclipse.
the class GitChangeSetSorterTest method blobShouldBeGreaterThanCommit.
@Test
public void blobShouldBeGreaterThanCommit() {
// given
Viewer viewer = mock(Viewer.class);
GitChangeSetSorter sorter = new GitChangeSetSorter();
GitModelBlob blob = mock(GitModelBlob.class);
GitModelCommit commit = mock(GitModelCommit.class);
// when
int actual = sorter.compare(viewer, blob, commit);
// then
assertTrue(actual > 0);
}
use of org.eclipse.egit.ui.internal.synchronize.model.GitModelCommit 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.GitModelCommit in project egit by eclipse.
the class GitChangeSetLabelProvider method createChangeSetLabel.
private String createChangeSetLabel(GitModelCommit commitModel) {
String format = store.getString(UIPreferences.SYNC_VIEW_CHANGESET_LABEL_FORMAT);
Commit commit = commitModel.getCachedCommitObj();
Map<String, String> bindings = new HashMap<>();
bindings.put(BINDING_CHANGESET_DATE, dateFormatter.formatDate(commit.getCommitDate()));
bindings.put(BINDING_CHANGESET_AUTHOR, commit.getAuthorName());
bindings.put(BINDING_CHANGESET_COMMITTER, commit.getCommitterName());
bindings.put(BINDING_CHANGESET_SHORT_MESSAGE, commit.getShortMessage());
return formatName(format, bindings);
}
Aggregations