void () { VirtualFile vf = createJar("a", "a/b"); VirtualFile jarRoot = JarFileSystem.getInstance().getJarRootForLocalFile(vf); assertNotNull(jarRoot); VirtualFile a = jarRoot.findChild("a"); assertNotNull(a); assertTrue(a.isValid()); assertTrue(jarRoot.isValid()); VirtualFile local = JarFileSystem.getInstance().getLocalByEntry(jarRoot); assertEquals(LocalFileSystem.getInstance(), local.getFileSystem()); JarFileSystemImpl.cleanupForNextTest(); // WTF, won't let delete jar otherwise MessageBusConnection connection = ApplicationManager.getApplication().getMessageBus().connect(getTestRootDisposable()); connection.subscribe(VirtualFileManager.VFS_CHANGES, new BulkFileListener() { @Override public void after(@NotNull List<? extends @NotNull VFileEvent> events) { // jars must be invalidated immediately after deleting the local root assertFalse(a.isValid()); assertFalse(jarRoot.isValid()); } }); VfsTestUtil.deleteFile(local); assertFalse(a.isValid()); assertFalse(jarRoot.isValid()); }