6869707172737475767778
r.add(new Field("c", "ccc")); r.add(new Field("d", "ddd")); // Perform copy copy.apply(r, new VariableSpace()); assertEquals("ddd", r.get("a").getValue()); assertEquals("ddd", r.get("b").getValue()); assertEquals("ccc", r.get("c").getValue()); }
96979899100101102103104105106
r.add(new Field("d", "ddd")); Copy clone = copy.clone(); // Perform clone of copy clone.apply(r, new VariableSpace()); assertEquals("ddd", r.get("a").getValue()); assertEquals("ddd", r.get("b").getValue()); assertEquals("ccc", r.get("c").getValue());
128129130131132133134135136137138
VariableSpace scope = new VariableSpace(); scope.setVariable("e", "eee"); scope.setVariable("f", "fff"); // Perform copy copy.apply(r, scope); assertEquals("eee", r.get("a").getValue()); assertEquals("eee", r.get("b").getValue()); assertEquals("ccc", r.get("c").getValue()); }
160161162163164165166167168169170
scope.setVariable("e", "eee"); scope.setVariable("f", "fff"); scope.setVariable("g", "ggg"); // Perform copy copy.apply(r, scope); assertEquals("aaa", scope.getVariable("e")); assertEquals("aaa", scope.getVariable("f")); assertEquals("ggg", scope.getVariable("g")); }
193194195196197198199200201202203
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")); }
222223224225226227228229230231232
// Add variable scope VariableSpace scope = new VariableSpace(); // Perform copy copy.apply(r, scope); } catch (Exception ex) { fail("Method must not raise exception."); } }
249250251252253254255256257258259
// Add variable scope VariableSpace scope = new VariableSpace(); // Perform copy copy.apply(r, scope); } @Test public void testExcessSpaceInApplyTo() throws BlockError { Copy copy = new Copy();
270271272273274275276277278279280
// Add variable scope VariableSpace scope = new VariableSpace(); // Perform copy copy.apply(r, scope); assertEquals("ddd", r.get("a").getValue()); assertEquals("ddd", r.get("b").getValue()); assertEquals("ccc", r.get("c").getValue()); }