Search in sources :

Example 16 with DrlDumper

use of org.drools.compiler.lang.DrlDumper in project drools by kiegroup.

the class DescrBuilderTest method testDumperPositional.

@Test
public void testDumperPositional() {
    PackageDescr pkg = DescrFactory.newPackage().name("org.test").newRule().name("org.test").lhs().pattern().type("Integer").constraint("this > 10", true).constraint("this > 11", true).constraint("this > 12", false).constraint("this > 13", false).end().end().rhs("").end().end().getDescr();
    String drl = new DrlDumper().dump(pkg);
    assertTrue(drl.contains("Integer( this > 10, this > 11; this > 12, this > 13 )"));
}
Also used : PackageDescr(org.drools.compiler.lang.descr.PackageDescr) DrlDumper(org.drools.compiler.lang.DrlDumper) Test(org.junit.Test)

Aggregations

DrlDumper (org.drools.compiler.lang.DrlDumper)16 PackageDescr (org.drools.compiler.lang.descr.PackageDescr)14 Test (org.junit.Test)14 InputStreamReader (java.io.InputStreamReader)5 KieSession (org.kie.api.runtime.KieSession)5 DrlParser (org.drools.compiler.compiler.DrlParser)4 InternalKnowledgeBase (org.drools.core.impl.InternalKnowledgeBase)4 XmlPackageReader (org.drools.compiler.compiler.xml.XmlPackageReader)3 KiePackage (org.kie.api.definition.KiePackage)3 ArrayList (java.util.ArrayList)2 LinkedList (java.util.LinkedList)2 List (java.util.List)2 Cheese (org.drools.compiler.Cheese)2 ByteArrayResource (org.drools.core.io.impl.ByteArrayResource)2 KieBase (org.kie.api.KieBase)2 EntryPoint (org.kie.api.runtime.rule.EntryPoint)2 StringReader (java.io.StringReader)1 StockTick (org.drools.compiler.StockTick)1 KnowledgeBuilderImpl (org.drools.compiler.builder.impl.KnowledgeBuilderImpl)1 DroolsError (org.drools.compiler.compiler.DroolsError)1