use of org.kie.pmml.evaluator.api.executor.PMMLRuntimeInternal in project drools by kiegroup.
the class PMMLMiningModelEvaluatorTest method getPMMLRuntime.
@Test
public void getPMMLRuntime() {
final KieServices kieServices = KieServices.Factory.get();
final KieContainer kieContainer = kieServices.newKieClasspathContainer();
final KieBase kieBase = kieContainer.getKieBase();
String kModulePackageName = "kModulePackageNameA";
String containerModelName = "containerModelNameA";
PMMLRuntime firstRetrieved = evaluator.getPMMLRuntime(kModulePackageName, kieBase, containerModelName);
assertNotNull(firstRetrieved);
assertTrue(firstRetrieved instanceof PMMLRuntimeInternal);
PMMLRuntimeInternal firstPMMLRuntimeInternal = (PMMLRuntimeInternal) firstRetrieved;
PMMLRuntime secondRetrieved = evaluator.getPMMLRuntime(kModulePackageName, kieBase, containerModelName);
assertTrue(secondRetrieved instanceof PMMLRuntimeInternal);
PMMLRuntimeInternal secondPMMLRuntimeInternal = (PMMLRuntimeInternal) secondRetrieved;
assertEquals(firstPMMLRuntimeInternal.getKnowledgeBase(), secondPMMLRuntimeInternal.getKnowledgeBase());
kModulePackageName = "kModulePackageNameB";
containerModelName = "containerModelNameB";
PMMLRuntime thirdRetrieved = evaluator.getPMMLRuntime(kModulePackageName, kieBase, containerModelName);
assertNotNull(thirdRetrieved);
assertTrue(thirdRetrieved instanceof PMMLRuntimeInternal);
PMMLRuntimeInternal thirdPMMLRuntimeInternal = (PMMLRuntimeInternal) thirdRetrieved;
assertNotEquals(firstPMMLRuntimeInternal.getKnowledgeBase(), thirdPMMLRuntimeInternal.getKnowledgeBase());
}
Aggregations