use of org.kie.soup.project.datamodel.imports.Imports in project drools-wb by kiegroup.
the class ScenarioTestEditorServiceImplTest method runScenarioWithoutDependentImports.
@Test
public void runScenarioWithoutDependentImports() throws Exception {
when(dataModelService.getDataModel(path)).thenReturn(modelOracle);
when(scenario.getImports()).thenReturn(new Imports());
testEditorService.addDependentImportsToScenario(scenario, path);
assertEquals(0, scenario.getImports().getImports().size());
}
use of org.kie.soup.project.datamodel.imports.Imports in project drools-wb by kiegroup.
the class FactModelPersistence method unmarshal.
public static FactModels unmarshal(final String content) {
try {
// De-serialize model
final List<FactMetaModel> models = toModel(content);
final FactModels factModels = new FactModels();
factModels.getModels().addAll(models);
// De-serialize Package name
final String packageName = PackageNameParser.parsePackageName(content);
factModels.setPackageName(packageName);
// De-serialize imports
final Imports imports = ImportsParser.parseImports(content);
factModels.setImports(imports);
return factModels;
} catch (final DroolsParserException e) {
throw new RuntimeException(e);
}
// TODO {porcelli} needs define error handling strategy
// log.error( "Unable to parse the DRL for the model - falling back to text (" + e.getMessage() + ")" );
// RuleContentText text = new RuleContentText();
// text.content = item.getContent();
// asset.setContent( text );
}
Aggregations