void () { File sub = tempDir.newDirectory("sub"); File file = tempDir.newFile("file.txt"); VirtualFile topDir = myFS.refreshAndFindFileByIoFile(tempDir.getRoot()); assertNotNull(topDir); VirtualFile sourceFile = myFS.refreshAndFindFileByIoFile(file); assertNotNull(sourceFile); VirtualFile parentDir = myFS.refreshAndFindFileByIoFile(sub); assertNotNull(parentDir); assertEquals(2, topDir.getChildren().length); try { sourceFile.copy(this, parentDir, "."); fail("Copying a file into a '.' path should have failed"); } catch (IOException ignored) { } topDir.refresh(false, true); assertTrue(topDir.exists()); assertEquals(2, topDir.getChildren().length); }