final PackageBuilder builder = new PackageBuilder();
RuleDescr ruleDescr;
AndDescr lhs;
PatternDescr patternDescr;
FieldConstraintDescr literalDescr;
final PackageDescr packageDescr = createBasicPackageWithOneRule(1,1);
ruleDescr = new RuleDescr( "rule-1" );
ruleDescr.setLocation( 42,
43 );
packageDescr.addRule( ruleDescr );
lhs = new AndDescr();
ruleDescr.setLhs( lhs );
patternDescr = new PatternDescr( Cheese.class.getName(),
"stilton" );
literalDescr = new FieldConstraintDescr( "type" );
literalDescr.addRestriction( new LiteralRestrictionDescr( "!=",
null ) );
patternDescr.addConstraint( literalDescr );
ruleDescr.setConsequence( "" );
ruleDescr = new RuleDescr( "rule-2" );
ruleDescr.setLocation( 42,
43 );
packageDescr.addRule( ruleDescr );
lhs = new AndDescr();
ruleDescr.setLhs( lhs );
patternDescr = new PatternDescr( Cheese.class.getName(),
"stilton" );
literalDescr = new FieldConstraintDescr( "type" );
literalDescr.addRestriction( new LiteralRestrictionDescr( "!=",
null ) );
patternDescr.addConstraint( literalDescr );
ruleDescr.setConsequence( "" );