Search in sources :

Example 1 with PackageDescrVisitor

use of org.drools.verifier.visitor.PackageDescrVisitor in project drools by kiegroup.

the class TestBaseOld method getTestData.

@SuppressWarnings("unchecked")
public Collection<? extends Object> getTestData(InputStream stream, VerifierData data) throws Exception {
    Reader drlReader = new InputStreamReader(stream);
    PackageDescr descr = new DrlParser(LanguageLevelOption.DRL5).parse(drlReader);
    PackageDescrVisitor packageDescrVisitor = new PackageDescrVisitor(data, Collections.EMPTY_LIST);
    packageDescrVisitor.visitPackageDescr(descr);
    // Rules with relations
    return data.getAll();
}
Also used : InputStreamReader(java.io.InputStreamReader) Reader(java.io.Reader) InputStreamReader(java.io.InputStreamReader) DrlParser(org.drools.compiler.compiler.DrlParser) PackageDescr(org.drools.compiler.lang.descr.PackageDescr) PackageDescrVisitor(org.drools.verifier.visitor.PackageDescrVisitor)

Example 2 with PackageDescrVisitor

use of org.drools.verifier.visitor.PackageDescrVisitor in project drools by kiegroup.

the class TestBase method setUp.

@Before
public void setUp() throws Exception {
    verifierData = VerifierReportFactory.newVerifierData();
    packageDescrVisitor = new PackageDescrVisitor(verifierData, Collections.<JarInputStream>emptyList());
}
Also used : JarInputStream(java.util.jar.JarInputStream) PackageDescrVisitor(org.drools.verifier.visitor.PackageDescrVisitor) Before(org.junit.Before)

Example 3 with PackageDescrVisitor

use of org.drools.verifier.visitor.PackageDescrVisitor in project drools by kiegroup.

the class VerifierImpl method addPackageDescr.

/*
     * (non-Javadoc)
     * 
     * @seeorg.drools.verifier.Verifier#addPackageDescr(org.kie.lang.descr.
     * PackageDescr)
     */
public void addPackageDescr(PackageDescr descr) {
    try {
        PackageDescrVisitor ruleFlattener = new PackageDescrVisitor(result.getVerifierData(), jars);
        ruleFlattener.visitPackageDescr(descr);
    } catch (Throwable t) {
        t.printStackTrace();
    }
}
Also used : PackageDescrVisitor(org.drools.verifier.visitor.PackageDescrVisitor)

Aggregations

PackageDescrVisitor (org.drools.verifier.visitor.PackageDescrVisitor)3 InputStreamReader (java.io.InputStreamReader)1 Reader (java.io.Reader)1 JarInputStream (java.util.jar.JarInputStream)1 DrlParser (org.drools.compiler.compiler.DrlParser)1 PackageDescr (org.drools.compiler.lang.descr.PackageDescr)1 Before (org.junit.Before)1