void () { myTestFixture.copyFileToProject("rename-in-include-ref.rnc"); final Project project = myTestFixture.getProject(); final RefactoringFactory factory = RefactoringFactory.getInstance(project); String fullPath = myTestFixture.getTempDirPath() + "/" + "rename-in-include-ref.rnc"; final VirtualFile copy = LocalFileSystem.getInstance().refreshAndFindFileByPath(fullPath.replace(File.separatorChar, '/')); assert copy != null : "file " + fullPath + " not found"; final PsiFile file = PsiManager.getInstance(project).findFile(copy); assertNotNull(file); myTestFixture.configureByFile("rename-in-include.rnc"); final RenameRefactoring refactoring = factory.createRename(file, "rename-after.rnc"); refactoring.setPreviewUsages(false); refactoring.setSearchInComments(false); refactoring.setSearchInNonJavaFiles(true); refactoring.run(); myTestFixture.checkResultByFile("rename-in-include_after.rnc"); assertEquals("rename-after.rnc", file.getName()); }