VirtualFile (@NotNull String sourcePath, @NotNull String targetPath) { String testDataPath = getTestDataPath(); File fromFile = new File(testDataPath + "/" + sourcePath); if (myTempDirFixture instanceof LightTempDirTestFixtureImpl) { return myTempDirFixture.copyAll(fromFile.getPath(), targetPath); } File targetFile = new File(getTempDirPath() + "/" + targetPath); try { FileUtil.copyDir(fromFile, targetFile); } catch (IOException e) { throw new RuntimeException(e); } VirtualFile file = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(targetFile); assertNotNull(file); file.refresh(false, true); IdeaTestExecutionPolicy policy = IdeaTestExecutionPolicy.current(); if (policy != null) { PsiDirectory directory = ReadAction.compute(() -> PsiManager.getInstance(getProject()).findDirectory(file)); assertNotNull(directory); policy.testDirectoryConfigured(directory); } return file; }