assertEquals("ggg", scope.getVariable("g"));
}
@Test
public void testCopyVariableToVariable() throws BlockError {
Copy copy = new Copy();
List<String> applyTo = new ArrayList<String>(3);
applyTo.add("$e");
applyTo.add("$f");
copy.setApplyTo(applyTo);
copy.setFrom("$h");
// Prepare record
RecordImpl r = new RecordImpl();
r.add(new Field("a", "aaa"));
r.add(new Field("b", "bbb"));
r.add(new Field("c", "ccc"));
r.add(new Field("d", "ddd"));
// Add variable scope
VariableSpace scope = new VariableSpace();
scope.setVariable("e", "eee");
scope.setVariable("f", "fff");
scope.setVariable("g", "ggg");
scope.setVariable("h", "hhh");
// Perform copy
copy.apply(r, scope);
assertEquals("hhh", scope.getVariable("e"));
assertEquals("hhh", scope.getVariable("f"));
assertEquals("ggg", scope.getVariable("g"));
}