java.lang.Object
org.assertj.core.api.AbstractAssert<LogicSchemaAssert,edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicSchema>
edu.upc.fib.inlab.imp.kse.logics.logicschema.assertions.LogicSchemaAssert
All Implemented Interfaces:
org.assertj.core.api.Assert<LogicSchemaAssert,edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicSchema>, org.assertj.core.api.Descriptable<LogicSchemaAssert>, org.assertj.core.api.ExtensionPoints<LogicSchemaAssert,edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicSchema>

public class LogicSchemaAssert extends org.assertj.core.api.AbstractAssert<LogicSchemaAssert,edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicSchema>
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Field Summary

    Fields inherited from class org.assertj.core.api.AbstractAssert

    actual, info, myself, objects, throwUnsupportedExceptionOnEquals
  • Constructor Summary

    Constructors
    Constructor
    Description
    LogicSchemaAssert(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicSchema logicSchema)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    assertAllLogicConstraintsAreEquivalent(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicSchema expectedSchema)
    Asserts whether the actual logicSchema constraints are equivalent to the expectedSchema constraints.
    assertAllPredicatesAreEquivalent(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicSchema expectedSchema)
    Asserts whether the actual logicSchema predicates (base or derived) are equivalent to the expectedSchema.
    assertThat(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicSchema actual)
     
     
    containsEquivalentConstraint(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicConstraint expectedConstraint)
    Checks whether the actual schema contains a constraint equivalent to expectedConstraint considering that two derived ordinary literals are equivalent if their derivation rules are equivalent
    containsEquivalentConstraint(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicConstraint expectedConstraint, LogicSchemaAssert.DerivedLiteralStrategy derivedLiteralsStrategy)
    Checks whether the actual schema contains a constraint equivalent to expectedConstraint considering that two derived ordinary literals are equivalent according to the given strategy.
    containsEquivalentDerivationRule(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.DerivationRule expectedRule)
    Checks whether the actual schema contains a derivation rule equivalent to expectedRule considering that two derived ordinary literals are equivalent iff their definition rules are equivalent
    containsEquivalentDerivationRule(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.DerivationRule expectedRule, LogicSchemaAssert.DerivedLiteralStrategy derivedLiteralsStrategy)
    Checks whether the actual schema contains a derivation rule equivalent to expectedRule considering that two derived ordinary literals are equivalent according to the given strategy.
    containsEquivalentPredicate(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Predicate expectedPredicate)
    Checks whether the actual schema contains a predicate equivalent to expectedPredicate considering that two derived ordinary literals (appearing in the definition rules of the given predicate) are equivalent iff their definition rules are equivalent
    containsEquivalentPredicate(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Predicate expectedPredicate, LogicSchemaAssert.DerivedLiteralStrategy derivedLiteralsStrategy)
    Checks whether the actual schema contains a predicate equivalent to expectedPredicate considering that two derived ordinary literals (appearing in the definition rules of the given predicate) are equivalent according to the derivedLiteralStrategy given
     
     
    containsPredicate(String predicateName, int arity)
     
    void
     
     
    isIsomorphicTo(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicSchema expected)
     
    isLogicallyEquivalentTo(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicSchema expectedSchema)
    Asserts whether the actual logicSchema is equivalent to the expectedSchema.
    usingIsomorphismOptions(edu.upc.fib.inlab.imp.kse.logics.logicschema.services.comparator.isomorphism.IsomorphismOptions options)
     

    Methods inherited from class org.assertj.core.api.AbstractAssert

    areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.assertj.core.api.Descriptable

    as, as, as, describedAs
  • Constructor Details

    • LogicSchemaAssert

      public LogicSchemaAssert(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicSchema logicSchema)
  • Method Details

    • assertThat

      public static LogicSchemaAssert assertThat(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicSchema actual)
    • containsPredicate

      public LogicSchemaAssert containsPredicate(String predicateName, int arity)
    • containsConstraintID

      public LogicSchemaAssert containsConstraintID(String constraintID)
    • containsExactlyThesePredicateNames

      public LogicSchemaAssert containsExactlyThesePredicateNames(String... predicateNames)
    • containsExactlyTheseConstraintIDs

      public LogicSchemaAssert containsExactlyTheseConstraintIDs(String... constraintIDs)
    • hasConstraintsSize

      public void hasConstraintsSize(int size)
    • isEmpty

      public LogicSchemaAssert isEmpty()
    • isLogicallyEquivalentTo

      public LogicSchemaAssert isLogicallyEquivalentTo(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicSchema expectedSchema)
      Asserts whether the actual logicSchema is equivalent to the expectedSchema. That is, whether they have equivalent predicates (base, and derived), and equivalent constraints. Do note that this comparison is NOT agnostic with the name of the derived predicates.

      Since this check is not decidable, this method applies a sound (but not complete) strategy. In particular, for each normal clause of one schema, it tries to find a homomorphic normal clause of the other schema, and viceversa.

      Parameters:
      expectedSchema - not null
      Returns:
      this assert
    • isIsomorphicTo

      public LogicSchemaAssert isIsomorphicTo(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicSchema expected)
    • assertAllLogicConstraintsAreEquivalent

      public LogicSchemaAssert assertAllLogicConstraintsAreEquivalent(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicSchema expectedSchema)
      Asserts whether the actual logicSchema constraints are equivalent to the expectedSchema constraints. Do note that this comparison IS agnostic with the name of the derived predicates.

      Since this check is not decidable, this method applies a sound (but not complete) strategy. In particular, for each logicConstraint of one schema, it tries to find a homomorphic logicConstraint of the other schema, and viceversa. In such case, two derived ordinary literals are considered to be homomorphic if they have homomorphic definition rules. In practice, this means that two logic constraints are equivalent if they are the same up-to renaming of variables and derived predicate names.

      Parameters:
      expectedSchema - not null
      Returns:
      this assert
    • assertAllPredicatesAreEquivalent

      public LogicSchemaAssert assertAllPredicatesAreEquivalent(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicSchema expectedSchema)
      Asserts whether the actual logicSchema predicates (base or derived) are equivalent to the expectedSchema. Do note that this comparison is NOT agnostic with the name of the derived predicates.

      Since this check is not decidable, this method applies a sound (but not complete) strategy. In particular, for each derivation rule of one schema, it tries to find a homomorphic derivation rule of the other schema, and viceversa.

      Parameters:
      expectedSchema - not null
      Returns:
      this assert
    • containsEquivalentConstraint

      public LogicSchemaAssert containsEquivalentConstraint(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicConstraint expectedConstraint)
      Checks whether the actual schema contains a constraint equivalent to expectedConstraint considering that two derived ordinary literals are equivalent if their derivation rules are equivalent
      Parameters:
      expectedConstraint - not null
      Returns:
      this assert
    • containsEquivalentConstraint

      public LogicSchemaAssert containsEquivalentConstraint(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicConstraint expectedConstraint, LogicSchemaAssert.DerivedLiteralStrategy derivedLiteralsStrategy)
      Checks whether the actual schema contains a constraint equivalent to expectedConstraint considering that two derived ordinary literals are equivalent according to the given strategy.
      Parameters:
      expectedConstraint - not null
      derivedLiteralsStrategy - not null
      Returns:
      this assert
    • containsEquivalentDerivationRule

      public LogicSchemaAssert containsEquivalentDerivationRule(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.DerivationRule expectedRule, LogicSchemaAssert.DerivedLiteralStrategy derivedLiteralsStrategy)
      Checks whether the actual schema contains a derivation rule equivalent to expectedRule considering that two derived ordinary literals are equivalent according to the given strategy.
      Parameters:
      expectedRule - not null
      derivedLiteralsStrategy - not null
      Returns:
      this assert
    • containsEquivalentDerivationRule

      public LogicSchemaAssert containsEquivalentDerivationRule(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.DerivationRule expectedRule)
      Checks whether the actual schema contains a derivation rule equivalent to expectedRule considering that two derived ordinary literals are equivalent iff their definition rules are equivalent
      Parameters:
      expectedRule - not null
      Returns:
      this assert
    • containsEquivalentPredicate

      public LogicSchemaAssert containsEquivalentPredicate(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Predicate expectedPredicate, LogicSchemaAssert.DerivedLiteralStrategy derivedLiteralsStrategy)
      Checks whether the actual schema contains a predicate equivalent to expectedPredicate considering that two derived ordinary literals (appearing in the definition rules of the given predicate) are equivalent according to the derivedLiteralStrategy given
      Parameters:
      expectedPredicate - not null
      derivedLiteralsStrategy - not null
      Returns:
      this assert
    • containsEquivalentPredicate

      public LogicSchemaAssert containsEquivalentPredicate(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Predicate expectedPredicate)
      Checks whether the actual schema contains a predicate equivalent to expectedPredicate considering that two derived ordinary literals (appearing in the definition rules of the given predicate) are equivalent iff their definition rules are equivalent
      Parameters:
      expectedPredicate - not null
      Returns:
      this assert
    • usingIsomorphismOptions

      public LogicSchemaAssert usingIsomorphismOptions(edu.upc.fib.inlab.imp.kse.logics.logicschema.services.comparator.isomorphism.IsomorphismOptions options)