final List<TypeDeclarationDescr> declarations = pkg.getTypeDeclarations();
assertEquals( 2,
declarations.size() );
TypeDeclarationDescr descr = declarations.get( 0 );
assertEquals( "CallEvent",
descr.getTypeName() );
assertEquals( 4,
descr.getAnnotationNames().size() );
assertEquals( "event",
descr.getAnnotation( "role" ).getValue() );
assertEquals( "org.drools.events.Call",
descr.getAnnotation( "class" ).getValue() );
assertEquals( "duration",
descr.getAnnotation( "duration" ).getValue() );
assertEquals( "timestamp",
descr.getAnnotation( "timestamp" ).getValue() );
assertNull( descr.getAnnotation( "FOO" ) );
descr = declarations.get( 1 );
assertEquals( "some.pkg.Type",
descr.getTypeName() );
assertEquals( 5,
descr.getAnnotationNames().size() );
assertNotNull( descr.getAnnotation( "name1" ) );
assertEquals( "\"value\"",
descr.getAnnotation( "name2" ).getValue() );
assertEquals( "10",
descr.getAnnotation( "name3" ).getValue( "k1" ) );
assertEquals( "\"a\"",
descr.getAnnotation( "name4" ).getValue( "k1" ) );
assertEquals( "Math.max( 10 + 25, 22 ) % 2 + someVariable",
descr.getAnnotation( "name4" ).getValue( "formula" ) );
assertEquals( "{ a, b, c }",
descr.getAnnotation( "name4" ).getValue( "array" ) );
assertEquals( "backward compatible value",
descr.getAnnotation( "name5" ).getValue() );
}