verify( ael,
times( 7 ) ).afterMatchFired(captor.capture());
List<AfterMatchFiredEvent> values = captor.getAllValues();
// first rule
Match act = values.get( 0 ).getMatch();
assertThat( act.getRule().getName(),
is( "launch" ) );
if ( phreak == RuleEngineOption.PHREAK ) {
// first rule
act = values.get( 1 ).getMatch();
assertThat( act.getRule().getName(),
is( "ba" ) );
assertThat( ((Number) act.getDeclarationValue( "$a" )).intValue(),
is( 2 ) );
assertThat( ((Number) act.getDeclarationValue( "$b" )).intValue(),
is( 1 ) );
// second rule
act = values.get( 2 ).getMatch();
assertThat( act.getRule().getName(),
is( "ba" ) );
assertThat( ((Number) act.getDeclarationValue( "$a" )).intValue(),
is( 3 ) );
assertThat( ((Number) act.getDeclarationValue( "$b" )).intValue(),
is( 1 ) );
// third rule
act = values.get( 3 ).getMatch();
assertThat( act.getRule().getName(),
is( "ba" ) );
assertThat( ((Number) act.getDeclarationValue( "$a" )).intValue(),
is( 3 ) );
assertThat( ((Number) act.getDeclarationValue( "$b" )).intValue(),
is( 2 ) );
// fourth rule
act = values.get( 4 ).getMatch();
assertThat( act.getRule().getName(),
is( "ab" ) );
assertThat( ((Number) act.getDeclarationValue( "$a" )).intValue(),
is( 2 ) );
assertThat( ((Number) act.getDeclarationValue( "$b" )).intValue(),
is( 1 ) );
// fifth rule
act = values.get( 5 ).getMatch();
assertThat( act.getRule().getName(),
is( "ab" ) );
assertThat( ((Number) act.getDeclarationValue( "$a" )).intValue(),
is( 3 ) );
assertThat( ((Number) act.getDeclarationValue( "$b" )).intValue(),
is( 1 ) );
// sixth rule
act = values.get( 6 ).getMatch();
assertThat( act.getRule().getName(),
is( "ab" ) );
assertThat( ((Number) act.getDeclarationValue( "$a" )).intValue(),
is( 3 ) );
assertThat( ((Number) act.getDeclarationValue( "$b" )).intValue(),
is( 2 ) );
} else {
// second rule
act = values.get( 1 ).getMatch();
assertThat( act.getRule().getName(),
is( "ba" ) );
assertThat( ((Number) act.getDeclarationValue( "$a" )).intValue(),
is( 3 ) );
assertThat( ((Number) act.getDeclarationValue( "$b" )).intValue(),
is( 2 ) );
// third rule
act = values.get( 2 ).getMatch();
assertThat( act.getRule().getName(),
is( "ab" ) );
assertThat( ((Number) act.getDeclarationValue( "$a" )).intValue(),
is( 3 ) );
assertThat( ((Number) act.getDeclarationValue( "$b" )).intValue(),
is( 2 ) );
// fourth rule
act = values.get( 3 ).getMatch();
assertThat( act.getRule().getName(),
is( "ba" ) );
assertThat( ((Number) act.getDeclarationValue( "$a" )).intValue(),
is( 3 ) );
assertThat( ((Number) act.getDeclarationValue( "$b" )).intValue(),
is( 1 ) );
// fifth rule
act = values.get( 4 ).getMatch();
assertThat( act.getRule().getName(),
is( "ab" ) );
assertThat( ((Number) act.getDeclarationValue( "$a" )).intValue(),
is( 3 ) );
assertThat( ((Number) act.getDeclarationValue( "$b" )).intValue(),
is( 1 ) );
// sixth rule
act = values.get( 5 ).getMatch();
assertThat( act.getRule().getName(),
is( "ba" ) );
assertThat( ((Number) act.getDeclarationValue( "$a" )).intValue(),
is( 2 ) );
assertThat( ((Number) act.getDeclarationValue( "$b" )).intValue(),
is( 1 ) );
// seventh rule
act = values.get( 6 ).getMatch();
assertThat( act.getRule().getName(),
is( "ab" ) );
assertThat( ((Number) act.getDeclarationValue( "$a" )).intValue(),
is( 2 ) );
assertThat( ((Number) act.getDeclarationValue( "$b" )).intValue(),
is( 1 ) );
}
}