String vmParameters = buildVmParameters(module, RPackageName, selectedTestJavaArtifact, androidVariant);
RunManager runManager = RunManager.getInstance(project);
runManager.getConfigurationFactories();
JUnitConfigurationType junitConfigType = ConfigurationTypeUtil.findConfigurationType(JUnitConfigurationType.class);
List<RunConfiguration> configs = runManager.getConfigurationsList(junitConfigType);
for (RunConfiguration config : configs) {
if (isRelevantRunConfig(module, config)) {
JUnitConfiguration jconfig = (JUnitConfiguration) config;
jconfig.setVMParameters(vmParameters);
}
}
for (ConfigurationFactory factory : junitConfigType.getConfigurationFactories()) {
RunnerAndConfigurationSettings settings = runManager.getConfigurationTemplate(factory);
RunConfiguration config = settings.getConfiguration();
if (isRelevantRunConfig(module, config)) {
JUnitConfiguration jconfig = (JUnitConfiguration) config;
jconfig.setVMParameters(vmParameters);