void (File jar, VirtualFile vFile, PsiFile file) { VirtualFile jarRoot; File libDir = new File(jar.getParent(), "lib"); assertTrue(libDir.mkdir()); VirtualFile vLibDir = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(libDir); assertNotNull(vLibDir); jarRoot = JarFileSystem.getInstance().getRootByLocal(vFile); assertNotNull(jarRoot); assertTrue(jarRoot.isValid()); PsiDirectory directory = getPsiManager().findDirectory(vLibDir); DataContext psiDataContext = SimpleDataContext.getSimpleContext(LangDataKeys.TARGET_PSI_ELEMENT, directory); new MoveHandler().invoke(myProject, new PsiElement[] {file}, psiDataContext); assertFalse(jarRoot.isValid()); jarRoot = JarFileSystem.getInstance().getRootByLocal(vFile); assertNotNull(jarRoot); assertTrue(jarRoot.isValid()); rename(directory, "lib2"); assertFalse(jarRoot.isValid()); }