public void testStatementOrdering1() throws Exception {
parseResource( "statement_ordering_1.drl" );
this.parser.compilation_unit();
final PackageDescr pkg = this.parser.getPackageDescr();
assertEquals( 2,
pkg.getRules().size() );
assertEquals( "foo",
((RuleDescr) pkg.getRules().get( 0 )).getName() );
assertEquals( "bar",
((RuleDescr) pkg.getRules().get( 1 )).getName() );
assertEquals( 2,
pkg.getFunctions().size() );
assertEquals( "cheeseIt",
((FunctionDescr) pkg.getFunctions().get( 0 )).getName() );
assertEquals( "uncheeseIt",
((FunctionDescr) pkg.getFunctions().get( 1 )).getName() );
assertEquals( 4,
pkg.getImports().size() );
assertEquals( "im.one",
((ImportDescr) pkg.getImports().get( 0 )).getTarget() );
assertEquals( "im.two",
((ImportDescr) pkg.getImports().get( 1 )).getTarget() );
assertEquals( "im.three",
((ImportDescr) pkg.getImports().get( 2 )).getTarget() );
assertEquals( "im.four",
((ImportDescr) pkg.getImports().get( 3 )).getTarget() );
assertFalse( this.parser.hasErrors() );
}