final Package pkg = new Package( "org.drools" );
final RuleDescr ruleDescr = (RuleDescr) pkgDescr.getRules().get( 0 );
final RuleBuilder builder = new RuleBuilder();
final PackageBuilder pkgBuilder = new PackageBuilder( pkg );
final PackageBuilderConfiguration conf = pkgBuilder.getPackageBuilderConfiguration();
DialectCompiletimeRegistry dialectRegistry = pkgBuilder.getPackageRegistry( pkg.getName() ).getDialectCompiletimeRegistry();
Dialect dialect = dialectRegistry.getDialect( "mvel" );
RuleBuildContext context = new RuleBuildContext( pkgBuilder,
ruleDescr,
dialectRegistry,
pkg,
dialect );
builder.build( context );
assertTrue( context.getErrors().toString(),
context.getErrors().isEmpty() );
final Rule rule = context.getRule();