use of org.eclipse.egit.ui.internal.commit.CommitEditorInputFactory in project egit by eclipse.
the class CommitEditorInputFactoryTest method shouldPersistAndRestoreCommit.
@Test
public void shouldPersistAndRestoreCommit() {
RepositoryCommit repositoryCommit = new RepositoryCommit(repository, commit);
new CommitEditorInput(repositoryCommit).saveState(memento);
IAdaptable restored = new CommitEditorInputFactory().createElement(memento);
assertNotNull(restored);
assertThat(restored, instanceOf(CommitEditorInput.class));
assertThat(repositoryCommit, isSameCommit(((CommitEditorInput) restored).getCommit()));
}
use of org.eclipse.egit.ui.internal.commit.CommitEditorInputFactory in project egit by eclipse.
the class CommitEditorInputFactoryTest method shouldPersistAndRestoreStashCommit.
@Test
public void shouldPersistAndRestoreStashCommit() {
RepositoryCommit stashCommit = new RepositoryCommit(repository, commit);
stashCommit.setStash(true);
new CommitEditorInput(stashCommit).saveState(memento);
IAdaptable restored = new CommitEditorInputFactory().createElement(memento);
assertNotNull(restored);
assertThat(restored, instanceOf(CommitEditorInput.class));
assertThat(stashCommit, isSameCommit(((CommitEditorInput) restored).getCommit()));
}
Aggregations