Class 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>
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals
-
Constructor Summary
ConstructorDescriptionLogicSchemaAssert
(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicSchema logicSchema) -
Method Summary
Modifier and TypeMethodDescriptionassertAllLogicConstraintsAreEquivalent
(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.static LogicSchemaAssert
assertThat
(edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.LogicSchema actual) containsConstraintID
(String constraintID) 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 equivalentcontainsEquivalentConstraint
(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 equivalentcontainsEquivalentDerivationRule
(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 equivalentcontainsEquivalentPredicate
(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 givencontainsExactlyTheseConstraintIDs
(String... constraintIDs) containsExactlyThesePredicateNames
(String... predicateNames) containsPredicate
(String predicateName, int arity) void
hasConstraintsSize
(int size) isEmpty()
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
-
containsConstraintID
-
containsExactlyThesePredicateNames
-
containsExactlyTheseConstraintIDs
-
hasConstraintsSize
public void hasConstraintsSize(int size) -
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 nullderivedLiteralsStrategy
- 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 nullderivedLiteralsStrategy
- 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 nullderivedLiteralsStrategy
- 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)
-