void (String query) { FindModel findModel = new FindModel(); findModel.setStringToFind(query); findModel.setWholeWordsOnly(true); findModel.setFromCursor(false); findModel.setGlobal(true); findModel.setMultipleFiles(true); findModel.setProjectScope(true); findModel.setDirectoryName(mySourceDirs[0].getPath()); findModel.setWithSubdirectories(true); List<UsageInfo> usages = findInProject(findModel); assertEquals(2, usages.size()); if (!(usages.get(0).getFile() instanceof PsiJavaFile)) { Collections.swap(usages, 0, 1); } PsiElement refElement = getParentFromUsage(usages.get(0)); assertTrue(refElement instanceof PsiLiteralExpression); assertEquals("xx.yy", ((PsiLiteralExpression)refElement).getValue()); VirtualFile file = mySourceDirs[0].findFileByRelativePath("x/dd.properties"); assertNotNull(file); PropertiesFile propertiesFile = (PropertiesFile)PsiManager.getInstance(myProject).findFile(file); assertNotNull(propertiesFile); refElement = getParentFromUsage(usages.get(1)); assertTrue(refElement instanceof IProperty); assertSame(propertiesFile.findPropertyByKey("xx.yy"), refElement); }