deprecate translations which shall be removed with 0.10.0

This commit is contained in:
Robert Stoll
2020-01-14 16:08:06 +01:00
parent a1617fb019
commit 9899d9fabf
17 changed files with 31 additions and 5 deletions

View File

@@ -44,6 +44,7 @@ fun <T> _collectForComposition(
collectedAssertions
} catch (@Suppress("DEPRECATION") e: ch.tutteli.atrium.creating.PlantHasNoSubjectException) {
@Suppress("DEPRECATION")
listOf(
AssertImpl.builder.explanatoryGroup
.withWarningType

View File

@@ -63,7 +63,10 @@ abstract class IterableAnyAssertionsSpec(
@Suppress("DEPRECATION")
asAssert().returnValueOf(subject::dec).asExpect().toBe(1.0)
}
}.toThrow<AssertionError> { messageContains(ErrorMessages.SUBJECT_ACCESSED_TOO_EARLY.getDefault()) }
}.toThrow<AssertionError> {
@Suppress("DEPRECATION")
messageContains(ErrorMessages.SUBJECT_ACCESSED_TOO_EARLY.getDefault())
}
}
}

View File

@@ -98,7 +98,10 @@ abstract class IterableContainsInAnyOrderAtLeast1EntriesAssertionsSpec(
@Suppress("DEPRECATION")
asAssert().returnValueOf(subject::dec).asExpect().toBe(1.0)
})
}.toThrow<AssertionError> { messageContains(ErrorMessages.SUBJECT_ACCESSED_TOO_EARLY.getDefault()) }
}.toThrow<AssertionError> {
@Suppress("DEPRECATION")
messageContains(ErrorMessages.SUBJECT_ACCESSED_TOO_EARLY.getDefault())
}
}
}

View File

@@ -108,7 +108,10 @@ abstract class IterableContainsInAnyOrderOnlyEntriesAssertionsSpec(
@Suppress("DEPRECATION")
asAssert().returnValueOf(subject::dec).asExpect().toBe(1.0)
})
}.toThrow<AssertionError> { messageContains(ErrorMessages.SUBJECT_ACCESSED_TOO_EARLY.getDefault()) }
}.toThrow<AssertionError> {
@Suppress("DEPRECATION")
messageContains(ErrorMessages.SUBJECT_ACCESSED_TOO_EARLY.getDefault())
}
}
}

View File

@@ -134,6 +134,7 @@ abstract class IterableContainsInOrderOnlyEntriesAssertionsSpec(
asAssert().returnValueOf(subject::dec).asExpect().toBe(1.0)
})
}.toThrow<AssertionError> {
@Suppress("DEPRECATION")
messageContains(ErrorMessages.SUBJECT_ACCESSED_TOO_EARLY.getDefault())
}
}

View File

@@ -26,7 +26,9 @@ enum class DescriptionIterableAssertion(override val value: String) : StringBase
INDEX_FROM_TO("Index %s..%s"),
NUMBER_OF_OCCURRENCES("Anzahl Treffer"),
SIZE_EXCEEDED("❗❗ hasNext() hat `false` zurückgegeben"),
@Deprecated("Will be removed with 0.10.0")
CANNOT_EVALUATE_SUBJECT_EMPTY_ITERABLE("$COULD_NOT_EVALUATE_DEFINED_ASSERTIONS -- `Iterable` gibt keinen nächsten Eintrag zurück.\n$VISIT_COULD_NOT_EVALUATE_ASSERTIONS"),
@Deprecated("Will be removed with 0.10.0")
CANNOT_EVALUATE_SUBJECT_ONLY_NULL("$COULD_NOT_EVALUATE_DEFINED_ASSERTIONS -- `Iterable` gibt nur `null` zurück.\n$VISIT_COULD_NOT_EVALUATE_ASSERTIONS"),
WARNING_ADDITIONAL_ENTRIES("zusätzliche Einträge entdeckt"),
WARNING_MISMATCHES("folgende Einträge erfüllten keine Aussage (Diskrepanzen)"),

View File

