RunProfile (Location<PsiMethod>[] testMethods, Module module, ConfigurationContext context, String configurationName) { RunnerAndConfigurationSettings settings = cloneTemplateConfiguration(context); JavaTestConfigurationBase configuration = (JavaTestConfigurationBase)settings.getConfiguration(); configuration.setModule(module); if (module == null) { configuration.setSearchScope(TestSearchScope.WHOLE_PROJECT); } else { configuration.setSearchScope(TestSearchScope.MODULE_WITH_DEPENDENCIES); } configuration.setShortenCommandLine(ShortenCommandLine.MANIFEST); return new MyRunProfile(testMethods, module, configuration, configurationName); }