コード例 #1
0
  /**
   * Compares two IncidenceClasses objects.
   *
   * @param incidence IncidenceClasses from the Schema.
   * @param gIncidence IncidenceClasses from the SchemaGraph.
   */
  private final void compareIncidenceClass(
      de.uni_koblenz.jgralab.schema.IncidenceClass incidence,
      IncidenceClass gIncidence,
      IncidenceDirection gDirection) {

    currentName = "IncidenceClass";

    checkExistingsOfSchemaElement(incidence);
    checkExistingsOfSchemaGraphElement(gIncidence);

    compareVertexClassesOfIncidenceClasses(incidence, gIncidence);

    currentName =
        incidence.getVertexClass().getQualifiedName()
            + " -- "
            + incidence.getEdgeClass().getQualifiedName();

    // Qualified Name, min, max and rolename are compared.
    compareAggregationKind(incidence, gIncidence);
    compareMaxValue(incidence, gIncidence);
    compareMinValue(incidence, gIncidence);
    compareRoleNames(incidence, gIncidence);
    compareDirection(incidence, gDirection);
    compareSubsettedIncidenceClasses(incidence, gIncidence);
  }
コード例 #2
0
  private void compareVertexClassesOfIncidenceClasses(
      de.uni_koblenz.jgralab.schema.IncidenceClass incidence, IncidenceClass gIncidence) {
    EndsAt edgeToVertexClass = gIncidence.getFirstEndsAtIncidence();
    assertTrue(
        "That should be an instance of \"VertexClass\".",
        edgeToVertexClass.getThat() instanceof VertexClass);

    VertexClass gVertexClass = (VertexClass) edgeToVertexClass.getThat();
    assertTrue(edgeToVertexClass.getNextEndsAtIncidence(OUTGOING) == null);
    de.uni_koblenz.jgralab.schema.VertexClass vertexClass = incidence.getVertexClass();

    assertFalse("There is no \"VertexClass\" defined in the schema.", vertexClass == null);
    assertFalse("There is no \"VertexClass\" defined in the schema graph.", gVertexClass == null);

    assertEquals(
        "The qualifed names of both \"VertexClasses\" do not match: "
            + vertexClass.getQualifiedName()
            + " != "
            + gVertexClass.get_qualifiedName(),
        vertexClass.getQualifiedName(),
        gVertexClass.get_qualifiedName());
  }