Search in sources :

Example 6 with PMMLModelMetadata

use of org.kie.workbench.common.dmn.api.editors.included.PMMLModelMetadata in project kie-wb-common by kiegroup.

the class ImportConverterTest method wbFromDMN_PMMLImportWithModels.

@Test
public void wbFromDMN_PMMLImportWithModels() {
    when(jsitImportMock.getImportType()).thenReturn(PMML_IMPORT_TYPE);
    pmmlDocumentMetadata.getModels().add(new PMMLModelMetadata("modelName", null));
    Import resultImport = ImportConverter.wbFromDMN(jsitImportMock, null, pmmlDocumentMetadata);
    assertTrue(resultImport instanceof ImportPMML);
    assertEquals(LOCATION_URI, resultImport.getLocationURI().getValue());
    assertEquals(NAME, resultImport.getNamespace());
    assertEquals(DESCRIPTION, resultImport.getDescription().getValue());
    assertEquals(NAME, resultImport.getName().getValue());
    assertEquals(PMML_IMPORT_TYPE, resultImport.getImportType());
    assertNotNull(resultImport.getId().getValue());
    assertEquals(1, ((ImportPMML) resultImport).getModelCount());
}
Also used : Import(org.kie.workbench.common.dmn.api.definition.model.Import) JSITImport(org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITImport) PMMLModelMetadata(org.kie.workbench.common.dmn.api.editors.included.PMMLModelMetadata) ImportPMML(org.kie.workbench.common.dmn.api.definition.model.ImportPMML) Test(org.junit.Test)

Example 7 with PMMLModelMetadata

use of org.kie.workbench.common.dmn.api.editors.included.PMMLModelMetadata in project kie-wb-common by kiegroup.

the class ImportConverterTest method wbFromDMN_PMMLImportNoPmmlModelMetadata.

@Test
public void wbFromDMN_PMMLImportNoPmmlModelMetadata() {
    when(jsitImportMock.getImportType()).thenReturn(PMML_IMPORT_TYPE);
    pmmlDocumentMetadata.getModels().add(new PMMLModelMetadata("modelName", null));
    Import resultImport = ImportConverter.wbFromDMN(jsitImportMock, null, null);
    assertTrue(resultImport instanceof ImportPMML);
    assertEquals(LOCATION_URI, resultImport.getLocationURI().getValue());
    assertEquals(NAME, resultImport.getNamespace());
    assertEquals(DESCRIPTION, resultImport.getDescription().getValue());
    assertEquals(NAME, resultImport.getName().getValue());
    assertEquals(PMML_IMPORT_TYPE, resultImport.getImportType());
    assertNotNull(resultImport.getId().getValue());
    assertEquals(0, ((ImportPMML) resultImport).getModelCount());
}
Also used : Import(org.kie.workbench.common.dmn.api.definition.model.Import) JSITImport(org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITImport) PMMLModelMetadata(org.kie.workbench.common.dmn.api.editors.included.PMMLModelMetadata) ImportPMML(org.kie.workbench.common.dmn.api.definition.model.ImportPMML) Test(org.junit.Test)

Aggregations

PMMLModelMetadata (org.kie.workbench.common.dmn.api.editors.included.PMMLModelMetadata)7 Test (org.junit.Test)6 PMMLDocumentMetadata (org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata)5 ArrayList (java.util.ArrayList)3 PMMLParameterMetadata (org.kie.workbench.common.dmn.api.editors.included.PMMLParameterMetadata)3 Arrays.asList (java.util.Arrays.asList)2 Collections.singletonList (java.util.Collections.singletonList)2 List (java.util.List)2 PMMLModelInfo (org.kie.dmn.core.pmml.PMMLModelInfo)2 Import (org.kie.workbench.common.dmn.api.definition.model.Import)2 ImportPMML (org.kie.workbench.common.dmn.api.definition.model.ImportPMML)2 JSITImport (org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITImport)2 Path (org.uberfire.backend.vfs.Path)2 Sets (org.kie.soup.commons.util.Sets)1 PMMLIncludedModel (org.kie.workbench.common.dmn.api.editors.included.PMMLIncludedModel)1