use of org.kie.pmml.models.drools.tree.evaluator.implementations.HasKnowledgeBuilderMock in project drools by kiegroup.
the class PMMLTreeModelEvaluatorTest method setUp.
@BeforeClass
public static void setUp() throws Exception {
evaluator = new PMMLTreeModelEvaluator();
final PMML pmml = TestUtils.loadFromFile(SOURCE_1);
assertNotNull(pmml);
assertEquals(1, pmml.getModels().size());
assertTrue(pmml.getModels().get(0) instanceof TreeModel);
KnowledgeBuilderImpl knowledgeBuilder = new KnowledgeBuilderImpl();
final CommonCompilationDTO<TreeModel> compilationDTO = CommonCompilationDTO.fromGeneratedPackageNameAndFields(PACKAGE_NAME, pmml, (TreeModel) pmml.getModels().get(0), new HasKnowledgeBuilderMock(knowledgeBuilder));
kiePMMLModel = provider.getKiePMMLModel(compilationDTO);
kieBase = new KieHelper().addContent(knowledgeBuilder.getPackageDescrs(kiePMMLModel.getKModulePackageName()).get(0)).setReleaseId(RELEASE_ID).build(ExecutableModelProject.class);
assertNotNull(kieBase);
}
Aggregations