assertEquals( "org.drools.compiler.test.Bean", bean.getName() );
assertEquals( "Bean", bean.getSimpleName() );
assertEquals( "org.drools.compiler.test", bean.getPackageName() );
assertEquals( 3, bean.getClassAnnotations().size() );
Annotation ann = bean.getClassAnnotations().get( 0 );
if (!ann.getName().equals("org.drools.compiler.compiler.TypeDeclarationTest$KlassAnnotation")) {
ann = bean.getClassAnnotations().get( 1 );
}
if (!ann.getName().equals("org.drools.compiler.compiler.TypeDeclarationTest$KlassAnnotation")) {
ann = bean.getClassAnnotations().get( 2 );
}
assertEquals( "org.drools.compiler.compiler.TypeDeclarationTest$KlassAnnotation", ann.getName() );
assertEquals( "klass", ann.getPropertyValue( "value" ) );
assertEquals( String.class, ann.getPropertyType( "value" ) );
assertEquals( 2, bean.getMetaData().size() );
assertEquals( "event", bean.getMetaData().get( "role" ) );
FactField field = bean.getField( "name" );
assertNotNull( field );
assertEquals( 2, field.getFieldAnnotations().size() );
Annotation fnn = field.getFieldAnnotations().get( 0 );
if (!fnn.getName().equals("org.drools.compiler.compiler.TypeDeclarationTest$FieldAnnotation")) {
fnn = field.getFieldAnnotations().get( 1 );
}
assertEquals( "org.drools.compiler.compiler.TypeDeclarationTest$FieldAnnotation", fnn.getName() );
assertEquals( "fld", fnn.getPropertyValue( "prop" ) );
assertEquals( String.class, fnn.getPropertyType( "prop" ) );
assertEquals( 1, field.getMetaData().size() );
assertTrue( field.getMetaData().containsKey( "key" ) );
}