Class TestSupportedEntityClassificationSearch
java.lang.Object
org.odpi.openmetadata.conformance.beans.OpenMetadataTestCase
org.odpi.openmetadata.conformance.tests.repository.RepositoryConformanceTestCase
org.odpi.openmetadata.conformance.tests.repository.instances.TestSupportedEntityClassificationSearch
Test that a repository can constrain an entity search by the classifications an entity carries.
findEntities() accepts a SearchClassifications with a MatchCriteria, and it is the only way to ask the repository "which entities carry this classification" - or, under NONE, "which do not". Where it is not relied upon, the code above the repository retrieves a broader set and drops the entities whose classifications do not suit, which costs a larger read and, since the repository has already applied paging by then, returns short pages.
This capability has a history of being wrong quietly. The PostgreSQL query builder carries a note that MatchCriteria was previously ignored here, so every named classification condition was combined the same way and the search returned nothing whatever the caller asked for. A search that returns nothing looks like an empty repository rather than a broken query, which is why it survived - and why it is worth asserting all three criteria rather than only the common one.
findEntities() accepts a SearchClassifications with a MatchCriteria, and it is the only way to ask the repository "which entities carry this classification" - or, under NONE, "which do not". Where it is not relied upon, the code above the repository retrieves a broader set and drops the entities whose classifications do not suit, which costs a larger read and, since the repository has already applied paging by then, returns short pages.
This capability has a history of being wrong quietly. The PostgreSQL query builder carries a note that MatchCriteria was previously ignored here, so every named classification condition was combined the same way and the search returned nothing whatever the caller asked for. A search that returns nothing looks like an empty repository rather than a broken query, which is why it survived - and why it is worth asserting all three criteria rather than only the common one.
-
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
ConstructorsConstructorDescriptionTestSupportedEntityClassificationSearch(RepositoryConformanceWorkPad workPad, EntityDef entityDef, List<ClassificationDef> classificationDefs) 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
-
TestSupportedEntityClassificationSearch
public TestSupportedEntityClassificationSearch(RepositoryConformanceWorkPad workPad, EntityDef entityDef, List<ClassificationDef> classificationDefs) Set up the test case.- Parameters:
workPad- place for parameters and resultsentityDef- the entity type to classifyclassificationDefs- the classification types available; the first is the one being tested
-
-
Method Details
-
run
Run the test.- Specified by:
runin classOpenMetadataTestCase- Throws:
Exception- something went wrong that the conformance suite could not handle
-