{
ValueReplacer replacer = new ValueReplacer(variables);
assertTrue(
variables.getUserDefinedVariables().containsKey("server"));
assertTrue(replacer.variables.containsKey("server"));
TestElement element = new TestPlan();
element.setProperty(
new StringProperty("domain", "jakarta.apache.org"));
List args = new ArrayList();
args.add("username is jack");
args.add("jacks_password");
element.setProperty(new CollectionProperty("args", args));
replacer.reverseReplace(element);
assertEquals("${server}", element.getPropertyAsString("domain"));
args = (List) element.getProperty("args").getObjectValue();
assertEquals(
"${password}",
((JMeterProperty) args.get(1)).getStringValue());
}