Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove deprecated stuff part 2 #859

Merged
merged 5 commits into from
Apr 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package ch.tutteli.atrium.assertions

import ch.tutteli.atrium.core.CoreFactory

/**
* A marker interface for types which can be used to identify bullet points in
* [CoreFactory.registerTextAssertionFormatterCapabilities].
* A marker interface for types which can be used to identify bullet points.
*/
interface BulletPointIdentifier
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package ch.tutteli.atrium.assertions

import ch.tutteli.atrium.core.CoreFactory

/**
* Represents the [AssertionGroupType] for [AssertionGroup]s which contain some kind of feature assertions.
*/
interface FeatureAssertionGroupType : AssertionGroupType

/**
* This class is only used as identifier for [CoreFactory.registerTextAssertionFormatterCapabilities].
* This class is only used as [BulletPointIdentifier].
*/
class PrefixFeatureAssertionGroupHeader private constructor() : BulletPointIdentifier

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package ch.tutteli.atrium.assertions

import ch.tutteli.atrium.core.CoreFactory
import ch.tutteli.atrium.reporting.AssertionFormatter
import ch.tutteli.atrium.reporting.Reporter

Expand All @@ -20,16 +19,12 @@ interface SummaryAssertionGroupType : DoNotFilterAssertionGroupType
/**
* Represents the identifier for bullet points used to prefix [Assertion]s which hold, in context of an
* [AssertionGroup] with type [SummaryAssertionGroupType].
*
* See also [CoreFactory.registerTextAssertionFormatterCapabilities].
*/
class PrefixSuccessfulSummaryAssertion private constructor() : BulletPointIdentifier

/**
* Represents the identifier for bullet points used to prefix [Assertion]s which do not hold, in context of an
* [AssertionGroup] with type [SummaryAssertionGroupType].
*
* See also [CoreFactory.registerTextAssertionFormatterCapabilities].
*/
class PrefixFailingSummaryAssertion private constructor() : BulletPointIdentifier

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//TODO remove file with 0.18.0
@file:Suppress("DEPRECATION")

package ch.tutteli.atrium.core

import ch.tutteli.atrium.assertions.*
Expand All @@ -19,7 +22,7 @@ annotation class ExperimentalNewExpectTypes
*
* It loads the implementation lazily via [loadSingleService].
*/
//TODO 0.17.0 deprecate
@Deprecated("Retrieve components via ComponentFactoryContainer; will be removed with 0.18.0")
val coreFactory by lazy { loadSingleService(CoreFactory::class) }

/**
Expand All @@ -31,7 +34,7 @@ val coreFactory by lazy { loadSingleService(CoreFactory::class) }
* Notice, the platform specific types have to define the default methods for `newReportingPlantNullable`
* (otherwise we are not binary backward compatible) -> will be moved to CoreFactoryCommon with 1.0.0
*/
//TODO 0.17.0 deprecate
@Deprecated("Retrieve components via ComponentFactoryContainer; will be removed with 0.18.0")
expect interface CoreFactory : CoreFactoryCommon

