final RunManagerEx runManager = (RunManagerEx) RunManager.getInstance(project);
runManager.setTemporaryConfiguration(settings);
}
private RunnerAndConfigurationSettings createConfiguration(Project project, Module module, PsiJavaFile testClassFile) {
RuntimeConfigurationProducer producer = new TestClassConfigurationProducer();
ConfigurationFactory configurationFactory = producer.getConfigurationType().getConfigurationFactories()[0];
RunnerAndConfigurationSettings settings = RunManager.getInstance(project).createRunConfiguration("", configurationFactory);
final JUnitConfiguration configuration = (JUnitConfiguration)settings.getConfiguration();
configuration.setModule(module);
PsiClass testClass = JUnitUtil.getTestClass(testClassFile);
configuration.beClassConfiguration(testClass);