Search in sources :

Example 1 with KiePMMLSimplePredicate

use of org.kie.pmml.commons.model.predicates.KiePMMLSimplePredicate in project drools by kiegroup.

the class KiePMMLSimplePredicateInstanceFactoryTest method getKiePMMLSimplePredicate.

@Test
public void getKiePMMLSimplePredicate() {
    List<Field<?>> fields = IntStream.range(0, 3).mapToObj(i -> getRandomDataField()).collect(Collectors.toList());
    final SimplePredicate toConvert = getRandomSimplePredicate((DataField) fields.get(0));
    final KiePMMLSimplePredicate retrieved = KiePMMLSimplePredicateInstanceFactory.getKiePMMLSimplePredicate(toConvert, fields);
    commonVerifyKiePMMLSimplePredicate(retrieved, toConvert, (DataField) fields.get(0));
}
Also used : IntStream(java.util.stream.IntStream) DataField(org.dmg.pmml.DataField) PMMLModelTestUtils.getRandomSimplePredicate(org.kie.pmml.compiler.api.testutils.PMMLModelTestUtils.getRandomSimplePredicate) List(java.util.List) SimplePredicate(org.dmg.pmml.SimplePredicate) Field(org.dmg.pmml.Field) KiePMMLSimplePredicate(org.kie.pmml.commons.model.predicates.KiePMMLSimplePredicate) InstanceFactoriesTestCommon.commonVerifyKiePMMLSimplePredicate(org.kie.pmml.compiler.commons.factories.InstanceFactoriesTestCommon.commonVerifyKiePMMLSimplePredicate) Test(org.junit.Test) PMMLModelTestUtils.getRandomDataField(org.kie.pmml.compiler.api.testutils.PMMLModelTestUtils.getRandomDataField) Collectors(java.util.stream.Collectors) DataField(org.dmg.pmml.DataField) Field(org.dmg.pmml.Field) PMMLModelTestUtils.getRandomDataField(org.kie.pmml.compiler.api.testutils.PMMLModelTestUtils.getRandomDataField) KiePMMLSimplePredicate(org.kie.pmml.commons.model.predicates.KiePMMLSimplePredicate) InstanceFactoriesTestCommon.commonVerifyKiePMMLSimplePredicate(org.kie.pmml.compiler.commons.factories.InstanceFactoriesTestCommon.commonVerifyKiePMMLSimplePredicate) PMMLModelTestUtils.getRandomSimplePredicate(org.kie.pmml.compiler.api.testutils.PMMLModelTestUtils.getRandomSimplePredicate) SimplePredicate(org.dmg.pmml.SimplePredicate) KiePMMLSimplePredicate(org.kie.pmml.commons.model.predicates.KiePMMLSimplePredicate) InstanceFactoriesTestCommon.commonVerifyKiePMMLSimplePredicate(org.kie.pmml.compiler.commons.factories.InstanceFactoriesTestCommon.commonVerifyKiePMMLSimplePredicate) Test(org.junit.Test)

Aggregations

List (java.util.List)1 Collectors (java.util.stream.Collectors)1 IntStream (java.util.stream.IntStream)1 DataField (org.dmg.pmml.DataField)1 Field (org.dmg.pmml.Field)1 SimplePredicate (org.dmg.pmml.SimplePredicate)1 Test (org.junit.Test)1 KiePMMLSimplePredicate (org.kie.pmml.commons.model.predicates.KiePMMLSimplePredicate)1 PMMLModelTestUtils.getRandomDataField (org.kie.pmml.compiler.api.testutils.PMMLModelTestUtils.getRandomDataField)1 PMMLModelTestUtils.getRandomSimplePredicate (org.kie.pmml.compiler.api.testutils.PMMLModelTestUtils.getRandomSimplePredicate)1 InstanceFactoriesTestCommon.commonVerifyKiePMMLSimplePredicate (org.kie.pmml.compiler.commons.factories.InstanceFactoriesTestCommon.commonVerifyKiePMMLSimplePredicate)1