Class TestSupportedRelationshipEffectivityConditions

java.lang.Object
org.odpi.openmetadata.conformance.beans.OpenMetadataTestCase
org.odpi.openmetadata.conformance.tests.repository.RepositoryConformanceTestCase
org.odpi.openmetadata.conformance.tests.repository.instances.TestSupportedRelationshipEffectivityConditions

public class TestSupportedRelationshipEffectivityConditions extends RepositoryConformanceTestCase
The relationship counterpart of the entity effectivity conditions test: that a repository can select relationships by their effectivity dates.
It exists separately rather than as more assertions on the entity test because of the last case below, which cannot be expressed with entities at all. The condition is built from two groups of nested conditions, and each group carries no property, operator or value of its own - all it does is group. A repository that evaluates such a group by testing it against every property of the instance has nothing to test when the instance has no properties, and can end up excluding it.
Entities cannot demonstrate that. Most entity types carry a unique attribute - qualifiedName on everything under Referenceable - and the repository refuses to create an instance of such a type with no properties at all. Relationships are the opposite: a great many open metadata relationship types define no attributes whatsoever, so a bare link with no properties is the ordinary case rather than a corner one, and every one of those instances is at risk.
The condition asserted here is the one a push-down of the effectivity window would use:
     ALL of:
         ANY of: effectiveFromTime IS NULL, effectiveFromTime <= T
         ANY of: effectiveToTime   IS NULL, effectiveToTime   >  T
 
Getting this wrong does not throw - it silently changes which relationships a caller sees.
  • Constructor Details

    • TestSupportedRelationshipEffectivityConditions

      public TestSupportedRelationshipEffectivityConditions(RepositoryConformanceWorkPad workPad, Map<String,EntityDef> entityDefs, RelationshipDef relationshipDef)
      Set up the test.
      Parameters:
      workPad - working area for the conformance run
      entityDefs - the entity types supported by the repository under test
      relationshipDef - the relationship type being tested
  • Method Details