Search in sources :

Example 1 with ParameterInfo

use of org.kie.api.pmml.ParameterInfo in project drools by kiegroup.

the class MiningSegmentTransferTest method testComplexResult.

@Test
public void testComplexResult() {
    MiningSegmentTransfer mst = new MiningSegmentTransfer(complexResult, "SEGMENT_2");
    mst.addResultToRequestMapping("firstObject", "object1");
    mst.addResultToRequestMapping("myComplex.varA", "stringFromMyComplex");
    mst.addResultToRequestMapping("myComplex.varB", "intValue");
    doBaselineAssertions(complexResult, mst);
    assertEquals(3, mst.getResultFieldNameToRequestFieldName().size());
    PMMLRequestData rqst = mst.getOutboundRequest();
    assertNotNull(rqst);
    assertEquals(complexResult.getCorrelationId(), rqst.getCorrelationId());
    Map<String, ParameterInfo> params = rqst.getMappedRequestParams();
    assertEquals(complexResult.getResultValue("firstObject", null), params.get("object1").getValue());
    assertEquals(complexResult.getResultValue("myComplex", "varA"), params.get("stringFromMyComplex").getValue());
    assertEquals(complexResult.getResultValue("myComplex", "varB"), params.get("intValue").getValue());
    System.out.println(rqst);
    System.out.println(complexResult);
}
Also used : PMMLRequestData(org.kie.api.pmml.PMMLRequestData) ParameterInfo(org.kie.api.pmml.ParameterInfo) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 PMMLRequestData (org.kie.api.pmml.PMMLRequestData)1 ParameterInfo (org.kie.api.pmml.ParameterInfo)1