Class IgnoreCaseComparator

  • All Implemented Interfaces:
    IModelComparator

    public class IgnoreCaseComparator
    extends Object
    implements IModelComparator
    Dummy custom comparator which only does an in-order traversal of both models, checking that all attributes are the same while (ignoring case and ignoring references). Only usable for internal testing, to avoid a dependency on the full-featured EMFModelComparator. This class is intentionally *NOT* registered as an OSGi extension, to test how to register comparators manually in non-OSGi environments.
    • Constructor Detail

      • IgnoreCaseComparator

        public IgnoreCaseComparator()
    • Method Detail

      • compare

        public Object compare​(IModel expectedModel,
                              IModel obtainedModel)
                       throws Exception
        Description copied from interface: IModelComparator
        Returns an object with the differences between this model and otherModel. If there are no differences, returns null. The exact configuration of the comparison depends on the model. For instance, unique identifiers (such as XMI IDs) may be ignored if the main object of these comparisons is to test model transformations. These tend to produce different unique identifiers each time they are run.
        Specified by:
        compare in interface IModelComparator
        Throws:
        IllegalArgumentException - The models cannot be compared: for instance, they use incompatible drivers.
        Exception - There was some other kind of problem when performing the comparison.