/**
Expand All @@ -52,7 +55,7 @@ expect interface CoreFactory : CoreFactoryCommon
* - [Reporter]
* - [AtriumErrorAdjuster]
*/
//TODO 0.17.0 deprecate
@Deprecated("Retrieve components via ComponentFactoryContainer; will be removed with 0.18.0")
interface CoreFactoryCommon {

/**
Expand All @@ -64,7 +67,7 @@ interface CoreFactoryCommon {
*
* @return The newly created method call formatter.
*/
@Deprecated("Create a new MethodCallFormatter via the ComponentFactoryContainer, e.g. via _logic.components.build<MethodCallFormatter>(); will be removed with 0.17.0")
@Deprecated("Create a new MethodCallFormatter via the ComponentFactoryContainer, e.g. via _logic.components.build<MethodCallFormatter>(); will be removed with 0.18.0")
fun newMethodCallFormatter(): MethodCallFormatter


Expand All @@ -91,7 +94,7 @@ interface CoreFactoryCommon {
* @throws IllegalArgumentException in case [primaryLocale] or [fallbackLocales] have as language `no` or if they
* have: as language `zh`, country is not set and script is either `Hant` or `Hans`.
*/
@Deprecated("Create a new Translator via the ComponentFactoryContainer, e.g. via _logic.components.build<Translator>(); will be removed with 0.17.0")
@Deprecated("Create a new Translator via the ComponentFactoryContainer, e.g. via _logic.components.build<Translator>(); will be removed with 0.18.0")
fun newTranslator(
translationSupplier: TranslationSupplier,
localeOrderDecider: LocaleOrderDecider,
Expand All @@ -108,7 +111,7 @@ interface CoreFactoryCommon {
*
* @return The newly created [Locale] order decider.
*/
@Deprecated("Create a new LocaleOrderDecider via the ComponentFactoryContainer, e.g. via _logic.components.build<LocaleOrderDecider>(); will be removed with 0.17.0")
@Deprecated("Create a new LocaleOrderDecider via the ComponentFactoryContainer, e.g. via _logic.components.build<LocaleOrderDecider>(); will be removed with 0.18.0")
fun newLocaleOrderDecider(): LocaleOrderDecider

/**
Expand All @@ -117,15 +120,15 @@ interface CoreFactoryCommon {
*
* @return The newly created object formatter.
*/
@Deprecated("Create a new ObjectFormatter via the ComponentFactoryContainer, e.g. via _logic.components.build<ObjectFormatter>(); will be removed with 0.17.0")
@Deprecated("Create a new ObjectFormatter via the ComponentFactoryContainer, e.g. via _logic.components.build<ObjectFormatter>(); will be removed with 0.18.0")
fun newDetailedObjectFormatter(translator: Translator): ObjectFormatter

/**
* Creates an [AssertionFormatterController] which all be used per default for [newAssertionFormatterFacade].
*
* @return The newly created assertion formatter controller.
*/
@Deprecated("Open an issue in case you used this; Will be removed with 0.17.0")
@Deprecated("Open an issue in case you used this; will be removed with 0.18.0")
fun newAssertionFormatterController(): AssertionFormatterController

/**
Expand All @@ -135,7 +138,7 @@ interface CoreFactoryCommon {
*
* @return The newly created assertion formatter facade.
*/
@Deprecated("Open an issue in case you used this; Will be removed with 0.17.0")
@Deprecated("Open an issue in case you used this; will be removed with 0.18.0")
fun newAssertionFormatterFacade(assertionFormatterController: AssertionFormatterController): AssertionFormatterFacade

/**
Expand All @@ -154,7 +157,7 @@ interface CoreFactoryCommon {
*
* @return The newly created assertion formatter.
*/
@Deprecated("Create it via TextAssertionPairFormatter.newSameLine(...); will be removed with 0.17.0")
@Deprecated("Create it via TextAssertionPairFormatter.newSameLine(...); will be removed with 0.18.0")
fun newTextSameLineAssertionPairFormatter(
objectFormatter: ObjectFormatter,
translator: Translator
Expand All @@ -178,7 +181,7 @@ interface CoreFactoryCommon {
*
* @return The newly created assertion formatter.
*/
@Deprecated("Create it via TextAssertionPairFormatter.newNextLine(...); will be removed with 0.17.0")
@Deprecated("Create it via TextAssertionPairFormatter.newNextLine(...); will be removed with 0.18.0")
fun newTextNextLineAssertionPairFormatter(
objectFormatter: ObjectFormatter,
translator: Translator
Expand All @@ -199,7 +202,7 @@ interface CoreFactoryCommon {
*
* @return The newly created assertion formatter.
*/
@Deprecated("Open an issue in case you used this; Will be removed with 0.17.0")
@Deprecated("Open an issue in case you used this; will be removed with 0.18.0")
fun newTextFallbackAssertionFormatter(
bulletPoints: Map<KClass<out BulletPointIdentifier>, String>,
assertionFormatterController: AssertionFormatterController,
Expand All @@ -221,7 +224,7 @@ interface CoreFactoryCommon {
*
* @return The newly created assertion formatter.
*/
@Deprecated("Open an issue in case you used this; Will be removed with 0.17.0")
@Deprecated("Open an issue in case you used this; will be removed with 0.18.0")
fun newTextFeatureAssertionGroupFormatter(
bulletPoints: Map<KClass<out BulletPointIdentifier>, String>,
assertionFormatterController: AssertionFormatterController,
Expand All @@ -242,7 +245,7 @@ interface CoreFactoryCommon {
*
* @return The newly created assertion formatter.
*/
@Deprecated("Open an issue in case you used this; Will be removed with 0.17.0")
@Deprecated("Open an issue in case you used this; will be removed with 0.18.0")
fun newTextListAssertionGroupFormatter(
bulletPoints: Map<KClass<out BulletPointIdentifier>, String>,
assertionFormatterController: AssertionFormatterController,
Expand All @@ -264,7 +267,7 @@ interface CoreFactoryCommon {
*
* @return The newly created assertion formatter.
*/
@Deprecated("Open an issue in case you used this; Will be removed with 0.17.0")
@Deprecated("Open an issue in case you used this; will be removed with 0.18.0")
fun newTextSummaryAssertionGroupFormatter(
bulletPoints: Map<KClass<out BulletPointIdentifier>, String>,
assertionFormatterController: AssertionFormatterController,
Expand All @@ -284,7 +287,7 @@ interface CoreFactoryCommon {
*
* @return The newly created assertion formatter.
*/
@Deprecated("Open an issue in case you used this; Will be removed with 0.17.0")
@Deprecated("Open an issue in case you used this; will be removed with 0.18.0")
fun newTextExplanatoryAssertionGroupFormatter(
bulletPoints: Map<KClass<out BulletPointIdentifier>, String>,
assertionFormatterController: AssertionFormatterController
Expand All @@ -305,7 +308,7 @@ interface CoreFactoryCommon {
* @param objectFormatter The formatter which is used to format objects other than [Assertion]s.
* @param translator The translator which is used to translate [Translatable] such as [DescriptiveAssertion.description].
*/
@Deprecated("Open an issue in case you used this; Will be removed with 0.17.0")
@Deprecated("Open an issue in case you used this; will be removed with 0.18.0")
fun registerTextAssertionFormatterCapabilities(
bulletPoints: Map<KClass<out BulletPointIdentifier>, String>,
assertionFormatterFacade: AssertionFormatterFacade,
Expand Down Expand Up @@ -333,7 +336,7 @@ interface CoreFactoryCommon {
* @return The newly created adjuster.
*/
@Deprecated(
"Use NoOpAtriumErrorAdjuster instead; will be removed with 0.17.0",
"Use NoOpAtriumErrorAdjuster instead; will be removed with 0.18.0",
ReplaceWith("ch.tutteli.atrium.reporting.erroradjusters.NoOpAtriumErrorAdjuster")
)
fun newNoOpAtriumErrorAdjuster(): AtriumErrorAdjuster
Expand All @@ -343,15 +346,15 @@ interface CoreFactoryCommon {
*
* @return The newly created adjuster.
*/
@Deprecated("Create a new RemoveRunnerFromAtriumError via the ComponentFactoryContainer, e.g. via _logic.components.build<RemoveRunnerFromAtriumError>(); will be removed with 0.17.0")
@Deprecated("Create a new RemoveRunnerFromAtriumError via the ComponentFactoryContainer, e.g. via _logic.components.build<RemoveRunnerFromAtriumError>(); will be removed with 0.18.0")
fun newRemoveRunnerAtriumErrorAdjuster(): AtriumErrorAdjuster

/**
* An [AtriumErrorAdjuster] which removes stack frames of Atrium.
*
* @return The newly created adjuster.
*/
@Deprecated("Create a new RemoveAtriumFromAtriumError via the ComponentFactoryContainer, e.g. via _logic.components.build<RemoveAtriumFromAtriumError>(); will be removed with 0.17.0")
@Deprecated("Create a new RemoveAtriumFromAtriumError via the ComponentFactoryContainer, e.g. via _logic.components.build<RemoveAtriumFromAtriumError>(); will be removed with 0.18.0")
fun newRemoveAtriumFromAtriumErrorAdjuster(): AtriumErrorAdjuster

/**
Expand All @@ -365,7 +368,7 @@ interface CoreFactoryCommon {
* @return The newly created adjuster.
*/
@Deprecated(
"Use MultiAtriumErrorAdjuster instead; will be removed with 0.17.0",
"Use MultiAtriumErrorAdjuster instead; will be removed with 0.18.0",
ReplaceWith(
"MultiAtriumErrorAdjuster(firstAdjuster, secondAdjuster, otherAdjusters)",
"ch.tutteli.atrium.reporting.erroradjusters.MultiAtriumErrorAdjuster"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//TODO remove file with 0.18.0
package ch.tutteli.atrium.core.polyfills

import ch.tutteli.kbox.forEachRemaining
Expand All @@ -11,15 +12,15 @@ import kotlin.reflect.KClass
* @throws NoSuchElementException in case there is no service found for [kClass].
* @throws IllegalStateException in case there is more than one service found for [kClass].
*/
//TODO 0.17.0 deprecate
@Deprecated("Retrieve components via ComponentFactoryContainer; will be removed with 0.18.0")
expect fun <T : Any> loadSingleService(kClass: KClass<T>): T

/**
* Loads all available service for the given [kClass].
*
* @return The loaded services as a [Sequence].
*/
//TODO 0.17.0 deprecate
@Deprecated("Retrieve components via ComponentFactoryContainer; will be removed with 0.18.0")
expect fun <T : Any> loadServices(kClass: KClass<T>): Sequence<T>

/**
Expand All @@ -28,7 +29,7 @@ expect fun <T : Any> loadServices(kClass: KClass<T>): Sequence<T>
* @throws NoSuchElementException in case there is no service found for [kClass].
* @throws IllegalStateException in case there is more than one service found for [kClass].
*/
//TODO 0.17.0 deprecate
@Deprecated("Retrieve components via ComponentFactoryContainer; will be removed with 0.18.0")
fun <T : Any> useSingleService(kClass: KClass<T>, itr: Iterator<T>): T {
if (!itr.hasNext()) throw NoSuchElementException("Could not find any implementation for ${kClass.fullName}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface AssertionContainer<T> : @kotlin.Suppress("DEPRECATION") SubjectProvide
*
* Might be we completely remove it without prior notice.
*/
//TODO 0.17.0/0.18.0 maybe it would be better to have proofFactories as val like we have components?
//TODO 0.18.0/0.19.0 maybe it would be better to have proofFactories as val like we have components?
@ExperimentalNewExpectTypes
fun <I : Any> getImpl(kClass: KClass<I>, defaultFactory: () -> I): I

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ch.tutteli.atrium.core.Some
* Provides the subject of an [Assertion].
*
* Notice, this interface had its mere purpose to facilitate the transition from `Assert` to [Expect] -- `Assert` was
* removed in 0.16.0 and thus this interface will be removed with 0.17.0.
* removed in 0.16.0 and thus this interface will be removed with 0.18.0.
*/
@Suppress("DEPRECATION")
@Deprecated("Will be removed with 0.18.0 without replacement, switch to Expect or AssertionContainer")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import ch.tutteli.atrium.assertions.Assertion
import ch.tutteli.atrium.assertions.AssertionGroup
import ch.tutteli.atrium.assertions.ExplanatoryAssertionGroupType
import ch.tutteli.atrium.assertions.InvisibleAssertionGroupType
import ch.tutteli.atrium.core.CoreFactory

/**
* Responsible to control the flow of reporting using [register]ed [AssertionFormatter]s.
Expand All @@ -16,8 +15,7 @@ interface AssertionFormatterController {
* formats it.
*
* The [parameterObject] allows to define an [assertionFilter][AssertionFormatterParameterObject.assertionFilter]
* to filter out [Assertion]s (for instance, filter out messages which hold
* &rarr; see [CoreFactory.newOnlyFailureReporter]).
* to filter out [Assertion]s (for instance, filter out messages which hold.
* Moreover the controller should take into account whether the control flow
* [AssertionFormatterParameterObject.isNotInDoNotFilterGroup] or is in such a group,
* in which case the filtering should not apply.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ch.tutteli.atrium.reporting

import ch.tutteli.atrium.assertions.Assertion
import ch.tutteli.atrium.core.CoreFactory

/**
* Responsible to call an appropriate [AssertionFormatter] which supports [format]ing a given [Assertion].
Expand All @@ -11,8 +10,7 @@ interface AssertionFormatterFacade {
/**
* Formats the given [assertion] and appends the result to the given [sb].
*
* One can define an [assertionFilter] to filter out [Assertion]s
* (for instance, filter out assertions which hold &rarr; see [CoreFactory.newOnlyFailureReporter]).
* One can define an [assertionFilter] to filter out [Assertion]s.
*
* @param sb The [StringBuilder] to which the formatted [assertion] will be appended.
* @param assertion The assertion which should be formatted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ package ch.tutteli.atrium.reporting
* Responsible to format a method call in reporting.
*/
interface MethodCallFormatter {

/**
* Returns a lazy representation of the method call to a method named [methodName] with the given [arguments].
*
* @param methodName The name of the method for which a call with the given [arguments] should be formatted.
* @param arguments The arguments of the method call.
*
* @return An lambda containing the logic to build the representation.
*/
@Deprecated("Use the overload which returns a string right away, wrap it into a lambda on your own if you need this functionality; will be removed with 0.17.0")
fun format(methodName: String, arguments: Array<out Any?>): () -> String

/**
* Returns a representation of a method call to a method named [methodName] with the given [arguments].
*
Expand All @@ -26,7 +14,6 @@ interface MethodCallFormatter {
*/
fun formatCall(methodName: String, arguments: Array<out Any?>): String


/**
* Formats the given [argument].
*/
Expand Down
Loading