Class MethodBasedConstraint

  • All Implemented Interfaces:
    Constraint

    public class MethodBasedConstraint
    extends AbstractConstraint
    Defines a constraint for combinatorial testing as a collection of parameters names and a function which can check whether any given value assignment for those parameters is valid or not according to some logic defined by the function.
    • Constructor Detail

      • MethodBasedConstraint

        public MethodBasedConstraint​(String name,
                                     List<String> parameterNames,
                                     ConstraintFunction constraintFunction,
                                     ConstraintStatus constraintStatus)
        Creates a new constraint. It is most efficient if only the parameters really involved and not additional ones are given.
        Parameters:
        name - a name to improve readability without further semantics
        parameterNames - the names of all involved parameters. Must not be, or contain null, or be empty
        constraintFunction - the function by which the values for the parameters are constrained. Must not be null
        constraintStatus - status is either Unknown or Correct which is related to conflict detection
    • Method Detail

      • checkIfValid

        public boolean checkIfValid​(Combination combination)
        Description copied from interface: Constraint
        Checks whether the given combination is valid or not.
        Parameters:
        combination - combination to be checked.
        Returns:
        true iff the combination is valid.