Class TestSupportedRelationshipEndCriteria


public class TestSupportedRelationshipEndCriteria extends RepositoryConformanceTestCase
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:
     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.
  • Constructor Details

    • TestSupportedRelationshipEndCriteria

      public TestSupportedRelationshipEndCriteria(RepositoryConformanceWorkPad workPad, Map<String,EntityDef> entityDefs, RelationshipDef relationshipDef)
      Set up the test case.
      Parameters:
      workPad - place for parameters and results
      entityDefs - the entity types supported by the repository under test
      relationshipDef - the relationship type being tested
  • Method Details