Search in sources :

Example 1 with EntryPointDeclarationDescr

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());
}
Also used : EntryPointDeclarationDescr(org.drools.compiler.lang.descr.EntryPointDeclarationDescr) PackageDescr(org.drools.compiler.lang.descr.PackageDescr) Test(org.junit.Test)

Aggregations

EntryPointDeclarationDescr (org.drools.compiler.lang.descr.EntryPointDeclarationDescr)1 PackageDescr (org.drools.compiler.lang.descr.PackageDescr)1 Test (org.junit.Test)1