assertEquals("Q", r.get("x"));
}
public void testVariablesInScope() {
Scenario sc = new Scenario();
sc.globals.add(new FactData("X", "x", new ArrayList(), false));
sc.fixtures.add(new FactData("Q", "q", new ArrayList(), true));
sc.fixtures.add(new FactData("Z", "z", new ArrayList(), false));
ExecutionTrace ex1 = new ExecutionTrace();
sc.fixtures.add(ex1);
sc.fixtures.add(new RetractFact("z"));
sc.fixtures.add(new FactData("Y", "y", new ArrayList(), false));
ExecutionTrace ex2 = new ExecutionTrace();
sc.fixtures.add(ex2);
List l = sc.getFactNamesInScope(ex1, true);
assertEquals(3, l.size());
assertEquals("q", l.get(0));
assertEquals("z", l.get(1));
assertEquals("x", l.get(2));
l = sc.getFactNamesInScope(ex1, false);
assertEquals(2, l.size());
assertFalse(l.contains(sc.globals.get(0)));
l = sc.getFactNamesInScope(ex2, true);
assertEquals(3, l.size());
assertEquals("q", l.get(0));
assertEquals("y", l.get(1));
assertEquals("x", l.get(2));
l= sc.getFactNamesInScope(null, true);
assertEquals(0, l.size());
}