final PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "errors_in_rule.drl" ) ) );
final Package pkg = builder.getPackage();
final DroolsError err = builder.getErrors().getErrors()[0];
final RuleError ruleErr = (RuleError) err;
assertNotNull( ruleErr.getDescr() );
assertTrue( ruleErr.getLine() != -1 );
final DroolsError errs[] = builder.getErrors().getErrors();
assertEquals( 3,
builder.getErrors().getErrors().length );
// check that its getting it from the ruleDescr
assertEquals( ruleErr.getLine(),
ruleErr.getDescr().getLine() );
// check the absolute error line number (there are more).
assertEquals( 11,
ruleErr.getLine() );
// now check the RHS, not being too specific yet, as long as it has the
// rules line number, not zero
final RuleError rhs = (RuleError) builder.getErrors().getErrors()[2];
assertTrue( rhs.getLine() > 7 ); // not being too specific - may need to
// change this when we rework the error
// reporting
}