Search in sources :

Example 1 with NullRevisionsProgress

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()));
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) NullRevisionsProgress(com.intellij.history.integration.ui.models.NullRevisionsProgress) EntireFileHistoryDialogModel(com.intellij.history.integration.ui.models.EntireFileHistoryDialogModel) FileHistoryDialogModel(com.intellij.history.integration.ui.models.FileHistoryDialogModel) Date(java.util.Date)

Example 2 with 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"));
}
Also used : NullRevisionsProgress(com.intellij.history.integration.ui.models.NullRevisionsProgress)

Example 3 with NullRevisionsProgress

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);
}
Also used : NullRevisionsProgress(com.intellij.history.integration.ui.models.NullRevisionsProgress) DiffContent(com.intellij.diff.contents.DiffContent) DocumentFragmentContent(com.intellij.diff.actions.DocumentFragmentContent)

Example 4 with NullRevisionsProgress

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);
}
Also used : NullRevisionsProgress(com.intellij.history.integration.ui.models.NullRevisionsProgress) DiffContent(com.intellij.diff.contents.DiffContent)

Aggregations

NullRevisionsProgress (com.intellij.history.integration.ui.models.NullRevisionsProgress)4 DiffContent (com.intellij.diff.contents.DiffContent)2 DocumentFragmentContent (com.intellij.diff.actions.DocumentFragmentContent)1 EntireFileHistoryDialogModel (com.intellij.history.integration.ui.models.EntireFileHistoryDialogModel)1 FileHistoryDialogModel (com.intellij.history.integration.ui.models.FileHistoryDialogModel)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 Date (java.util.Date)1