@@ -7,6 +7,7 @@ import ch.tutteli.atrium.reporting.translating.StringBasedTranslatable
* Contains the [DescriptiveAssertion.description]s of the assertion functions which are applicable to [Map].
*/
enum class DescriptionListAssertion(override val value: String) : StringBasedTranslatable {
@Deprecated("Will be removed with 0.10.0")
CANNOT_EVALUATE_INDEX_OUT_OF_BOUNDS("$COULD_NOT_EVALUATE_DEFINED_ASSERTIONS -- Index ausserhalb der Grenzen (index out of bounds).\n$VISIT_COULD_NOT_EVALUATE_ASSERTIONS"),
INDEX_OUT_OF_BOUNDS("❗❗ Index ausserhalb der Grenzen (index out of bounds)")
}

View File

@@ -7,6 +7,7 @@ import ch.tutteli.atrium.reporting.translating.StringBasedTranslatable
* Contains the [DescriptiveAssertion.description]s of the assertion functions which are applicable to [Map].
*/
enum class DescriptionMapAssertion(override val value: String) : StringBasedTranslatable {
@Deprecated("Will be removed with 0.10.0")
CANNOT_EVALUATE_KEY_DOES_NOT_EXIST("$COULD_NOT_EVALUATE_DEFINED_ASSERTIONS -- der gegebene Key existiert nicht.\n$VISIT_COULD_NOT_EVALUATE_ASSERTIONS"),
CONTAINS_IN_ANY_ORDER("enthält, in beliebiger Reihenfolge"),
CONTAINS_KEY("enthält Key"),

View File

@@ -18,6 +18,8 @@ enum class DescriptionThrowableAssertion(override val value: String) : StringBas
OCCURRED_EXCEPTION_MESSAGE("message"),
OCCURRED_EXCEPTION_STACKTRACE("stacktrace"),
OCCURRED_EXCEPTION_SUPPRESSED("suppressed"),
@Deprecated("Will be removed with 0.10.0")
IS_NOT_THROWN_1("wird"),
@Deprecated("Will be removed with 0.10.0")
IS_NOT_THROWN_2("nicht geworfen"),
}

View File

@@ -12,5 +12,6 @@ enum class ErrorMessages(override val value: String) : StringBasedTranslatable {
HINT_AT_LEAST_ONE_ASSERTION_DEFINED("Manchmal kann man eine Alternative zu `{ }` verwenden. Zum Beispiel, anstelle von `wirft<..> { }` sollten Sie `wirft<..>()` verwenden."),
DEDSCRIPTION_BASED_ON_SUBJECT("Kann die Beschreibung NICHT anzeigen, da sie auf dem Subjekt der Behauptung beruht, welches nicht definiert ist"),
REPRESENTATION_BASED_ON_SUBJECT_NOT_DEFINED("kann die Representation NICHT evaluieren, da sie auf dem Subjekt der Behauptung beruht, welches nicht definiert ist."),
@Deprecated("Will be removed with 0.10.0")
SUBJECT_ACCESSED_TOO_EARLY("Konnte die zusätzlichen Aussagen (Assertions) nicht auswerten; das Subjekt (subject) wurde zu früh verwendet. Bitte erfassen Sie einen Bug-Report unter $BUG_REPORT_URL inklusive Stacktrace wenn möglich -- vielen Dank."),
}

View File

@@ -18,6 +18,6 @@ enum class DescriptionAnyAssertion(override val value: String) : StringBasedTran
)
NOT_TO_BE(DescriptionBasic.NOT_TO_BE.value),
IS_A("is instance of type"),
IS_SAME("is the same as"),
IS_NOT_SAME("is not the same as")
IS_SAME("is the same instance as"),
IS_NOT_SAME("is not the same instance as")
}

View File

