public void testRuleWithQuery() throws Exception {
final PackageBuilder builder = new PackageBuilder();
final PackageDescr packageDescr = new PackageDescr( "p1" );
QueryDescr queryDescr = new QueryDescr( "query1" );
queryDescr.addParameter( "String",
"$name" );
queryDescr.addParameter( "int",
"$age" );
queryDescr.addParameter( "String",
"$likes" );
packageDescr.addRule( queryDescr );
AndDescr lhs = new AndDescr();
queryDescr.setLhs( lhs );
PatternDescr pattern = new PatternDescr( Person.class.getName() );
lhs.addDescr( pattern );
pattern.addConstraint( new ExprConstraintDescr("$name : name") );
pattern.addConstraint( new ExprConstraintDescr("$age : age") );
pattern.addConstraint( new ExprConstraintDescr("$likes : likes") );