use of org.kie.workbench.common.screens.datamodeller.model.EditorModelContent in project kie-wb-common by kiegroup.
the class DataModelerScreenPresenterTestBase method createContent.
protected EditorModelContent createContent(boolean includeTypesInfo, boolean addParseErrors) {
EditorModelContent content = new EditorModelContent();
content.setDataObject(testObject1);
content.setDataModel(testModel);
content.setSource(testSource);
content.setOriginalClassName(testObject1.getClassName());
content.setOriginalPackageName(testObject1.getPackageName());
content.setPath(path);
content.setCurrentModule(kieModule);
content.setCurrentModulePackages(testPackages);
content.setOverview(overview);
if (includeTypesInfo) {
content.setAnnotationDefinitions(testAnnotationDefs);
content.setPropertyTypes(testTypeDefs);
}
if (addParseErrors) {
content.setErrors(testErrors);
}
return content;
}
use of org.kie.workbench.common.screens.datamodeller.model.EditorModelContent in project kie-wb-common by kiegroup.
the class SourceEditorReadOnlyTest method setUp.
@Before
@Override
public void setUp() throws Exception {
super.setUp();
final boolean loadTypesInfo = true;
EditorModelContent content = createContent(loadTypesInfo, false);
when(versionRecordManager.getCurrentPath()).thenReturn(path);
when(modelerService.loadContent(path, loadTypesInfo)).thenReturn(content);
when(javaSourceEditor.getContent()).thenReturn(content.getSource());
// access modification related setup
when(sessionInfo.getIdentity()).thenReturn(user);
}
use of org.kie.workbench.common.screens.datamodeller.model.EditorModelContent in project kie-wb-common by kiegroup.
the class DataModelerEditorsTestHelper method createTestContext.
public static DataModelerContext createTestContext() {
DataModelerContext context = new DataModelerContext("123456789");
context.init(PropertyTypeFactoryImpl.getInstance().getBasePropertyTypes());
List<AnnotationDefinition> commonAnnotations = CommonAnnotations.getCommonAnnotations();
Map<String, AnnotationDefinition> annotationDefinitions = new HashMap<String, AnnotationDefinition>();
for (AnnotationDefinition annotationDefinition : commonAnnotations) {
annotationDefinitions.put(annotationDefinition.getClassName(), annotationDefinition);
}
context.setAnnotationDefinitions(annotationDefinitions);
EditorModelContent content = new EditorModelContent();
content.setDataModel(createTestModel());
content.setCurrentModule(new KieModule());
context.setEditorModelContent(content);
return context;
}
Aggregations