/** * Add the referenced property set as system properties for the TestNG JVM. * * @param sysPropertySet A PropertySet of system properties. */ public void addConfiguredPropertySet(PropertySet sysPropertySet) { Properties properties = sysPropertySet.getProperties(); log(properties.keySet().size() + " properties found in nested propertyset", Project.MSG_VERBOSE); for (Object propKeyObj : properties.keySet()) { String propKey = (String) propKeyObj; Environment.Variable sysProp = new Environment.Variable(); sysProp.setKey(propKey); if (properties.get(propKey) instanceof String) { String propVal = (String) properties.get(propKey); sysProp.setValue(propVal); getJavaCommand().addSysproperty(sysProp); log("Added system property " + propKey + " with value " + propVal, Project.MSG_VERBOSE); } else { log("Ignoring non-String property " + propKey, Project.MSG_WARN); } } }
/** * Add the referenced property set as system properties for the TestNG JVM. * * @param sysPropertySet A PropertySet of system properties. */ public void addConfiguredPropertySet(PropertySet sysPropertySet) { Properties properties = sysPropertySet.getProperties(); log( properties.keySet().size() + " properties found in nested propertyset", Project.MSG_VERBOSE); for (Object propKeyObj : properties.keySet()) { String propKey = (String) propKeyObj; Environment.Variable sysProp = new Environment.Variable(); sysProp.setKey(propKey); if (properties.get(propKey) instanceof String) { String propVal = (String) properties.get(propKey); sysProp.setValue(propVal); getJavaCommand().addSysproperty(sysProp); log("Added system property " + propKey + " with value " + propVal, Project.MSG_VERBOSE); } else { log("Ignoring non-String property " + propKey, Project.MSG_WARN); } } }
Environment.Variable var = new Environment.Variable(); var.setKey("CVS_CLIENT_PORT"); var.setValue(String.valueOf(port)); env.addVariable(var); var.setValue(String.valueOf(port)); env.addVariable(var); Environment.Variable var = new Environment.Variable(); var.setKey("CVS_PASSFILE"); var.setValue(String.valueOf(passFile)); env.addVariable(var); log("Using cvs passfile: " + String.valueOf(passFile), Environment.Variable var = new Environment.Variable(); var.setKey("CVS_RSH"); var.setValue(String.valueOf(cvsRsh)); env.addVariable(var);
/** * {@inheritDoc} */ @Override public void setSystemProperty(String name, String value) { if (name != null && !name.isEmpty()) { Environment.Variable var = new Environment.Variable(); var.setKey(name); var.setValue(value != null ? value : ""); this.java.addSysproperty(var); } }
/** * <p>Convenience method to create an Ant environment variable that contains a * string from an URI. * <p><b>Note</b> that {@link java.net.URI#getPath()} will be used. * * @param key The key or name of the variable * @param value The URI to take the value from; {@link java.net.URI#getPath()} will be used * @return The created environment variable */ public final Environment.Variable createSysProperty(String key, URI value) { Environment.Variable var = new Environment.Variable(); var.setKey(key); var.setValue(value.getPath()); return var; }
/** * Convenience method to create an Ant environment variable that contains a string. * * @param key The key or name of the variable * @param value The value * @return The created environment variable */ public Environment.Variable createSysProperty(String key, String value) { Environment.Variable var = new Environment.Variable(); var.setKey(key); var.setValue(value); return var; }
/** * Convenience method to create an Ant environment variable that contains a * string. * * @param key The key or name of the variable * @param value The value * @return The created environment variable */ public final Environment.Variable createSysProperty(String key, String value) { Environment.Variable var = new Environment.Variable(); var.setKey(key); var.setValue(value); return var; }
void transferCoberturaDataFileProperty(Java task) { String coberturaProperty = coberturaPropertyValue(); if (coberturaProperty != null) { Variable sysproperty = new Variable(); sysproperty.setKey( COB_PROP_KEY); sysproperty.setValue(coberturaProperty); task.addSysproperty(sysproperty); } }
private List<Variable> getVariables(Properties props) { ArrayList<Variable> vars = new ArrayList<Variable>(); for (Entry<Object, Object> entry : props.entrySet()) { Variable var = new Variable(); var.setKey(entry.getKey().toString()); var.setValue(String.valueOf(entry.getValue())); vars.add(var); } return vars; }
public void setSystemProperty(final Java java, final String name, final String value) { assert java != null; assert name != null; assert value != null; Environment.Variable var = new Environment.Variable(); var.setKey(name); var.setValue(value); java.addSysproperty(var); }
/** * Create an Ant {@link Variable} configured with a simple value. * @param key variable name * @param value variable value * @return a configured {@link Variable} */ public static Environment.Variable createVariable(final String key, final String value) { Environment.Variable variable = new Environment.Variable(); variable.setKey(key); variable.setValue(value); return variable; }
protected void setSystemProperty(final Java java, final String name, final String value) { assert java != null; assert name != null; assert value != null; Environment.Variable var = new Environment.Variable(); var.setKey(name); var.setValue(value); java.addSysproperty(var); }
public void setSystemProperty(final Java java, final String name, final String value) { assert java != null; assert name != null; assert value != null; Environment.Variable var = new Environment.Variable(); var.setKey(name); var.setValue(value); java.addSysproperty(var); }
protected void setSystemProperty(final Java java, final String name, final String value) { assert java != null; assert name != null; assert value != null; Environment.Variable var = new Environment.Variable(); var.setKey(name); var.setValue(value); java.addSysproperty(var); }
public Variable getPathVariable() { if (paths.isEmpty()) return null; final Variable pathVariable = new Variable(); pathVariable.setKey("PATH"); pathVariable.setValue(StringUtils.join(paths.iterator(), File.pathSeparator)); return pathVariable; }
Variable variable = new Variable(); variable.setKey("PATH"); variable.setValue(PATH); task.addEnv(variable);
var.setValue(libdir.getAbsolutePath()); javaTask.addSysproperty(var);
private void delegateCommandSystemProperties() { // Iterate over command-line args and pass them through as sysproperty // exclude any built-in properties that start with "ant." for (Object propKey : getProject().getUserProperties().keySet()) { String propName = (String) propKey; String propVal = getProject().getUserProperty(propName); if (propName.startsWith("ant.")) { log("Excluding ant property: " + propName + ": " + propVal, Project.MSG_DEBUG); } else { log("Including user property: " + propName + ": " + propVal, Project.MSG_DEBUG); Environment.Variable var = new Environment.Variable(); var.setKey(propName); var.setValue(propVal); addSysproperty(var); } } }
private void delegateCommandSystemProperties() { // Iterate over command-line args and pass them through as sysproperty // exclude any built-in properties that start with "ant." for (Object propKey : getProject().getUserProperties().keySet()) { String propName = (String) propKey; String propVal = getProject().getUserProperty(propName); if (propName.startsWith("ant.")) { log("Excluding ant property: " + propName + ": " + propVal, Project.MSG_DEBUG); } else { log("Including user property: " + propName + ": " + propVal, Project.MSG_DEBUG); Environment.Variable var = new Environment.Variable(); var.setKey(propName); var.setValue(propVal); addSysproperty(var); } } }