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());
}
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());
}
Aggregations