use of org.drools.core.rule.TypeMetaInfo in project drools by kiegroup.
the class JavaBeansEventRoleTest method testFullyQualifiedDeclarativeTypeName.
@Test
public void testFullyQualifiedDeclarativeTypeName() throws Exception {
String declaration = "package org.drools.compiler;\n" + "public class Bean {}";
String drl = "declare org.drools.compiler.Bean\n" + " @role(event)\n" + "end";
KieServices ks = KieServices.Factory.get();
KieFileSystem kfs = ks.newKieFileSystem().write("src/main/java/org/drools/compiler/Bean.java", declaration).write("src/main/resources/bean1.drl", drl);
final KieBuilder kieBuilder = ks.newKieBuilder(kfs);
final KieModule kieModule = kieBuilder.buildAll().getKieModule();
final KieModuleMetaData kieModuleMetaData = KieModuleMetaData.Factory.newKieModuleMetaData(kieModule);
final String packageName = "org.drools.compiler";
final String className = "Bean";
final Class clazz = kieModuleMetaData.getClass(packageName, className);
final TypeMetaInfo typeMetaInfo = kieModuleMetaData.getTypeMetaInfo(clazz);
assertTrue(typeMetaInfo.isEvent());
}
Aggregations