final KnowledgeBuilderImpl builder1 = new KnowledgeBuilderImpl();
final PackageDescr packageDescr1 = new PackageDescr( "package1" );
createEvalRule( packageDescr1,
"1==1" );
builder1.addPackage( packageDescr1 );
final EvalCondition eval1 = (EvalCondition) ((RuleImpl)builder1.getPackage().getRules().iterator().next()).getLhs().getChildren().get( 0 );
final KnowledgeBuilderImpl builder2 = new KnowledgeBuilderImpl();
final PackageDescr packageDescr2 = new PackageDescr( "package2" );
createEvalRule( packageDescr2,
"1==1" );
builder2.addPackage( packageDescr2 );
final EvalCondition eval2 = (EvalCondition) ((RuleImpl)builder2.getPackage().getRules().iterator().next()).getLhs().getChildren().get( 0 );
final KnowledgeBuilderImpl builder3 = new KnowledgeBuilderImpl();
final PackageDescr packageDescr3 = new PackageDescr( "package3" );
createEvalRule( packageDescr3,
"1==3" );
builder3.addPackage( packageDescr3 );
final EvalCondition eval3 = (EvalCondition) ((RuleImpl)builder3.getPackage().getRules().iterator().next()).getLhs().getChildren().get( 0 );
assertEquals( eval1,
eval2 );
assertFalse( eval1.equals( eval3 ) );
assertFalse( eval2.equals( eval3 ) );