use of com.intellij.history.integration.ui.models.NullRevisionsProgress in project intellij-community by JetBrains.
the class FileHistoryDialogTest method testTitles.
public void testTitles() throws IOException {
long leftTime = new Date(2001 - 1900, 1, 3, 12, 0).getTime();
long rightTime = new Date(2002 - 1900, 2, 4, 14, 0).getTime();
VirtualFile f = createChildData(myRoot, "old.txt");
setBinaryContent(f, "old".getBytes(), -1, leftTime, this);
rename(f, "new.txt");
setBinaryContent(f, "new".getBytes(), -1, rightTime, this);
byte[] content = new byte[0];
setBinaryContent(f, content);
FileHistoryDialogModel m = createFileModelAndSelectRevisions(f, 0, 2);
assertEquals(FileUtil.toSystemDependentName(f.getPath()), m.getDifferenceModel().getTitle());
assertEquals(DateFormatUtil.formatPrettyDateTime(leftTime) + " - old.txt", m.getDifferenceModel().getLeftTitle(new NullRevisionsProgress()));
assertEquals(DateFormatUtil.formatPrettyDateTime(rightTime) + " - new.txt", m.getDifferenceModel().getRightTitle(new NullRevisionsProgress()));
}
use of com.intellij.history.integration.ui.models.NullRevisionsProgress in project intellij-community by JetBrains.
the class SelectionHistoryDialogTest method testTitles.
public void testTitles() throws IOException {
rename(f, "ff.txt");
setBinaryContent(f, new byte[0]);
initModelOnSecondLineAndSelectRevisions(0, 1);
assertEquals(FileUtil.toSystemDependentName(f.getPath()), dm.getTitle());
assertTrue(dm.getLeftTitle(new NullRevisionsProgress()), dm.getLeftTitle(new NullRevisionsProgress()).endsWith(" - f.txt"));
assertTrue(dm.getRightTitle(new NullRevisionsProgress()), dm.getRightTitle(new NullRevisionsProgress()).endsWith(" - ff.txt"));
}
use of com.intellij.history.integration.ui.models.NullRevisionsProgress in project intellij-community by JetBrains.
the class SelectionHistoryDialogTest method testDiffContentsAndTitleForCurrentRevision.
public void testDiffContentsAndTitleForCurrentRevision() throws IOException {
initModelOnSecondLineAndSelectRevisions(0, 0);
assertEquals("Current", dm.getRightTitle(new NullRevisionsProgress()));
DiffContent right = dm.getRightDiffContent(new NullRevisionsProgress());
assertContent("bcd", right);
assertTrue(right instanceof DocumentFragmentContent);
}
use of com.intellij.history.integration.ui.models.NullRevisionsProgress in project intellij-community by JetBrains.
the class SelectionHistoryDialogTest method testDiffContents.
public void testDiffContents() throws IOException {
initModelOnSecondLineAndSelectRevisions(0, 1);
DiffContent left = dm.getLeftDiffContent(new NullRevisionsProgress());
DiffContent right = dm.getRightDiffContent(new NullRevisionsProgress());
assertContent("b", left);
assertContent("bc", right);
}
Aggregations