Skip to content

Commit

Permalink
Merge pull request #8483 from mandy-chessell/oak2024
Browse files Browse the repository at this point in the history
Fixes to PostgreSQL Repository Connector for CTS
  • Loading branch information
mandy-chessell authored Nov 9, 2024
2 parents bf15e2f + 0d6e977 commit 8e2eb51
Show file tree
Hide file tree
Showing 24 changed files with 1,699 additions and 1,217 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@

@cohort=ctsCohort

###
# group: Configuration
# @name Query cSuite server's configuration
# Query the current configuration of the conformance suite server.
GET {{baseURL}}/open-metadata/admin-services/users/{{adminUserId}}/servers/{{ctsServer}}/configuration

###
# group: Configuration
# @name Set cSuite server's user Id
Expand Down Expand Up @@ -73,7 +67,9 @@ Content-Type: application/json

{
"class": "RepositoryConformanceWorkbenchConfig",
"tutRepositoryServerName": "{{tutServer}}"
"tutRepositoryServerName": "{{tutServer}}",
"maxSearchResults": 20,
"testEntityTypes": ["Asset"]
}


Expand Down Expand Up @@ -107,12 +103,17 @@ DELETE {{baseURL}}/open-metadata/admin-services/users/{{adminUserId}}/servers/{{
# Remove all of the configuration for the open metadata conformance suite.
DELETE {{baseURL}}/open-metadata/admin-services/users/{{adminUserId}}/servers/{{ctsServer}}/conformance-suite-workbenches



###
# group: Starting/Stopping CTS server
# @name Activate conformance suite using config
# @name Start conformance suite using config
# Activate open metadata conformance suite services.
POST {{baseURL}}/open-metadata/platform-services/users/{{adminUserId}}/server-platform/servers/{{ctsServer}}/instance




###
# group: Starting/Stopping CTS server
# @name Deactivate conformance suite server
Expand Down Expand Up @@ -153,4 +154,13 @@ GET {{baseURL}}/servers/{{ctsServer}}/open-metadata/conformance-suite/users/{{ad
# group: Getting Results
# @name Retrieve report of a specific test case
# Retrieve the results of all failed test cases.
GET {{baseURL}}/servers/{{ctsServer}}/open-metadata/conformance-suite/users/{{adminUserId}}/report/test-cases/repository-entity-reference-copy-lifecycle-ConceptModelElement
GET {{baseURL}}/servers/{{ctsServer}}/open-metadata/conformance-suite/users/{{adminUserId}}/report/test-cases/repository-entity-reference-copy-lifecycle-ConceptModelElement


###
# group: Configuration
# @name Query cSuite server's configuration
# Query the current configuration of the conformance suite server.
GET {{baseURL}}/open-metadata/admin-services/users/{{adminUserId}}/servers/{{ctsServer}}/configuration

###
Original file line number Diff line number Diff line change
Expand Up @@ -198,146 +198,142 @@ protected void run() throws Exception
defaultProfileId,
defaultRequirementId);

verifyCondition(((metadataCollectionId != null) && (metadataCollectionId.equals(repositoryConformanceWorkPad.getTutMetadataCollectionId()))),
assertion6,
assertionMsg6,
defaultProfileId,
defaultRequirementId);

addDiscoveredProperty(metadataCollectionIdPropertyName,
originator.getMetadataCollectionId(),
defaultProfileId,
defaultRequirementId);

serverName = originator.getServerName();

verifyCondition((serverName != null),
assertion7,
assertionMsg7,
defaultProfileId,
defaultRequirementId);

verifyCondition(((serverName != null) && (serverName.equals(repositoryConformanceWorkPad.getTutServerName()))),
assertion8,
assertionMsg8,
defaultProfileId,
defaultRequirementId);

addDiscoveredProperty(serverNamePropertyName,
serverName,
defaultProfileId,
defaultRequirementId);

if (originator.getServerType() != null)
if ((metadataCollectionId != null) && (metadataCollectionId.equals(repositoryConformanceWorkPad.getTutMetadataCollectionId())))
{
addDiscoveredProperty(serverTypePropertyName,
originator.getServerType(),
/*
* Only check type events from the TUT.
*/
addDiscoveredProperty(metadataCollectionIdPropertyName,
originator.getMetadataCollectionId(),
defaultProfileId,
defaultRequirementId);
}

if (originator.getOrganizationName() != null)
{
addDiscoveredProperty(orgNamePropertyName,
originator.getOrganizationName(),
serverName = originator.getServerName();
verifyCondition((serverName != null),
assertion7,
assertionMsg7,
defaultProfileId,
defaultRequirementId);
verifyCondition(((serverName != null) && (serverName.equals(repositoryConformanceWorkPad.getTutServerName()))),
assertion8,
assertionMsg8,
defaultProfileId,
defaultRequirementId);
addDiscoveredProperty(serverNamePropertyName,
serverName,
defaultProfileId,
defaultRequirementId);
}
}

if (eventType != null)
{
addDiscoveredProperty(eventTypePropertyName,
eventType.getName(),
defaultProfileId,
defaultRequirementId);


typeDef = event.getTypeDef();
attributeTypeDef = event.getAttributeTypeDef();

switch (eventType)
{
case NEW_TYPEDEF_EVENT:
case DELETED_TYPEDEF_EVENT:
case RE_IDENTIFIED_TYPEDEF_EVENT:
verifyCondition((typeDef != null),
assertion9,
assertionMsg9,
defaultProfileId,
defaultRequirementId);
verifyCondition((attributeTypeDef == null),
assertion10,
assertionMsg10,
defaultProfileId,
defaultRequirementId);

if (typeDef != null)
{
addDiscoveredProperty(typeDefGUIDPropertyName,
typeDef.getGUID(),
defaultProfileId,
defaultRequirementId);
addDiscoveredProperty(typeDefNamePropertyName,
typeDef.getName(),
defaultProfileId,
defaultRequirementId);
}
break;

case UPDATED_TYPEDEF_EVENT:
/*
* If this is a type update event then it does not have the (new) TypeDef available,
* so verify that the event contains the patch.
*/
TypeDefPatch typeDefPatch = event.getTypeDefPatch();
verifyCondition((typeDefPatch != null),
assertion13,
assertionMsg13,
defaultProfileId,
defaultRequirementId);
verifyCondition((typeDef == null),
assertion9,
assertionMsg9,
defaultProfileId,
defaultRequirementId);
verifyCondition((attributeTypeDef == null),
assertion10,
assertionMsg10,
defaultProfileId,
defaultRequirementId);
break;

case NEW_ATTRIBUTE_TYPEDEF_EVENT:
case DELETED_ATTRIBUTE_TYPEDEF_EVENT:
case RE_IDENTIFIED_ATTRIBUTE_TYPEDEF_EVENT:
verifyCondition((attributeTypeDef != null),
assertion11,
assertionMsg11,
defaultProfileId,
defaultRequirementId);
verifyCondition((typeDef == null),
assertion12,
assertionMsg12,
defaultProfileId,
defaultRequirementId);

if (attributeTypeDef != null)
if (originator.getServerType() != null)
{
addDiscoveredProperty(serverTypePropertyName,
originator.getServerType(),
defaultProfileId,
defaultRequirementId);
}

if (originator.getOrganizationName() != null)
{
addDiscoveredProperty(orgNamePropertyName,
originator.getOrganizationName(),
defaultProfileId,
defaultRequirementId);
}

if (eventType != null)
{
addDiscoveredProperty(eventTypePropertyName,
eventType.getName(),
defaultProfileId,
defaultRequirementId);


typeDef = event.getTypeDef();
attributeTypeDef = event.getAttributeTypeDef();

switch (eventType)
{
addDiscoveredProperty(attributeTypeDefGUIDPropertyName,
attributeTypeDef.getGUID(),
defaultProfileId,
defaultRequirementId);
addDiscoveredProperty(attributeTypeDefNamePropertyName,
attributeTypeDef.getName(),
defaultProfileId,
defaultRequirementId);
case NEW_TYPEDEF_EVENT:
case DELETED_TYPEDEF_EVENT:
case RE_IDENTIFIED_TYPEDEF_EVENT:
verifyCondition((typeDef != null),
assertion9,
assertionMsg9,
defaultProfileId,
defaultRequirementId);
verifyCondition((attributeTypeDef == null),
assertion10,
assertionMsg10,
defaultProfileId,
defaultRequirementId);

if (typeDef != null)
{
addDiscoveredProperty(typeDefGUIDPropertyName,
typeDef.getGUID(),
defaultProfileId,
defaultRequirementId);
addDiscoveredProperty(typeDefNamePropertyName,
typeDef.getName(),
defaultProfileId,
defaultRequirementId);
}
break;

case UPDATED_TYPEDEF_EVENT:
/*
* If this is a type update event then it does not have the (new) TypeDef available,
* so verify that the event contains the patch.
*/
TypeDefPatch typeDefPatch = event.getTypeDefPatch();
verifyCondition((typeDefPatch != null),
assertion13,
assertionMsg13,
defaultProfileId,
defaultRequirementId);
verifyCondition((typeDef == null),
assertion9,
assertionMsg9,
defaultProfileId,
defaultRequirementId);
verifyCondition((attributeTypeDef == null),
assertion10,
assertionMsg10,
defaultProfileId,
defaultRequirementId);
break;

case NEW_ATTRIBUTE_TYPEDEF_EVENT:
case DELETED_ATTRIBUTE_TYPEDEF_EVENT:
case RE_IDENTIFIED_ATTRIBUTE_TYPEDEF_EVENT:
verifyCondition((attributeTypeDef != null),
assertion11,
assertionMsg11,
defaultProfileId,
defaultRequirementId);
verifyCondition((typeDef == null),
assertion12,
assertionMsg12,
defaultProfileId,
defaultRequirementId);

if (attributeTypeDef != null)
{
addDiscoveredProperty(attributeTypeDefGUIDPropertyName,
attributeTypeDef.getGUID(),
defaultProfileId,
defaultRequirementId);
addDiscoveredProperty(attributeTypeDefNamePropertyName,
attributeTypeDef.getName(),
defaultProfileId,
defaultRequirementId);
}
break;

case TYPEDEF_ERROR_EVENT:

break;
}
break;

case TYPEDEF_ERROR_EVENT:

break;
}
}
}

Expand Down
Loading

0 comments on commit 8e2eb51

Please sign in to comment.