invalidateDMOProjectCache.fire(new InvalidateDMOProjectCacheEvent(null, null, path));
DataModelTO reloadedModel = modelerService.loadModel(project);
assertNotNull(reloadedModel);
ProjectDataModelOracle projectDataModelOracle = dataModelService.getProjectDataModel(path);
String types[] = projectDataModelOracle.getFactTypes();
if (types != null) {
for (String type : types) {
if ((objectPackage + "." + objectName).equals(type)) {
// Check type annotations
Set<Annotation> annotations = projectDataModelOracle.getTypeAnnotations(type);
assertNotNull(annotations);
assertEquals("Type " + type + " should hold 3 annotations: ", 3, annotations.size());
checkAnnotation(annotations, AnnotationDefinitionTO.LABEL_ANNOTATION, objectLabelValue);
checkAnnotation(annotations, AnnotationDefinitionTO.DESCRIPTION_ANNOTATION, objectDescriptionValue);
checkAnnotation(annotations, AnnotationDefinitionTO.ROLE_ANNOTATION, objectRoleValue);
// Check type field annotations
ModelField[] fields = projectDataModelOracle.getModelFields().get(type);
assertNotNull(fields);
assertEquals("Error in type " + type + "'s fields: ", 2, fields.length);
Map<String, Set<Annotation>> mFieldAnnotations = projectDataModelOracle.getTypeFieldsAnnotations(type);
assertNotNull(mFieldAnnotations);
Set fieldAnnotations = mFieldAnnotations.get(fieldName);
assertNotNull(fieldAnnotations);
assertEquals("Field " + fieldName + "should have 3 annotations: ", 3, fieldAnnotations.size());
checkAnnotation(fieldAnnotations, AnnotationDefinitionTO.LABEL_ANNOTATION, fieldLabelValue);