use of com.intellij.history.core.changes.DeleteChange 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());
}
Aggregations