Class TestSupportedEffectivityConditions
java.lang.Object
org.odpi.openmetadata.conformance.beans.OpenMetadataTestCase
org.odpi.openmetadata.conformance.tests.repository.RepositoryConformanceTestCase
org.odpi.openmetadata.conformance.tests.repository.instances.TestSupportedEffectivityConditions
Test that a repository can select instances by their effectivity dates.
The code above the repository asks "which instances are in effect at this moment" constantly, and today it answers that question in Java, after retrieval, by testing each instance's effectiveFromTime and effectiveToTime. Both repositories hold those two values as searchable header properties, so the question can be asked of the repository instead - but only if the null cases behave, because an open-ended effectivity is the normal case, not the exception.
The condition asserted here is the one such a push-down would use:
The code above the repository asks "which instances are in effect at this moment" constantly, and today it answers that question in Java, after retrieval, by testing each instance's effectiveFromTime and effectiveToTime. Both repositories hold those two values as searchable header properties, so the question can be asked of the repository instead - but only if the null cases behave, because an open-ended effectivity is the normal case, not the exception.
The condition asserted here is the one such a push-down would use:
ALL of:
ANY of: effectiveFromTime IS NULL, effectiveFromTime <= T
ANY of: effectiveToTime IS NULL, effectiveToTime > T
Getting the null handling wrong here does not throw - it silently changes which elements a caller sees,
which is why this needs certifying before anything relies on it.-
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
ConstructorsConstructorDescriptionTestSupportedEffectivityConditions(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
-
TestSupportedEffectivityConditions
public TestSupportedEffectivityConditions(RepositoryConformanceWorkPad workPad, EntityDef entityDef) Set up the test case.- Parameters:
workPad- place for parameters and resultsentityDef- the entity 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
-