void () { PersistentFS pfs = PersistentFS.getInstance(); VirtualFile root0 = VirtualFileManager.getInstance().findFileByUrl("temp:///"); NewVirtualFileSystem tempFS = (NewVirtualFileSystem)root0.getFileSystem(); NewVirtualFile root1 = pfs.findRoot("/root1", tempFS); NewVirtualFile root2 = pfs.findRoot("/root2", tempFS); NewVirtualFile root3 = pfs.findRoot("/root3", tempFS); for (VirtualFile root : pfs.getRoots()) { System.out.println(root); } VirtualFile root0TestFile = VfsTestUtil.createFile(root0, "/test-file"); VirtualFile root1TestFile = VfsTestUtil.createFile(root1, "/test-file"); VirtualFile root2TestFile = VfsTestUtil.createFile(root2, "/test-file"); VirtualFile root3TestFile = VfsTestUtil.createFile(root3, "/test-file"); //reconnect: ((PersistentFSImpl)pfs).disconnect(); //FIXME in a short window while PFS is disconnected async services could come and get 'already disposed' // exception, which fails the test in its .tearDown() ((PersistentFSImpl)pfs).connect(); assertEquals("No roots must be loaded yet", pfs.getRoots().length, 0); NewVirtualFile root1_2 = pfs.findRoot("/root1", tempFS); assertArrayEquals("root1 must be loaded since explicitly queried", pfs.getRoots(), new VirtualFile[]{root1_2}); assertNotNull( "/root1/test-file must be successfully found (root1 was explicitly loaded)", pfs.findFileById(((VirtualFileWithId)root1TestFile).getId()) ); assertNotNull( "temp:///test-file must be successfully found (root0 must be auto-loaded)", pfs.findFileById(((VirtualFileWithId)root0TestFile).getId()) ); assertNotNull( "/root2/test-file must be successfully found (root2 must be auto-loaded)", pfs.findFileById(((VirtualFileWithId)root2TestFile).getId()) ); assertNotNull( "/root3/test-file must be successfully found (root3 must be auto-loaded)", pfs.findFileById(((VirtualFileWithId)root3TestFile).getId()) ); }