use of org.kie.pmml.evaluator.assembler.factories.PMMLRuleMapperFactory.KIE_PMML_RULE_MAPPER_CLASS_NAME in project drools by kiegroup.
the class PMMLCompilerServiceTest method addPMMLRuleMappersHasSourceMap.
@Test
public void addPMMLRuleMappersHasSourceMap() {
KiePMMLTestingModelWithSources kiePmmlModel = new KiePMMLTestingModelWithSources("TEST", "kmodulePackageName", new HashMap<>());
assertTrue(kiePmmlModel.getSourcesMap().isEmpty());
final List<String> generatedRuleMappers = IntStream.range(0, 3).mapToObj(i -> "apackage" + i + "." + KIE_PMML_RULE_MAPPER_CLASS_NAME).collect(Collectors.toList());
PMMLCompilerService.addPMMLRuleMappers(kiePmmlModel, generatedRuleMappers, "source_path");
assertFalse(kiePmmlModel.getSourcesMap().isEmpty());
String expected = kiePmmlModel.getKModulePackageName() + "." + KIE_PMML_RULE_MAPPERS_CLASS_NAME;
assertTrue(kiePmmlModel.getSourcesMap().containsKey(expected));
}
use of org.kie.pmml.evaluator.assembler.factories.PMMLRuleMapperFactory.KIE_PMML_RULE_MAPPER_CLASS_NAME in project drools by kiegroup.
the class PMMLCompilerServiceTest method addPMMLRuleMappersNotHasSourceMap.
@Test(expected = KiePMMLException.class)
public void addPMMLRuleMappersNotHasSourceMap() {
final KiePMMLModel kiePmmlModel = KiePMMLTestingModel.builder("name", Collections.emptyList(), MINING_FUNCTION.REGRESSION).build();
final List<String> generatedRuleMappers = IntStream.range(0, 3).mapToObj(i -> "apackage" + i + "." + KIE_PMML_RULE_MAPPER_CLASS_NAME).collect(Collectors.toList());
PMMLCompilerService.addPMMLRuleMappers(kiePmmlModel, generatedRuleMappers, "source_path");
}
Aggregations