Class TestSupportedInstanceCounts
java.lang.Object
org.odpi.openmetadata.conformance.beans.OpenMetadataTestCase
org.odpi.openmetadata.conformance.tests.repository.RepositoryConformanceTestCase
org.odpi.openmetadata.conformance.tests.repository.instances.TestSupportedInstanceCounts
Test that a repository's instance counts agree with what it returns from the equivalent search.
countEntities() and countRelationships() take the same criteria as their find() counterparts, and the code above the repository uses them to answer "how many" without pulling the instances back. A count that disagrees with the search is worse than no count at all: it is used to size pages and to decide whether there is anything to fetch, so a wrong answer is acted upon rather than noticed.
The assertion is that the count is at least the number of instances this test created, and matches the instances find() reports for the same criteria that this repository is answerable for counting - those it homes, and those it replicates on behalf of a non-cohort provenance. It is not an absolute number because the repository legitimately holds other instances of the type, and it is not the whole of what find() returns because find() also returns reference copies of instances another member homes; those are counted by that member, so counting them here too would double them in a federated count.
countEntities() and countRelationships() take the same criteria as their find() counterparts, and the code above the repository uses them to answer "how many" without pulling the instances back. A count that disagrees with the search is worse than no count at all: it is used to size pages and to decide whether there is anything to fetch, so a wrong answer is acted upon rather than noticed.
The assertion is that the count is at least the number of instances this test created, and matches the instances find() reports for the same criteria that this repository is answerable for counting - those it homes, and those it replicates on behalf of a non-cohort provenance. It is not an absolute number because the repository legitimately holds other instances of the type, and it is not the whole of what find() returns because find() also returns reference copies of instances another member homes; those are counted by that member, so counting them here too would double them in a federated count.
-
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
ConstructorsConstructorDescriptionTestSupportedInstanceCounts(RepositoryConformanceWorkPad workPad, EntityDef entityDef) 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
-
TestSupportedInstanceCounts
Set up the test case.- Parameters:
workPad- place for parameters and resultsentityDef- the entity type being counted
-
-
Method Details
-
run
Run the test.- Specified by:
runin classOpenMetadataTestCase- Throws:
Exception- something went wrong that the conformance suite could not handle
-