void () { final Project project = myProjectFixture.getProject(); final PsiClass psiClass = findTestClass(project); final TestNGInClassConfigurationProducer producer = new TestNGInClassConfigurationProducer(); final MapDataContext dataContext = new MapDataContext(); dataContext.put(CommonDataKeys.PROJECT, project); dataContext.put(PlatformCoreDataKeys.MODULE, ModuleUtilCore.findModuleForPsiElement(psiClass)); dataContext.put(Location.DATA_KEY, PsiLocation.fromPsiElement(psiClass)); final ConfigurationFromContext fromContext = producer.createConfigurationFromContext(ConfigurationContext.getFromContext(dataContext, ActionPlaces.UNKNOWN)); assert fromContext != null; final RunnerAndConfigurationSettings config = fromContext.getConfigurationSettings(); final RunConfiguration runConfiguration = config.getConfiguration(); Assert.assertTrue(runConfiguration instanceof TestNGConfiguration); TestNGConfigurationType t = (TestNGConfigurationType)runConfiguration.getType(); Assert.assertTrue(t.isConfigurationByLocation(runConfiguration, new PsiLocation(project, psiClass))); }