public void testGlobal() throws Exception {
final DRLParser parser = parseResource( "globals.drl" );
parser.compilation_unit();
final PackageDescr pack = parser.getPackageDescr();
assertEquals( 1,
pack.getRules().size() );
final RuleDescr rule = (RuleDescr) pack.getRules().get( 0 );
assertEquals( 1,
rule.getLhs().getDescrs().size() );
assertEquals( 1,
pack.getImports().size() );
assertEquals( 2,
pack.getGlobals().size() );
final GlobalDescr foo = (GlobalDescr) pack.getGlobals().get( 0 );
assertEquals( "java.lang.String",
foo.getType() );
assertEquals( "foo",
foo.getIdentifier() );
final GlobalDescr bar = (GlobalDescr) pack.getGlobals().get( 1 );
assertEquals( "java.lang.Integer",
bar.getType() );
assertEquals( "bar",
bar.getIdentifier() );