use of org.drools.compiler.lang.descr.EntryPointDeclarationDescr in project drools by kiegroup.
the class RuleParserTest method testEntryPointDeclaration.
@Test
public void testEntryPointDeclaration() throws Exception {
final String text = "package org.drools\n" + "declare entry-point eventStream\n" + " @source(\"jndi://queues/events\")\n" + " @foo( true )\n" + "end";
PackageDescr pkg = (PackageDescr) parse("compilationUnit", text);
assertEquals("org.drools", pkg.getName());
assertEquals(1, pkg.getEntryPointDeclarations().size());
EntryPointDeclarationDescr epd = pkg.getEntryPointDeclarations().iterator().next();
assertEquals("eventStream", epd.getEntryPointId());
assertEquals(2, epd.getAnnotations().size());
assertEquals("\"jndi://queues/events\"", epd.getAnnotation("source").getValue());
assertEquals("true", epd.getAnnotation("foo").getValue());
}
Aggregations