use of org.kie.pmml.api.enums.PMML_STEP in project drools by kiegroup.
the class PMMLRuntimeInternalImplTest method evaluateWithPmmlRuntimeListeners.
@Test
public void evaluateWithPmmlRuntimeListeners() {
final PMMLRequestData requestData = getPMMLRequestData();
final List<PMMLStep> pmmlSteps = new ArrayList<>();
final PMMLContext pmmlContext = new PMMLContextImpl(requestData);
pmmlRuntime.addPMMLListener(getPMMLListener(pmmlSteps));
pmmlRuntime.evaluate(modelMock, pmmlContext);
Arrays.stream(PMML_STEP.values()).forEach(pmml_step -> {
Optional<PMMLStep> retrieved = pmmlSteps.stream().filter(pmmlStep -> pmml_step.equals(((PMMLRuntimeStep) pmmlStep).getPmmlStep())).findFirst();
assertTrue(retrieved.isPresent());
commonValuateStep(retrieved.get(), pmml_step, modelMock, requestData);
});
}
use of org.kie.pmml.api.enums.PMML_STEP in project drools by kiegroup.
the class PMMLRuntimeInternalImplTest method evaluateWithPMMLContextListeners.
@Test
public void evaluateWithPMMLContextListeners() {
final PMMLRequestData requestData = getPMMLRequestData();
final List<PMMLStep> pmmlSteps = new ArrayList<>();
final PMMLContext pmmlContext = new PMMLContextImpl(requestData, Collections.singleton(getPMMLListener(pmmlSteps)));
pmmlRuntime.evaluate(modelMock, pmmlContext);
Arrays.stream(PMML_STEP.values()).forEach(pmml_step -> {
Optional<PMMLStep> retrieved = pmmlSteps.stream().filter(pmmlStep -> pmml_step.equals(((PMMLRuntimeStep) pmmlStep).getPmmlStep())).findFirst();
assertTrue(retrieved.isPresent());
commonValuateStep(retrieved.get(), pmml_step, modelMock, requestData);
});
}
Aggregations