void () { initProject("findInPath", "src"); VirtualFile directory = mySourceDirs[0].findFileByRelativePath("x"); VirtualFile file = directory.findChild("dd.properties"); assertNotNull(file); SearchScope scope = GlobalSearchScope.filesScope(myProject, Arrays.asList(directory)); Module module = ModuleManager.getInstance(myProject).getModules()[0]; String moduleName = module.getName(); String dirName = directory.getPresentableUrl(); FindModel model = new FindModel(); checkContext(model, myProject, null, null, true, null, null, false); model.setDirectoryName("initialDirectoryName"); model.setModuleName("initialModuleName"); model.setProjectScope(false); model.setCustomScopeName("initialScopeName"); checkContext(model, myProject, directory, module, false, dirName, moduleName, false); checkContext(model, myProject, directory, null, false, dirName, moduleName, false);//prev directory state checkContext(model, myProject, null, null, false, dirName, moduleName, false);//prev module and dir state model.setCustomScope(scope); model.setCustomScope(true); checkContext(model, myProject, null, null, false, dirName, moduleName, true);//prev module and dir state }