use of com.intellij.history.integration.ui.models.FileHistoryDialogModel 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.FileHistoryDialogModel in project intellij-community by JetBrains.
the class FileHistoryDialogTest method testContentWhenOnlyOneRevisionSelected.
public void testContentWhenOnlyOneRevisionSelected() throws IOException {
VirtualFile f = createChildData(myRoot, "f.txt");
setBinaryContent(f, "old".getBytes());
setBinaryContent(f, "new".getBytes());
FileHistoryDialogModel m = createFileModelAndSelectRevisions(f, 0, 0);
assertDiffContents("old", "new", m);
}
use of com.intellij.history.integration.ui.models.FileHistoryDialogModel in project intellij-community by JetBrains.
the class FileHistoryDialogTest method testContent.
public void testContent() throws IOException {
VirtualFile f = createChildData(myRoot, "f.txt");
setBinaryContent(f, "old".getBytes());
setBinaryContent(f, "new".getBytes());
setBinaryContent(f, "current".getBytes());
FileHistoryDialogModel m = createFileModelAndSelectRevisions(f, 0, 1);
assertDiffContents("old", "new", m);
}
use of com.intellij.history.integration.ui.models.FileHistoryDialogModel in project intellij-community by JetBrains.
the class FileHistoryDialogTest method createFileModelAndSelectRevisions.
private FileHistoryDialogModel createFileModelAndSelectRevisions(VirtualFile f, int first, int second) {
FileHistoryDialogModel m = createFileModel(f);
m.selectRevisions(first, second);
return m;
}
use of com.intellij.history.integration.ui.models.FileHistoryDialogModel in project intellij-community by JetBrains.
the class FileHistoryDialogTest method testContentForCurrentRevision.
public void testContentForCurrentRevision() throws IOException {
VirtualFile f = createChildData(myRoot, "f.txt");
setBinaryContent(f, "old".getBytes());
setBinaryContent(f, "current".getBytes());
FileHistoryDialogModel m = createFileModelAndSelectRevisions(f, 0, 0);
assertDiffContents("old", "current", m);
assertTrue(getRightDiffContent(m) instanceof DocumentContent);
}
Aggregations