*/
public class OtherwiseTest {
@Test
public void testOneRuleFiringNoOtherwise() throws Exception {
final RuleBase ruleBase = RuleBaseFactory.newRuleBase( RuleBase.RETEOO );
final Package pkg = new Package( "Miss Manners" );
pkg.setClassFieldAccessorCache( new ClassFieldAccessorCache( Thread.currentThread().getContextClassLoader() ) );
final Rule rule1 = getRule( "rule1" );
pkg.addRule( rule1 );
final Rule ruleOtherwise = getOtherwise( "rule2" );
pkg.addRule( ruleOtherwise );
ruleBase.addPackage( pkg );
final WorkingMemory workingMemory = ruleBase.newStatefulSession();
workingMemory.insert( new TestBean() );
workingMemory.fireAllRules();
assertTrue( ((MockConsequence) rule1.getConsequence()).fired );
assertFalse( ((MockConsequence) ruleOtherwise.getConsequence()).fired );