use of com.intellij.history.core.tree.Entry in project intellij-community by JetBrains.
the class StreamTest method testEmptyDirectoryEntry.
@Test
public void testEmptyDirectoryEntry() throws IOException {
Entry e = new DirectoryEntry("name");
StreamUtil.writeEntry(os, e);
Entry result = StreamUtil.readEntry(is);
assertEquals(DirectoryEntry.class, result.getClass());
assertEquals("name", result.getName());
}
use of com.intellij.history.core.tree.Entry in project intellij-community by JetBrains.
the class FileListeningTest method testDeletionDoesNotVersionIgnoredFilesRecursively.
public void testDeletionDoesNotVersionIgnoredFilesRecursively() throws Exception {
String dir1 = createDirectoryExternally("dir");
createFileExternally("dir/f.txt");
createFileExternally("dir/f.class");
createFileExternally("dir/subdir/f.txt");
createDirectoryExternally("dir/subdir/subdir2");
createFileExternally("dir/subdir/subdir2/f.txt");
LocalFileSystem.getInstance().refresh(false);
addExcludedDir(myRoot.getPath() + "/dir/subdir");
addContentRoot(myRoot.getPath() + "/dir/subdir/subdir2");
final VirtualFile vDir1 = LocalFileSystem.getInstance().findFileByPath(dir1);
assertNotNull(dir1, vDir1);
delete(vDir1);
List<Change> changes = getVcs().getChangeListInTests().getChangesInTests().get(0).getChanges();
assertEquals(1, changes.size());
Entry e = ((DeleteChange) changes.get(0)).getDeletedEntry();
final List<Entry> children = e.getChildren();
sortEntries(children);
assertEquals(2, children.size());
assertEquals("f.txt", children.get(0).getName());
assertEquals("subdir", children.get(1).getName());
assertEquals(1, children.get(1).getChildren().size());
assertEquals("subdir2", children.get(1).getChildren().get(0).getName());
}
use of com.intellij.history.core.tree.Entry in project intellij-community by JetBrains.
the class DirectoryChangeModelTest method testCanNotShowFileDifferenceForDirectories.
public void testCanNotShowFileDifferenceForDirectories() {
Entry left = new DirectoryEntry("left");
Entry right = new DirectoryEntry("right");
Difference d = new Difference(false, left, right);
assertFalse(createModelOn(d).canShowFileDifference());
}
use of com.intellij.history.core.tree.Entry in project intellij-community by JetBrains.
the class RevisionsAndDiffsTest method testRevisionsForFileCreatedWithSameNameAsDeletedOne.
public void testRevisionsForFileCreatedWithSameNameAsDeletedOne() throws IOException {
VirtualFile f = createFile("file.txt", "old");
loadContent(f);
delete(f);
f = createFile("file.txt", "new");
loadContent(f);
List<Revision> rr = getRevisionsFor(f);
assertEquals(4, rr.size());
Entry e = rr.get(0).findEntry();
assertEquals("file.txt", e.getName());
assertContent("new", e);
assertNull(rr.get(1).findEntry());
e = rr.get(2).findEntry();
assertEquals("file.txt", e.getName());
assertContent("old", e);
assertNull(rr.get(3).findEntry());
}
use of com.intellij.history.core.tree.Entry in project intellij-community by JetBrains.
the class RevisionsAndDiffsTest method testRevisionsForFileCreatedInPlaceOfRenamedOne.
public void testRevisionsForFileCreatedInPlaceOfRenamedOne() throws IOException {
VirtualFile f = createFile("file1.txt", "content1");
loadContent(f);
rename(f, "file2.txt");
VirtualFile ff = createFile("file1.txt", "content2");
loadContent(ff);
List<Revision> rr = getRevisionsFor(ff);
assertEquals(2, rr.size());
Entry e = rr.get(0).findEntry();
assertEquals("file1.txt", e.getName());
assertContent("content2", e);
rr = getRevisionsFor(f);
assertEquals(3, rr.size());
e = rr.get(0).findEntry();
assertEquals("file2.txt", e.getName());
assertContent("content1", e);
e = rr.get(1).findEntry();
assertEquals("file1.txt", e.getName());
assertContent("content1", e);
}
Aggregations