IDEA-101546 Maven surefire environment variables

This commit is contained in:
Sergey Evdokimov
2013-02-21 14:26:36 +04:00
parent b181622876
commit 62e5d89e92
2 changed files with 19 additions and 0 deletions
@@ -17,6 +17,7 @@
package com.intellij.execution.configurations;
import com.intellij.execution.configuration.EnvironmentVariablesComponent;
import gnu.trove.THashMap;
import java.io.File;
import java.util.HashMap;
@@ -48,6 +49,14 @@ public class SimpleProgramParameters {
return myEnv;
}
public String addEnv(String name, String value) {
if (myEnv == null) {
myEnv = new THashMap<String, String>();
}
return myEnv.put(name, value);
}
public void setEnv(final Map<String, String> env) {
myEnv = env;
}
@@ -67,5 +67,15 @@ public class MavenJUnitPatcher extends JUnitPatcher {
javaParameters.getVMParametersList().addProperty(propertyName, value);
}
}
Element environmentVariables = config.getChild("environmentVariables");
if (environmentVariables != null) {
for (Element element : (List<Element>)environmentVariables.getChildren()) {
String variableName = element.getName();
String value = element.getValue();
javaParameters.addEnv(variableName, value);
}
}
}
}