Package org.drools.eclipse.core

Examples of org.drools.eclipse.core.RuleSet


    @Test
    public void testNodeBuild() {
        RuleContentOutlinePage page = new RuleContentOutlinePage( null );
        String source = "package test;\nexpander foobar.dsl\nimport foo\nfunction void smeg(s) {\n \n}\n";
        page.populatePackageTreeNode( source );
        RuleSet ruleSet = page.getRuleSet();
        Package p = ruleSet.getPackage("test");
        assertNotNull(p);
        DroolsElement[] nodes = p.getChildren();

        for ( int i = 0; i < nodes.length; i++ ) {
            if ( nodes[i] instanceof Function ) {
                Function func = (Function) nodes[i];
                assertEquals( "smeg()",
                              func.getFunctionName() );

            }
        }

        source = "package test;\n function String foo(String bar) {";
        page.populatePackageTreeNode( source );
        p = ruleSet.getPackage("test");
        assertNotNull(p);
        Function func = (Function) p.getChildren()[0];
        assertEquals( "foo()",
                      func.getFunctionName() );
View Full Code Here

TOP

Related Classes of org.drools.eclipse.core.RuleSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.