@Test
public void testExists() throws Exception {
KnowledgeBuilderImpl builder = new KnowledgeBuilderImpl();
// Make sure we can't accessa variable bound inside the not node
RuleImpl rule = createRule( new ExistsDescr(),
builder,
"update(stilton);" );
assertTrue( builder.hasErrors() );
builder = new KnowledgeBuilderImpl();
rule = createRule( new ExistsDescr(),
builder,
"" );
assertEquals( 0,
builder.getErrors().getErrors().length );
final GroupElement lhs = rule.getLhs();
assertLength( 1,
lhs.getChildren() );
final GroupElement exists = (GroupElement) lhs.getChildren().get( 0 );
assertLength( 1,