void () { String path = PathManagerEx.getTestDataPath() + BASE_PATH + "/" + getTestName(true); VirtualFile root = LocalFileSystem.getInstance().findFileByIoFile(new File(path)); assert root != null : path; loadAllModulesUnder(root); configureByExistingFile(root.findFileByRelativePath("src/ppp/SomeClass.java")); PsiField field = ((PsiJavaFile)myFile).getClasses()[0].findFieldByName("f", false); assert field != null; PsiClass aClass = ((PsiClassType)field.getType()).resolve(); assert aClass != null; assertEquals("ppp.BadClass", aClass.getQualifiedName()); //lies in source VirtualFile vFile1 = myFile.getVirtualFile(); VirtualFile vFile2 = aClass.getContainingFile().getVirtualFile(); assert vFile1 != null; assert vFile2 != null; assertEquals(vFile1.getParent(), vFile2.getParent()); }