Commit 20d4f4d8 by David Radley Committed by Graham Wallis

ATLAS2604 Minor fixups to open metadata archive types

parent e7aec335
......@@ -134,7 +134,7 @@ public class OMRSArchiveHelper
CollectionDef collectionDef = new CollectionDef(CollectionDefCategory.OM_COLLECTION_MAP);
collectionDef.setGUID(guid);
collectionDef.setName("map<" + propertyKeyType.getName() + ", " + propertyValueType.getName() + ">");
collectionDef.setName("map<" + propertyKeyType.getName() + "," + propertyValueType.getName() + ">");
collectionDef.setDescription(description);
collectionDef.setDescriptionGUID(descriptionGUID);
collectionDef.setVersion(versionNumber);
......@@ -405,7 +405,7 @@ public class OMRSArchiveHelper
attribute.setAttributeName(attributeName);
attribute.setAttributeDescription(attributeDescription);
attribute.setAttributeDescriptionGUID(attributeDescriptionGUID);
attribute.setAttributeType(this.archiveBuilder.getCollectionDef("map<string, string>"));
attribute.setAttributeType(this.archiveBuilder.getCollectionDef("map<string,string>"));
attribute.setAttributeCardinality(AttributeCardinality.AT_MOST_ONE);
attribute.setValuesMinCount(0);
attribute.setValuesMaxCount(1);
......
......@@ -186,7 +186,7 @@ public class OpenMetadataTypesArchive
/**
* Defines the "map<string, string>" type.
* Defines the "map<string,string>" type.
*
* @return CollectionDef for this type
*/
......@@ -10959,7 +10959,7 @@ public class OpenMetadataTypesArchive
* Set up end 1.
*/
final String end1EntityType = "GlossaryTerm";
final String end1AttributeName = "attributes";
final String end1AttributeName = "attributesTypedBy";
final String end1AttributeDescription = "Attributes of this type.";
final String end1AttributeDescriptionGUID = null;
final AttributeCardinality end1Cardinality = AttributeCardinality.ANY_NUMBER_UNORDERED;
......@@ -12885,9 +12885,9 @@ public class OpenMetadataTypesArchive
/*
* Set up end 1.
*/
final String end1EntityType = "GovernanceRule";
final String end1AttributeName = "implementsGovernanceRules";
final String end1AttributeDescription = "The rules that are implemented by this component.";
final String end1EntityType = "GovernanceProcess";
final String end1AttributeName = "implementsGovernanceProcesses";
final String end1AttributeDescription = "The processes that are implemented by this component.";
final String end1AttributeDescriptionGUID = null;
final AttributeCardinality end1Cardinality = AttributeCardinality.ANY_NUMBER_UNORDERED;
......@@ -12902,9 +12902,9 @@ public class OpenMetadataTypesArchive
/*
* Set up end 2.
*/
final String end2EntityType = "SoftwareComponent";
final String end2EntityType = "Process";
final String end2AttributeName = "implementations";
final String end2AttributeDescription = "The software components that implement this governance rule.";
final String end2AttributeDescription = "The processes that implement this governance process.";
final String end2AttributeDescriptionGUID = null;
final AttributeCardinality end2Cardinality = AttributeCardinality.ANY_NUMBER_UNORDERED;
......@@ -12922,7 +12922,7 @@ public class OpenMetadataTypesArchive
TypeDefAttribute property;
final String attribute1Name = "notes";
final String attribute1Description = "Documents reasons for implementing the rule using this implementation.";
final String attribute1Description = "Documents reasons for implementing the process using this implementation.";
final String attribute1DescriptionGUID = null;
property = archiveHelper.getStringTypeDefAttribute(attribute1Name, attribute1Description, attribute1DescriptionGUID);
......@@ -14438,8 +14438,8 @@ public class OpenMetadataTypesArchive
* Set up end 1.
*/
final String end1EntityType = "Referenceable";
final String end1AttributeName = "licensed";
final String end1AttributeDescription = "Items licensed by this type of license.";
final String end1AttributeName = "certifies";
final String end1AttributeDescription = "Items certified by this type of certification.";
final String end1AttributeDescriptionGUID = null;
final AttributeCardinality end1Cardinality = AttributeCardinality.ANY_NUMBER_UNORDERED;
......@@ -14454,9 +14454,9 @@ public class OpenMetadataTypesArchive
/*
* Set up end 2.
*/
final String end2EntityType = "LicenseType";
final String end2AttributeName = "licenses";
final String end2AttributeDescription = "The types of licenses that apply.";
final String end2EntityType = "CertificationType";
final String end2AttributeName = "certifications";
final String end2AttributeDescription = "The types of certifications that apply.";
final String end2AttributeDescriptionGUID = null;
final AttributeCardinality end2Cardinality = AttributeCardinality.ANY_NUMBER_UNORDERED;
......@@ -16430,7 +16430,7 @@ public class OpenMetadataTypesArchive
* Set up end 2.
*/
final String end2EntityType = "SchemaType";
final String end2AttributeName = "apiResponse";
final String end2AttributeName = "apiHeader";
final String end2AttributeDescription = "Header structure for this API operation.";
final String end2AttributeDescriptionGUID = null;
final AttributeCardinality end2Cardinality = AttributeCardinality.ANY_NUMBER_UNORDERED;
......
......@@ -399,6 +399,30 @@ public enum OMRSErrorCode
"A request for a type from category {0} passed a null name.",
"The build of the archive terminates.",
"Verify the definition of the elements being added to the archive. Once the definitions have been corrected, rerun the request."),
DUPLICATE_ENDDEF1_NAME_IN_ARCHIVE(400, "OMRS-ARCHIVEBUILDER-400-006 ",
"endDef2 type {0} and EndDef1 name {1} in RelationshipDef {2} are incorrect, because entity {0} already has a {1} attribute or is referred to in an existing relationshipDef with an endDef with name {1}.",
"The build of the archive terminates.",
"Verify the definition of the types being added to the archive. Once the definitions have been corrected, rerun the request."),
DUPLICATE_ENDDEF2_NAME_IN_ARCHIVE(400, "OMRS-ARCHIVEBUILDER-400-007 ",
"EndDef1 type {0} and EndDef2 name {1} in RelationshipDef {2} are incorrect, because entity {0} already has a {1} attribute or is referred to in an existing relationshipDef with an endDef with name {1}.",
"The build of the archive terminates.",
"Verify the definition of the types being added to the archive. Once the definitions have been corrected, rerun the request."),
DUPLICATE_RELATIONSHIP_ATTR_IN_ARCHIVE(400, "OMRS-ARCHIVEBUILDER-400-008 ",
"Duplicate attribute name {0} is defined in RelationshipDef {2}. ",
"The build of the archive terminates.",
"Verify the definition of the types being added to the archive. Once the definitions have been corrected, rerun the request."),
DUPLICATE_ENTITY_ATTR_IN_ARCHIVE(400, "OMRS-ARCHIVEBUILDER-400-009 ",
"Duplicate attribute name {0} is defined in EntityDef {2}. ",
"The build of the archive terminates.",
"Verify the definition of the types being added to the archive. Once the definitions have been corrected, rerun the request."),
DUPLICATE_CLASSIFICATION_ATTR_IN_ARCHIVE(400, "OMRS-ARCHIVEBUILDER-400-010 ",
"Duplicate attribute name {0} is defined in ClassificationDef {2}. ",
"The build of the archive terminates.",
"Verify the definition of the types being added to the archive. Once the definitions have been corrected, rerun the request."),
BLANK_TYPENAME_IN_ARCHIVE(400, "OMRS-ARCHIVEBUILDER-400-011 ",
"Type name {0} is invalid because it contains a blank character. ",
"The build of the archive terminates.",
"Verify the definition of the types being added to the archive. Once the definitions have been corrected, rerun the request."),
NULL_LOG_RECORD(400, "OMRS-AUDITLOG-400-001 ",
"A null log record has been passed by the audit log to the audit log store.",
"The audit log store throws an exception and the log record is not written to the audit log store.",
......
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.atlas.omrs.archivemanager.opentypes;
import org.apache.atlas.omrs.archivemanager.properties.OpenMetadataArchive;
import org.apache.atlas.omrs.archivemanager.properties.OpenMetadataArchiveTypeStore;
import org.apache.atlas.omrs.metadatacollection.properties.typedefs.*;
import java.util.*;
import org.testng.annotations.Test;
import java.util.List;
import static org.testng.Assert.assertFalse;
/**
* Test that the open metadata archive types load without error.
*/
public class TestOpenMetadataTypesArchive
{
@Test
public void testOpenMetadataTypesload()
{
OpenMetadataTypesArchive archive = new OpenMetadataTypesArchive();
//load the archive
OpenMetadataArchive archiveProperties = archive.getOpenMetadataArchive();
OpenMetadataArchiveTypeStore typeStore = archiveProperties.getArchiveTypeStore();
assert (typeStore != null);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment