void () { final List<String> data = TestUtils.readInput(getTestDataPath() + getTestName(true) + ".test"); String text = data.get(0); myFixture.configureByText(GroovyFileType.GROOVY_FILE_TYPE, text); int selStart = myFixture.getEditor().getSelectionModel().getSelectionStart(); int selEnd = myFixture.getEditor().getSelectionModel().getSelectionEnd(); final GroovyFile file = (GroovyFile)myFixture.getFile(); final PsiElement start = file.findElementAt(selStart); final PsiElement end = file.findElementAt(selEnd - 1); final GrControlFlowOwner owner = PsiTreeUtil.getParentOfType(PsiTreeUtil.findCommonParent(start, end), GrControlFlowOwner.class, false); assert owner != null; GrStatement firstStatement = getStatement(start, owner); GrStatement lastStatement = getStatement(end, owner); final GrControlFlowOwner flowOwner = ControlFlowUtils.findControlFlowOwner(firstStatement); final GroovyControlFlow flow = ControlFlowBuilder.buildControlFlow(flowOwner, GrAllVarsInitializedPolicy.getInstance()); final FragmentVariableInfos fragmentVariableInfos = ReachingDefinitionsCollector.obtainVariableFlowInformation(firstStatement, lastStatement, flowOwner, flow); TestCase.assertEquals(data.get(1), dumpInfo(fragmentVariableInfos).trim()); }