Class TestSupportedRelationshipEndCriteria
java.lang.Object
org.odpi.openmetadata.conformance.beans.OpenMetadataTestCase
org.odpi.openmetadata.conformance.tests.repository.RepositoryConformanceTestCase
org.odpi.openmetadata.conformance.tests.repository.instances.TestSupportedRelationshipEndCriteria
Test that a repository can constrain a relationship search by the entities at the ends of the relationship.
findRelationships() accepts end1EntityGUIDs, end2EntityGUIDs and an EndMatchCriteria, and this is the only way to ask "which relationships connect these two elements" in one call. Where it is not relied upon, the code above the repository has to retrieve a broader set and discard the rest in memory - which costs a larger read than the question needs, and, because the repository has already applied paging by the time the discarding happens, returns short pages while matches remain unseen.
The test builds a small deliberate graph rather than reusing whatever instances exist, because the assertions are about exact result sets:
findRelationships() accepts end1EntityGUIDs, end2EntityGUIDs and an EndMatchCriteria, and this is the only way to ask "which relationships connect these two elements" in one call. Where it is not relied upon, the code above the repository has to retrieve a broader set and discard the rest in memory - which costs a larger read than the question needs, and, because the repository has already applied paging by the time the discarding happens, returns short pages while matches remain unseen.
The test builds a small deliberate graph rather than reusing whatever instances exist, because the assertions are about exact result sets:
end1A ---- r1 ----> end2A
end1A ---- r2 ----> end2B
end1B ---- r3 ----> end2A
end1B ---- r4 ----> end2B
That is enough to tell each constraint apart: end 1 alone selects r1 and r2, end 2 alone selects r1 and r3,
and the two together select r1 or all three depending on the match criteria.-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.conformance.beans.OpenMetadataTestCase
OpenMetadataTestCase.TestPhase -
Field Summary
Fields inherited from class org.odpi.openmetadata.conformance.tests.repository.RepositoryConformanceTestCase
cohortRepositoryConnector, repositoryConformanceWorkPadFields inherited from class org.odpi.openmetadata.conformance.beans.OpenMetadataTestCase
defaultProfileId, defaultRequirementId, discoveredProperties, exceptionBean, notSupportedAssertions, successfulAssertions, successMessage, testCaseDescriptionURL, unsuccessfulAssertions -
Constructor Summary
ConstructorsConstructorDescriptionTestSupportedRelationshipEndCriteria(RepositoryConformanceWorkPad workPad, Map<String, EntityDef> entityDefs, RelationshipDef relationshipDef) Set up the test case. -
Method Summary
Methods inherited from class org.odpi.openmetadata.conformance.tests.repository.RepositoryConformanceTestCase
addEntityProxyToRepository, addEntityToRepository, buildExceptionMessage, generatePropertiesForInstance, getAllPropertiesForInstance, getAllUniquePropertiesForInstance, getEntityDef, getMaxSearchResults, getMetadataCollection, getMinPropertiesForInstance, getPropertiesForInstance, getPropertiesForTypeDef, getPropertyValueForAttributeType, getRepositoryConnector, incrementSuccessfulCount, incrementUnsuccessfulCount, logTestEnd, logTestStart, propertyValueMatchesSearch, propertyValueMatchesSearch, updateTestIdByTypeMethods inherited from class org.odpi.openmetadata.conformance.beans.OpenMetadataTestCase
addDiscoveredProperty, addNotSupportedAssertion, assertCondition, assertCondition, assertObjectsAreEqual, cleanTest, cleanup, endAsynchronousTest, executeTest, executeTest, getResult, getSummary, getTestCaseDescriptionURL, getTestCaseId, getTestCaseName, isTestPassed, isTestRan, run, setSuccessMessage, startAsynchronousTest, toString, updateTestId, verifyCondition, verifyCondition, verifyObjectsAreEqual
-
Constructor Details
-
TestSupportedRelationshipEndCriteria
public TestSupportedRelationshipEndCriteria(RepositoryConformanceWorkPad workPad, Map<String, EntityDef> entityDefs, RelationshipDef relationshipDef) Set up the test case.- Parameters:
workPad- place for parameters and resultsentityDefs- the entity types supported by the repository under testrelationshipDef- the relationship type being tested
-
-
Method Details
-
run
Run the test.- Specified by:
runin classOpenMetadataTestCase- Throws:
Exception- something went wrong that the conformance suite could not handle
-