@@ -26,7 +26,9 @@ enum class DescriptionIterableAssertion(override val value: String) : StringBase
INDEX_FROM_TO("index %s..%s"),
NUMBER_OF_OCCURRENCES("number of occurrences"),
SIZE_EXCEEDED("❗❗ hasNext() returned false"),
@Deprecated("Will be removed with 0.10.0")
CANNOT_EVALUATE_SUBJECT_EMPTY_ITERABLE("$COULD_NOT_EVALUATE_DEFINED_ASSERTIONS -- `Iterable` has no next entry.\n$VISIT_COULD_NOT_EVALUATE_ASSERTIONS"),
@Deprecated("Will be removed with 0.10.0")
CANNOT_EVALUATE_SUBJECT_ONLY_NULL("$COULD_NOT_EVALUATE_DEFINED_ASSERTIONS -- `Iterable` returns only `null` for `next()`.\n$VISIT_COULD_NOT_EVALUATE_ASSERTIONS"),
WARNING_ADDITIONAL_ENTRIES("additional entries detected"),
WARNING_MISMATCHES("following entries were mismatched"),

View File

@@ -7,6 +7,7 @@ import ch.tutteli.atrium.reporting.translating.StringBasedTranslatable
* Contains the [DescriptiveAssertion.description]s of the assertion functions which are applicable to [Map].
*/
enum class DescriptionListAssertion(override val value: String) : StringBasedTranslatable {
@Deprecated("Will be removed with 0.10.0")
CANNOT_EVALUATE_INDEX_OUT_OF_BOUNDS("$COULD_NOT_EVALUATE_DEFINED_ASSERTIONS -- index out of bounds.\n$VISIT_COULD_NOT_EVALUATE_ASSERTIONS"),
INDEX_OUT_OF_BOUNDS("❗❗ index out of bounds"),
}

View File

@@ -7,6 +7,7 @@ import ch.tutteli.atrium.reporting.translating.StringBasedTranslatable
* Contains the [DescriptiveAssertion.description]s of the assertion functions which are applicable to [Map].
*/
enum class DescriptionMapAssertion(override val value: String) : StringBasedTranslatable {
@Deprecated("Will be removed with 0.10.0")
CANNOT_EVALUATE_KEY_DOES_NOT_EXIST("$COULD_NOT_EVALUATE_DEFINED_ASSERTIONS -- given key does not exist.\n$VISIT_COULD_NOT_EVALUATE_ASSERTIONS"),
CONTAINS_IN_ANY_ORDER("contains, in any order"),
CONTAINS_KEY("contains key"),

View File

@@ -18,6 +18,8 @@ enum class DescriptionThrowableAssertion(override val value: String) : StringBas
OCCURRED_EXCEPTION_MESSAGE("message"),
OCCURRED_EXCEPTION_STACKTRACE("stacktrace"),
OCCURRED_EXCEPTION_SUPPRESSED("suppressed"),
@Deprecated("Will be removed with 0.10.0")
IS_NOT_THROWN_1("is"),
@Deprecated("Will be removed with 0.10.0")
IS_NOT_THROWN_2("not thrown at all"),
}

View File

@@ -16,5 +16,6 @@ enum class DescriptionTypeTransformationAssertion(override val value: String) :
ReplaceWith("DescriptionAnyAssertion.IS_A", "ch.tutteli.atrium.translations.DescriptionAnyAssertion")
)
IS_A("is type or sub-type of"),
@Deprecated("Will be removed with 0.10.0")
WARNING_DOWN_CAST_FAILED("$COULD_NOT_EVALUATE_DEFINED_ASSERTIONS -- the down-cast to %s failed.\n$VISIT_COULD_NOT_EVALUATE_ASSERTIONS"),
}

View File

@@ -12,5 +12,6 @@ enum class ErrorMessages(override val value: String) : StringBasedTranslatable {
HINT_AT_LEAST_ONE_ASSERTION_DEFINED("Sometimes you can use an alternative to `{ }` For instance, instead of `toThrow<..> { }` you should use `toThrow<..>()`"),
DEDSCRIPTION_BASED_ON_SUBJECT("CANNOT show description as it is based on subject which is not defined"),
REPRESENTATION_BASED_ON_SUBJECT_NOT_DEFINED("CANNOT evaluate representation as it is based on subject which is not defined."),
@Deprecated("Will be removed with 0.10.0")
SUBJECT_ACCESSED_TOO_EARLY("Could not evaluate sub-assertions; the subject was accessed too early. Please report a bug at $BUG_REPORT_URL including stacktrace if possible -- thank you"),
}