}
@Test
public void testExecutionTrace() {
Scenario sc = new Scenario();
sc.getGlobals().add( new FactData( "A",
"A",
new ArrayList(),
false ) );
sc.getFixtures().add( new FactData( "B",
"B",
new ArrayList(),
true ) );
sc.getFixtures().add( new FactData( "C",
"C",
new ArrayList(),
true ) );
ExecutionTrace ex1 = new ExecutionTrace();
sc.getFixtures().add( ex1 );
sc.getFixtures().add( new VerifyFact() );
sc.getFixtures().add( new RetractFact() );
sc.getFixtures().add( new FactData( "D",
"D",
new ArrayList(),
false ) );
sc.getFixtures().add( new FactData( "E",
"E",
new ArrayList(),
false ) );
ExecutionTrace ex2 = new ExecutionTrace();
sc.getFixtures().add( ex2 );
sc.getFixtures().add( new VerifyFact() );
sc.getFixtures().add( new FactData( "F",
"F",
new ArrayList(),
false ) );
ExecutionTrace ex3 = new ExecutionTrace();
sc.getFixtures().add( ex3 );
assertEquals( 11,
sc.getFixtures().size() );
sc.removeExecutionTrace( ex2 );
assertEquals( 6,
sc.getFixtures().size() );
assertTrue( sc.isFactNameReserved( "A" ) );
assertTrue( sc.isFactNameReserved( "B" ) );
assertTrue( sc.isFactNameReserved( "C" ) );
assertFalse( sc.isFactNameReserved( "D" ) );
assertFalse( sc.isFactNameReserved( "E" ) );
assertTrue( sc.isFactNameReserved( "F" ) );
}