From 2519afb2546d808819db43b677df5abfc6405ee2 Mon Sep 17 00:00:00 2001 From: Robert Stoll Date: Thu, 1 Apr 2021 22:57:33 +0200 Subject: [PATCH] remove deprecated modules, ReportFactory, ExpectBuilder and dependOnMe moreover: - adjust packages.md, also remove deprecaed modules there and remove documentation which is no longer used - remove createRegisterJsServicesTask in build.gradle - adjust bbc/bc due to breaking changes (removal of different types). in the same go we have to forgive bc for infix as we no longer have ReporterFactory and since we don't use ascii bullet points in infix tests any more since 0.16.0 - we have established own tests for this aspect - rename RealTranslatorIntSpec to TranslatorIntSpec and remove the existing TranslatorIntSpec which was intended for ReporterFactory based implementations. --- README.md | 6 +- apis/differences.md | 22 +- .../src/test/kotlin/testSetup.kt | 13 - .../atrium-api-fluent-en_GB-jvm/build.gradle | 16 - .../build.gradle | 15 +- .../src/test/kotlin/testSetup.kt | 13 - .../atrium-api-infix-en_GB-jvm/build.gradle | 16 - .../build.gradle | 15 +- build.gradle | 70 +--- .../atrium-fluent-en_GB-common/build.gradle | 6 - .../atrium-fluent-en_GB-js/build.gradle | 6 - .../tutteli/atrium/fluent/en_GB/dependOnMe.kt | 17 - .../src/test/kotlin/testSetup.kt | 4 - .../atrium-fluent-en_GB-jvm/build.gradle | 13 - .../src/module/module-info.java | 1 - .../atrium-infix-en_GB-common/build.gradle | 5 - .../atrium-infix-en_GB-js/build.gradle | 5 - .../tutteli/atrium/infix/en_GB/dependOnMe.kt | 18 - .../src/test/kotlin/testSetup.kt | 4 - .../atrium-infix-en_GB-jvm/build.gradle | 13 - .../src/module/module-info.java | 1 - .../ch/tutteli/atrium/core/CoreFactory.kt | 3 + .../atrium/core/polyfills/loadService.kt | 3 + .../atrium/core/polyfills/properties.kt | 15 - .../atrium/reporting/ReporterFactory.kt | 93 ----- .../core/polyfills/AtriumPropertyTest.kt | 42 --- .../atrium/core/polyfills/LoadServicesTest.kt | 37 -- .../core/polyfills/LoadSingleServiceTest.kt | 36 -- .../core/polyfills/UseSingleServiceTest.kt | 40 --- .../atrium/core/polyfills/testServices.kt | 9 - .../atrium/core/polyfills/properties.kt | 11 - .../src/test/kotlin/testSetup.kt | 14 - .../ch/tutteli/atrium/core/CoreFactory.kt | 1 + .../atrium/core/polyfills/properties.kt | 8 - .../src/module/module-info.java | 1 - .../erroradjusters/AdjustStackSpec.kt | 2 - ...rEntityAndLocaleTranslationSupplierSpec.kt | 4 +- ...pertiesPerLocaleTranslationSupplierSpec.kt | 2 +- .../ResourceBundleBasedTranslatorSpec.kt | 2 +- ...e.polyfills.InterfaceWithOneImplementation | 2 - ...e.polyfills.InterfaceWithTwoImplementation | 3 - .../translating/Atrium_fr.properties | 3 - .../translating/Atrium_it.properties | 3 - .../build.gradle | 15 - ...AssertionFormatterControllerBasedFacade.kt | 28 -- .../AssertionFormatterControllerImpl.kt | 70 ---- .../lib/reporting/DetailedObjectFormatter.kt | 84 ----- .../reporting/MultiAtriumErrorAdjusterImpl.kt | 16 - .../lib/reporting/NoOpAtriumErrorAdjuster.kt | 28 -- ...attingSingleAssertionGroupTypeFormatter.kt | 43 --- .../lib/reporting/OnlyFailureReporter.kt | 35 -- .../RemoveAtriumFromAtriumErrorAdjuster.kt | 12 - .../RemoveRunnerAtriumErrorAdjuster.kt | 12 - .../SingleAssertionGroupTypeFormatter.kt | 115 ------ .../TextExplanatoryAssertionGroupFormatter.kt | 70 ---- .../TextFallbackAssertionFormatter.kt | 114 ------ .../TextFeatureAssertionGroupFormatter.kt | 69 ---- .../TextListAssertionGroupFormatter.kt | 40 --- .../TextListBasedAssertionGroupFormatter.kt | 44 --- .../lib/reporting/TextMethodCallFormatter.kt | 32 -- .../TextNextLineAssertionPairFormatter.kt | 64 ---- .../TextPrefixBasedAssertionGroupFormatter.kt | 33 -- .../TextSameLineAssertionPairFormatter.kt | 49 --- .../TextSummaryAssertionGroupFormatter.kt | 67 ---- .../CoroutineBasedLocaleOrderDecider.kt | 111 ------ .../TranslationSupplierBasedTranslator.kt | 40 --- .../AssertionFormatterControllerSpec.kt | 8 - .../lib/reporting/DelegatingReporter.kt | 13 - .../lib/reporting/OnlyFailureReporterSpec.kt | 8 - ...tExplanatoryAssertionGroupFormatterSpec.kt | 84 ----- .../TextFallbackAssertionFormatterSpec.kt | 95 ----- .../reporting/TextMethodCallFormatterSpec.kt | 8 - .../TextNextLineAssertionPairFormatterSpec.kt | 77 ---- .../TextSummaryAssertionGroupFormatterSpec.kt | 67 ---- .../translating/LocaleOrderDeciderSpec.kt | 8 - .../atrium-core-robstoll-lib-js/build.gradle | 22 -- .../lib/reporting/DetailedObjectFormatter.kt | 47 --- .../reporting/FilterAtriumErrorAdjuster.kt | 26 -- .../reporting/MultiAtriumErrorAdjusterImpl.kt | 26 -- .../lib/reporting/NoOpAtriumErrorAdjuster.kt | 14 - .../RemoveAtriumFromAtriumErrorAdjuster.kt | 20 -- .../RemoveRunnerAtriumErrorAdjuster.kt | 20 -- .../robstoll/lib/reporting/AdjustStackTest.kt | 98 ----- .../src/test/kotlin/testSetup.kt | 12 - .../atrium-core-robstoll-lib-jvm/build.gradle | 22 -- .../lib/reporting/DetailedObjectFormatter.kt | 80 ----- .../reporting/FilterAtriumErrorAdjuster.kt | 27 -- .../reporting/MultiAtriumErrorAdjusterImpl.kt | 26 -- .../lib/reporting/NoOpAtriumErrorAdjuster.kt | 17 - .../RemoveAtriumFromAtriumErrorAdjuster.kt | 16 - .../RemoveRunnerAtriumErrorAdjuster.kt | 21 -- .../PropertiesBasedTranslationSupplier.kt | 96 ----- ...esPerEntityAndLocaleTranslationSupplier.kt | 38 -- .../PropertiesPerLocaleTranslationSupplier.kt | 33 -- .../ResourceBundleBasedTranslator.kt | 73 ---- .../src/module/module-info.java | 9 - .../robstoll/lib/reporting/AdjustStackSpec.kt | 195 ---------- .../reporting/DetailedObjectFormatterSpec.kt | 186 ---------- .../TextFeatureAssertionGroupFormatterSpec.kt | 54 --- .../TextListAssertionGroupFormatterSpec.kt | 53 --- ...rEntityAndLocaleTranslationSupplierSpec.kt | 27 -- ...pertiesPerLocaleTranslationSupplierSpec.kt | 27 -- .../ResourceBundleBasedTranslatorSpec.kt | 36 -- .../TranslationSupplierBasedTranslatorSpec.kt | 29 -- .../translating/Atrium_de.properties | 2 - .../translating/Atrium_de_CH.properties | 1 - .../translating/Atrium_fr.properties | 6 - .../translating/Atrium_it.properties | 2 - .../translating/Atrium_zh.properties | 4 - .../translating/Atrium_zh_CN.properties | 3 - .../translating/Atrium_zh_HK.properties | 3 - .../translating/Atrium_zh_Hans.properties | 2 - .../translating/Atrium_zh_Hans_CN.properties | 1 - .../translating/Atrium_zh_Hans_SG.properties | 1 - .../translating/Atrium_zh_Hant.properties | 2 - .../translating/Atrium_zh_Hant_HK.properties | 1 - .../translating/Atrium_zh_Hant_MO.properties | 1 - .../translating/Atrium_zh_Hant_TW.properties | 1 - .../translating/Atrium_zh_MO.properties | 3 - .../translating/Atrium_zh_SG.properties | 3 - .../translating/Atrium_zh_TW.properties | 3 - .../atrium/specs/AssertionVerb_fr.properties | 1 - ...atorIntSpec$TestTranslatable_fr.properties | 2 - ...atorIntSpec$TestTranslatable_it.properties | 2 - .../DescriptionAnyAssertion_de.properties | 2 - .../DescriptionAnyAssertion_de_CH.properties | 1 - .../DescriptionAnyAssertion_fr.properties | 3 - .../DescriptionAnyAssertion_zh.properties | 4 - .../DescriptionAnyAssertion_zh_CN.properties | 3 - .../DescriptionAnyAssertion_zh_HK.properties | 3 - ...DescriptionAnyAssertion_zh_Hans.properties | 2 - ...criptionAnyAssertion_zh_Hans_CN.properties | 1 - ...criptionAnyAssertion_zh_Hans_SG.properties | 1 - ...DescriptionAnyAssertion_zh_Hant.properties | 2 - ...criptionAnyAssertion_zh_Hant_HK.properties | 1 - ...criptionAnyAssertion_zh_Hant_MO.properties | 1 - ...criptionAnyAssertion_zh_Hant_TW.properties | 1 - .../DescriptionAnyAssertion_zh_MO.properties | 3 - .../DescriptionAnyAssertion_zh_SG.properties | 3 - .../DescriptionAnyAssertion_zh_TW.properties | 3 - .../atrium-core-robstoll-common/build.gradle | 6 - .../core/robstoll/CoreFactoryCommonImpl.kt | 142 -------- .../atrium-core-robstoll-js/build.gradle | 6 - .../atrium/core/robstoll/CoreFactoryImpl.kt | 5 - .../atrium/core/robstoll/dependOnMe.kt | 9 - .../atrium/core/robstoll/registerServices.kt | 11 - .../atrium-core-robstoll-jvm/build.gradle | 6 - .../atrium/core/robstoll/CoreFactoryImpl.kt | 22 -- .../ch.tutteli.atrium.core.CoreFactory | 1 - .../src/module/module-info.java | 10 - gradle/scripts/gh-pages.gradle | 2 - logic/atrium-logic-common/build.gradle | 2 +- .../IterableLikeContainsAssertions.kt | 2 +- ...terableLikeContainsInAnyOrderAssertions.kt | 2 +- .../creators/MapLikeContainsAssertions.kt | 2 +- logic/atrium-logic-js/build.gradle | 2 +- logic/atrium-logic-jvm/build.gradle | 2 +- .../src/module/module-info.java | 2 +- .../api/atrium-domain-api-common/build.gradle | 8 - .../domain/creating/NewFeatureAssertions.kt | 27 -- .../creating/collectors/AssertionCollector.kt | 80 ----- .../api/atrium-domain-api-js/build.gradle | 8 - .../api/atrium-domain-api-jvm/build.gradle | 8 - .../src/module/module-info.java | 7 - .../build.gradle | 11 - .../creating/NewFeatureAssertionsBuilder.kt | 230 ------------ .../creating/PleaseUseReplacementException.kt | 15 - .../AssertionOptionExplantoryExtensions.kt | 26 -- .../AssertionFormatterControllerOption.kt | 42 --- .../AssertionFormatterFacadeOption.kt | 52 --- .../reporting/AssertionPairFormatterOption.kt | 68 ---- .../AtriumErrorAdjusterCommonOption.kt | 29 -- .../reporting/AtriumErrorAdjusterOption.kt | 101 ------ .../builders/reporting/ExpectBuilder.kt | 278 --------------- .../reporting/LocaleOrderDeciderOption.kt | 36 -- .../reporting/ObjectFormatterOption.kt | 35 -- .../builders/reporting/ReporterBuilder.kt | 82 ----- .../reporting/ReporterBuilderFinalStep.kt | 23 -- .../builders/reporting/ReporterOption.kt | 46 --- .../reporting/TextAssertionFormatterOption.kt | 67 ---- .../builders/reporting/TranslatorOption.kt | 47 --- .../AssertionFormatterControllerOptionImpl.kt | 23 -- .../AssertionFormatterFacadeOptionImpl.kt | 25 -- .../impl/AssertionPairFormatterOptionImpl.kt | 19 - .../impl/AtriumErrorAdjusterOptionImpl.kt | 52 --- .../reporting/impl/DefaultReporterFactory.kt | 41 --- .../impl/LocaleOrderDeciderOptionImpl.kt | 19 - .../impl/MultipleAdjustersOptionImpl.kt | 27 -- .../impl/ObjectFormatterOptionImpl.kt | 20 -- .../impl/ReporterBuilderFinalStepImpl.kt | 11 - .../reporting/impl/ReporterBuilderImpl.kt | 8 - .../reporting/impl/ReporterOptionImpl.kt | 26 -- .../impl/TextAssertionFormatterOptionImpl.kt | 42 --- .../reporting/impl/TranslatorOptionImpl.kt | 30 -- .../reporting/impl/verb/OptionsChooserImpl.kt | 30 -- .../reporting/impl/verb/defaultImpls.kt | 39 -- .../domain/builders/utils/VarArgHelper.kt | 43 --- .../builders/utils/containsValidators.kt | 46 --- .../domain/builders/utils/groupsToList.kt | 60 ---- .../domain/builders/utils/mapArguments.kt | 308 ---------------- .../atrium/domain/builders/utils/nullable.kt | 191 ---------- .../atrium/domain/builders/utils/subAssert.kt | 16 - .../atrium-domain-builders-js/build.gradle | 10 - .../atrium/domain/builders/dependOnMe.kt | 7 - .../domain/builders/registerServices.kt | 11 - .../builders/reporting/ReporterBuilder.kt | 18 - .../reporting/TextAssertionFormatterOption.kt | 24 -- .../builders/reporting/TranslatorOption.kt | 12 - .../reporting/impl/ReporterBuilderImpl.kt | 25 -- .../atrium-domain-builders-jvm/build.gradle | 17 - .../builders/reporting/ReporterBuilder.kt | 46 --- .../reporting/TextAssertionFormatterOption.kt | 48 --- .../builders/reporting/TranslatorOption.kt | 48 --- .../reporting/impl/ReporterBuilderImpl.kt | 30 -- ...h.tutteli.atrium.reporting.ReporterFactory | 1 - .../src/module/module-info.java | 15 - .../atrium/domain/builders/utils/Test.java | 57 --- .../build.gradle | 13 - .../creating/collectors/collectAssertions.kt | 70 ---- .../build.gradle | 13 - .../build.gradle | 28 -- .../src/module/module-info.java | 8 - .../build.gradle | 6 - .../collectors/AssertionCollectorImpl.kt | 24 -- .../atrium-domain-robstoll-js/build.gradle | 6 - .../atrium/domain/robstoll/dependOnMe.kt | 9 - .../domain/robstoll/registerServices.kt | 11 - .../atrium-domain-robstoll-jvm/build.gradle | 6 - ...ain.creating.collectors.AssertionCollector | 1 - .../src/module/module-info.java | 8 - misc/kdoc/packages.md | 34 +- misc/specs/atrium-specs-common/build.gradle | 9 +- misc/specs/atrium-specs-js/build.gradle | 9 +- misc/specs/atrium-specs-jvm/build.gradle | 8 +- .../TextFeatureAssertionGroupFormatterSpec.kt | 3 + ...extListBasedAssertionGroupFormatterSpec.kt | 3 + .../translating/RealTranslatorIntSpec.kt | 335 ------------------ .../translating/TranslatorIntSpec.kt | 25 +- misc/tools/bc-tests/build.gradle.kts | 219 ++++++++++-- misc/tools/readme-examples/build.gradle | 1 - .../atriumVerbs.kt | 8 - .../atrium-verbs-internal-js/build.gradle | 2 - .../atrium-verbs-internal-jvm/build.gradle | 2 - .../src/module/module-info.java | 5 +- misc/verbs/atrium-verbs-jvm/build.gradle | 1 - .../src/module/module-info.java | 5 +- samples/js/src/test/kotlin/testSetup.kt | 4 - .../src/jsTest/kotlin/testSetup.kt | 4 - settings.gradle.kts | 93 +++-- 249 files changed, 302 insertions(+), 7276 deletions(-) delete mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-js/src/test/kotlin/testSetup.kt delete mode 100644 apis/infix-en_GB/atrium-api-infix-en_GB-js/src/test/kotlin/testSetup.kt delete mode 100644 bundles/fluent-en_GB/atrium-fluent-en_GB-js/src/main/kotlin/ch/tutteli/atrium/fluent/en_GB/dependOnMe.kt delete mode 100644 bundles/fluent-en_GB/atrium-fluent-en_GB-js/src/test/kotlin/testSetup.kt delete mode 100644 bundles/infix-en_GB/atrium-infix-en_GB-js/src/main/kotlin/ch/tutteli/atrium/infix/en_GB/dependOnMe.kt delete mode 100644 bundles/infix-en_GB/atrium-infix-en_GB-js/src/test/kotlin/testSetup.kt delete mode 100644 core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/core/polyfills/properties.kt delete mode 100644 core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/reporting/ReporterFactory.kt delete mode 100644 core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/AtriumPropertyTest.kt delete mode 100644 core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/LoadServicesTest.kt delete mode 100644 core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/LoadSingleServiceTest.kt delete mode 100644 core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/UseSingleServiceTest.kt delete mode 100644 core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/testServices.kt delete mode 100644 core/api/atrium-core-api-js/src/main/kotlin/ch/tutteli/atrium/core/polyfills/properties.kt delete mode 100644 core/api/atrium-core-api-js/src/test/kotlin/testSetup.kt delete mode 100644 core/api/atrium-core-api-jvm/src/main/kotlin/ch/tutteli/atrium/core/polyfills/properties.kt delete mode 100644 core/api/atrium-core-api-jvm/src/test/resources/META-INF/services/ch.tutteli.atrium.core.polyfills.InterfaceWithOneImplementation delete mode 100644 core/api/atrium-core-api-jvm/src/test/resources/META-INF/services/ch.tutteli.atrium.core.polyfills.InterfaceWithTwoImplementation delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/build.gradle delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AssertionFormatterControllerBasedFacade.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AssertionFormatterControllerImpl.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DetailedObjectFormatter.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/MultiAtriumErrorAdjusterImpl.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/NoOpAtriumErrorAdjuster.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/NoSpecialChildFormattingSingleAssertionGroupTypeFormatter.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/OnlyFailureReporter.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveAtriumFromAtriumErrorAdjuster.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/SingleAssertionGroupTypeFormatter.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextExplanatoryAssertionGroupFormatter.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextFallbackAssertionFormatter.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextFeatureAssertionGroupFormatter.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextListAssertionGroupFormatter.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextListBasedAssertionGroupFormatter.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextMethodCallFormatter.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextNextLineAssertionPairFormatter.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextPrefixBasedAssertionGroupFormatter.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextSameLineAssertionPairFormatter.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextSummaryAssertionGroupFormatter.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/CoroutineBasedLocaleOrderDecider.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/TranslationSupplierBasedTranslator.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AssertionFormatterControllerSpec.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DelegatingReporter.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/OnlyFailureReporterSpec.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextExplanatoryAssertionGroupFormatterSpec.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextFallbackAssertionFormatterSpec.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextMethodCallFormatterSpec.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextNextLineAssertionPairFormatterSpec.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextSummaryAssertionGroupFormatterSpec.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/LocaleOrderDeciderSpec.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-js/build.gradle delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DetailedObjectFormatter.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/FilterAtriumErrorAdjuster.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/MultiAtriumErrorAdjusterImpl.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/NoOpAtriumErrorAdjuster.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveAtriumFromAtriumErrorAdjuster.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-js/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AdjustStackTest.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-js/src/test/kotlin/testSetup.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/build.gradle delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DetailedObjectFormatter.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/FilterAtriumErrorAdjuster.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/MultiAtriumErrorAdjusterImpl.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/NoOpAtriumErrorAdjuster.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveAtriumFromAtriumErrorAdjuster.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesBasedTranslationSupplier.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesPerEntityAndLocaleTranslationSupplier.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesPerLocaleTranslationSupplier.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/ResourceBundleBasedTranslator.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/module/module-info.java delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AdjustStackSpec.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DetailedObjectFormatterSpec.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextFeatureAssertionGroupFormatterSpec.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextListAssertionGroupFormatterSpec.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesPerEntityAndLocaleTranslationSupplierSpec.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesPerLocaleTranslationSupplierSpec.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/ResourceBundleBasedTranslatorSpec.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/TranslationSupplierBasedTranslatorSpec.kt delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_de.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_de_CH.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_fr.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_it.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_CN.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_HK.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hans.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hans_CN.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hans_SG.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hant.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hant_HK.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hant_MO.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hant_TW.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_MO.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_SG.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_TW.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/specs/AssertionVerb_fr.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/specs/reporting/translating/TranslatorIntSpec$TestTranslatable_fr.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/specs/reporting/translating/TranslatorIntSpec$TestTranslatable_it.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_de.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_de_CH.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_fr.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_CN.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_HK.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hans.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hans_CN.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hans_SG.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hant.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hant_HK.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hant_MO.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hant_TW.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_MO.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_SG.properties delete mode 100644 core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_TW.properties delete mode 100644 core/robstoll/atrium-core-robstoll-common/build.gradle delete mode 100644 core/robstoll/atrium-core-robstoll-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/CoreFactoryCommonImpl.kt delete mode 100644 core/robstoll/atrium-core-robstoll-js/build.gradle delete mode 100644 core/robstoll/atrium-core-robstoll-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/CoreFactoryImpl.kt delete mode 100644 core/robstoll/atrium-core-robstoll-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/dependOnMe.kt delete mode 100644 core/robstoll/atrium-core-robstoll-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/registerServices.kt delete mode 100644 core/robstoll/atrium-core-robstoll-jvm/build.gradle delete mode 100644 core/robstoll/atrium-core-robstoll-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/CoreFactoryImpl.kt delete mode 100644 core/robstoll/atrium-core-robstoll-jvm/src/main/resources/META-INF/services/ch.tutteli.atrium.core.CoreFactory delete mode 100644 core/robstoll/atrium-core-robstoll-jvm/src/module/module-info.java delete mode 100644 misc/deprecated/domain/api/atrium-domain-api-common/build.gradle delete mode 100644 misc/deprecated/domain/api/atrium-domain-api-common/src/main/kotlin/ch/tutteli/atrium/domain/creating/NewFeatureAssertions.kt delete mode 100644 misc/deprecated/domain/api/atrium-domain-api-common/src/main/kotlin/ch/tutteli/atrium/domain/creating/collectors/AssertionCollector.kt delete mode 100644 misc/deprecated/domain/api/atrium-domain-api-js/build.gradle delete mode 100644 misc/deprecated/domain/api/atrium-domain-api-jvm/build.gradle delete mode 100644 misc/deprecated/domain/api/atrium-domain-api-jvm/src/module/module-info.java delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/build.gradle delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/creating/NewFeatureAssertionsBuilder.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/creating/PleaseUseReplacementException.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/creating/collectors/AssertionOptionExplantoryExtensions.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AssertionFormatterControllerOption.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AssertionFormatterFacadeOption.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AssertionPairFormatterOption.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AtriumErrorAdjusterCommonOption.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AtriumErrorAdjusterOption.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ExpectBuilder.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/LocaleOrderDeciderOption.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ObjectFormatterOption.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterBuilder.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterBuilderFinalStep.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterOption.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TextAssertionFormatterOption.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TranslatorOption.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/AssertionFormatterControllerOptionImpl.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/AssertionFormatterFacadeOptionImpl.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/AssertionPairFormatterOptionImpl.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/AtriumErrorAdjusterOptionImpl.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/DefaultReporterFactory.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/LocaleOrderDeciderOptionImpl.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/MultipleAdjustersOptionImpl.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ObjectFormatterOptionImpl.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterBuilderFinalStepImpl.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterBuilderImpl.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterOptionImpl.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/TextAssertionFormatterOptionImpl.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/TranslatorOptionImpl.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/verb/OptionsChooserImpl.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/verb/defaultImpls.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/VarArgHelper.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/containsValidators.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/groupsToList.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/mapArguments.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/nullable.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/subAssert.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-js/build.gradle delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/dependOnMe.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/registerServices.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterBuilder.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TextAssertionFormatterOption.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TranslatorOption.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterBuilderImpl.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-jvm/build.gradle delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterBuilder.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TextAssertionFormatterOption.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TranslatorOption.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterBuilderImpl.kt delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/resources/META-INF/services/ch.tutteli.atrium.reporting.ReporterFactory delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/module/module-info.java delete mode 100644 misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/test/java/ch/tutteli/atrium/domain/builders/utils/Test.java delete mode 100644 misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-common/build.gradle delete mode 100644 misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/domain/robstoll/lib/creating/collectors/collectAssertions.kt delete mode 100644 misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-js/build.gradle delete mode 100644 misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-jvm/build.gradle delete mode 100644 misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-jvm/src/module/module-info.java delete mode 100644 misc/deprecated/domain/robstoll/atrium-domain-robstoll-common/build.gradle delete mode 100644 misc/deprecated/domain/robstoll/atrium-domain-robstoll-common/src/main/kotlin/ch/tutteli/atrium/domain/robstoll/creating/collectors/AssertionCollectorImpl.kt delete mode 100644 misc/deprecated/domain/robstoll/atrium-domain-robstoll-js/build.gradle delete mode 100644 misc/deprecated/domain/robstoll/atrium-domain-robstoll-js/src/main/kotlin/ch/tutteli/atrium/domain/robstoll/dependOnMe.kt delete mode 100644 misc/deprecated/domain/robstoll/atrium-domain-robstoll-js/src/main/kotlin/ch/tutteli/atrium/domain/robstoll/registerServices.kt delete mode 100644 misc/deprecated/domain/robstoll/atrium-domain-robstoll-jvm/build.gradle delete mode 100644 misc/deprecated/domain/robstoll/atrium-domain-robstoll-jvm/src/main/resources/META-INF/services/ch.tutteli.atrium.domain.creating.collectors.AssertionCollector delete mode 100644 misc/deprecated/domain/robstoll/atrium-domain-robstoll-jvm/src/module/module-info.java delete mode 100644 misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/reporting/translating/RealTranslatorIntSpec.kt delete mode 100644 samples/js/src/test/kotlin/testSetup.kt delete mode 100644 samples/multiplatform/src/jsTest/kotlin/testSetup.kt diff --git a/README.md b/README.md index b6a87920a..8e5e5365b 100644 --- a/README.md +++ b/README.md @@ -2335,16 +2335,12 @@ Unfortunately we do not have the time to cover all cases, so let us know if you ## Own Sophisticated Assertion Builders Do you want to write an own sophisticated assertion builder (or extend a current with more options) instead of an assertion function? -Great, we do not provide documentation yet (had only one question about it so far). -Therefore, please have a look at the implementation, for instance how the sophisticated assertion builders for `Iterable` are defined: -[ch.tutteli.atrium.creating.iterable.contains](https://github.com/robstoll/atrium/tree/master/domain/api/atrium-domain-api-common/src/main/kotlin/ch/tutteli/atrium/domain/creating/iterable/contains). -Notice that the implementation supports [Internationalization](#internationalization-1). +Great, we do not provide documentation yet (had only one question about it since 2017). We are willing to provide more documentation if you need it (please open an issue). In the meantime we might help you via slack, please post your questions in the [atrium Slack channel](https://kotlinlang.slack.com/messages/C887ZKGCQ) ([Invite yourself](https://slack.kotlinlang.org/) in case you do not have an account yet). - # Use own Assertion Verbs Atrium offers three assertion verbs out of the box: `expect`, `assert` and `assertThat`. diff --git a/apis/differences.md b/apis/differences.md index d47a99ea7..74f849a11 100644 --- a/apis/differences.md +++ b/apis/differences.md @@ -7,12 +7,10 @@ Atrium provides so called bundle-modules which merely bundle dependencies (they These modules bundle: - an API module - a translation module (the language used in reporting) -- an implementation of the domain of Atrium -- an implementation of the core of Atrium - +- predefined expectation verbs. Following a list of the available bundle-modules. -The links point to the KDoc of their included API where you find an overview of all available assertion functions of the API. +The links point to the KDoc of their included API where you find an overview of all available expectation functions of the API. - [atrium-fluent-en_GB](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.api.fluent.en_-g-b/index.html) - [atrium-infix-en_GB](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.api.infix.en_-g-b/index.html) @@ -39,7 +37,7 @@ If you forget to dit it, then the compiler will complain that you have the same Atrium currently provides two API styles: fluent and infix. We dit not show every single difference but merely where the APIs differ in naming. -For instance, the assertion function `Expect.toBe`: +For instance, the expectation function `Expect.toBe`: *atrium-api-fluent-en_GB* ```kotlin @@ -60,7 +58,7 @@ is toit similar, we will not list it here (ok, we did now but I guess you get th - [in any order](#iterable-contains-in-any-order) - [in order](#iterable-contains-in-order) - [Iterable contains not](#iterable-contains-not) -- [Iterable predicate-like assertions](#iterable-predicate-like-assertions) +- [Iterable predicate-like expectations](#iterable-predicate-like-expectations) - [List get](#list-get) - [Map getExisting](#map-getexisting) - [Map contains](#map-contains) @@ -111,7 +109,7 @@ expect(x).contains.ignoringCase.notOrAtMost(1).elementsOf(anIterable) ``` Notice that the final steps `value`, `values` and `regex` -in the sophisticated assertion building process +in the sophisticated expectation building process are applicable to all shown examples (e.g. `exactly(1).values("hello", "robert")` could have been finished with `exactly(1).regex("h(e|a)llo")` as well). @@ -128,7 +126,7 @@ expect(x) contains o ignoring case notOrAtMost 1 elementsOf anIterable ``` Notice that the final steps `value`, `values(...)`, `regex` and `regexPatterns(..)` -in the sophisticated assertion building process +in the sophisticated expectation building process are applicable to all shown examples (e.g. `exactly 1 values("hello", "robert")` could have been finished with `exactly 1 regex "h(e|a)llo"` as well). @@ -154,7 +152,7 @@ expect(x).contains.inAnyOrder.only.entries({ toBe(3) }, { isLessThan(2) }) ``` Notice that the final steps `value`, `values`, `entry` and `entries` -in the sophisticated assertion building process +in the sophisticated expectation building process are applicable to all shown examples (e.g. `butAtMost(2).value(3.2)` could have been finished with `entries(...)` as well) @@ -178,7 +176,7 @@ Note that `o` is a filler object which is only there so that we can turn extensi a method with one parameter and thus make it available as infix method. The final steps `value`, `values(...)`, `entry` and `entries(...)` -in the sophisticated assertion building process, +in the sophisticated expectation building process, are applicable to all shown examples (e.g. `butAtMost 2 value 3.2` could have been finished with `entries(...)` as well) @@ -257,8 +255,8 @@ expect(x) containsNot o entry { it isLessThan 2 } expect(x) containsNot o the entries(null, { it isLessThan 2 }, { it isGreaterThan 5 }) ``` -# Iterable predicate-like assertions -For more sophisticated assertions such as "there should be two matches", use the sophisticated assertion builder `contains.inAnyOrder` +# Iterable predicate-like expectations +For more sophisticated expectations such as "there should be two matches", use the sophisticated expectation builder `contains.inAnyOrder` -> see [Iterable contains in any order](#iterable-contains-in-any-order) for more information *atrium-api-fluent-en_GB* diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-js/src/test/kotlin/testSetup.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-js/src/test/kotlin/testSetup.kt deleted file mode 100644 index f0b397d6e..000000000 --- a/apis/fluent-en_GB/atrium-api-fluent-en_GB-js/src/test/kotlin/testSetup.kt +++ /dev/null @@ -1,13 +0,0 @@ -//TODO remove file with 1.0.0 -@file:Suppress("DEPRECATION") - -import ch.tutteli.atrium.core.robstoll.dependOn_atrium_core_robstoll -import ch.tutteli.atrium.domain.robstoll.dependOn_atrium_domain_robstoll - -fun dependOnAtrium() { - dependOn_atrium_core_robstoll() - dependOn_atrium_domain_robstoll() -} - -@Suppress("unused") -private val establishDependencyToAtrium = dependOnAtrium() diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/build.gradle b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/build.gradle index 7162d34af..12c2dd9c1 100644 --- a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/build.gradle +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/build.gradle @@ -4,13 +4,6 @@ ext.jacoco_additional = [ prefixedProject('translations-en_GB-jvm'), prefixedProject('logic-jvm'), prefixedProject('core-api-jvm'), - //TODO remove with 0.17.0 - prefixedProject('domain-builders-jvm'), - prefixedProject('domain-robstoll-jvm'), - prefixedProject('domain-robstoll-lib-jvm'), - prefixedProject('domain-api-jvm'), - prefixedProject('core-robstoll-jvm'), - prefixedProject('core-robstoll-lib-jvm'), ] dependencies { @@ -18,12 +11,3 @@ dependencies { testImplementation prefixedProject('specs-jvm') } - - -//TODO 0.17.0 or 0.18.0 should not be necessary https://youtrack.jetbrains.com/issue/KT-28124 -compileTestKotlin.dependsOn( - prefixedProject('core-robstoll-jvm').compileKotlin, - prefixedProject('core-robstoll-jvm').processResources, - prefixedProject('domain-robstoll-jvm').compileKotlin, - prefixedProject('domain-robstoll-jvm').processResources -) diff --git a/apis/fluent-en_GB/extensions/kotlin_1_3/atrium-api-fluent-en_GB-kotlin_1_3-jvm/build.gradle b/apis/fluent-en_GB/extensions/kotlin_1_3/atrium-api-fluent-en_GB-kotlin_1_3-jvm/build.gradle index 590cb7f75..b946782a8 100644 --- a/apis/fluent-en_GB/extensions/kotlin_1_3/atrium-api-fluent-en_GB-kotlin_1_3-jvm/build.gradle +++ b/apis/fluent-en_GB/extensions/kotlin_1_3/atrium-api-fluent-en_GB-kotlin_1_3-jvm/build.gradle @@ -1,11 +1,7 @@ description = 'Kotlin 1.3 specific assertion functions and builders for fluent-en_GB -- will be merged into fluent-en_GB with 1.0.0' ext.jacoco_additional = [ - prefixedProject('domain-builders-jvm'), - prefixedProject('domain-robstoll-jvm'), - prefixedProject('domain-robstoll-lib-jvm'), - prefixedProject('core-robstoll-jvm'), - prefixedProject('core-robstoll-lib-jvm'), + prefixedProject('logic-kotlin_1_3-jvm'), ] dependencies { @@ -14,12 +10,3 @@ dependencies { testImplementation prefixedProject('specs-jvm') } - - -//TODO 0.17.0 or 0.18.0 should not be necessary https://youtrack.jetbrains.com/issue/KT-28124 -compileTestKotlin.dependsOn( - prefixedProject('core-robstoll-jvm').compileKotlin, - prefixedProject('core-robstoll-jvm').processResources, - prefixedProject('domain-robstoll-jvm').compileKotlin, - prefixedProject('domain-robstoll-jvm').processResources -) diff --git a/apis/infix-en_GB/atrium-api-infix-en_GB-js/src/test/kotlin/testSetup.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-js/src/test/kotlin/testSetup.kt deleted file mode 100644 index f0b397d6e..000000000 --- a/apis/infix-en_GB/atrium-api-infix-en_GB-js/src/test/kotlin/testSetup.kt +++ /dev/null @@ -1,13 +0,0 @@ -//TODO remove file with 1.0.0 -@file:Suppress("DEPRECATION") - -import ch.tutteli.atrium.core.robstoll.dependOn_atrium_core_robstoll -import ch.tutteli.atrium.domain.robstoll.dependOn_atrium_domain_robstoll - -fun dependOnAtrium() { - dependOn_atrium_core_robstoll() - dependOn_atrium_domain_robstoll() -} - -@Suppress("unused") -private val establishDependencyToAtrium = dependOnAtrium() diff --git a/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/build.gradle b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/build.gradle index 56459946f..52d7b6aeb 100644 --- a/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/build.gradle +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/build.gradle @@ -4,13 +4,6 @@ ext.jacoco_additional = [ prefixedProject('translations-de_CH-jvm'), prefixedProject('logic-jvm'), prefixedProject('core-api-jvm'), - //TODO remove with 0.17.0 - prefixedProject('domain-builders-jvm'), - prefixedProject('domain-robstoll-jvm'), - prefixedProject('domain-robstoll-lib-jvm'), - prefixedProject('domain-api-jvm'), - prefixedProject('core-robstoll-jvm'), - prefixedProject('core-robstoll-lib-jvm'), ] dependencies { @@ -21,12 +14,3 @@ dependencies { } testImplementation prefixedProject('translations-de_CH-jvm') } - - -//TODO 0.17.0 or 0.18.0 should not be necessary https://youtrack.jetbrains.com/issue/KT-28124 -compileTestKotlin.dependsOn( - prefixedProject('core-robstoll-jvm').compileKotlin, - prefixedProject('core-robstoll-jvm').processResources, - prefixedProject('domain-robstoll-jvm').compileKotlin, - prefixedProject('domain-robstoll-jvm').processResources -) diff --git a/apis/infix-en_GB/extensions/kotlin_1_3/atrium-api-infix-en_GB-kotlin_1_3-jvm/build.gradle b/apis/infix-en_GB/extensions/kotlin_1_3/atrium-api-infix-en_GB-kotlin_1_3-jvm/build.gradle index 5233736a3..0ff0099cf 100644 --- a/apis/infix-en_GB/extensions/kotlin_1_3/atrium-api-infix-en_GB-kotlin_1_3-jvm/build.gradle +++ b/apis/infix-en_GB/extensions/kotlin_1_3/atrium-api-infix-en_GB-kotlin_1_3-jvm/build.gradle @@ -1,11 +1,7 @@ description = 'Kotlin 1.3 specific assertion functions and builders for infix-en_GB -- will be merged into infix-en_GB with 1.0.0' ext.jacoco_additional = [ - prefixedProject('domain-builders-jvm'), - prefixedProject('domain-robstoll-jvm'), - prefixedProject('domain-robstoll-lib-jvm'), - prefixedProject('core-robstoll-jvm'), - prefixedProject('core-robstoll-lib-jvm'), + prefixedProject('logic-kotlin_1_3-jvm'), ] dependencies { @@ -14,12 +10,3 @@ dependencies { testImplementation prefixedProject('specs-jvm') } - - -//TODO 0.17.0 or 0.18.0 should not be necessary https://youtrack.jetbrains.com/issue/KT-28124 -compileTestKotlin.dependsOn( - prefixedProject('core-robstoll-jvm').compileKotlin, - prefixedProject('core-robstoll-jvm').processResources, - prefixedProject('domain-robstoll-jvm').compileKotlin, - prefixedProject('domain-robstoll-jvm').processResources -) diff --git a/build.gradle b/build.gradle index 3c8f2a364..6431be3c3 100644 --- a/build.gradle +++ b/build.gradle @@ -80,12 +80,7 @@ buildscript { !(it.projectDir.path.contains("/translations/") || it.projectDir.path.contains("\\translations\\")) && !it.name.endsWith("-common") && !it.name.endsWith("-js") && - it.name != "${rootProject.name}-domain-api-jvm" && - it.name != "${rootProject.name}-core-robstoll-jvm" && - !it.name.startsWith("${rootProject.name}-specs") && - //TODO remove with 0.17.0 - it.name != "${rootProject.name}-domain-robstoll-jvm" && - it.name != "${rootProject.name}-domain-builders-jvm" + !it.name.startsWith("${rootProject.name}-specs") } ] } @@ -319,67 +314,8 @@ configure(bundleSmokeTests) { import java.nio.file.Files import java.nio.file.Paths -import java.util.function.Function import java.util.stream.Collectors -def createRegisterJsServicesTask(String projectName, String packageName, Function filter) { - Project project = prefixedProject(projectName) - configure(project) { - def registerJsServices = project.tasks.create(name: 'generateJsRegisterServices', group: 'build') { - def jvm = "${getProjectNameWithoutSuffix(project)}-jvm" - def servicesDir = project.file("../$jvm/src/main/resources/META-INF/services/") - def services = project.file("$srcKotlin/${packageName.replace('.', '/')}/registerServices.kt") - inputs.dir servicesDir - outputs.file services - - doLast { - services.write("""\ - @file:Suppress("DEPRECATION") - - package $packageName - - import ch.tutteli.atrium.core.polyfills.registerService - - @Suppress("unused" /* here in order that the code is executed when module is loaded */) - private val register = run { - """.stripIndent()) - def sortedMap = new TreeMap() - servicesDir.traverse { - if (it.isFile() && filter.apply(it.name)) { - sortedMap.put(it.name, it.withReader { it.readLine() }) - } - } - sortedMap.each { entry -> - services.append("\n registerService<") - services.append(entry.key) - services.append("> { ") - services.append(entry.value) - services.append("() }") - } - services.append("\n}\n") - } - } - compileKotlin2Js.dependsOn registerJsServices - } -} - -//TODO remove with 0.17.0 -createRegisterJsServicesTask('core-robstoll-js', 'ch.tutteli.atrium.core.robstoll') { true } -createRegisterJsServicesTask('domain-builders-js', 'ch.tutteli.atrium.domain.builders') { true } -createRegisterJsServicesTask('domain-robstoll-js', 'ch.tutteli.atrium.domain.robstoll') { - !(it in [ - 'ch.tutteli.atrium.domain.creating.BigDecimalAssertions', - 'ch.tutteli.atrium.domain.creating.OptionalAssertions', - 'ch.tutteli.atrium.domain.creating.PathAssertions', - 'ch.tutteli.atrium.domain.creating.LocalDateAssertions', - 'ch.tutteli.atrium.domain.creating.LocalDateTimeAssertions', - 'ch.tutteli.atrium.domain.creating.ZonedDateTimeAssertions', - 'ch.tutteli.atrium.domain.creating.ChronoLocalDateAssertions', - 'ch.tutteli.atrium.domain.creating.ChronoLocalDateTimeAssertions', - 'ch.tutteli.atrium.domain.creating.ChronoZonedDateTimeAssertions' - ]) -} - List projectNamesToProject(String[] names) { names.collect { projectName -> prefixedProject(projectName) } } @@ -430,10 +366,10 @@ def createJsTestTask(String... subprojectNames) { createJsTestTask( 'core-api-js', - 'core-robstoll-lib-js', 'api-fluent-en_GB-js', 'api-infix-en_GB-js', - 'fluent-en_GB-js' + 'fluent-en_GB-js', + 'infix-en_GB-js' ) def useJupiter(String... projectNames) { diff --git a/bundles/fluent-en_GB/atrium-fluent-en_GB-common/build.gradle b/bundles/fluent-en_GB/atrium-fluent-en_GB-common/build.gradle index 8d1720202..f2bd6e58c 100644 --- a/bundles/fluent-en_GB/atrium-fluent-en_GB-common/build.gradle +++ b/bundles/fluent-en_GB/atrium-fluent-en_GB-common/build.gradle @@ -4,10 +4,4 @@ dependencies { api prefixedProject('verbs-common') api prefixedProject('api-fluent-en_GB-common') api prefixedProject('translations-en_GB-common') - api prefixedProject('domain-builders-common') - api prefixedProject('domain-api-common') - api prefixedProject('core-api-common') - - runtimeOnly prefixedProject('domain-robstoll-common') - runtimeOnly prefixedProject('core-robstoll-common') } diff --git a/bundles/fluent-en_GB/atrium-fluent-en_GB-js/build.gradle b/bundles/fluent-en_GB/atrium-fluent-en_GB-js/build.gradle index f8e4ee9cc..daa737618 100644 --- a/bundles/fluent-en_GB/atrium-fluent-en_GB-js/build.gradle +++ b/bundles/fluent-en_GB/atrium-fluent-en_GB-js/build.gradle @@ -4,10 +4,4 @@ dependencies { api prefixedProject('verbs-js') api prefixedProject('api-fluent-en_GB-js') api prefixedProject('translations-en_GB-js') - api prefixedProject('domain-builders-js') - api prefixedProject('domain-api-js') - api prefixedProject('core-api-js') - - implementation prefixedProject('domain-robstoll-js') - implementation prefixedProject('core-robstoll-js') } diff --git a/bundles/fluent-en_GB/atrium-fluent-en_GB-js/src/main/kotlin/ch/tutteli/atrium/fluent/en_GB/dependOnMe.kt b/bundles/fluent-en_GB/atrium-fluent-en_GB-js/src/main/kotlin/ch/tutteli/atrium/fluent/en_GB/dependOnMe.kt deleted file mode 100644 index 55700df92..000000000 --- a/bundles/fluent-en_GB/atrium-fluent-en_GB-js/src/main/kotlin/ch/tutteli/atrium/fluent/en_GB/dependOnMe.kt +++ /dev/null @@ -1,17 +0,0 @@ -//TODO remove file with 1.0.0 -@file:Suppress("DEPRECATION") -package ch.tutteli.atrium.fluent.en_GB - -import ch.tutteli.atrium.core.robstoll.dependOn_atrium_core_robstoll -import ch.tutteli.atrium.domain.robstoll.dependOn_atrium_domain_robstoll - -/** - * Dummy function in order that other modules can define a dependency on atrium-fluent-en_GB-js - * - * Moreover it has the side effect that a dependency on core-robstoll and domain-robstoll is established. - * This is necessary, as it has only a loosely coupled dependency (via serviceLoader). - */ -fun dependOnAtrium() { - dependOn_atrium_core_robstoll() - dependOn_atrium_domain_robstoll() -} diff --git a/bundles/fluent-en_GB/atrium-fluent-en_GB-js/src/test/kotlin/testSetup.kt b/bundles/fluent-en_GB/atrium-fluent-en_GB-js/src/test/kotlin/testSetup.kt deleted file mode 100644 index 10196e352..000000000 --- a/bundles/fluent-en_GB/atrium-fluent-en_GB-js/src/test/kotlin/testSetup.kt +++ /dev/null @@ -1,4 +0,0 @@ -import ch.tutteli.atrium.fluent.en_GB.dependOnAtrium - -@Suppress("unused") -private val establishDependencyToAtrium = dependOnAtrium() diff --git a/bundles/fluent-en_GB/atrium-fluent-en_GB-jvm/build.gradle b/bundles/fluent-en_GB/atrium-fluent-en_GB-jvm/build.gradle index d5f7a6c33..281b0318a 100644 --- a/bundles/fluent-en_GB/atrium-fluent-en_GB-jvm/build.gradle +++ b/bundles/fluent-en_GB/atrium-fluent-en_GB-jvm/build.gradle @@ -5,23 +5,10 @@ ext.jacoco_additional = [ prefixedProject('translations-en_GB-jvm'), prefixedProject('logic-jvm'), prefixedProject('core-api-jvm'), - //TODO remove with 0.17.0 - prefixedProject('domain-builders-jvm'), - prefixedProject('domain-robstoll-jvm'), - prefixedProject('domain-robstoll-lib-jvm'), - prefixedProject('domain-api-jvm'), - prefixedProject('core-robstoll-jvm'), - prefixedProject('core-robstoll-lib-jvm'), ] dependencies { api prefixedProject('verbs-jvm') api prefixedProject('api-fluent-en_GB-jvm') api prefixedProject('translations-en_GB-jvm') - api prefixedProject('domain-builders-jvm') - api prefixedProject('domain-api-jvm') - api prefixedProject('core-api-jvm') - - runtimeOnly prefixedProject('domain-robstoll-jvm') - runtimeOnly prefixedProject('core-robstoll-jvm') } diff --git a/bundles/fluent-en_GB/atrium-fluent-en_GB-jvm/src/module/module-info.java b/bundles/fluent-en_GB/atrium-fluent-en_GB-jvm/src/module/module-info.java index 32ba699fc..ff79dbdfd 100644 --- a/bundles/fluent-en_GB/atrium-fluent-en_GB-jvm/src/module/module-info.java +++ b/bundles/fluent-en_GB/atrium-fluent-en_GB-jvm/src/module/module-info.java @@ -1,7 +1,6 @@ module ch.tutteli.atrium.fluent.en_GB { requires transitive ch.tutteli.atrium.verbs; requires transitive ch.tutteli.atrium.api.fluent.en_GB; - requires transitive ch.tutteli.atrium.domain.builders; requires transitive ch.tutteli.atrium.translations.en_GB; requires kotlin.stdlib; } diff --git a/bundles/infix-en_GB/atrium-infix-en_GB-common/build.gradle b/bundles/infix-en_GB/atrium-infix-en_GB-common/build.gradle index 89e3094f8..79240a437 100644 --- a/bundles/infix-en_GB/atrium-infix-en_GB-common/build.gradle +++ b/bundles/infix-en_GB/atrium-infix-en_GB-common/build.gradle @@ -4,10 +4,5 @@ dependencies { api prefixedProject('verbs-common') api prefixedProject('api-infix-en_GB-common') api prefixedProject('translations-en_GB-common') - api prefixedProject('domain-builders-common') - api prefixedProject('domain-api-common') api prefixedProject('core-api-common') - - runtimeOnly prefixedProject('domain-robstoll-common') - runtimeOnly prefixedProject('core-robstoll-common') } diff --git a/bundles/infix-en_GB/atrium-infix-en_GB-js/build.gradle b/bundles/infix-en_GB/atrium-infix-en_GB-js/build.gradle index 6a50e2861..d2049f2c9 100644 --- a/bundles/infix-en_GB/atrium-infix-en_GB-js/build.gradle +++ b/bundles/infix-en_GB/atrium-infix-en_GB-js/build.gradle @@ -4,10 +4,5 @@ dependencies { api prefixedProject('verbs-js') api prefixedProject('api-infix-en_GB-js') api prefixedProject('translations-en_GB-js') - api prefixedProject('domain-builders-js') - api prefixedProject('domain-api-js') api prefixedProject('core-api-js') - - implementation prefixedProject('domain-robstoll-js') - implementation prefixedProject('core-robstoll-js') } diff --git a/bundles/infix-en_GB/atrium-infix-en_GB-js/src/main/kotlin/ch/tutteli/atrium/infix/en_GB/dependOnMe.kt b/bundles/infix-en_GB/atrium-infix-en_GB-js/src/main/kotlin/ch/tutteli/atrium/infix/en_GB/dependOnMe.kt deleted file mode 100644 index aa04b3e5f..000000000 --- a/bundles/infix-en_GB/atrium-infix-en_GB-js/src/main/kotlin/ch/tutteli/atrium/infix/en_GB/dependOnMe.kt +++ /dev/null @@ -1,18 +0,0 @@ -//TODO remove file with 1.0.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.infix.en_GB - -import ch.tutteli.atrium.core.robstoll.dependOn_atrium_core_robstoll -import ch.tutteli.atrium.domain.robstoll.dependOn_atrium_domain_robstoll - -/** - * Dummy function in order that other modules can define a dependency on atrium-infix-en_GB-js - * - * Moreover it has the side effect that a dependency on core-robstoll and domain-robstoll is established. - * This is necessary, as it has only a loosely coupled dependency (via serviceLoader). - */ -fun dependOnAtrium() { - dependOn_atrium_core_robstoll() - dependOn_atrium_domain_robstoll() -} diff --git a/bundles/infix-en_GB/atrium-infix-en_GB-js/src/test/kotlin/testSetup.kt b/bundles/infix-en_GB/atrium-infix-en_GB-js/src/test/kotlin/testSetup.kt deleted file mode 100644 index 8b1a8c5a8..000000000 --- a/bundles/infix-en_GB/atrium-infix-en_GB-js/src/test/kotlin/testSetup.kt +++ /dev/null @@ -1,4 +0,0 @@ -import ch.tutteli.atrium.infix.en_GB.dependOnAtrium - -@Suppress("unused") -private val establishDependencyToAtrium = dependOnAtrium() diff --git a/bundles/infix-en_GB/atrium-infix-en_GB-jvm/build.gradle b/bundles/infix-en_GB/atrium-infix-en_GB-jvm/build.gradle index 497f17ad5..d17e1c289 100644 --- a/bundles/infix-en_GB/atrium-infix-en_GB-jvm/build.gradle +++ b/bundles/infix-en_GB/atrium-infix-en_GB-jvm/build.gradle @@ -5,24 +5,11 @@ ext.jacoco_additional = [ prefixedProject('translations-en_GB-jvm'), prefixedProject('logic-jvm'), prefixedProject('core-api-jvm'), - //TODO remove with 0.17.0 - prefixedProject('domain-builders-jvm'), - prefixedProject('domain-robstoll-jvm'), - prefixedProject('domain-robstoll-lib-jvm'), - prefixedProject('domain-api-jvm'), - prefixedProject('core-robstoll-jvm'), - prefixedProject('core-robstoll-lib-jvm'), ] - dependencies { api prefixedProject('verbs-jvm') api prefixedProject('api-infix-en_GB-jvm') api prefixedProject('translations-en_GB-jvm') - api prefixedProject('domain-builders-jvm') - api prefixedProject('domain-api-jvm') api prefixedProject('core-api-jvm') - - runtimeOnly prefixedProject('domain-robstoll-jvm') - runtimeOnly prefixedProject('core-robstoll-jvm') } diff --git a/bundles/infix-en_GB/atrium-infix-en_GB-jvm/src/module/module-info.java b/bundles/infix-en_GB/atrium-infix-en_GB-jvm/src/module/module-info.java index 4ef639ee2..e17c14665 100644 --- a/bundles/infix-en_GB/atrium-infix-en_GB-jvm/src/module/module-info.java +++ b/bundles/infix-en_GB/atrium-infix-en_GB-jvm/src/module/module-info.java @@ -1,7 +1,6 @@ module ch.tutteli.atrium.infix.en_GB { requires transitive ch.tutteli.atrium.verbs; requires transitive ch.tutteli.atrium.api.infix.en_GB; - requires transitive ch.tutteli.atrium.domain.builders; requires transitive ch.tutteli.atrium.translations.en_GB; requires kotlin.stdlib; } diff --git a/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/core/CoreFactory.kt b/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/core/CoreFactory.kt index 8650fa0da..321db53bc 100644 --- a/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/core/CoreFactory.kt +++ b/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/core/CoreFactory.kt @@ -19,6 +19,7 @@ annotation class ExperimentalNewExpectTypes * * It loads the implementation lazily via [loadSingleService]. */ +//TODO 0.17.0 deprecate val coreFactory by lazy { loadSingleService(CoreFactory::class) } /** @@ -30,6 +31,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 expect interface CoreFactory : CoreFactoryCommon /** @@ -50,6 +52,7 @@ expect interface CoreFactory : CoreFactoryCommon * - [Reporter] * - [AtriumErrorAdjuster] */ +//TODO 0.17.0 deprecate interface CoreFactoryCommon { /** diff --git a/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/core/polyfills/loadService.kt b/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/core/polyfills/loadService.kt index 23aa749a1..57e58ea83 100644 --- a/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/core/polyfills/loadService.kt +++ b/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/core/polyfills/loadService.kt @@ -11,6 +11,7 @@ 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 expect fun loadSingleService(kClass: KClass): T /** @@ -18,6 +19,7 @@ expect fun loadSingleService(kClass: KClass): T * * @return The loaded services as a [Sequence]. */ +//TODO 0.17.0 deprecate expect fun loadServices(kClass: KClass): Sequence /** @@ -26,6 +28,7 @@ expect fun loadServices(kClass: KClass): Sequence * @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 fun useSingleService(kClass: KClass, itr: Iterator): T { if (!itr.hasNext()) throw NoSuchElementException("Could not find any implementation for ${kClass.fullName}") diff --git a/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/core/polyfills/properties.kt b/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/core/polyfills/properties.kt deleted file mode 100644 index 621d412db..000000000 --- a/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/core/polyfills/properties.kt +++ /dev/null @@ -1,15 +0,0 @@ -package ch.tutteli.atrium.core.polyfills - -/** - * Returns the specified value for the property with the given [key] or `null` in case it is not defined. - * - * @return The value of the property with the specified [key] or `null` in case it is not defined. - */ -@Deprecated("Will be removed with 0.17.0 without replacement - note, a Reporter should now be be retrieved via ComponentFactoryContainer") -expect fun getAtriumProperty(key: String): String? - -/** - * Sets the property with the given [key] to the given [newValue]. - */ -@Deprecated("Will be removed with 0.17.0 without replacement - note, a Reporter should now be be retrieved via ComponentFactoryContainer") -expect fun setAtriumProperty(key: String, newValue: String) diff --git a/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/reporting/ReporterFactory.kt b/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/reporting/ReporterFactory.kt deleted file mode 100644 index 8c5d279ef..000000000 --- a/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/reporting/ReporterFactory.kt +++ /dev/null @@ -1,93 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.reporting - -import ch.tutteli.atrium.core.polyfills.getAtriumProperty -import ch.tutteli.atrium.core.polyfills.loadServices -import ch.tutteli.atrium.core.polyfills.setAtriumProperty - -/** - * The access point to an implementation of [Reporter]. - * - * It loads implementations of [ReporterFactory] lazily via [loadServices] and searches for the id specified via - * Atrium's property with key [ReporterFactory.ATRIUM_PROPERTY_KEY] (which is - * `ch.tutteli.atrium.reporting.reporterFactory`) or uses `default` in case the property is not specified. - * - * Use [ReporterFactory.specifyFactory] or [ReporterFactory.specifyFactoryIfNotYetSet] to define another value for the - * property. - * - * Notice, that searching for a [ReporterFactory] is only done once and the result is cached afterwards. - * Please [open an issue](https://github.com/robstoll/atrium/issues/new?template=feature_request.md&title=[Feature]%20change%20Reporter%20during%20test%20run) - * if you want to able to change the [Reporter] during a test-run. - */ -@Deprecated("A Reporter should now be be retrieved via ComponentFactoryContainer where the different components of a reporter should also be defined via ComponentFactoryContainer. This property will be removed with 0.17.0") -val reporter: Reporter by lazy { - val id = getAtriumProperty(ReporterFactory.ATRIUM_PROPERTY_KEY) ?: "default" - val factory = loadServices(ReporterFactory::class) - .firstOrNull { it.id == id } - ?: throw IllegalStateException("Could not find a ${ReporterFactory::class.simpleName} with id $id") - - factory.create() -} - - -/** - * Responsible to create a [Reporter]. - * - * It identify itself via its [id]. This id can be used by a user to specify that this [ReporterFactory] shall be used. - * In order to do that, the user has to define the system property `ch.tutteli.atrium.reporting.reporterFactory` - */ -@Deprecated("A Reporter should now be be retrieved via ComponentFactoryContainer where the different components of a reporter should also be defined via ComponentFactoryContainer. This class will be removed with 0.17.0") -interface ReporterFactory { - /** - * Identification of the supplier - */ - val id: String - - /** - * Creates a new [Reporter]. - */ - fun create(): Reporter - - /** - * Provides utility functions to specify a [ReporterFactory]. - */ - @Suppress("DeprecatedCallableAddReplaceWith") - companion object { - /** - * The key of Atrium's property which is used to define which [ReporterFactory] shall be used. - * You can use [ReporterFactory.specifyFactory] or [ReporterFactory.specifyFactoryIfNotYetSet] - */ - @Deprecated("A Reporter should now be be retrieved via ComponentFactoryContainer where the different components of a reporter should also be defined via ComponentFactoryContainer. ReporterFactory will be removed with 0.17.0") - const val ATRIUM_PROPERTY_KEY = "ch.tutteli.atrium.reporting.reporterFactory" - - /** - * Sets Atrium's property with key [ATRIUM_PROPERTY_KEY] (which is - * `ch.tutteli.atrium.reporting.reporterFactory`) to the given [reporterFactoryId] - * regardless if another id was specified before. - * - * Use [specifyFactoryIfNotYetSet] if you only want to set a default value but not overwrite an existing - * specification. - */ - @Deprecated("A Reporter should now be be retrieved via ComponentFactoryContainer where the different components of a reporter should also be defined via ComponentFactoryContainer. ReporterFactory will be removed with 0.17.0") - fun specifyFactory(reporterFactoryId: String) { - setAtriumProperty(ATRIUM_PROPERTY_KEY, reporterFactoryId) - } - - /** - * Sets Atrium's property with key [ATRIUM_PROPERTY_KEY] (which is - * `ch.tutteli.atrium.reporting.reporterFactory`) to the given [reporterFactoryId] - * if another id was not *yet* specified before. - * - * Use [specifyFactory] if you do not care if another id was specified before or in other words, if you want to - * overwrite a potentially previously defined id. - */ - @Deprecated("A Reporter should now be be retrieved via ComponentFactoryContainer where the different components of a reporter should also be defined via ComponentFactoryContainer. ReporterFactory will be removed with 0.17.0") - fun specifyFactoryIfNotYetSet(reporterFactoryId: String) { - if (getAtriumProperty(ATRIUM_PROPERTY_KEY) == null) { - specifyFactory(reporterFactoryId) - } - } - } -} diff --git a/core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/AtriumPropertyTest.kt b/core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/AtriumPropertyTest.kt deleted file mode 100644 index 36d35a8be..000000000 --- a/core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/AtriumPropertyTest.kt +++ /dev/null @@ -1,42 +0,0 @@ -//TODO remove with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.polyfills - -import ch.tutteli.atrium.api.infix.en_GB.* -import ch.tutteli.atrium.api.verbs.internal.expect -import kotlin.test.Test - -class AtriumPropertyTest { - - @Test - fun get_undefined_returnsNull() { - expect(getAtriumProperty("notYetDefined")) toBe null - } - - @Test - fun get_defined_returnsDefinedValue() { - //arrange - setAtriumProperty("a", "b") - //act & assert - expect(getAtriumProperty("a")) toBe "b" - } - - @Test - fun set_undefined_definedAfterwards() { - //act - setAtriumProperty("a", "b") - //assert - expect(getAtriumProperty("a")) toBe "b" - } - - @Test - fun set_defined_overwrites() { - //arrange - setAtriumProperty("a", "b") - //act - setAtriumProperty("a", "c") - //assert - expect(getAtriumProperty("a")) toBe "c" - } -} diff --git a/core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/LoadServicesTest.kt b/core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/LoadServicesTest.kt deleted file mode 100644 index e010c1b48..000000000 --- a/core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/LoadServicesTest.kt +++ /dev/null @@ -1,37 +0,0 @@ -//TODO remove with 0.17.0 -package ch.tutteli.atrium.core.polyfills - -import ch.tutteli.atrium.api.infix.en_GB.* -import ch.tutteli.atrium.api.verbs.internal.expect -import kotlin.test.Test - -class LoadServicesTest { - @Test - fun noServiceFound_EmptySequence() { - expect(loadServices(LoadServicesTest::class).toList()) toBe empty - } - - @Test - fun oneServiceFound_ReturnsTheService() { - expect(loadServices(InterfaceWithOneImplementation::class)).asIterable { - it containsExactly { isA() } - } - } - - @Test - fun twoServicesFound_ThrowsIllegalStateException() { - expect(loadServices(InterfaceWithTwoImplementation::class)) asIterable o contains o inAny order but only the entries( - { isA() }, - { isA() } - ) - expect { - loadSingleService(InterfaceWithTwoImplementation::class) - }.toThrow { - this messageContains values( - "Found more than one implementation ", - Service1::class.fullName, - Service2::class.fullName - ) - } - } -} diff --git a/core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/LoadSingleServiceTest.kt b/core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/LoadSingleServiceTest.kt deleted file mode 100644 index a1475f27f..000000000 --- a/core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/LoadSingleServiceTest.kt +++ /dev/null @@ -1,36 +0,0 @@ -//TODO remove with 0.17.0 -package ch.tutteli.atrium.core.polyfills - -import ch.tutteli.atrium.api.infix.en_GB.* -import ch.tutteli.atrium.api.verbs.internal.expect -import kotlin.test.Test - -class LoadSingleServiceTest { - @Test - fun noServiceFound_ThrowsNoSuchElementException() { - expect { - loadSingleService(LoadSingleServiceTest::class) - }.toThrow { - it messageContains values("Could not find any implementation", LoadSingleServiceTest::class.fullName) - } - } - - @Test - fun oneServiceFound_ReturnsTheService() { - val service = loadSingleService(InterfaceWithOneImplementation::class) - expect(service).isA() - } - - @Test - fun twoServicesFound_ThrowsIllegalStateException() { - expect { - loadSingleService(InterfaceWithTwoImplementation::class) - }.toThrow { - its messageContains values( - "Found more than one implementation ", - Service1::class.fullName, - Service2::class.fullName - ) - } - } -} diff --git a/core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/UseSingleServiceTest.kt b/core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/UseSingleServiceTest.kt deleted file mode 100644 index d72f9c86a..000000000 --- a/core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/UseSingleServiceTest.kt +++ /dev/null @@ -1,40 +0,0 @@ -//TODO remove with 0.17.0 -package ch.tutteli.atrium.core.polyfills - -import ch.tutteli.atrium.api.infix.en_GB.* -import ch.tutteli.atrium.api.verbs.internal.expect -import kotlin.test.Test - -class UseSingleServiceTest { - @Test - fun emptyIterator_ThrowsNoSuchElementException() { - expect { - useSingleService(InterfaceWithOneImplementation::class, listOf().iterator()) - }.toThrow { - its messageContains values( - "Could not find any implementation", - InterfaceWithOneImplementation::class.fullName - ) - } - } - - @Test - fun oneServiceFound_ReturnsTheService() { - val service = useSingleService(InterfaceWithOneImplementation::class, listOf(SingleService()).iterator()) - expect(service).isA() - } - - @Test - fun twoServiceFound_ReturnsTheService() { - expect { - useSingleService(InterfaceWithTwoImplementation::class, listOf(Service1(), Service2()).iterator()) - }.toThrow { - its messageContains values( - "Found more than one implementation ", - Service1::class.fullName, - Service2::class.fullName - ) - } - } -} - diff --git a/core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/testServices.kt b/core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/testServices.kt deleted file mode 100644 index 85877bd64..000000000 --- a/core/api/atrium-core-api-common/src/test/kotlin/ch/tutteli/atrium/core/polyfills/testServices.kt +++ /dev/null @@ -1,9 +0,0 @@ -//TODO remove with 0.17.0 -package ch.tutteli.atrium.core.polyfills - -interface InterfaceWithOneImplementation -class SingleService : InterfaceWithOneImplementation - -interface InterfaceWithTwoImplementation -class Service1 : InterfaceWithTwoImplementation -class Service2 : InterfaceWithTwoImplementation diff --git a/core/api/atrium-core-api-js/src/main/kotlin/ch/tutteli/atrium/core/polyfills/properties.kt b/core/api/atrium-core-api-js/src/main/kotlin/ch/tutteli/atrium/core/polyfills/properties.kt deleted file mode 100644 index 0b7994157..000000000 --- a/core/api/atrium-core-api-js/src/main/kotlin/ch/tutteli/atrium/core/polyfills/properties.kt +++ /dev/null @@ -1,11 +0,0 @@ -package ch.tutteli.atrium.core.polyfills - -private val properties = mutableMapOf() - -@Deprecated("Will be removed with 0.17.0 without replacement") -actual fun getAtriumProperty(key: String): String? = properties[key] - -@Deprecated("Will be removed with 0.17.0 without replacement") -actual fun setAtriumProperty(key: String, newValue: String) { - properties[key] = newValue -} diff --git a/core/api/atrium-core-api-js/src/test/kotlin/testSetup.kt b/core/api/atrium-core-api-js/src/test/kotlin/testSetup.kt deleted file mode 100644 index 55a3fae2a..000000000 --- a/core/api/atrium-core-api-js/src/test/kotlin/testSetup.kt +++ /dev/null @@ -1,14 +0,0 @@ -//TODO remove file with 1.0.0 -@file:Suppress("DEPRECATION") -import ch.tutteli.atrium.core.polyfills.* -import ch.tutteli.atrium.core.robstoll.dependOn_atrium_core_robstoll -import ch.tutteli.atrium.domain.robstoll.dependOn_atrium_domain_robstoll - -private val currentSetupWorkaround = dep() -private fun dep() { - dependOn_atrium_domain_robstoll() - dependOn_atrium_core_robstoll() - registerService { SingleService() } - registerService { Service1() } - registerService { Service2() } -} diff --git a/core/api/atrium-core-api-jvm/src/main/kotlin/ch/tutteli/atrium/core/CoreFactory.kt b/core/api/atrium-core-api-jvm/src/main/kotlin/ch/tutteli/atrium/core/CoreFactory.kt index 14c359b4c..e6ab824c8 100644 --- a/core/api/atrium-core-api-jvm/src/main/kotlin/ch/tutteli/atrium/core/CoreFactory.kt +++ b/core/api/atrium-core-api-jvm/src/main/kotlin/ch/tutteli/atrium/core/CoreFactory.kt @@ -11,6 +11,7 @@ import ch.tutteli.atrium.reporting.translating.Locale import ch.tutteli.atrium.reporting.translating.TranslationSupplier import java.util.* +//TODO 0.17.0 deprecate actual interface CoreFactory : CoreFactoryCommon { /** diff --git a/core/api/atrium-core-api-jvm/src/main/kotlin/ch/tutteli/atrium/core/polyfills/properties.kt b/core/api/atrium-core-api-jvm/src/main/kotlin/ch/tutteli/atrium/core/polyfills/properties.kt deleted file mode 100644 index cca4f869e..000000000 --- a/core/api/atrium-core-api-jvm/src/main/kotlin/ch/tutteli/atrium/core/polyfills/properties.kt +++ /dev/null @@ -1,8 +0,0 @@ -package ch.tutteli.atrium.core.polyfills - -@Deprecated("Will be removed with 0.17.0 without replacement") -actual fun getAtriumProperty(key: String): String? = System.getProperty(key) -@Deprecated("Will be removed with 0.17.0 without replacement") -actual fun setAtriumProperty(key: String, newValue: String) { - System.setProperty(key, newValue) -} diff --git a/core/api/atrium-core-api-jvm/src/module/module-info.java b/core/api/atrium-core-api-jvm/src/module/module-info.java index 5744e32fa..4a63deaa4 100644 --- a/core/api/atrium-core-api-jvm/src/module/module-info.java +++ b/core/api/atrium-core-api-jvm/src/module/module-info.java @@ -19,6 +19,5 @@ module ch.tutteli.atrium.core.api { // TODO 0.17.0 or 0.18.0 remove once DefaultComponentFactoryContainer is internal exports ch.tutteli.atrium.creating.impl to ch.tutteli.atrium.logic, - ch.tutteli.atrium.domain.robstoll.lib, ch.tutteli.atrium.api.infix.en_GB; } diff --git a/core/api/atrium-core-api-jvm/src/test/kotlin/ch/tutteli/atrium/reporting/erroradjusters/AdjustStackSpec.kt b/core/api/atrium-core-api-jvm/src/test/kotlin/ch/tutteli/atrium/reporting/erroradjusters/AdjustStackSpec.kt index 138bf7b2e..edf2ea8e5 100644 --- a/core/api/atrium-core-api-jvm/src/test/kotlin/ch/tutteli/atrium/reporting/erroradjusters/AdjustStackSpec.kt +++ b/core/api/atrium-core-api-jvm/src/test/kotlin/ch/tutteli/atrium/reporting/erroradjusters/AdjustStackSpec.kt @@ -13,8 +13,6 @@ import ch.tutteli.atrium.logic._logic import ch.tutteli.atrium.logic.creating.RootExpectBuilder import ch.tutteli.atrium.logic.utils.expectLambda import ch.tutteli.atrium.reporting.AtriumErrorAdjuster -import ch.tutteli.atrium.reporting.Reporter -import ch.tutteli.atrium.reporting.reporter import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.describe diff --git a/core/api/atrium-core-api-jvm/src/test/kotlin/ch/tutteli/atrium/reporting/translating/PropertiesPerEntityAndLocaleTranslationSupplierSpec.kt b/core/api/atrium-core-api-jvm/src/test/kotlin/ch/tutteli/atrium/reporting/translating/PropertiesPerEntityAndLocaleTranslationSupplierSpec.kt index 889ce597f..293e27bdb 100644 --- a/core/api/atrium-core-api-jvm/src/test/kotlin/ch/tutteli/atrium/reporting/translating/PropertiesPerEntityAndLocaleTranslationSupplierSpec.kt +++ b/core/api/atrium-core-api-jvm/src/test/kotlin/ch/tutteli/atrium/reporting/translating/PropertiesPerEntityAndLocaleTranslationSupplierSpec.kt @@ -3,10 +3,10 @@ package ch.tutteli.atrium.reporting.translating import ch.tutteli.atrium.creating.ExperimentalComponentFactoryContainer import ch.tutteli.atrium.creating.build import ch.tutteli.atrium.reporting.translating.impl.TranslationSupplierBasedTranslator -import ch.tutteli.atrium.specs.reporting.translating.RealTranslatorIntSpec +import ch.tutteli.atrium.specs.reporting.translating.TranslatorIntSpec @ExperimentalComponentFactoryContainer -object PropertiesPerEntityAndLocaleTranslationSupplierSpec : RealTranslatorIntSpec( +object PropertiesPerEntityAndLocaleTranslationSupplierSpec : TranslatorIntSpec( { optionsChooser, primaryLocale, fallbackLocales -> optionsChooser.apply { withSingletonComponent(TranslationSupplier::class){ diff --git a/core/api/atrium-core-api-jvm/src/test/kotlin/ch/tutteli/atrium/reporting/translating/PropertiesPerLocaleTranslationSupplierSpec.kt b/core/api/atrium-core-api-jvm/src/test/kotlin/ch/tutteli/atrium/reporting/translating/PropertiesPerLocaleTranslationSupplierSpec.kt index d0b846058..eddd94c56 100644 --- a/core/api/atrium-core-api-jvm/src/test/kotlin/ch/tutteli/atrium/reporting/translating/PropertiesPerLocaleTranslationSupplierSpec.kt +++ b/core/api/atrium-core-api-jvm/src/test/kotlin/ch/tutteli/atrium/reporting/translating/PropertiesPerLocaleTranslationSupplierSpec.kt @@ -5,7 +5,7 @@ import ch.tutteli.atrium.creating.build import ch.tutteli.atrium.reporting.translating.impl.TranslationSupplierBasedTranslator @ExperimentalComponentFactoryContainer -object PropertiesPerLocaleTranslationSupplierSpec : ch.tutteli.atrium.specs.reporting.translating.RealTranslatorIntSpec( +object PropertiesPerLocaleTranslationSupplierSpec : ch.tutteli.atrium.specs.reporting.translating.TranslatorIntSpec( { optionsChooser, primaryLocale, fallbackLocales -> optionsChooser.apply { withSingletonComponent(TranslationSupplier::class){ diff --git a/core/api/atrium-core-api-jvm/src/test/kotlin/ch/tutteli/atrium/reporting/translating/ResourceBundleBasedTranslatorSpec.kt b/core/api/atrium-core-api-jvm/src/test/kotlin/ch/tutteli/atrium/reporting/translating/ResourceBundleBasedTranslatorSpec.kt index 30fcbe379..cf2782445 100644 --- a/core/api/atrium-core-api-jvm/src/test/kotlin/ch/tutteli/atrium/reporting/translating/ResourceBundleBasedTranslatorSpec.kt +++ b/core/api/atrium-core-api-jvm/src/test/kotlin/ch/tutteli/atrium/reporting/translating/ResourceBundleBasedTranslatorSpec.kt @@ -13,7 +13,7 @@ object ResourceBundleBasedTranslatorSpec : Spek({ ) - object AtriumsTranslatorIntSpec : ch.tutteli.atrium.specs.reporting.translating.RealTranslatorIntSpec( + object AtriumsTranslatorIntSpec : ch.tutteli.atrium.specs.reporting.translating.TranslatorIntSpec( { options, primaryLocale, fallbackLocales -> options.apply { withSingletonComponent(Translator::class) { diff --git a/core/api/atrium-core-api-jvm/src/test/resources/META-INF/services/ch.tutteli.atrium.core.polyfills.InterfaceWithOneImplementation b/core/api/atrium-core-api-jvm/src/test/resources/META-INF/services/ch.tutteli.atrium.core.polyfills.InterfaceWithOneImplementation deleted file mode 100644 index a4a459757..000000000 --- a/core/api/atrium-core-api-jvm/src/test/resources/META-INF/services/ch.tutteli.atrium.core.polyfills.InterfaceWithOneImplementation +++ /dev/null @@ -1,2 +0,0 @@ -# TODO remove with 1.0.0 -ch.tutteli.atrium.core.polyfills.SingleService diff --git a/core/api/atrium-core-api-jvm/src/test/resources/META-INF/services/ch.tutteli.atrium.core.polyfills.InterfaceWithTwoImplementation b/core/api/atrium-core-api-jvm/src/test/resources/META-INF/services/ch.tutteli.atrium.core.polyfills.InterfaceWithTwoImplementation deleted file mode 100644 index e0742ed27..000000000 --- a/core/api/atrium-core-api-jvm/src/test/resources/META-INF/services/ch.tutteli.atrium.core.polyfills.InterfaceWithTwoImplementation +++ /dev/null @@ -1,3 +0,0 @@ -# TODO remove with 1.0.0 -ch.tutteli.atrium.core.polyfills.Service1 -ch.tutteli.atrium.core.polyfills.Service2 diff --git a/core/api/atrium-core-api-jvm/src/test/resources/ch/tutteli/atrium/reporting/translating/Atrium_fr.properties b/core/api/atrium-core-api-jvm/src/test/resources/ch/tutteli/atrium/reporting/translating/Atrium_fr.properties index d2bdc3faa..d202f8882 100644 --- a/core/api/atrium-core-api-jvm/src/test/resources/ch/tutteli/atrium/reporting/translating/Atrium_fr.properties +++ b/core/api/atrium-core-api-jvm/src/test/resources/ch/tutteli/atrium/reporting/translating/Atrium_fr.properties @@ -2,8 +2,5 @@ ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=est ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE=n'est pas ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_NOT_SAME=n'est pas la m\u00EAme instance que ch.tutteli.atrium.specs.AssertionVerb-ASSERT=il applique que -ch.tutteli.atrium.specs.reporting.translating.RealTranslatorIntSpec.TestTranslatable-DATE_KNOWN=%tD \u00E9tait %tA!! -ch.tutteli.atrium.specs.reporting.translating.RealTranslatorIntSpec.TestTranslatable-PLACEHOLDER=Caract\u00E8re de remplacement %s -# TODO remove with 0.17.0 ch.tutteli.atrium.specs.reporting.translating.TranslatorIntSpec.TestTranslatable-DATE_KNOWN=%tD \u00E9tait %tA!! ch.tutteli.atrium.specs.reporting.translating.TranslatorIntSpec.TestTranslatable-PLACEHOLDER=Caract\u00E8re de remplacement %s diff --git a/core/api/atrium-core-api-jvm/src/test/resources/ch/tutteli/atrium/reporting/translating/Atrium_it.properties b/core/api/atrium-core-api-jvm/src/test/resources/ch/tutteli/atrium/reporting/translating/Atrium_it.properties index 1a493aa60..7dab7a2fb 100644 --- a/core/api/atrium-core-api-jvm/src/test/resources/ch/tutteli/atrium/reporting/translating/Atrium_it.properties +++ b/core/api/atrium-core-api-jvm/src/test/resources/ch/tutteli/atrium/reporting/translating/Atrium_it.properties @@ -1,5 +1,2 @@ -ch.tutteli.atrium.specs.reporting.translating.RealTranslatorIntSpec.TestTranslatable-DATE_KNOWN=solo %tA!! -ch.tutteli.atrium.specs.reporting.translating.RealTranslatorIntSpec.TestTranslatable-DATE_UNKNOWN=solo %tA!! -# TODO remove with 0.17.0 ch.tutteli.atrium.specs.reporting.translating.TranslatorIntSpec.TestTranslatable-DATE_KNOWN=solo %tA!! ch.tutteli.atrium.specs.reporting.translating.TranslatorIntSpec.TestTranslatable-DATE_UNKNOWN=solo %tA!! diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/build.gradle b/core/robstoll-lib/atrium-core-robstoll-lib-common/build.gradle deleted file mode 100644 index 2167111c7..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/build.gradle +++ /dev/null @@ -1,15 +0,0 @@ -description = 'Contains the bits and pieces behind robstoll\'s implementation ' + - 'of Atrium as common module. You should only depend on this module if you are ' + - 'providing an implementation as well and want to reuse certain artifacts. If you are a consumer of ' + - 'Atrium, then you should depend on atrium-core-robstoll-common instead.' - -dependencies { - implementation "ch.tutteli.kbox:kbox-common:$kbox_version", excludeKotlin - api prefixedProject('core-api-common') - - // it is up to the consumer of atrium-core-robstoll-lib which atrium-translations module is used at runtime - compileOnly prefixedProject('translations-en_GB-common') - - testImplementation prefixedProject('api-fluent-en_GB-common') - testImplementation prefixedProject('specs-common') -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AssertionFormatterControllerBasedFacade.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AssertionFormatterControllerBasedFacade.kt deleted file mode 100644 index 228b4bf12..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AssertionFormatterControllerBasedFacade.kt +++ /dev/null @@ -1,28 +0,0 @@ -//TODO remove with 0.17.0 - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.assertions.Assertion -import ch.tutteli.atrium.reporting.AssertionFormatter -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.AssertionFormatterFacade -import ch.tutteli.atrium.reporting.AssertionFormatterParameterObject - -/** - * Responsible to call an appropriate [AssertionFormatter] which supports [format]ing a given [Assertion] -- it does - * so by delegating this responsibility to the specified [assertionFormatterController]. - * - * @constructor Responsible to call an appropriate [AssertionFormatter] which supports [format]ing a given [Assertion] -- it does - * so by delegating this responsibility to the given [assertionFormatterController]. - * @param assertionFormatterController The controller used to control the flow of formatting. - */ -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -class AssertionFormatterControllerBasedFacade(private val assertionFormatterController: AssertionFormatterController) : - AssertionFormatterFacade { - - override fun format(assertion: Assertion, sb: StringBuilder, assertionFilter: (Assertion) -> Boolean) = - assertionFormatterController.format(assertion, AssertionFormatterParameterObject.new(sb, assertionFilter)) - - override fun register(assertionFormatterFactory: (AssertionFormatterController) -> AssertionFormatter) = - assertionFormatterController.register(assertionFormatterFactory(assertionFormatterController)) -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AssertionFormatterControllerImpl.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AssertionFormatterControllerImpl.kt deleted file mode 100644 index 033f5f999..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AssertionFormatterControllerImpl.kt +++ /dev/null @@ -1,70 +0,0 @@ -//TODO remove with 0.17.0 - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.assertions.Assertion -import ch.tutteli.atrium.assertions.AssertionGroup -import ch.tutteli.atrium.assertions.InvisibleAssertionGroupType -import ch.tutteli.atrium.reporting.AssertionFormatter -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.AssertionFormatterParameterObject - -/** - * Represents an [AssertionFormatterController] which does nothing special in addition - * but just the job of the controller :) - * - * @see AssertionFormatterController - */ -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -class AssertionFormatterControllerImpl : AssertionFormatterController { - private val assertionFormatters = mutableListOf() - - override fun format(assertion: Assertion, parameterObject: AssertionFormatterParameterObject) { - if (noNeedToFormat(assertion, parameterObject)) return - - val assertionFormatter = assertionFormatters - .firstOrNull { it.canFormat(assertion) } - ?: AssertionFormatterController.noSuitableAssertionFormatterFound(assertion) - - when (assertion) { - is AssertionGroup -> formatGroup(assertion, assertionFormatter, parameterObject) - else -> assertionFormatter.format(assertion, parameterObject) - } - } - - private fun noNeedToFormat(assertion: Assertion, parameterObject: AssertionFormatterParameterObject): Boolean { - //assertionFilter only applies if: - // - we are not in an assertion group which should not be filtered (e.g. explanatory or summary group) and - // - if the given assertion is not an explanatory assertion group either. - return parameterObject.isNotInDoNotFilterGroup() - && !isExplanatoryAssertionGroup(assertion) - && !parameterObject.assertionFilter(assertion) - } - - private fun formatGroup( - assertionGroup: AssertionGroup, - assertionFormatter: AssertionFormatter, - parameterObject: AssertionFormatterParameterObject - ) { - assertionFormatter.formatGroup( - assertionGroup, - parameterObject - ) { childParameterObject, formatAssertionInGroup -> - assertionGroup.assertions - .filter { !noNeedToFormat(it, childParameterObject) } - .forEach { formatChild(it, formatAssertionInGroup) } - } - } - - private fun formatChild(it: Assertion, formatAssertionInGroup: (Assertion) -> Unit) { - if (it is AssertionGroup && it.type is InvisibleAssertionGroupType) { - it.assertions.forEach { formatChild(it, formatAssertionInGroup) } - } else { - formatAssertionInGroup(it) - } - } - - override fun register(assertionFormatter: AssertionFormatter) { - assertionFormatters.add(assertionFormatter) - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DetailedObjectFormatter.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DetailedObjectFormatter.kt deleted file mode 100644 index 2a7247de6..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DetailedObjectFormatter.kt +++ /dev/null @@ -1,84 +0,0 @@ -//TODO remove with 0.17.0 - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.core.polyfills.fullName -import ch.tutteli.atrium.reporting.* -import ch.tutteli.atrium.reporting.translating.Translatable -import ch.tutteli.atrium.reporting.translating.Translator -import kotlin.reflect.KClass - -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -expect class DetailedObjectFormatter(translator: Translator) : ObjectFormatter - -/** - * Base class for the platform specific implementation of [DetailedObjectFormatter]. - * - * It cannot format Java's `Class`, this has to be done in the JVM module. Moreover it requires a platform specific - * implementation of [identityHash] and [format] a [KClass]. - */ -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -abstract class DetailedObjectFormatterCommon( - private val translator: Translator -) : ObjectFormatter { - - /** - * Returns a formatted version of the given [value]. - * - * The following rules apply for the representation of an object: - * - `null` is represented as [Text.NULL].[Text.string] - * - [LazyRepresentation] is [evaluated][LazyRepresentation.eval] and then again [format]ted - * - [Char] is put in apostrophes - * - [Boolean] is represented with its [toString] representation - * - [String] is put in quotes and its [KClass.fullName] is omitted - * - [CharSequence] is put in quotes, but [KClass.fullName] is used in contrast to [String] - * - [Text] is represented as [Text.string] - * - [Translatable] is represented as result of its translation (by [translator]) - * - [KClass]'s format is defined by the concrete platform specific subclass. - * - [Enum] is represented as "[toString] ([KClass.fullName]) - * - [Throwable] is represented as "[KClass.fullName]" - * - All other objects are represented as "[toString] ([KClass.fullName] [identityHash])" - * - * @param value The value which shall be formatted. - * - * @return The formatted [value]. - */ - @Suppress( /* TODO remove with 1.0.0 */ "DEPRECATION") - override fun format(value: Any?): String = when (value) { - null -> Text.NULL.string - is LazyRepresentation -> format(value.eval()) - is Char -> "'$value'" - is Boolean -> value.toString() - is String -> format(value) - is CharSequence -> format(value) - is Text -> limitRepresentation(value.string) - is Translatable -> limitRepresentation(translator.translate(value)) - is KClass<*> -> format(value) - is Enum<*> -> format(value) - is Throwable -> format(value) - //TODO remove with 1.0.0 - is StringBasedRawString -> limitRepresentation(value.string) - is ch.tutteli.atrium.reporting.translating.TranslatableBasedRawString -> limitRepresentation(translator.translate(value.translatable)) - - else -> limitRepresentation(value.toString()) + classNameAndIdentity(value) - } - - private fun format(string: String) = "\"${limitRepresentation(string)}\"" + identityHash(INDENT, string) - private fun format(charSequence: CharSequence) = "\"${limitRepresentation(charSequence.toString())}\"" + classNameAndIdentity(charSequence) - private fun format(enum: Enum<*>) = - limitRepresentation(enum.toString()) + INDENT + "(" + (enum::class.fullName) + ")" - - private fun format(throwable: Throwable) = throwable::class.fullName - - private fun classNameAndIdentity(any: Any): String = INDENT + "(${any::class.fullName}${identityHash(" ", any)})" - private fun limitRepresentation(value: String): String { - return if (value.length > 10000) "${value.substring(0, 10000)}..." else value - } - - protected abstract fun format(kClass: KClass<*>): String - protected abstract fun identityHash(indent: String, any: Any): String - - companion object { - internal const val INDENT: String = " " - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/MultiAtriumErrorAdjusterImpl.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/MultiAtriumErrorAdjusterImpl.kt deleted file mode 100644 index d294c04ce..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/MultiAtriumErrorAdjusterImpl.kt +++ /dev/null @@ -1,16 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster - -@Deprecated( - "Use MultiAtriumErrorAdjuster from atrium-core, will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.reporting.erroradjusters.MultiAtriumErrorAdjuster") -) -expect class MultiAtriumErrorAdjusterImpl( - firstAdjuster: AtriumErrorAdjuster, - secondAdjuster: AtriumErrorAdjuster, - otherAdjusters: List -) : AtriumErrorAdjuster diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/NoOpAtriumErrorAdjuster.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/NoOpAtriumErrorAdjuster.kt deleted file mode 100644 index e4891b320..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/NoOpAtriumErrorAdjuster.kt +++ /dev/null @@ -1,28 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster - -/** - * An implementation of an [AtriumErrorAdjuster] which adjust nothings. - */ -@Deprecated( - "Use NoOpAtriumErrorAdjuster from atrium-core, will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.reporting.erroradjusters.NoOpAtriumErrorAdjuster") -) -expect object NoOpAtriumErrorAdjuster : AtriumErrorAdjuster - -/** - * An implementation of an [AtriumErrorAdjuster] which adjust nothings and can be used by the platforms to provide the - * actual type of [NoOpAtriumErrorAdjuster]. - */ -@Deprecated( - "Use NoOpAtriumErrorAdjuster from atrium-core, will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.reporting.erroradjusters.NoOpAtriumErrorAdjusterCommon") -) -abstract class NoOpAtriumErrorAdjusterCommon : AtriumErrorAdjuster { - override fun adjustOtherThanStacks(throwable: Throwable) {} - override fun adjust(throwable: Throwable) {} -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/NoSpecialChildFormattingSingleAssertionGroupTypeFormatter.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/NoSpecialChildFormattingSingleAssertionGroupTypeFormatter.kt deleted file mode 100644 index eeebf8930..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/NoSpecialChildFormattingSingleAssertionGroupTypeFormatter.kt +++ /dev/null @@ -1,43 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.assertions.Assertion -import ch.tutteli.atrium.assertions.AssertionGroup -import ch.tutteli.atrium.assertions.AssertionGroupType -import ch.tutteli.atrium.reporting.AssertionFormatter -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.AssertionFormatterParameterObject -import kotlin.reflect.KClass - -/** - * A base type for [AssertionFormatter] which [canFormat][AssertionFormatter.canFormat] only - * [AssertionGroup]s of one specific [AssertionGroupType] and does nothing special when it comes to formatting - * [AssertionGroup.assertions] (merely delegates to [assertionFormatterController]). - * - * @param T The [AssertionGroupType] which the concrete sub class [canFormat][AssertionFormatter.canFormat]. - * - * @property clazz The [AssertionGroupType] which the concrete sub class [canFormat][AssertionFormatter.canFormat]. - * - * @constructor A base type for [AssertionFormatter] which [canFormat][AssertionFormatter.canFormat] only - * [AssertionGroup]s of one specific [AssertionGroupType]. - * @param clazz The [AssertionGroupType] which the concrete sub class [canFormat][AssertionFormatter.canFormat]. - * @param assertionFormatterController The controller to which this formatter gives back the control - * when it comes to format children of an [AssertionGroup]. - */ -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -abstract class NoSpecialChildFormattingSingleAssertionGroupTypeFormatter( - clazz: KClass, - private val assertionFormatterController: AssertionFormatterController -) : SingleAssertionGroupTypeFormatter(clazz) { - - - override fun formatGroupAssertions( - formatAssertions: (AssertionFormatterParameterObject, (Assertion) -> Unit) -> Unit, - childParameterObject: AssertionFormatterParameterObject - ) { - formatAssertions(childParameterObject) { - assertionFormatterController.format(it, childParameterObject) - } - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/OnlyFailureReporter.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/OnlyFailureReporter.kt deleted file mode 100644 index 81590ff65..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/OnlyFailureReporter.kt +++ /dev/null @@ -1,35 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("OverridingDeprecatedMember") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.assertions.Assertion -import ch.tutteli.atrium.reporting.AssertionFormatterFacade -import ch.tutteli.atrium.reporting.AtriumError -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster -import ch.tutteli.atrium.reporting.Reporter - -/** - * A [Reporter] which reports only failing assertions. - * - * @property assertionFormatterFacade The formatter used to format [Assertion]s. - * - * @constructor A [Reporter] which reports only failing assertions. - * @param assertionFormatterFacade The formatter used to format [Assertion]s. - * @param atriumErrorAdjuster The adjuster which should be used to adjust the resulting [AtriumError]. - */ -@Deprecated("Reporting will fundamentally change with the replacement of Assertion with Proof in 0.17.0. There is a replacement in 0.16.0 in atrium-api-core which will be deprecated again in 0.17.0. This class will be removed with 0.17.0") -class OnlyFailureReporter( - private val assertionFormatterFacade: AssertionFormatterFacade, - override val atriumErrorAdjuster: AtriumErrorAdjuster -) : Reporter { - - /** - * Formats the given [assertion] with the help of the defined [assertionFormatterFacade] - * and appends the result to the given [sb] but only in case the given [assertion] [holds][Assertion.holds]. - */ - override fun format(assertion: Assertion, sb: StringBuilder): Unit = - assertionFormatterFacade.format(assertion, sb, this::assertionFilter) - - private fun assertionFilter(assertion: Assertion) = !assertion.holds() -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveAtriumFromAtriumErrorAdjuster.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveAtriumFromAtriumErrorAdjuster.kt deleted file mode 100644 index c6a2125eb..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveAtriumFromAtriumErrorAdjuster.kt +++ /dev/null @@ -1,12 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster - -@Deprecated( - "Use RemoveAtriumFromAtriumErrorAdjuster from atrium-core, will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.reporting.erroradjusters.impl.RemoveAtriumFromAtriumErrorAdjuster") -) -expect class RemoveAtriumFromAtriumErrorAdjuster() : AtriumErrorAdjuster diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt deleted file mode 100644 index 63884687d..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt +++ /dev/null @@ -1,12 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster - -@Deprecated( - "Use RemoveRunnerAtriumErrorAdjuster from atrium-core, will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.reporting.erroradjusters.impl.RemoveRunnerAtriumErrorAdjuster") -) -expect class RemoveRunnerAtriumErrorAdjuster() : AtriumErrorAdjuster diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/SingleAssertionGroupTypeFormatter.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/SingleAssertionGroupTypeFormatter.kt deleted file mode 100644 index 0313e78f2..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/SingleAssertionGroupTypeFormatter.kt +++ /dev/null @@ -1,115 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.assertions.Assertion -import ch.tutteli.atrium.assertions.AssertionGroup -import ch.tutteli.atrium.assertions.AssertionGroupType -import ch.tutteli.atrium.core.polyfills.fullName -import ch.tutteli.atrium.reporting.AssertionFormatter -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.AssertionFormatterParameterObject -import kotlin.reflect.KClass - -/** - * A base type for [AssertionFormatter] which [canFormat][AssertionFormatter.canFormat] only - * [AssertionGroup]s of one specific [AssertionGroupType]. - * - * @param T The [AssertionGroupType] which the concrete sub class [canFormat][AssertionFormatter.canFormat]. - * - * @property clazz The [AssertionGroupType] which the concrete sub class [canFormat][AssertionFormatter.canFormat]. - * - * @constructor A base type for [AssertionFormatter] which [canFormat][AssertionFormatter.canFormat] only - * [AssertionGroup]s of one specific [AssertionGroupType]. - * @param clazz The [AssertionGroupType] which the concrete sub class [canFormat][AssertionFormatter.canFormat]. - */ -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -abstract class SingleAssertionGroupTypeFormatter( - private val clazz: KClass -) : AssertionFormatter { - - /** - * Returns true if the given [assertion] is an [AssertionGroup] and its [type][AssertionGroup.type] - * is [T] or a sub type. - */ - final override fun canFormat(assertion: Assertion) = assertion is AssertionGroup && clazz.isInstance(assertion.type) - - /** - * Always throws an [UnsupportedOperationException], because this [AssertionFormatter] can only format - * [AssertionGroup]s. - * - * @throws UnsupportedOperationException always! - */ - final override fun formatNonGroup(assertion: Assertion, parameterObject: AssertionFormatterParameterObject) = - throw UnsupportedOperationException( - "supports only ${clazz.fullName} for which one has to call ${AssertionFormatter::formatGroup.name}" - ) - - /** - * Checks whether [assertionGroup] is [T] or a sub type and if so, calls [formatGroupHeaderAndGetChildParameterObject] - * and uses the resulting child-[AssertionFormatterParameterObject] to format [AssertionGroup.assertions]. - * - * If [assertionGroup] is *not* [T] or a sub type, then it throws an [UnsupportedOperationException]. - * - * @param assertionGroup The assertion group which should be formatted. - * @param parameterObject The parameter object which contains inter alia the [sb][AssertionFormatterParameterObject.sb] - * to which the result will be appended. - * @param formatAssertions The function which should be called to format the - * [assertions][AssertionGroup.assertions] of the given [assertionGroup]. - * It itself expects a function which formats single [Assertion]s in the context of the given - * [assertionGroup]. - * - * @see [AssertionFormatter.formatGroup]. - * - * @throws UnsupportedOperationException if the given [assertionGroup] is not [T] or a sub type of it. - */ - final override fun formatGroup( - assertionGroup: AssertionGroup, - parameterObject: AssertionFormatterParameterObject, - formatAssertions: (AssertionFormatterParameterObject, (Assertion) -> Unit) -> Unit - ) = when { - clazz.isInstance(assertionGroup.type) -> formatSpecificGroup(assertionGroup, parameterObject, formatAssertions) - else -> throw UnsupportedOperationException("supports only ${clazz.fullName}") - } - - private fun formatSpecificGroup( - assertionGroup: AssertionGroup, - parameterObject: AssertionFormatterParameterObject, - formatAssertions: (AssertionFormatterParameterObject, (Assertion) -> Unit) -> Unit - ) { - val childParameterObject = formatGroupHeaderAndGetChildParameterObject(assertionGroup, parameterObject) - formatGroupAssertions(formatAssertions, childParameterObject) - } - - /** - * Formats the group header of the given [assertionGroup] (with [type][AssertionGroup.type] [T]) -- appends the - * result to the [sb][AssertionFormatterParameterObject.sb] of the given [parameterObject] -- and returns the - * [AssertionFormatterParameterObject] which shall be used for the [AssertionGroup.assertions]. - * - * @param assertionGroup The assertion group which should be formatted. - * @param parameterObject The parameter object which contains inter alia the [sb][AssertionFormatterParameterObject.sb] - * to which the result will be appended. - * - * @return The [AssertionFormatterParameterObject] which shall be used for the [AssertionGroup.assertions]. - */ - protected abstract fun formatGroupHeaderAndGetChildParameterObject( - assertionGroup: AssertionGroup, - parameterObject: AssertionFormatterParameterObject - ): AssertionFormatterParameterObject - - /** - * Formats the [AssertionGroup.assertions] -- has to call the given [formatAssertions] function in order that - * the [AssertionFormatterController] can steer the process. - * - * @param formatAssertions The function which should be called to format the [assertions][AssertionGroup.assertions] - * of a given [AssertionGroup]. It itself expects a function which formats single [Assertion]s in the context - * of the given [AssertionGroup]. - * @param childParameterObject The parameter object which shall be used to format [AssertionGroup.assertions] -- contains - * inter alia the [sb][AssertionFormatterParameterObject.sb] to which the result will be appended. - */ - protected abstract fun formatGroupAssertions( - formatAssertions: (AssertionFormatterParameterObject, (Assertion) -> Unit) -> Unit, - childParameterObject: AssertionFormatterParameterObject - ) -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextExplanatoryAssertionGroupFormatter.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextExplanatoryAssertionGroupFormatter.kt deleted file mode 100644 index b100c6dd2..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextExplanatoryAssertionGroupFormatter.kt +++ /dev/null @@ -1,70 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.assertions.* -import ch.tutteli.atrium.reporting.AssertionFormatter -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.AssertionFormatterParameterObject -import kotlin.reflect.KClass - -/** - * Represents an [AssertionFormatter] which formats [AssertionGroup]s with an [ExplanatoryAssertionGroupType] by - * neglecting the group header and defining an child-[AssertionFormatterParameterObject] which indicates that we are in an - * explanatory assertion. - * - * Furthermore it uses the bullet point defined for [WarningAssertionGroupType] in `bulletPoints` (see constructor) - * (`"❗❗ "` if absent) as prefix for the child-[AssertionFormatterParameterObject] if the [AssertionGroup.type] is a - * [WarningAssertionGroupType]. Otherwise it is using the bullet point defined for [ExplanatoryAssertionGroupType] - * (`"» "` if absent). - * - * Its usage is intended for text output (e.g. to the console). - * - * @constructor Represents an [AssertionFormatter] which formats [AssertionGroup]s with an - * [ExplanatoryAssertionGroupType] by defining only an [AssertionFormatterParameterObject] -- which indicates - * that we are in an explanatory assertion group and uses the `bulletPoints` (passed as argument) as prefix -- - * and completely ignoring [AssertionGroup.description] and [AssertionGroup.representation]. - * - * @param bulletPoints The formatter uses the bullet point defined for [WarningAssertionGroupType] - * (`"❗❗ "` if absent) or the bullet point defined for [ExplanatoryAssertionGroupType] - * (`"» "` if absent) as prefix of the child-[AssertionFormatterParameterObject]. - * - * @param assertionFormatterController The controller to which this formatter gives back the control - * when it comes to format children of an [AssertionGroup]. - */ -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -class TextExplanatoryAssertionGroupFormatter( - bulletPoints: Map, String>, - assertionFormatterController: AssertionFormatterController -) : NoSpecialChildFormattingSingleAssertionGroupTypeFormatter( - ExplanatoryAssertionGroupType::class, - assertionFormatterController -) { - private val explanatoryBulletPoint = bulletPoints[ExplanatoryAssertionGroupType::class] ?: "» " - private val warningBulletPoint = bulletPoints[WarningAssertionGroupType::class] ?: "❗❗ " - private val informationBulletPoint = bulletPoints[InformationAssertionGroupType::class] ?: "ℹ " - - override fun formatGroupHeaderAndGetChildParameterObject( - assertionGroup: AssertionGroup, - parameterObject: AssertionFormatterParameterObject - ): AssertionFormatterParameterObject { - fun withIndent(bulletPoint: String) = - parameterObject.createForExplanatoryFilterAssertionGroup().createChildWithNewPrefix(bulletPoint) - - fun withOrWithoutIndent(bulletPoint: String, withIndent: Boolean) = - if (withIndent) withIndent(bulletPoint) - else parameterObject.createForExplanatoryFilterAssertionGroup(bulletPoint) - - //TODO 1.0.0 move val inside when - val assertionGroupType = assertionGroup.type - return when (assertionGroupType) { - is InformationAssertionGroupType -> withOrWithoutIndent( - informationBulletPoint, - assertionGroupType.withIndent - ) - WarningAssertionGroupType -> withIndent(warningBulletPoint) - else -> withIndent(explanatoryBulletPoint) - } - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextFallbackAssertionFormatter.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextFallbackAssertionFormatter.kt deleted file mode 100644 index 276529fdd..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextFallbackAssertionFormatter.kt +++ /dev/null @@ -1,114 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.assertions.* -import ch.tutteli.atrium.core.polyfills.fullName -import ch.tutteli.atrium.reporting.* -import ch.tutteli.atrium.reporting.translating.Untranslatable -import kotlin.reflect.KClass - -/** - * Formats an [Assertion] for text output (e.g. to the console) by using the given [assertionPairFormatter] - * to format the group header for [AssertionGroup]s and uses the bullet point defined for - * [RootAssertionGroupType] as prefix for the [AssertionGroup.assertions]. - * - * The [assertionPairFormatter] is also used to format [DescriptiveAssertion]s. - * - * Currently the following [Assertion] types are supported: - * - [AssertionGroup] of type [RootAssertionGroupType] - * - [DescriptiveAssertion] - * - [ExplanatoryAssertion] - * - * In addition it defines a fallback for unknown [AssertionGroupType]s as well as for unknown [Assertion] types. - * - * @property assertionFormatterController The [AssertionFormatterController] used to steer the control flow of - * the reporting process. - * @property assertionPairFormatter The formatter used to format assertion pairs (e.g. [DescriptiveAssertion.description] - * and [DescriptiveAssertion.representation]) - * - * @constructor Formats an [Assertion] for text output (e.g. for the console) where it uses a given - * [assertionPairFormatter] which defines how an assertion pair (e.g. [DescriptiveAssertion.description] - * and [DescriptiveAssertion.representation]) is formatted. - * @param bulletPoints The formatter uses the bullet point defined for [RootAssertionGroupType] - * (`"◆ "` if absent) as prefix of the child-[AssertionFormatterParameterObject]. - * @param assertionFormatterController The [AssertionFormatterController] used to steer the control flow of - * the reporting process. - * @param assertionPairFormatter The formatter which is used to format assertion pairs - * (e.g. [DescriptiveAssertion.description] and [DescriptiveAssertion.representation]) - */ -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -class TextFallbackAssertionFormatter( - bulletPoints: Map, String>, - private val assertionFormatterController: AssertionFormatterController, - private val assertionPairFormatter: AssertionPairFormatter, - private val objectFormatter: ObjectFormatter -) : AssertionFormatter { - private val rootPrefix = bulletPoints[RootAssertionGroupType::class] ?: "◆ " - private val formatter = TextPrefixBasedAssertionGroupFormatter(rootPrefix) - - override fun canFormat(assertion: Assertion): Boolean { - // two fallback are implemented one for IAssertionGroup (uses always formatGroup) - // and the other one for any kind of IAssertion (fallback to formatFallback) - return true - } - - override fun formatNonGroup(assertion: Assertion, parameterObject: AssertionFormatterParameterObject) { - parameterObject.appendLnIndentAndPrefix() - when (assertion) { - is DescriptiveAssertion -> appendDescriptiveAssertion(assertion, parameterObject) - is RepresentationOnlyAssertion -> appendRepresentationOnlyAssertion(assertion, parameterObject) - is ExplanatoryAssertion -> appendExplanatoryAssertion(assertion, parameterObject) - else -> formatFallback(assertion, parameterObject) - } - } - - private fun appendDescriptiveAssertion( - assertion: DescriptiveAssertion, - parameterObject: AssertionFormatterParameterObject - ) { - assertionPairFormatter.format(parameterObject, assertion.description, assertion.representation) - } - - private fun appendRepresentationOnlyAssertion( - assertion: RepresentationOnlyAssertion, - parameterObject: AssertionFormatterParameterObject - ) { - parameterObject.sb.append(objectFormatter.format(assertion.representation)) - } - - private fun appendExplanatoryAssertion( - assertion: ExplanatoryAssertion, - parameterObject: AssertionFormatterParameterObject - ) { - parameterObject.sb.append(objectFormatter.format(assertion.explanation)) - } - - private fun formatFallback(assertion: Assertion, parameterObject: AssertionFormatterParameterObject) { - val translatable = - Untranslatable("Unsupported type ${assertion::class.fullName}, can only report whether it holds") - assertionPairFormatter.format(parameterObject, translatable, assertion.holds()) - } - - override fun formatGroup( - assertionGroup: AssertionGroup, - parameterObject: AssertionFormatterParameterObject, - formatAssertions: (AssertionFormatterParameterObject, (Assertion) -> Unit) -> Unit - ) { - val childParameterObject = formatGroupHeaderAndGetChildParameterObject(assertionGroup, parameterObject) - formatAssertions(childParameterObject) { - assertionFormatterController.format(it, childParameterObject) - } - } - - private fun formatGroupHeaderAndGetChildParameterObject( - assertionGroup: AssertionGroup, parameterObject: AssertionFormatterParameterObject - ) = when (assertionGroup.type) { - RootAssertionGroupType -> formatter.formatAfterAppendLnEtc( - assertionPairFormatter, assertionGroup, parameterObject - ) - else -> formatter.formatWithGroupName(assertionPairFormatter, assertionGroup, parameterObject) - } - -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextFeatureAssertionGroupFormatter.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextFeatureAssertionGroupFormatter.kt deleted file mode 100644 index 4bafeda0c..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextFeatureAssertionGroupFormatter.kt +++ /dev/null @@ -1,69 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.assertions.AssertionGroup -import ch.tutteli.atrium.assertions.BulletPointIdentifier -import ch.tutteli.atrium.assertions.FeatureAssertionGroupType -import ch.tutteli.atrium.assertions.PrefixFeatureAssertionGroupHeader -import ch.tutteli.atrium.reporting.* -import ch.tutteli.atrium.reporting.translating.Translatable -import ch.tutteli.atrium.reporting.translating.TranslatableWithArgs -import ch.tutteli.atrium.reporting.translating.Untranslatable -import kotlin.reflect.KClass - -/** - * Represents an [AssertionFormatter] which formats [AssertionGroup]s with a [FeatureAssertionGroupType] by - * using the given [assertionPairFormatter] to format the group header, additionally prefixing it with the - * "bullet point" (typically an arrow) defined for [PrefixFeatureAssertionGroupHeader] and uses the bullet point - * defined for [FeatureAssertionGroupType] as prefix for the [AssertionGroup.assertions]. - * - * Its usage is intended for text output (e.g. to the console). - * - * @constructor Represents an [AssertionFormatter] which formats [AssertionGroup]s with an - * [FeatureAssertionGroupType] by using the given [assertionPairFormatter] to format the group header, additionally - * prefixing it with the "bullet point" (typically an arrow) defined for [PrefixFeatureAssertionGroupHeader] and uses - * the bullet point defined for [FeatureAssertionGroupType] as prefix for the [AssertionGroup.assertions]. - * - * @param bulletPoints The formatter uses the bullet point defined for [PrefixFeatureAssertionGroupHeader] - * (`"▶ "` if absent) as prefix of the group header and [FeatureAssertionGroupType] (`"◾ "` if absent) - * as prefix of the child-[AssertionFormatterParameterObject]. - * @param assertionFormatterController The controller to which this formatter gives back the control - * when it comes to format children of an [AssertionGroup]. - * @param assertionPairFormatter The formatter which is used to format assertion pairs. - */ -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -class TextFeatureAssertionGroupFormatter( - bulletPoints: Map, String>, - assertionFormatterController: AssertionFormatterController, - private val assertionPairFormatter: AssertionPairFormatter -) : NoSpecialChildFormattingSingleAssertionGroupTypeFormatter( - FeatureAssertionGroupType::class, - assertionFormatterController -) { - - private val prefix = (bulletPoints[FeatureAssertionGroupType::class] ?: "◾ ") - private val arrow = (bulletPoints[PrefixFeatureAssertionGroupHeader::class] ?: "▶ ") - - override fun formatGroupHeaderAndGetChildParameterObject( - assertionGroup: AssertionGroup, - parameterObject: AssertionFormatterParameterObject - ): AssertionFormatterParameterObject { - parameterObject.appendLnIndentAndPrefix() - val translatable = TranslatableWithArgs(Untranslatable("$arrow%s"), assertionGroup.description) - val group = DecoratedAssertionGroup(translatable, assertionGroup, parameterObject) - val newParameterObject = parameterObject.createChildWithNewPrefixAndAdditionalIndent(prefix, arrow.length) - assertionPairFormatter.formatGroupHeader(parameterObject, group, newParameterObject) - return newParameterObject - } - - private class DecoratedAssertionGroup( - newName: Translatable, - assertionGroup: AssertionGroup, - parameterObject: AssertionFormatterParameterObject - ) : AssertionGroup by assertionGroup { - override val description: Translatable = newName - override val representation: Any = if(parameterObject.isNotInExplanatoryFilterGroup()) assertionGroup.representation else Text.EMPTY - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextListAssertionGroupFormatter.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextListAssertionGroupFormatter.kt deleted file mode 100644 index 1f236d329..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextListAssertionGroupFormatter.kt +++ /dev/null @@ -1,40 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.assertions.AssertionGroup -import ch.tutteli.atrium.assertions.BulletPointIdentifier -import ch.tutteli.atrium.assertions.ListAssertionGroupType -import ch.tutteli.atrium.reporting.AssertionFormatter -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.AssertionFormatterParameterObject -import ch.tutteli.atrium.reporting.AssertionPairFormatter -import kotlin.reflect.KClass - -/** - * Represents an [AssertionFormatter] which formats [AssertionGroup]s with a [ListAssertionGroupType] by - * using the given [assertionPairFormatter] to format the group header and uses the bullet point defined for - * [ListAssertionGroupType] as prefix for the [AssertionGroup.assertions]. - * - * Its usage is intended for text output (e.g. to the console). - * - * @constructor Represents an [AssertionFormatter] which formats [AssertionGroup]s with a [ListAssertionGroupType] - * by putting each assertion on an own line prefixed with a bullet point. - * @param bulletPoints The formatter uses the bullet point defined for [ListAssertionGroupType] - * (`" ⚬ "` if absent) as prefix of the child-[AssertionFormatterParameterObject]. - * @param assertionFormatterController The controller to which this formatter gives back the control - * when it comes to format children of an [AssertionGroup]. - * @param assertionPairFormatter The formatter which is used to format assertion pairs. - */ -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -class TextListAssertionGroupFormatter( - bulletPoints: Map, String>, - assertionFormatterController: AssertionFormatterController, - assertionPairFormatter: AssertionPairFormatter -) : TextListBasedAssertionGroupFormatter( - bulletPoints[ListAssertionGroupType::class] ?: "⚬ ", - assertionFormatterController, - assertionPairFormatter, - ListAssertionGroupType::class -) diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextListBasedAssertionGroupFormatter.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextListBasedAssertionGroupFormatter.kt deleted file mode 100644 index 5352c9d28..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextListBasedAssertionGroupFormatter.kt +++ /dev/null @@ -1,44 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.assertions.AssertionGroup -import ch.tutteli.atrium.assertions.AssertionGroupType -import ch.tutteli.atrium.reporting.AssertionFormatter -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.AssertionFormatterParameterObject -import ch.tutteli.atrium.reporting.AssertionPairFormatter -import kotlin.reflect.KClass - -/** - * Represents an [AssertionFormatter] which formats [AssertionGroup]s with type [T] by using the given - * [assertionPairFormatter] to format the group header and using the given `bulletPoint` (see constructor) to prefix - * the [AssertionGroup.assertions]. - * - * Its usage is intended for text output (e.g. to the console). - * - * @constructor Represents an [AssertionFormatter] which formats [AssertionGroup]s with type [T] by - * putting each assertion on an own line prefixed with a bullet point. - * @param bulletPoint The bullet point (might also be more than one character) which shall be used. - * @param assertionFormatterController The controller to which this formatter gives back the control - * when it comes to format children of an [AssertionGroup]. - * @param assertionPairFormatter The formatter which is used to format assertion pairs. - * @param clazz The [AssertionGroupType] which the concrete sub class [canFormat][AssertionFormatter.canFormat]. - */ -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -abstract class TextListBasedAssertionGroupFormatter( - bulletPoint: String, - assertionFormatterController: AssertionFormatterController, - private val assertionPairFormatter: AssertionPairFormatter, - clazz: KClass -) : NoSpecialChildFormattingSingleAssertionGroupTypeFormatter(clazz, assertionFormatterController) { - private val formatter = - TextPrefixBasedAssertionGroupFormatter(bulletPoint) - - override fun formatGroupHeaderAndGetChildParameterObject( - assertionGroup: AssertionGroup, - parameterObject: AssertionFormatterParameterObject - ): AssertionFormatterParameterObject = - formatter.formatWithGroupName(assertionPairFormatter, assertionGroup, parameterObject) -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextMethodCallFormatter.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextMethodCallFormatter.kt deleted file mode 100644 index 80dab3ffd..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextMethodCallFormatter.kt +++ /dev/null @@ -1,32 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.reporting.MethodCallFormatter -import ch.tutteli.atrium.reporting.Text - -/** - * Responsible to format a method call for text output (e.g. to the console) where it represents arguments of a - * method call by using their [Any.toString] representation with a few exceptions. - * - * The exceptions are: - * - [CharSequence], is wrapped in quotes (`"`) and \r as well as \n are escaped. - * - [Char] is wrapped in apostrophes (`'`) - */ -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -object TextMethodCallFormatter : MethodCallFormatter { - override fun formatCall(methodName: String, arguments: Array): String = - arguments.joinToString(", ", prefix = "$methodName(", postfix = ")") { formatArgument(it) } - - override fun format(methodName: String, arguments: Array): () -> String = { - formatCall(methodName, arguments) - } - - override fun formatArgument(argument: Any?): String = when (argument) { - null -> Text.NULL.string - is CharSequence -> "\"$argument\"".replace("\r", "\\r").replace("\n", "\\n") - is Char -> "'$argument'" - else -> argument.toString() - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextNextLineAssertionPairFormatter.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextNextLineAssertionPairFormatter.kt deleted file mode 100644 index 2a21dd105..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextNextLineAssertionPairFormatter.kt +++ /dev/null @@ -1,64 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.assertions.AssertionGroup -import ch.tutteli.atrium.assertions.DescriptiveAssertion -import ch.tutteli.atrium.reporting.* -import ch.tutteli.atrium.reporting.translating.Translatable -import ch.tutteli.atrium.reporting.translating.Translator - -/** - * Represents an [AssertionPairFormatter] formatter of assertion pairs -- which consists of a [Translatable] - * and a representation -- where it puts the translation on one line and the representation on the next line - * (including indentation as if the representation is a child). - * - * Its usage is intended for text output (e.g. to the console). - * - * @property objectFormatter Used to format objects such as [DescriptiveAssertion.representation]. - * @property translator Used to translate [Translatable]s such as [DescriptiveAssertion.description]. - * - * @constructor Represents an [AssertionPairFormatter] formatter of assertion pairs -- which consists of a - * [Translatable] and a representation -- where it puts them on the same line in the form: - * `translation: representation`. - * @param objectFormatter Used to format objects such as [DescriptiveAssertion.representation]. - * @param translator Used to translate [Translatable]s such as [DescriptiveAssertion.description]. - */ -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -class TextNextLineAssertionPairFormatter( - private val objectFormatter: ObjectFormatter, - private val translator: Translator -) : AssertionPairFormatter { - - override fun formatGroupHeader( - parameterObject: AssertionFormatterParameterObject, - assertionGroup: AssertionGroup, - newParameterObject: AssertionFormatterParameterObject - ): Unit = format(parameterObject, assertionGroup.description, assertionGroup.representation, newParameterObject) - - override fun format( - parameterObject: AssertionFormatterParameterObject, - translatable: Translatable, - representation: Any - ): Unit = format(parameterObject, translatable, representation, parameterObject) - - private fun format( - parameterObject: AssertionFormatterParameterObject, - translatable: Translatable, - representation: Any, - newParameterObject: AssertionFormatterParameterObject - ) { - parameterObject.sb.append(translator.translate(translatable)).append(":") - - @Suppress(/* TODO remove RawString.Empty with 1.0.0*/ "DEPRECATION") - // yes, we check only for Text.EMPTY and not for `representation !is Text || representation.string != ""` - // on purpose. You can only create an empty Text via a hack and not via the normal invoke function in - // the companion of Text - if (representation != Text.EMPTY && representation != RawString.EMPTY) { - newParameterObject.appendLnAndIndent() - newParameterObject.indent(newParameterObject.prefix.length) - parameterObject.sb.append(objectFormatter.format(representation)) - } - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextPrefixBasedAssertionGroupFormatter.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextPrefixBasedAssertionGroupFormatter.kt deleted file mode 100644 index e94437fc5..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextPrefixBasedAssertionGroupFormatter.kt +++ /dev/null @@ -1,33 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.assertions.AssertionGroup -import ch.tutteli.atrium.reporting.AssertionFormatterParameterObject -import ch.tutteli.atrium.reporting.AssertionPairFormatter - -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -class TextPrefixBasedAssertionGroupFormatter( - private val prefix: String -) { - fun formatWithGroupName( - assertionPairFormatter: AssertionPairFormatter, - assertionGroup: AssertionGroup, - parameterObject: AssertionFormatterParameterObject - ): AssertionFormatterParameterObject { - parameterObject.appendLnIndentAndPrefix() - return formatAfterAppendLnEtc(assertionPairFormatter, assertionGroup, parameterObject) - } - - fun formatAfterAppendLnEtc( - assertionPairFormatter: AssertionPairFormatter, - assertionGroup: AssertionGroup, - parameterObject: AssertionFormatterParameterObject - ): AssertionFormatterParameterObject { - val newParameterObject = parameterObject.createChildWithNewPrefix(prefix) - assertionPairFormatter.formatGroupHeader(parameterObject, assertionGroup, newParameterObject) - return newParameterObject - } - -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextSameLineAssertionPairFormatter.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextSameLineAssertionPairFormatter.kt deleted file mode 100644 index d33d49d17..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextSameLineAssertionPairFormatter.kt +++ /dev/null @@ -1,49 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.assertions.AssertionGroup -import ch.tutteli.atrium.assertions.DescriptiveAssertion -import ch.tutteli.atrium.reporting.AssertionFormatterParameterObject -import ch.tutteli.atrium.reporting.AssertionPairFormatter -import ch.tutteli.atrium.reporting.ObjectFormatter -import ch.tutteli.atrium.reporting.translating.Translatable -import ch.tutteli.atrium.reporting.translating.Translator - -/** - * Represents an [AssertionPairFormatter] formatter of assertion pairs -- which consists of a [Translatable] - * and a representation -- where it puts them on the same line in the form: `translation: representation`. - * - * Its usage is intended for text output (e.g. to the console). - * - * @property objectFormatter Used to format objects such as [DescriptiveAssertion.representation]. - * @property translator Used to translate [Translatable]s such as [DescriptiveAssertion.description]. - * - * @constructor Represents an [AssertionPairFormatter] formatter of assertion pairs -- which consists of a - * [Translatable] and a representation -- where it puts them on the same line in the form: - * `translation: representation`. - * @param objectFormatter Used to format objects such as [DescriptiveAssertion.representation]. - * @param translator Used to translate [Translatable]s such as [DescriptiveAssertion.description]. - */ -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -class TextSameLineAssertionPairFormatter( - private val objectFormatter: ObjectFormatter, - private val translator: Translator -) : AssertionPairFormatter { - - override fun formatGroupHeader( - parameterObject: AssertionFormatterParameterObject, - assertionGroup: AssertionGroup, - newParameterObject: AssertionFormatterParameterObject - ): Unit = format(parameterObject, assertionGroup.description, assertionGroup.representation) - - override fun format( - parameterObject: AssertionFormatterParameterObject, - translatable: Translatable, - representation: Any - ) { - parameterObject.sb.append(translator.translate(translatable)).append(": ") - .append(objectFormatter.format(representation)) - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextSummaryAssertionGroupFormatter.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextSummaryAssertionGroupFormatter.kt deleted file mode 100644 index 0020f95f3..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextSummaryAssertionGroupFormatter.kt +++ /dev/null @@ -1,67 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.assertions.* -import ch.tutteli.atrium.reporting.AssertionFormatter -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.AssertionFormatterParameterObject -import ch.tutteli.atrium.reporting.AssertionPairFormatter -import kotlin.reflect.KClass - -/** - * Represents an [AssertionFormatter] which formats [AssertionGroup]s with a [SummaryAssertionGroupType] by - * using the given [assertionPairFormatter] to format the group header and uses the bullet point defined - * for [PrefixSuccessfulSummaryAssertion] as prefix for successful [AssertionGroup.assertions] and the bullet point - * defined for [PrefixFeatureAssertionGroupHeader] as prefix for failing [AssertionGroup.assertions]. - * - * Its usage is intended for text output (e.g. to the console). - * - * @constructor Represents an [AssertionFormatter] which formats [AssertionGroup]s with an - * [SummaryAssertionGroupType] by using the given [assertionPairFormatter] to format the group header and uses the - * bullet point defined for [PrefixSuccessfulSummaryAssertion] as prefix for successful [AssertionGroup.assertions] - * and the bullet point defined for [PrefixFeatureAssertionGroupHeader] as prefix for failing [AssertionGroup.assertions]. - * - * @param bulletPoints The formatter uses the bullet point defined for [PrefixSuccessfulSummaryAssertion] - * (`"✔ "` if absent) as prefix for successful assertions in [AssertionGroup.assertions] and the bullet point defined - * for [PrefixFailingSummaryAssertion] (`"✘ "` if absent) for failing assertions. - * - * @param assertionFormatterController The controller to which this formatter gives back the control - * when it comes to format children of an [AssertionGroup]. - * @param assertionPairFormatter The formatter which is used to format assertion pairs. - */ -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -class TextSummaryAssertionGroupFormatter( - bulletPoints: Map, String>, - private val assertionFormatterController: AssertionFormatterController, - private val assertionPairFormatter: AssertionPairFormatter -) : SingleAssertionGroupTypeFormatter(SummaryAssertionGroupType::class) { - private val successful = (bulletPoints[PrefixSuccessfulSummaryAssertion::class] ?: "✔ ") - private val failing = (bulletPoints[PrefixFailingSummaryAssertion::class] ?: "✘ ") - - override fun formatGroupHeaderAndGetChildParameterObject( - assertionGroup: AssertionGroup, - parameterObject: AssertionFormatterParameterObject - ): AssertionFormatterParameterObject { - parameterObject.appendLnIndentAndPrefix() - assertionPairFormatter.format(parameterObject, assertionGroup.description, assertionGroup.representation) - //the prefix which should be used for assertions is defined in the formatGroupAssertions - return parameterObject.createForDoNotFilterAssertionGroup() - } - - override fun formatGroupAssertions( - formatAssertions: (AssertionFormatterParameterObject, (Assertion) -> Unit) -> Unit, - childParameterObject: AssertionFormatterParameterObject - ) { - val successfulParameterObject = childParameterObject.createChildWithNewPrefix(successful) - val failingParameterObject = childParameterObject.createChildWithNewPrefix(failing) - formatAssertions(childParameterObject) { - if (it.holds()) { - assertionFormatterController.format(it, successfulParameterObject) - } else { - assertionFormatterController.format(it, failingParameterObject) - } - } - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/CoroutineBasedLocaleOrderDecider.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/CoroutineBasedLocaleOrderDecider.kt deleted file mode 100644 index 3c399d859..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/CoroutineBasedLocaleOrderDecider.kt +++ /dev/null @@ -1,111 +0,0 @@ -@file:Suppress("EXPERIMENTAL_FEATURE_WARNING", "DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting.translating - -import ch.tutteli.atrium.reporting.translating.Locale -import ch.tutteli.atrium.reporting.translating.LocaleOrderDecider -import ch.tutteli.atrium.reporting.translating.getDefaultLocale -import ch.tutteli.kbox.forElementAndForEachIn - -/** - * Responsible to determine in which order [Locale]s should be processed. - * - * Adopted from Java's `ResourceBundle.Control.getCandidateLocales()` and `ResourceBundle.Control.getFallbackLocale()` - * but there are a few differences: - * - is based on Atrium's [Locale] and not `java.util.java` - * - allows to define more than one fallback [Locale] - * - does not use [getDefaultLocale] implicitly (one can define it explicitly as fallback [Locale] though) - * - it does not return `java.util.Locale.ROOT` - * - * Further information can be found at [LocaleOrderDecider]. - */ -@Deprecated("Use ResourceBundleInspiredLocaleOrderDecider from atrium-core; will be removed with 0.17.0") -class CoroutineBasedLocaleOrderDecider : LocaleOrderDecider { - - override fun determineOrder(primaryLocale: Locale, fallbackLocales: List): Sequence { - val locales = mutableListOf() - forElementAndForEachIn(primaryLocale, fallbackLocales) { locale -> - when (locale.language) { - "zh" -> locales.specialCaseChinese(locale) - else -> locales.normalCase(locale) - } - } - return locales.asSequence() - } - - private fun MutableList.specialCaseChinese(locale: Locale) { - val script = if (locale.script == null && locale.country != null) { - when (locale.country) { - "TW", "HK", "MO" -> "Hant" - "CN", "SG" -> "Hans" - else -> "" - } - } else { - locale.script - } - normalCase(locale, script = script) - } - - private fun MutableList.normalCase( - locale: Locale, - language: String = locale.language, - script: String? = locale.script, - country: String? = locale.country, - variant: String? = locale.variant - ) { - fallbackDueToVariant(language, script, country, variant) - fallbackDueToCountry(language, script, country) - fallbackDueToScript(language, script, country, variant) - fallbackDueToLanguage(language) - } - - private fun MutableList.fallbackDueToVariant( - language: String, - script: String?, - country: String?, - variant: String? - ) { - if (variant != null) { - var newVariant: String = variant - do { - val fallback = Locale(language, script, country, newVariant) - add(fallback) - newVariant = newVariant.substringBeforeLast('_', "") - } while (newVariant.isNotEmpty()) - } - } - - private fun MutableList.fallbackDueToCountry( - language: String, - script: String?, - country: String? - ) { - if (country != null) { - val fallback = Locale(language, script, country, null) - add(fallback) - } - } - - private fun MutableList.fallbackDueToScript( - language: String, - script: String?, - country: String?, - variant: String? - ) { - if (script != null) { - val fallback = Locale(language, script, null, null) - add(fallback) - - // fallback variants without considering script - fallbackDueToVariant(language, null, country, variant) - - // fallback country without considering script - fallbackDueToCountry(language, null, country) - } - } - - private fun MutableList.fallbackDueToLanguage(language: String) { - val fallback = Locale(language) - add(fallback) - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/TranslationSupplierBasedTranslator.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/TranslationSupplierBasedTranslator.kt deleted file mode 100644 index 92f71880f..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/TranslationSupplierBasedTranslator.kt +++ /dev/null @@ -1,40 +0,0 @@ -package ch.tutteli.atrium.core.robstoll.lib.reporting.translating - -import ch.tutteli.atrium.reporting.translating.* - -/** - * Represents a [Translator] which uses a given [TranslationSupplier] to retrieve translations and - * a given [LocaleOrderDecider] to determine in which order it should try to find translations - * for a given [Translatable]. - * - * @property translationSupplier The [TranslationSupplier] which provides available translations. - * @property localeOrderDecider Decides in which order [Locale]s are processed to find a translation for a - * given [Translatable]. - * - * @constructor Represents a [Translator] which uses a [TranslationSupplier] to retrieve translations and - * [LocaleOrderDecider] to determine in which order it should try to find translations for a given - * [Translatable]. - * @param translationSupplier The [TranslationSupplier] as such. - * @param localeOrderDecider Decides in which order [Locale]s are processed to find a translation for a - * given [Translatable]. - * @param primaryLocale The [Locale] to which the translator translates per default as well as the [Locale] - * which will be used in [String.format], which in turn is used to substitute the placeholders in - * the resulting translation of [TranslatableWithArgs.translatable] with the [TranslatableWithArgs.arguments]. - * @param fallbackLocales Used in case a translation for a given [Translatable] is not defined for - * [primaryLocale] or one of its secondary alternatives -- the fallback [Locale]s are used in the given order. - */ -@Deprecated("Use the one from atrium-core will be removed with 0.17.0", ReplaceWith("ch.tutteli.atrium.reporting.translating.impl.TranslationSupplierBasedTranslator")) -class TranslationSupplierBasedTranslator( - private val translationSupplier: TranslationSupplier, - private val localeOrderDecider: LocaleOrderDecider, - primaryLocale: Locale, - fallbackLocales: List -) : ArgumentsSupportingTranslator(primaryLocale, fallbackLocales) { - - override fun translateWithoutArgs(translatable: Translatable): String { - return localeOrderDecider.determineOrder(primaryLocale, fallbackLocales) - .map { translationSupplier.get(translatable, it) } - .firstOrNull { it != null } - ?: translatable.getDefault() - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AssertionFormatterControllerSpec.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AssertionFormatterControllerSpec.kt deleted file mode 100644 index 94e1c7b9a..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AssertionFormatterControllerSpec.kt +++ /dev/null @@ -1,8 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -object AssertionFormatterControllerSpec : ch.tutteli.atrium.specs.reporting.AssertionFormatterControllerSpec( - ::AssertionFormatterControllerImpl -) diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DelegatingReporter.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DelegatingReporter.kt deleted file mode 100644 index 169e67191..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DelegatingReporter.kt +++ /dev/null @@ -1,13 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster -import ch.tutteli.atrium.reporting.Reporter - -internal class DelegatingReporter( - reporter: Reporter, - override val atriumErrorAdjuster: AtriumErrorAdjuster -) : Reporter by reporter - diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/OnlyFailureReporterSpec.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/OnlyFailureReporterSpec.kt deleted file mode 100644 index 84f7336c3..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/OnlyFailureReporterSpec.kt +++ /dev/null @@ -1,8 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -object OnlyFailureReporterSpec : ch.tutteli.atrium.specs.reporting.OnlyFailureReporterSpec( - ::OnlyFailureReporter -) diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextExplanatoryAssertionGroupFormatterSpec.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextExplanatoryAssertionGroupFormatterSpec.kt deleted file mode 100644 index 0b253a38f..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextExplanatoryAssertionGroupFormatterSpec.kt +++ /dev/null @@ -1,84 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.assertions.BulletPointIdentifier -import ch.tutteli.atrium.assertions.DefaultExplanatoryAssertionGroupType -import ch.tutteli.atrium.assertions.ExplanatoryAssertionGroupType -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.ObjectFormatter -import ch.tutteli.atrium.reporting.translating.Translator -import org.spekframework.spek2.Spek -import kotlin.reflect.KClass - -class TextExplanatoryAssertionGroupFormatterSpec : Spek({ - - include(AtriumsTextExplanatoryAssertionFormatterSpec) - include(AtriumsTextWarningAssertionFormatterSpec) - include(AtriumsTextInformationAssertionFormatterSpec) - include(AtriumsSingleAssertionGroupTypeFormatterSpec) - include(AtriumsAssertionFormatterSpec) - -}) { - object AtriumsTextExplanatoryAssertionFormatterSpec : - ch.tutteli.atrium.specs.reporting.TextExplanatoryAssertionGroupFormatterSpec( - factory(), "[Atrium's TextExplanatory...Spec] " - ) - - object AtriumsTextWarningAssertionFormatterSpec : - ch.tutteli.atrium.specs.reporting.TextWarningAssertionGroupFormatterSpec( - factory(), "[Atrium's TextWarning...Spec] " - ) - - object AtriumsTextInformationWithIndentAssertionFormatterSpec : - ch.tutteli.atrium.specs.reporting.TextInformationAssertionGroupFormatterSpec( - factory(), withIndent = true, describePrefix = "[Atrium's TextInformation...Spec] " - ) - - object AtriumsTextInformationAssertionFormatterSpec : - ch.tutteli.atrium.specs.reporting.TextInformationAssertionGroupFormatterSpec( - factory(), withIndent = false, describePrefix = "[Atrium's TextInformation...Spec] " - ) - - object AtriumsEmptyNameAndSubjectAssertionGroupFormatterSpec : - ch.tutteli.atrium.specs.reporting.EmptyNameAndSubjectAssertionGroupFormatterSpec( - factoryWithoutBulletPoint(), - ExplanatoryAssertionGroupType::class, - DefaultExplanatoryAssertionGroupType, - object : ExplanatoryAssertionGroupType {}, - "[Atrium's EmptyNameAndSubject...Spec] " - ) - - object AtriumsSingleAssertionGroupTypeFormatterSpec : - ch.tutteli.atrium.specs.reporting.SingleAssertionGroupTypeFormatterSpec( - factoryWithObjectFormatter(), - ExplanatoryAssertionGroupType::class, - object : ExplanatoryAssertionGroupType {}, - DefaultExplanatoryAssertionGroupType, - "[Atrium's SingleAssertionGroupType...Spec] " - ) - - object AtriumsAssertionFormatterSpec : ch.tutteli.atrium.specs.reporting.AssertionFormatterSpec( - factoryWithObjectFormatter(), "[Atrium's AssertionFormatterSpec] " - ) - - companion object { - private fun factory() = - { bulletPoints: Map, String>, assertionFormatterController: AssertionFormatterController -> - TextExplanatoryAssertionGroupFormatter( - bulletPoints, - assertionFormatterController - ) - } - - private fun factoryWithoutBulletPoint() = { assertionFormatterController: AssertionFormatterController -> - factory()(mapOf(ExplanatoryAssertionGroupType::class to "*"), assertionFormatterController) - } - - private fun factoryWithObjectFormatter() = - { bulletPoints: Map, String>, assertionFormatterController: AssertionFormatterController, _: ObjectFormatter, _: Translator -> - factory()(bulletPoints, assertionFormatterController) - } - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextFallbackAssertionFormatterSpec.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextFallbackAssertionFormatterSpec.kt deleted file mode 100644 index b3f54d2a3..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextFallbackAssertionFormatterSpec.kt +++ /dev/null @@ -1,95 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.api.fluent.en_GB.toBe -import ch.tutteli.atrium.api.verbs.internal.AssertionVerb.EXPECT -import ch.tutteli.atrium.api.verbs.internal.expect -import ch.tutteli.atrium.assertions.AssertionGroup -import ch.tutteli.atrium.assertions.BulletPointIdentifier -import ch.tutteli.atrium.assertions.RootAssertionGroupType -import ch.tutteli.atrium.assertions.builders.assertionBuilder -import ch.tutteli.atrium.assertions.builders.root -import ch.tutteli.atrium.core.coreFactory -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.ObjectFormatter -import ch.tutteli.atrium.reporting.translating.Translator -import ch.tutteli.atrium.reporting.translating.UsingDefaultTranslator -import ch.tutteli.atrium.specs.lineSeparator -import ch.tutteli.atrium.specs.reporting.ToStringObjectFormatter -import ch.tutteli.atrium.specs.reporting.alwaysTrueAssertionFilter -import ch.tutteli.atrium.specs.toBeDescr -import ch.tutteli.atrium.translations.DescriptionAnyAssertion.NOT_TO_BE -import ch.tutteli.atrium.translations.DescriptionAnyAssertion.TO_BE -import org.spekframework.spek2.Spek -import org.spekframework.spek2.style.specification.describe -import kotlin.reflect.KClass - -class TextFallbackAssertionFormatterSpec : Spek({ - - include(AtriumsTextFallbackAssertionFormatterSpec) - include(AtriumsAssertionFormatterSpec) - - val squarePoint = "▪" - - val facade = coreFactory.newAssertionFormatterFacade(coreFactory.newAssertionFormatterController()) - facade.register { - TextFallbackAssertionFormatter( - mapOf(RootAssertionGroupType::class to "$squarePoint "), - it, - TextSameLineAssertionPairFormatter( - ToStringObjectFormatter, - UsingDefaultTranslator() - ), ToStringObjectFormatter - ) - } - - var sb = StringBuilder() - afterEachTest { - sb = StringBuilder() - } - - describe("fun ${TextFallbackAssertionFormatter::format.name}") { - context("a ${AssertionGroup::class.simpleName} of type ${RootAssertionGroupType::class.simpleName}") { - it("includes the group ${AssertionGroup::description.name}, its ${AssertionGroup::representation.name} as well as the ${AssertionGroup::assertions.name}") { - val assertionGroup = with(assertionBuilder) { - assertionBuilder.root.withDescriptionAndRepresentation(EXPECT, "subject") - .withAssertions( - descriptive.failing.withDescriptionAndRepresentation(TO_BE, "bli").build(), - descriptive.failing.withDescriptionAndRepresentation(NOT_TO_BE, "bye").build() - ) - .build() - } - expect(mapOf("1" to 2).entries) - facade.format(assertionGroup, sb, alwaysTrueAssertionFilter) - expect(sb.toString()).toBe( - "${EXPECT.getDefault()}: subject$lineSeparator" + - "$squarePoint $toBeDescr: bli$lineSeparator" + - "$squarePoint ${NOT_TO_BE.getDefault()}: bye" - ) - } - } - } -}) { - object AtriumsTextFallbackAssertionFormatterSpec : - ch.tutteli.atrium.specs.reporting.TextFallbackAssertionFormatterSpec( - factory(), "[Atrium's TextFallback..Spec] " - ) - - object AtriumsAssertionFormatterSpec : ch.tutteli.atrium.specs.reporting.AssertionFormatterSpec( - factory(), "[Atrium's AssertionFormatterSpec] " - ) - - companion object { - internal fun factory() = - { bulletPoints: Map, String>, assertionFormatterController: AssertionFormatterController, objectFormatter: ObjectFormatter, translator: Translator -> - TextFallbackAssertionFormatter( - bulletPoints, - assertionFormatterController, - TextSameLineAssertionPairFormatter(objectFormatter, translator), - objectFormatter - ) - } - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextMethodCallFormatterSpec.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextMethodCallFormatterSpec.kt deleted file mode 100644 index 4e0d29144..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextMethodCallFormatterSpec.kt +++ /dev/null @@ -1,8 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -object TextMethodCallFormatterSpec : ch.tutteli.atrium.specs.reporting.TextMethodCallFormatterSpec( - { TextMethodCallFormatter } -) diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextNextLineAssertionPairFormatterSpec.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextNextLineAssertionPairFormatterSpec.kt deleted file mode 100644 index 20f529777..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextNextLineAssertionPairFormatterSpec.kt +++ /dev/null @@ -1,77 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.api.fluent.en_GB.toBe -import ch.tutteli.atrium.api.verbs.internal.expect -import ch.tutteli.atrium.assertions.builders.assertionBuilder -import ch.tutteli.atrium.assertions.builders.root -import ch.tutteli.atrium.reporting.Text -import ch.tutteli.atrium.reporting.translating.Untranslatable -import ch.tutteli.atrium.reporting.translating.UsingDefaultTranslator -import ch.tutteli.atrium.specs.describeFunTemplate -import ch.tutteli.atrium.specs.lineSeparator -import ch.tutteli.atrium.specs.reporting.AssertionFormatterSpecBase -import ch.tutteli.atrium.specs.reporting.ToStringObjectFormatter -import org.spekframework.spek2.style.specification.Suite - -class TextNextLineAssertionPairFormatterSpec : AssertionFormatterSpecBase({ - - fun describeFun(vararg funName: String, body: Suite.() -> Unit) = describeFunTemplate("", funName, body = body) - - val testee = TextNextLineAssertionPairFormatter( - ToStringObjectFormatter, - UsingDefaultTranslator() - ) - - val bulletPoint = "** " - val indentBulletPoint = " ".repeat(bulletPoint.length) - val name = "group name" - val subject = 123 - - describeFun(testee::formatGroupHeader.name) { - it("puts the representation on the next line indented as the bullet point used for newParameterObject") { - val newParameterObject = parameterObject.createChildWithNewPrefix(bulletPoint) - val assertionGroup = assertionBuilder.root - .withDescriptionAndRepresentation(name, subject) - .withAssertions(listOf()) - .build() - testee.formatGroupHeader(parameterObject, assertionGroup, newParameterObject) - expect(sb.toString()).toBe("$name:$lineSeparator$indentBulletPoint$subject") - } - - it("does not append a new line if the subject is ${Text::class.simpleName}${Text.Companion::EMPTY.name}") { - val assertionGroup = assertionBuilder.root - .withDescriptionAndEmptyRepresentation(name) - .withAssertions(listOf()) - .build() - val newParameterObject = parameterObject.createChildWithNewPrefix(bulletPoint) - testee.formatGroupHeader(parameterObject, assertionGroup, newParameterObject) - expect(sb.toString()).toBe("$name:") - } - } - - describeFun(testee::format.name) { - context("current indent 0, no prefix") { - it("puts the representation on the next line without indent") { - testee.format(parameterObject, Untranslatable(name), subject) - expect(sb.toString()).toBe("$name:$lineSeparator$subject") - } - } - - context("current indent 2, new prefix length 2") { - it("puts the representation on the next line with 2 indent") { - val newParameterObject = parameterObject.createChildWithNewPrefix("==") - testee.format(newParameterObject, Untranslatable(name), subject) - expect(sb.toString()).toBe("$name:$lineSeparator $subject") - } - } - - it("does not append a new line if the subject is ${Text::class.simpleName}${Text.Companion::EMPTY.name}") { - val newParameterObject = parameterObject.createChildWithNewPrefix(bulletPoint) - testee.format(newParameterObject, Untranslatable(name), Text.EMPTY) - expect(sb.toString()).toBe("$name:") - } - } -}) diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextSummaryAssertionGroupFormatterSpec.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextSummaryAssertionGroupFormatterSpec.kt deleted file mode 100644 index 672cd5bc8..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextSummaryAssertionGroupFormatterSpec.kt +++ /dev/null @@ -1,67 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.assertions.BulletPointIdentifier -import ch.tutteli.atrium.assertions.DefaultSummaryAssertionGroupType -import ch.tutteli.atrium.assertions.SummaryAssertionGroupType -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.ObjectFormatter -import ch.tutteli.atrium.reporting.translating.Translator -import ch.tutteli.atrium.reporting.translating.UsingDefaultTranslator -import ch.tutteli.atrium.specs.reporting.ToStringObjectFormatter -import org.spekframework.spek2.Spek -import kotlin.reflect.KClass - -class TextSummaryAssertionGroupFormatterSpec : Spek({ - - include(AtriumsTextSummaryAssertionGroupFormatterSpec) - include(AtriumsSingleAssertionGroupTypeFormatterSpec) - include(AtriumsAssertionFormatterSpec) - -}) { - object AtriumsTextSummaryAssertionGroupFormatterSpec : - ch.tutteli.atrium.specs.reporting.TextSummaryAssertionGroupFormatterSpec( - factoryWithoutObjectFormatter(), "[Atrium's SummaryGroup...Spec] " - ) - - object AtriumsSingleAssertionGroupTypeFormatterSpec : - ch.tutteli.atrium.specs.reporting.SingleAssertionGroupTypeFormatterSpec( - factory(), - SummaryAssertionGroupType::class, - DefaultSummaryAssertionGroupType, - object : SummaryAssertionGroupType {}, - "[Atrium's SingleAssertionGroupType...Spec] " - ) - - object AtriumsAssertionFormatterSpec : ch.tutteli.atrium.specs.reporting.AssertionFormatterSpec( - factory(), "[Atrium's AssertionFormatterSpec] " - ) - - companion object { - private fun factoryWithoutObjectFormatter() = - { bulletPoints: Map, String>, controller: AssertionFormatterController -> - TextSummaryAssertionGroupFormatter( - bulletPoints, - controller, - TextSameLineAssertionPairFormatter( - ToStringObjectFormatter, - UsingDefaultTranslator() - ) - ) - } - - private fun factory() = - { bulletPoints: Map, String>, controller: AssertionFormatterController, objectFormatter: ObjectFormatter, translator: Translator -> - TextSummaryAssertionGroupFormatter( - bulletPoints, - controller, - TextSameLineAssertionPairFormatter( - objectFormatter, - translator - ) - ) - } - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/LocaleOrderDeciderSpec.kt b/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/LocaleOrderDeciderSpec.kt deleted file mode 100644 index 9fca5d42c..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-common/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/LocaleOrderDeciderSpec.kt +++ /dev/null @@ -1,8 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting.translating - -class LocaleOrderDeciderSpec : ch.tutteli.atrium.specs.reporting.translating.LocaleOrderDeciderSpec( - ::CoroutineBasedLocaleOrderDecider -) diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-js/build.gradle b/core/robstoll-lib/atrium-core-robstoll-lib-js/build.gradle deleted file mode 100644 index 40559f820..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-js/build.gradle +++ /dev/null @@ -1,22 +0,0 @@ -description = 'Contains the bits and pieces behind robstoll\'s implementation ' + - 'of Atrium for the JS platform. You should only depend on this module if you are ' + - 'providing an implementation as well and want to reuse certain artifacts. If you are a consumer of ' + - 'Atrium, then you should depend on atrium-core-robstoll instead.' - -dependencies { - implementation "ch.tutteli.kbox:kbox-js:$kbox_version", excludeKotlin - api prefixedProject('core-api-js') - - // it is up to the consumer of atrium-core-robstoll-lib which atrium-translations module is used at runtime - compileOnly prefixedProject('translations-en_GB-js') - - testImplementation prefixedProject('api-fluent-en_GB-js') - testImplementation prefixedProject('specs-js') -} - -//TODO 0.17.0 or 0.18.0 should not be necessary https://youtrack.jetbrains.com/issue/KT-27797 -compileTestKotlin2Js.dependsOn( - prefixedProject('core-robstoll-js').jar, - prefixedProject('domain-robstoll-js').jar, - prefixedProject('domain-builders-js').jar -) diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DetailedObjectFormatter.kt b/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DetailedObjectFormatter.kt deleted file mode 100644 index f0dd11e82..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DetailedObjectFormatter.kt +++ /dev/null @@ -1,47 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.reporting.ObjectFormatter -import ch.tutteli.atrium.reporting.translating.Translator -import kotlin.reflect.KClass - -external class WeakMap { - fun set(k: dynamic, v: String) - fun get(k: dynamic): String? -} - -private val pseudoIdentityHash = WeakMap() -private val primitiveIdentityHash = hashMapOf() -private var count = 0 - -actual class DetailedObjectFormatter actual constructor( - translator: Translator -) : DetailedObjectFormatterCommon(translator), ObjectFormatter { - - override fun format(kClass: KClass<*>): String { - return "${kClass.simpleName} (${kClass.js.name})" - } - - override fun identityHash(indent: String, any: Any): String { - val current = getHash(any) - val hash = if (current != null) { - current - } else { - val newHash = (++count).toString() - setHash(any, newHash) - newHash - } - return "$indent<$hash>" - } - - private fun getHash(any: Any): String? = - if (jsTypeOf(any) == "object") pseudoIdentityHash.get(any) - else primitiveIdentityHash[any] - - private fun setHash(any: Any, newHash: String) { - if (jsTypeOf(any) == "object") pseudoIdentityHash.set(any, newHash) - else primitiveIdentityHash[any] = newHash - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/FilterAtriumErrorAdjuster.kt b/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/FilterAtriumErrorAdjuster.kt deleted file mode 100644 index d319550fc..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/FilterAtriumErrorAdjuster.kt +++ /dev/null @@ -1,26 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.core.polyfills.stackBacktrace -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster - -@Deprecated( - "Use FilterAtriumErrorAdjuster from atrium-core, will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.reporting.erroradjusters.FilterAtriumErrorAdjuster") -) -abstract class FilterAtriumErrorAdjuster : AtriumErrorAdjuster { - - final override fun adjust(throwable: Throwable) { - val filteredStack = adjustStack(throwable.stackBacktrace.asSequence()) - val prefix = " at " - throwable.asDynamic().stack = filteredStack.joinToString("\n$prefix", prefix) - throwable.cause?.let { adjust(it) } - } - - /** - * Does nothing (no adjustments) - override in subclass if you want a different behaviour. - */ - override fun adjustOtherThanStacks(throwable: Throwable) {} -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/MultiAtriumErrorAdjusterImpl.kt b/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/MultiAtriumErrorAdjusterImpl.kt deleted file mode 100644 index 4327b44d5..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/MultiAtriumErrorAdjusterImpl.kt +++ /dev/null @@ -1,26 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster - -@Deprecated( - "Use MultiAtriumErrorAdjuster from atrium-core, will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.reporting.erroradjusters.MultiAtriumErrorAdjuster") -) -actual class MultiAtriumErrorAdjusterImpl actual constructor( - private val firstAdjuster: AtriumErrorAdjuster, - private val secondAdjuster: AtriumErrorAdjuster, - private val otherAdjusters: List -) : FilterAtriumErrorAdjuster(), AtriumErrorAdjuster { - - override fun adjustStack(stackTrace: Sequence): Sequence = - firstAdjuster.adjustStack(stackTrace) - .let { secondAdjuster.adjustStack(it) } - .let { - otherAdjusters.fold(it) { filteredStack, adjuster -> - adjuster.adjustStack(filteredStack) - } - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/NoOpAtriumErrorAdjuster.kt b/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/NoOpAtriumErrorAdjuster.kt deleted file mode 100644 index 984ec8fcc..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/NoOpAtriumErrorAdjuster.kt +++ /dev/null @@ -1,14 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster - -@Deprecated( - "Use NoOpAtriumErrorAdjuster from atrium-core, will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.reporting.erroradjusters.NoOpAtriumErrorAdjuster") -) -actual object NoOpAtriumErrorAdjuster : NoOpAtriumErrorAdjusterCommon(), AtriumErrorAdjuster { - override fun adjustStack(stackTrace: Sequence): Sequence = stackTrace -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveAtriumFromAtriumErrorAdjuster.kt b/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveAtriumFromAtriumErrorAdjuster.kt deleted file mode 100644 index 3cae2b0bb..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveAtriumFromAtriumErrorAdjuster.kt +++ /dev/null @@ -1,20 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster - -@Deprecated( - "Use RemoveAtriumFromAtriumErrorAdjuster from atrium-core, will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.reporting.erroradjusters.impl.RemoveAtriumFromAtriumErrorAdjuster") -) -actual class RemoveAtriumFromAtriumErrorAdjuster : FilterAtriumErrorAdjuster(), AtriumErrorAdjuster { - override fun adjustStack(stackTrace: Sequence): Sequence = stackTrace.filter { - !atriumRegex.containsMatchIn(it) - } - - companion object { - val atriumRegex = Regex("[\\\\|/]atrium-[a-zA-Z-]+.js") - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt b/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt deleted file mode 100644 index 1d06bd7af..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt +++ /dev/null @@ -1,20 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster - -@Deprecated( - "Use RemoveRunnerAtriumErrorAdjuster from atrium-core, will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.reporting.erroradjusters.impl.RemoveRunnerAtriumErrorAdjuster") -) -actual class RemoveRunnerAtriumErrorAdjuster : FilterAtriumErrorAdjuster(), AtriumErrorAdjuster { - override fun adjustStack(stackTrace: Sequence): Sequence = stackTrace.takeWhile { - !runnerRegex.containsMatchIn(it) - } - - companion object { - val runnerRegex: Regex = Regex("[\\\\|/]node_modules[\\\\|/](mocha|jasmine)[\\\\|/]") - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AdjustStackTest.kt b/core/robstoll-lib/atrium-core-robstoll-lib-js/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AdjustStackTest.kt deleted file mode 100644 index 251e3ac91..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AdjustStackTest.kt +++ /dev/null @@ -1,98 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.api.fluent.en_GB.* -import ch.tutteli.atrium.api.verbs.internal.AssertionVerb -import ch.tutteli.atrium.api.verbs.internal.expect -import ch.tutteli.atrium.core.ExperimentalNewExpectTypes -import ch.tutteli.atrium.core.coreFactory -import ch.tutteli.atrium.core.polyfills.stackBacktrace -import ch.tutteli.atrium.creating.ExperimentalComponentFactoryContainer -import ch.tutteli.atrium.logic.creating.RootExpectBuilder -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster -import ch.tutteli.atrium.reporting.Reporter -import ch.tutteli.atrium.reporting.reporter -import kotlin.test.Test - -@Deprecated("will be removed with 0.17.0") -class AdjustStackTest { - - @Test - fun noOp_containsMochaAndAtrium() { - expect { - assertNoOp(1).toBe(2) - }.toThrow { - feature(AssertionError::stackBacktrace).contains( - { contains("mocha") }, - { contains("atrium-core-api-js.js") } - ) - } - } - - @Test - fun removeRunner_containsAtriumButNotMocha() { - expect { - assertRemoveRunner(1).toBe(2) - }.toThrow { - feature(AssertionError::stackBacktrace) - .containsNot.entry { contains("mocha") } - .contains { contains("atrium-core-api-js.js") } - } - } - - @Test - fun removeRunner_containsAtriumButNotMochaInCause() { - val adjuster = coreFactory.newRemoveRunnerAtriumErrorAdjuster() - val throwable = IllegalArgumentException("hello", UnsupportedOperationException("world")) - adjuster.adjust(throwable) - expect(throwable.cause!!.stackBacktrace) - .containsNot.entry { contains("mocha") } - .contains { contains("atrium-core-robstoll-lib-js") } - } - - @Test - fun removeAtrium_containsMochaButNotAtrium() { - expect { - assertRemoveAtrium(1).toBe(2) - }.toThrow { - feature(AssertionError::stackBacktrace) - .contains { contains("mocha") } - .containsNot.entry { contains("atrium-core-api-js.js") } - } - } - - @Test - fun removeAtrium_containsMochaButNotAtriumInCause() { - val adjuster = coreFactory.newRemoveAtriumFromAtriumErrorAdjuster() - val throwable = IllegalArgumentException("hello", UnsupportedOperationException("world")) - adjuster.adjust(throwable) - expect(throwable.cause!!.stackBacktrace) - .contains { contains("mocha") } - .containsNot.entry { contains("atrium-core-robstoll-lib-js") } - } - - private fun assertNoOp(subject: T) = createExpect( - subject, coreFactory.newNoOpAtriumErrorAdjuster() - ) - - private fun assertRemoveRunner(subject: T) = createExpect( - subject, coreFactory.newRemoveRunnerAtriumErrorAdjuster() - ) - - private fun assertRemoveAtrium(subject: T) = createExpect( - subject, coreFactory.newRemoveAtriumFromAtriumErrorAdjuster() - ) - - @Suppress("DEPRECATION" /* OptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */) - @UseExperimental(ExperimentalNewExpectTypes::class, ExperimentalComponentFactoryContainer::class) - private fun createExpect(subject: T, adjuster: AtriumErrorAdjuster) = - RootExpectBuilder.forSubject(subject) - .withVerb(AssertionVerb.EXPECT) - .withOptions { - withComponent(AtriumErrorAdjuster::class) { _ -> adjuster } - withComponent(Reporter::class) { _ -> DelegatingReporter(reporter, adjuster) } - } - .build() -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/test/kotlin/testSetup.kt b/core/robstoll-lib/atrium-core-robstoll-lib-js/src/test/kotlin/testSetup.kt deleted file mode 100644 index 6e3eb9d5e..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/test/kotlin/testSetup.kt +++ /dev/null @@ -1,12 +0,0 @@ -//TODO remove file with 1.0.0 -@file:Suppress("DEPRECATION") -import ch.tutteli.atrium.core.robstoll.dependOn_atrium_core_robstoll -import ch.tutteli.atrium.domain.builders.dependOn_domain_builders -import ch.tutteli.atrium.domain.robstoll.dependOn_atrium_domain_robstoll - -private val currentSetupWorkaround = dep() -private fun dep() { - dependOn_atrium_domain_robstoll() - dependOn_atrium_core_robstoll() - dependOn_domain_builders() -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/build.gradle b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/build.gradle deleted file mode 100644 index c98db2129..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/build.gradle +++ /dev/null @@ -1,22 +0,0 @@ -description = 'Contains the bits and pieces behind robstoll\'s implementation ' + - 'of Atrium for the JVM platform. You should only depend on this module if you are ' + - 'providing an implementation as well and want to reuse certain artifacts. If you are a consumer of ' + - 'Atrium, then you should depend on atrium-core-robstoll instead.' - -dependencies { - api prefixedProject('core-api-jvm') - - // it is up to the consumer of atrium-core-robstoll-lib which atrium-translations module is used at runtime - compileOnly prefixedProject('translations-en_GB-jvm') - - testImplementation prefixedProject('api-fluent-en_GB-jvm') - testImplementation prefixedProject('specs-jvm') -} - -//TODO 0.17.0 or 0.18.0 should not be necessary https://youtrack.jetbrains.com/issue/KT-28124 -compileTestKotlin.dependsOn( - prefixedProject('core-robstoll-jvm').compileKotlin, - prefixedProject('core-robstoll-jvm').processResources, - prefixedProject('domain-robstoll-jvm').compileKotlin, - prefixedProject('domain-robstoll-jvm').processResources -) diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DetailedObjectFormatter.kt b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DetailedObjectFormatter.kt deleted file mode 100644 index 5c3d9128c..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DetailedObjectFormatter.kt +++ /dev/null @@ -1,80 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress( - // TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed - "JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE", "DEPRECATION" -) - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.reporting.* -import ch.tutteli.atrium.reporting.translating.Translatable -import ch.tutteli.atrium.reporting.translating.Translator -import kotlin.reflect.KClass - -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -abstract class AbstractDetailedObjectFormatter( - private val translator: Translator -) : DetailedObjectFormatterCommon(translator) { - /** - * Returns a formatted version of the given [value]. - * - * The following rules apply for the representation of an object: - * - `null` is represented as [Text.NULL].[Text.string] - * - [LazyRepresentation] is [evaluated][LazyRepresentation.eval] and then again [format]ted - * - [Char] is put in apostrophes - * - [Boolean] is represented with its [toString] representation - * - [String] is put in quotes and its [Class.getName] is omitted - * - [CharSequence] is put in quotes, but [KClass.qualifiedName] is used in contrast to [String] - * - [Text] is represented as [Text.string] - * - [Translatable] is represented as result of its translation (by [translator]) - * - [Class] is represented as "[Class.getSimpleName] ([Class.getName])" - * - [KClass] is represented as "[KClass.simpleName] ([KClass.qualifiedName])" unless the [KClass.qualifiedName] - * differs from [Class.getName] in which case, "-- Class: [Class.getName]" is appended in addition - * - [Enum] is represented as "[toString] ([Class.getName]) - * - [Throwable] is represented as "[Class.getName]" - * - All other objects are represented as "[toString] ([Class.getName] <[System.identityHashCode]>)" - * - * @param value The value which shall be formatted. - * - * @return The formatted [value]. - */ - final override fun format(value: Any?): String = when (value) { - is Class<*> -> format(value) - else -> super.format(value) - } - - private fun format(clazz: Class<*>) = "${clazz.simpleName} (${clazz.name})" - - final override fun format(kClass: KClass<*>): String { - val kotlinClass = "${kClass.simpleName} (${kClass.qualifiedName})" - return when { - kClass.qualifiedName == kClass.java.name -> kotlinClass - kClass.java.isPrimitive -> "$kotlinClass -- Class: ${kClass.java.simpleName}" - else -> "$kotlinClass -- Class: ${kClass.java.name}" - } - } - - override fun identityHash(indent: String, any: Any): String = "$indent<${System.identityHashCode(any)}>" -} - -/** - * Formats an object by using its [toString] representation, its [Class.getName] and its [System.identityHashCode] - * (in most cases). - * - * Some objects are treated differently, refer to [format] for details. - * - * The aim of representing more information than just [toString] is to avoid situations where an assert may fail - * and [toString] does not distinguish two compared objects. - * Consider the following error message "error, assert: 1 to be 1" would not be very helpful. - * "error, assert: 1 (Int <123>) to be 1 (Double <456>)" on the other hand is helpful. - * - * @property translator The [Translator] used to translate [Translatable]s. - * - * @constructor Formats an object by using its [toString] representation, its [Class.getName] and its [System.identityHashCode] - * (in most cases). - * @param translator The [Translator] used to translate [Translatable]s. - */ -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -actual class DetailedObjectFormatter actual constructor( - private val translator: Translator -) : AbstractDetailedObjectFormatter(translator), ObjectFormatter diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/FilterAtriumErrorAdjuster.kt b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/FilterAtriumErrorAdjuster.kt deleted file mode 100644 index bd138844c..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/FilterAtriumErrorAdjuster.kt +++ /dev/null @@ -1,27 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster - -@Deprecated( - "Use FilterAtriumErrorAdjuster from atrium-core, will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.reporting.erroradjusters.FilterAtriumErrorAdjuster") -) -abstract class FilterAtriumErrorAdjuster : AtriumErrorAdjuster { - - final override fun adjust(throwable: Throwable) { - val filteredStackTrace = adjustStackTrace(throwable.stackTrace.asSequence()) - val arr = filteredStackTrace.toList().toTypedArray() - throwable.stackTrace = arr - throwable.cause?.let { adjust(it) } - throwable.suppressed.forEach { adjust(it) } - adjustOtherThanStacks(throwable) - } - - /** - * Does nothing (no adjustments) - override in subclass if you want a different behaviour. - */ - override fun adjustOtherThanStacks(throwable: Throwable) {} -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/MultiAtriumErrorAdjusterImpl.kt b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/MultiAtriumErrorAdjusterImpl.kt deleted file mode 100644 index 3060bce1a..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/MultiAtriumErrorAdjusterImpl.kt +++ /dev/null @@ -1,26 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster - -@Deprecated( - "Use MultiAtriumErrorAdjuster from atrium-core, will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.reporting.erroradjusters.MultiAtriumErrorAdjuster") -) -actual class MultiAtriumErrorAdjusterImpl actual constructor( - private val firstAdjuster: AtriumErrorAdjuster, - private val secondAdjuster: AtriumErrorAdjuster, - private val otherAdjusters: List -) : FilterAtriumErrorAdjuster(), AtriumErrorAdjuster { - - override fun adjustStackTrace(stackTrace: Sequence): Sequence = - firstAdjuster.adjustStackTrace(stackTrace) - .let { secondAdjuster.adjustStackTrace(it) } - .let { - otherAdjusters.fold(it) { filteredStack, adjuster -> - adjuster.adjustStackTrace(filteredStack) - } - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/NoOpAtriumErrorAdjuster.kt b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/NoOpAtriumErrorAdjuster.kt deleted file mode 100644 index 5ac6d4ae1..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/NoOpAtriumErrorAdjuster.kt +++ /dev/null @@ -1,17 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION", - // TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed - "JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" -) - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster - -@Deprecated( - "Use NoOpAtriumErrorAdjuster from atrium-core, will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.reporting.erroradjusters.NoOpAtriumErrorAdjuster") -) -actual object NoOpAtriumErrorAdjuster : NoOpAtriumErrorAdjusterCommon(), AtriumErrorAdjuster { - override fun adjustStackTrace(stackTrace: Sequence): Sequence = stackTrace -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveAtriumFromAtriumErrorAdjuster.kt b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveAtriumFromAtriumErrorAdjuster.kt deleted file mode 100644 index 48fb7bf82..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveAtriumFromAtriumErrorAdjuster.kt +++ /dev/null @@ -1,16 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster - -@Deprecated( - "Use RemoveAtriumFromAtriumErrorAdjuster from atrium-core, will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.reporting.erroradjusters.impl.RemoveAtriumFromAtriumErrorAdjuster") -) -actual class RemoveAtriumFromAtriumErrorAdjuster : FilterAtriumErrorAdjuster(), AtriumErrorAdjuster { - - override fun adjustStackTrace(stackTrace: Sequence): Sequence = - stackTrace.filter { !it.className.startsWith("ch.tutteli.atrium") } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt deleted file mode 100644 index 2baadd755..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt +++ /dev/null @@ -1,21 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster - -@Deprecated( - "Use RemoveRunnerAtriumErrorAdjuster from atrium-core, will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.reporting.erroradjusters.impl.RemoveRunnerAtriumErrorAdjuster") -) -actual class RemoveRunnerAtriumErrorAdjuster : FilterAtriumErrorAdjuster(), AtriumErrorAdjuster { - - override fun adjustStackTrace(stackTrace: Sequence): Sequence = - stackTrace.takeWhile { - !it.className.startsWith("org.junit") && - !it.className.startsWith("org.jetbrains.spek") && - !it.className.startsWith("org.spekframework.spek2") && - !it.className.startsWith("io.kotlintest") - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesBasedTranslationSupplier.kt b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesBasedTranslationSupplier.kt deleted file mode 100644 index 365ca27ef..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesBasedTranslationSupplier.kt +++ /dev/null @@ -1,96 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress( - // TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed - "JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE", "DEPRECATION" -) - - -package ch.tutteli.atrium.core.robstoll.lib.reporting.translating - -import ch.tutteli.atrium.reporting.translating.Locale -import ch.tutteli.atrium.reporting.translating.Translatable -import ch.tutteli.atrium.reporting.translating.TranslationSupplier -import java.util.* -import java.util.concurrent.ConcurrentHashMap - -/** - * A base class for properties based [TranslationSupplier]s which provides a loading - * and caching mechanism of properties files. - * - * There is no way to purge the cache. This class is intended for a one run process where - * translations do not change in between. - * - * @param T Translations are grouped by a certain aspect (for instance, by [Locale]). [T] defines the type of it. - */ -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -abstract class PropertiesBasedTranslationSupplier : TranslationSupplier { - /** - * The cached translations. - */ - private val translations = ConcurrentHashMap>() - - /** - * Gets the cached [Properties] content as [Map] for the given [key] or - * loads the properties file with the given [fileName] and creates a map out of it using the given [keyCreator] - * function to create the keys of the map, based on a key of a property. - * - * @param key The key which identifies the [Properties] - * @param fileName The fileName of the properties file without file extension, including the package in which it resides - * as absolute path (no '../' are allowed). In case it does not start with '/' (which would be a - * relative path), then a '/' is prepended. Hence it is always searched with an - * absolute path -- which is the same behaviour as for a properties based [ResourceBundle]. - * @param keyCreator The function used to create keys of the resulting [Map] (in case the properties file needs - * to be loaded). It is called passing in a key of a property of the properties file. - * - * @return A [Map] containing the resulting keys (based on the [Properties], see [keyCreator]) with its translations. - */ - protected fun getOrLoadProperties(key: T, fileName: String, keyCreator: (String) -> String): Map { - require(!fileName.contains("../")) { - "only paths without any '../' are allowed" - } - return this.translations.getOrPut(key) { - val absoluteFileName = if (fileName.startsWith('/')) fileName else "/$fileName" - val file = this::class.java.getResourceAsStream("$absoluteFileName.properties") - if (file != null) { - val properties = Properties() - file.use { - properties.load(it) - } - properties.stringPropertyNames().associate { - keyCreator(it) to properties.getProperty(it) - } - } else { - emptyMap() - } - } - } - - /** - * Returns the name of the properties file without extension -- including the package (as prefixed relative path) - * in which it resides if necessary -- in which we expect to find a translation in the given [locale] for - * [baseName]. - * - * The implementation is based on [ResourceBundle.Control.toBundleName]. - * @param baseName Usually the [Translatable] or another identifier for which we are searching translations. Has to - * contain the package name as well if necessary ('.' will be replaced with '/'). - * @param locale The [Locale] for which we are searching a translation. - * - * @return The name of the properties file. - */ - protected fun getFileNameFor(baseName: String, locale: Locale): String { - val sb = StringBuilder(baseName) - //using _ as separator to be compatible with ResourceBundle - .append('_').append(locale.language) - - if (locale.script != null) { - sb.append('_').append(locale.script) - } - if (locale.country != null) { - sb.append('_').append(locale.country) - } - if (locale.variant != null) { - sb.append('_').append(locale.variant) - } - return sb.toString().replace('.', '/') - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesPerEntityAndLocaleTranslationSupplier.kt b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesPerEntityAndLocaleTranslationSupplier.kt deleted file mode 100644 index 4ccf13096..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesPerEntityAndLocaleTranslationSupplier.kt +++ /dev/null @@ -1,38 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress( - // TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed - "JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE", "DEPRECATION" -) - -package ch.tutteli.atrium.core.robstoll.lib.reporting.translating - -import ch.tutteli.atrium.core.polyfills.fullName -import ch.tutteli.atrium.reporting.translating.Locale -import ch.tutteli.atrium.reporting.translating.Translatable -import ch.tutteli.atrium.reporting.translating.TranslationSupplier -import java.util.* - -/** - * Represents a [TranslationSupplier] which is based on properties-files which are structured per - * entity (enum, object or class) and [Locale]. - * - * For instance, the translations for `ch.tutteli.atrium.DescriptionAnyAssertion` and the [Locale] `de_CH` are - * stored in a properties file named `DescriptionAnyAssertion_de_CH.properties` in the folder `/ch/tutteli/atrium/` - * (compatible with the behaviour of [ResourceBundle] - thus properties files should also use ISO-8859-1 as encoding). - * - * An entry in such a file would look like as follows: - * `TO_BE = a translation for TO_BE` - */ -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -class PropertiesPerEntityAndLocaleTranslationSupplier : PropertiesBasedTranslationSupplier() { - - override fun get(translatable: Translatable, locale: Locale): String? { - val qualifiedName = translatable::class.java.name - val fileName = getFileNameFor(qualifiedName, locale) - val fullName = translatable::class.fullName(translatable) - val translations = getOrLoadProperties(fileName, fileName, keyCreator = { - fullName + Translatable.ID_SEPARATOR + it - }) - return translations[translatable.id] - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesPerLocaleTranslationSupplier.kt b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesPerLocaleTranslationSupplier.kt deleted file mode 100644 index f43bad633..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesPerLocaleTranslationSupplier.kt +++ /dev/null @@ -1,33 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress( - // TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed - "JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE", "DEPRECATION" -) - - -package ch.tutteli.atrium.core.robstoll.lib.reporting.translating - -import ch.tutteli.atrium.reporting.translating.Locale -import ch.tutteli.atrium.reporting.translating.Translatable -import ch.tutteli.atrium.reporting.translating.TranslationSupplier - -/** - * Represents a [TranslationSupplier] which is based on properties-files which are structured per [Locale]. - * - * For instance, the translations for `ch.tutteli.atrium.DescriptionAnyAssertion` and the [Locale] `de_CH` are - * stored in a properties file named `Atrium_de_CH.properties` in the folder `/ch/tutteli/atrium/reporting/translating`. - * - * For instance, the translations for the [Locale] `de_CH` are stored in a properties file named . - * - * An entry in such a file would look like the following: - * `ch.tutteli.atrium.DescriptionAnyAssertion-TO_BE = a translation for TO_BE` - */ -@Deprecated("Use the implementation of atrium-core; will be removed with 0.17.0") -class PropertiesPerLocaleTranslationSupplier : PropertiesBasedTranslationSupplier() { - - override fun get(translatable: Translatable, locale: Locale): String? { - val fileName = getFileNameFor(this::class.java.`package`.name + ".Atrium", locale) - val translations = getOrLoadProperties(locale, fileName, keyCreator = { it }) - return translations[translatable.id] - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/ResourceBundleBasedTranslator.kt b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/ResourceBundleBasedTranslator.kt deleted file mode 100644 index 2af11122b..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/ResourceBundleBasedTranslator.kt +++ /dev/null @@ -1,73 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress( - // TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed - "JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE", "DEPRECATION" -) - -package ch.tutteli.atrium.core.robstoll.lib.reporting.translating - -import ch.tutteli.atrium.reporting.translating.* -import ch.tutteli.atrium.reporting.translating.Locale -import ch.tutteli.kbox.forElementAndForEachIn -import java.util.* - -/** - * Represents a [Translator] which reuses [ResourceBundle] properties based capabilities but uses an enhanced - * fallback mechanism. - * - * Instead of falling back to [java.util.Locale.getDefault] one is able to specify fallback [Locale] oneself. - * Whether this includes [java.util.Locale.getDefault] or not is up to the user. - * - * The translations are located in properties files structured per entity (enum, object or class). - * For instance, the translations for `ch.tutteli.atrium.DescriptionAnyAssertion` and the [Locale] `de_CH` are - * stored in a properties file named `DescriptionAnyAssertion_de_CH.properties` in the folder `/ch/tutteli/atrium/`. - * - * An entry in such a file would look like as follows: - * `TO_BE = a translation for TO_BE` - * - * This class is only used as reference implementation to see that compatibility with ResourceBundle is still given. - * - * @constructor Represents a [Translator] which reuses [ResourceBundle] properties based capabilities but uses - * an enhanced fallback mechanism. Instead of falling back to [java.util.Locale.getDefault] one is able to - * specify fallback [Locale] oneself. Whether this includes [java.util.Locale.getDefault] or not is up to the user. - * @param primaryLocale The [Locale] to which the translator translates per default as well as the [Locale] - * which will be used in [java.lang.String.format], which in turn is used to substitute the placeholders in the - * resulting translation of [TranslatableWithArgs.translatable] with the [TranslatableWithArgs.arguments]. - * @param fallbackLocales Used in case a translation for a given [Translatable] is not defined for - * [primaryLocale] or one of its secondary alternatives -- the fallback [Locale]s are used in the given order. - */ -@Deprecated("Will be removed with 0.17.0") -internal class ResourceBundleBasedTranslator( - primaryLocale: Locale, - fallbackLocales: List -) : ArgumentsSupportingTranslator(primaryLocale, fallbackLocales) { - - override fun translateWithoutArgs(translatable: Translatable): String { - val control = ResourceBundle.Control.getNoFallbackControl(ResourceBundle.Control.FORMAT_PROPERTIES) - forElementAndForEachIn(primaryLocale, fallbackLocales) { locale -> - try { - val bundle = ResourceBundle.getBundle(translatable::class.java.name, locale.toJavaLocale(), control) - return bundle.getString(translatable.name) - } catch (ex: MissingResourceException) { - //that's fine we'll return getDefault below if no translation was found - } - } - return translatable.getDefault() - } - - companion object { - /** - * Creates a [ResourceBundleBasedTranslator] and aggregates it with a [ResourceBundle.Control] which either - * makes use of the given [fallbackLocales] if provided or uses only the given [primaryLocale]. - * - * @param primaryLocale The primary [Locale] which will be used in [java.lang.String.format] to substitute the - * placeholders in the resulting translation of [TranslatableWithArgs.translatable] with - * the [TranslatableWithArgs.arguments]. - * @param fallbackLocales Used in case a translation for a given [Translatable] is not defined for - * [primaryLocale] or one of its secondary alternatives -- the [fallbackLocales] are used in the - * given order. - */ - fun create(primaryLocale: Locale, vararg fallbackLocales: Locale) = - ResourceBundleBasedTranslator(primaryLocale, fallbackLocales.toList()) - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/module/module-info.java b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/module/module-info.java deleted file mode 100644 index 4c8f02a2b..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/module/module-info.java +++ /dev/null @@ -1,9 +0,0 @@ -module ch.tutteli.atrium.core.robstoll.lib { - requires ch.tutteli.atrium.core.api; - requires ch.tutteli.kbox; - requires static ch.tutteli.atrium.translations.en_GB; - requires kotlin.stdlib; - - exports ch.tutteli.atrium.core.robstoll.lib.reporting; - exports ch.tutteli.atrium.core.robstoll.lib.reporting.translating; -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AdjustStackSpec.kt b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AdjustStackSpec.kt deleted file mode 100644 index 3a258df8b..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/AdjustStackSpec.kt +++ /dev/null @@ -1,195 +0,0 @@ -//TODO remove with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.api.fluent.en_GB.* -import ch.tutteli.atrium.api.verbs.internal.AssertionVerb -import ch.tutteli.atrium.api.verbs.internal.expect -import ch.tutteli.atrium.core.ExperimentalNewExpectTypes -import ch.tutteli.atrium.core.coreFactory -import ch.tutteli.atrium.core.polyfills.stackBacktrace -import ch.tutteli.atrium.creating.Expect -import ch.tutteli.atrium.creating.ExperimentalComponentFactoryContainer -import ch.tutteli.atrium.logic.creating.RootExpectBuilder -import ch.tutteli.atrium.logic.creating.RootExpectOptions -import ch.tutteli.atrium.logic.utils.expectLambda -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster -import ch.tutteli.atrium.reporting.Reporter -import ch.tutteli.atrium.reporting.reporter -import org.spekframework.spek2.Spek -import org.spekframework.spek2.style.specification.describe - -class AdjustStackSpec : Spek({ - - describe("no-op adjuster") { - fun assertNoOp(subject: T) = createExpect( - subject, coreFactory.newNoOpAtriumErrorAdjuster() - ) - - it("contains spek, junit, atrium.creating and atrium.reporting") { - expect { - assertNoOp(1).toBe(2) - }.toThrow { - feature { f(it::stackBacktrace) }.contains( - { startsWith("org.spekframework.spek2") }, - { startsWith("ch.tutteli.atrium.creating") }, - { startsWith("ch.tutteli.atrium.reporting") } - ) - } - } - } - - fun mapStartsWith(list: List): Pair.() -> Unit, Array.() -> Unit>> { - val asserts = list.map { c -> expectLambda { startsWith(c) } } - return asserts.first() to asserts.drop(1).toTypedArray() - } - - mapOf( - "remove test runner adjuster" to Triple( - coreFactory.newRemoveRunnerAtriumErrorAdjuster(), - listOf("org.spekframework.spek2", "kotlin.coroutines", "kotlinx.coroutines"), - listOf("ch.tutteli.atrium") - ), - "remove atrium adjuster" to Triple( - coreFactory.newRemoveAtriumFromAtriumErrorAdjuster(), - listOf("ch.tutteli.atrium"), - listOf("org.spekframework.spek2") - ) - ).forEach { (description, triple) -> - val (adjuster, containsNot, contains) = triple - val (containsNotFirst, containsNotRest) = mapStartsWith(containsNot) - val (containsFirst, containsRest) = mapStartsWith(contains) - describe(description) { - it("does not contain $containsNot in stackBacktrace but $contains") { - expect { - createExpect(1, adjuster).toBe(2) - }.toThrow { - feature { f(it::stackBacktrace) } - .containsNot.entries(containsNotFirst, *containsNotRest) - .contains(containsFirst, *containsRest) - } - } - - - it("does not contain $containsNot in stackBacktrace of cause, but $contains") { - val throwable = IllegalArgumentException("hello", UnsupportedOperationException("world")) - adjuster.adjust(throwable) - expect(throwable.cause!!.stackBacktrace) - .containsNot.entries(containsNotFirst, *containsNotRest) - .contains(containsFirst, *containsRest) - } - - it("does not contain $containsNot in stackBacktrace of cause of cause, but $contains") { - val throwable = IllegalArgumentException( - "hello", - UnsupportedOperationException("world", IllegalStateException("and good night")) - ) - adjuster.adjust(throwable) - expect(throwable.cause!!.cause!!.stackBacktrace) - .containsNot.entries(containsNotFirst, *containsNotRest) - .contains(containsFirst, *containsRest) - } - - it("does not contain $containsNot in stackBacktrace of suppressed exception, but $contains") { - val throwable1 = IllegalArgumentException("hello", UnsupportedOperationException("world")) - val throwable2 = IllegalArgumentException("hello", UnsupportedOperationException("world")) - val throwable = IllegalStateException("with suppressed") - throwable.addSuppressed(throwable1) - throwable.addSuppressed(throwable2) - adjuster.adjust(throwable) - expect(throwable.suppressed).asList().all { - feature { f(it::stackBacktrace) } - .containsNot.entries(containsNotFirst, *containsNotRest) - .contains(containsFirst, *containsRest) - } - } - - it("does not contain $containsNot in stackBacktrace of cause of suppressed exception, but $contains") { - val throwable1 = IllegalArgumentException("hello", UnsupportedOperationException("world")) - val throwable2 = IllegalArgumentException("hello", UnsupportedOperationException("world")) - val throwable = IllegalStateException("with suppressed") - throwable.addSuppressed(throwable1) - throwable.addSuppressed(throwable2) - adjuster.adjust(throwable) - expect(throwable.suppressed).asList().all { - cause { - feature { f(it::stackBacktrace) } - .containsNot.entries(containsNotFirst, *containsNotRest) - .contains(containsFirst, *containsRest) - } - } - } - } - } - - mapOf( - "combine remove runner adjuster and remove atrium adjuster" to - coreFactory.newMultiAtriumErrorAdjuster( - coreFactory.newRemoveRunnerAtriumErrorAdjuster(), - coreFactory.newRemoveAtriumFromAtriumErrorAdjuster(), - listOf() - ), - "combine remove atrium adjuster and remove runner adjuster" to - coreFactory.newMultiAtriumErrorAdjuster( - coreFactory.newRemoveAtriumFromAtriumErrorAdjuster(), - coreFactory.newRemoveRunnerAtriumErrorAdjuster(), - listOf() - ), - "combine noop adjust, remove atrium adjuster and remove runner adjuster" to - coreFactory.newMultiAtriumErrorAdjuster( - coreFactory.newNoOpAtriumErrorAdjuster(), - coreFactory.newRemoveAtriumFromAtriumErrorAdjuster(), - listOf(coreFactory.newRemoveRunnerAtriumErrorAdjuster()) - ), - "combine remove atrium adjuster, remove runner adjuster and noop adjuster several times" to - coreFactory.newMultiAtriumErrorAdjuster( - coreFactory.newRemoveAtriumFromAtriumErrorAdjuster(), - coreFactory.newRemoveRunnerAtriumErrorAdjuster(), - listOf( - coreFactory.newNoOpAtriumErrorAdjuster(), - coreFactory.newRemoveRunnerAtriumErrorAdjuster(), - coreFactory.newNoOpAtriumErrorAdjuster() - ) - ) - ).forEach { (description, adjuster) -> - describe(description) { - it("stackBacktrace is empty as we filter out everything") { - expect { - createExpect(1, adjuster).toBe(2) - }.toThrow { - feature { f(it::stackBacktrace) }.isEmpty() - } - } - - it("stackBacktrace of cause is empty as we filter out everything") { - val throwable = IllegalArgumentException("hello", UnsupportedOperationException("world")) - adjuster.adjust(throwable) - expect(throwable.cause!!.stackBacktrace).isEmpty() - } - - it("stackBacktrace of suppressed is empty as we filter out everything") { - val throwable1 = IllegalArgumentException("hello", UnsupportedOperationException("world")) - val throwable2 = IllegalArgumentException("hello", UnsupportedOperationException("world")) - val throwable = IllegalStateException("with suppressed") - throwable.addSuppressed(throwable1) - throwable.addSuppressed(throwable2) - adjuster.adjust(throwable) - expect(throwable.suppressed).asList().all { - feature { f(it::stackBacktrace) }.isEmpty() - } - } - } - } -}) - -@Suppress("DEPRECATION" /* OptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */) -@UseExperimental(ExperimentalNewExpectTypes::class, ExperimentalComponentFactoryContainer::class) -private fun createExpect(subject: T, adjuster: AtriumErrorAdjuster) = - RootExpectBuilder.forSubject(subject) - .withVerb(AssertionVerb.EXPECT) - .withOptions { - withComponent(AtriumErrorAdjuster::class) { _ -> adjuster } - withComponent(Reporter::class) { _ -> DelegatingReporter(reporter, adjuster) } - } - .build() diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DetailedObjectFormatterSpec.kt b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DetailedObjectFormatterSpec.kt deleted file mode 100644 index 6c4411bbe..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DetailedObjectFormatterSpec.kt +++ /dev/null @@ -1,186 +0,0 @@ -//TODO remove with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.api.fluent.en_GB.toBe -import ch.tutteli.atrium.api.verbs.internal.expect -import ch.tutteli.atrium.core.robstoll.lib.reporting.DetailedObjectFormatterCommon.Companion.INDENT -import ch.tutteli.atrium.reporting.translating.UsingDefaultTranslator -import ch.tutteli.atrium.specs.reporting.ObjectFormatterSpec -import org.spekframework.spek2.Spek -import org.spekframework.spek2.style.specification.describe -import kotlin.reflect.KClass - -object DetailedObjectFormatterSpec : Spek({ - include(AtriumsObjectFormatterSpec) - - val testee = DetailedObjectFormatter(UsingDefaultTranslator()) - - describe("format") { - - context("a ${Char::class.simpleName}") { - val result = testee.format('a') - it("returns the ${Char::class.simpleName} in apostrophes") { - expect(result).toBe("'a'") - } - } - - context("a ${Boolean::class.simpleName}") { - it("returns the toString representation of the ${Boolean::class.simpleName}") { - expect(testee.format(true)).toBe("true") - expect(testee.format(false)).toBe("false") - } - } - - context("a ${String::class.simpleName}") { - it("returns two quotes including identity hash if empty ${String::class.simpleName}") { - val string = "" - val result = testee.format(string) - expect(result).toBe("\"\"" + INDENT + "<${System.identityHashCode(string)}>") - } - it("returns the ${String::class.simpleName} in quotes including identity hash") { - val string = "atrium" - val result = testee.format(string) - expect(result).toBe("\"$string\"" + INDENT + "<${System.identityHashCode(string)}>") - } - it("returns line breaks (does not escape") { - val string = "atrium\nAn assertion framework for Kotlin" - val result = testee.format(string) - expect(result).toBe("\"$string\"" + INDENT + "<${System.identityHashCode(string)}>") - } - } - - val typeNameAndHash = "including type name and identity hash" - - context("a ${CharSequence::class.simpleName} besides ${String::class.simpleName}") { - it("returns two quotes $typeNameAndHash if empty ${CharSequence::class.simpleName}") { - val value = StringBuilder("") - val result = testee.format(value) - expect(result).toBe( - "\"\"" + INDENT - + "(${value::class.qualifiedName} <${System.identityHashCode(value)}>)" - ) - } - it("returns ${CharSequence::class.simpleName} in quotes $typeNameAndHash") { - val value = StringBuilder("atrium") - val result = testee.format(value) - expect(result).toBe( - "\"$value\"" + INDENT - + "(${value::class.qualifiedName} <${System.identityHashCode(value)}>)" - ) - } - } - - context("an enum") { - val enum = Color.Red - val result = testee.format(Color.Red) - it("returns its toString representation together with its Class.name but without System.identityHash") { - expect(result).toBe("Red" + INDENT + "(${enum::class.java.name})") - } - } - - context("a Throwable") { - val result = testee.format(AssertionError("blablabla")) - it("returns only its Class.name") { - expect(result).toBe(AssertionError::class.java.name) - } - } - - context("a ${Class::class.simpleName}") { - val result = testee.format(DetailedObjectFormatterSpec::class.java) - it("returns its simpleName and name in parenthesis") { - val clazz = DetailedObjectFormatterSpec::class.java - expect(result).toBe("${clazz.simpleName} (${clazz.name})") - } - } - - context("on a ${KClass::class.simpleName}") { - - context("java Class is the same (no special Kotlin class)") { - val result = testee.format(DetailedObjectFormatterSpec::class) - it("returns the simpleName and qualified in parenthesis") { - val clazz = DetailedObjectFormatterSpec::class - expect(result).toBe("${clazz.java.simpleName} (${clazz.java.name})") - expect(result).toBe("${clazz.simpleName} (${clazz.qualifiedName})") - } - } - - context("a primitive Kotlin wrapper class (java Class is not the same)") { - val result = testee.format(Int::class) - it("returns the simpleName and qualified in parenthesis including java's simpleName") { - val clazz = Int::class - expect(result).toBe("${clazz.simpleName} (${clazz.qualifiedName}) -- Class: ${clazz.java.simpleName}") - } - } - - context("a non primitive Kotlin class (java Class is not the same)") { - val result = testee.format(CharSequence::class) - it("returns the simpleName and qualified in parenthesis including java's name") { - val clazz = CharSequence::class - expect(result).toBe("${clazz.simpleName} (${clazz.qualifiedName}) -- Class: ${clazz.java.name}") - } - } - - } - - context("output type information") { - it("type information is still given in the output if no textual limiting occurs") { - val numbers = mutableListOf() - repeat(10) { numbers += it } - val result = testee.format(numbers) - val expected = "[${numbers.joinToString(", ")}]$INDENT(${numbers::class.qualifiedName} <${System.identityHashCode(numbers)}>)" - expect(result).toBe(expected) - } - - it("type information is still given in the output if the textual representation is too long") { - val numbers = mutableListOf() - repeat(5000) { numbers += it } - val result = testee.format(numbers) - val expected = - "${numbers - .joinToString(prefix = "[", separator = ", ") - .substring(0, 10000)}...$INDENT(${numbers::class.qualifiedName} <${System.identityHashCode(numbers)}>)" - expect(result).toBe(expected) - } - } - - mapOf( - java.lang.Byte::class.java.simpleName to 1.toByte(), - java.lang.Short::class.java.simpleName to 1.toShort(), - java.lang.Integer::class.java.simpleName to 1, - java.lang.Long::class.java.simpleName to 1L, - java.lang.Float::class.java.simpleName to 1.0f, - java.lang.Double::class.java.simpleName to 1.0 - ).forEach { (typeName, value) -> - context(typeName) { - val result = testee.format(value) - it("returns subject's toString() $typeNameAndHash") { - expect(result).toBe( - value.toString() + INDENT - + "(${value::class.qualifiedName} <${System.identityHashCode(value)}>)" - ) - } - } - } - - context("an anonymous class") { - val anonymous = object : Any() { - override fun toString(): String = "anonymous type" - } - val result = testee.format(anonymous) - it("returns subject's toString() $typeNameAndHash") { - expect(result).toBe( - anonymous.toString() + INDENT - + "(${anonymous::class.java.name} <${System.identityHashCode(anonymous)}>)" - ) - } - } - } -}) { - object AtriumsObjectFormatterSpec : ObjectFormatterSpec(::DetailedObjectFormatter) -} - -private enum class Color { - Red //, Blue, Green -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextFeatureAssertionGroupFormatterSpec.kt b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextFeatureAssertionGroupFormatterSpec.kt deleted file mode 100644 index 172f15ed7..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextFeatureAssertionGroupFormatterSpec.kt +++ /dev/null @@ -1,54 +0,0 @@ -//TODO remove with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.assertions.BulletPointIdentifier -import ch.tutteli.atrium.assertions.DefaultFeatureAssertionGroupType -import ch.tutteli.atrium.assertions.FeatureAssertionGroupType -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.ObjectFormatter -import ch.tutteli.atrium.reporting.translating.Translator -import org.spekframework.spek2.Spek -import kotlin.reflect.KClass - -class TextFeatureAssertionGroupFormatterSpec : Spek({ - - include(AtriumsTextFeatureAssertionGroupFormatterSpec) - include(AtriumsSingleAssertionGroupTypeFormatterSpec) - include(AtriumsAssertionFormatterSpec) - -}) { - object AtriumsTextFeatureAssertionGroupFormatterSpec : - ch.tutteli.atrium.specs.reporting.TextFeatureAssertionGroupFormatterSpec( - factory(), "[Atrium's TextFeature...Spec] " - ) - - object AtriumsSingleAssertionGroupTypeFormatterSpec : - ch.tutteli.atrium.specs.reporting.SingleAssertionGroupTypeFormatterSpec( - factory(), - FeatureAssertionGroupType::class, - object : FeatureAssertionGroupType {}, - DefaultFeatureAssertionGroupType, - "[Atrium's SingleAssertionGroupType...Spec] " - ) - - object AtriumsAssertionFormatterSpec : ch.tutteli.atrium.specs.reporting.AssertionFormatterSpec( - factory(), "[Atrium's AssertionFormatterSpec] " - ) - - - companion object { - internal fun factory() = - { bulletPoints: Map, String>, controller: AssertionFormatterController, objectFormatter: ObjectFormatter, translator: Translator -> - TextFeatureAssertionGroupFormatter( - bulletPoints, - controller, - TextSameLineAssertionPairFormatter( - objectFormatter, - translator - ) - ) - } - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextListAssertionGroupFormatterSpec.kt b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextListAssertionGroupFormatterSpec.kt deleted file mode 100644 index 0874e2d95..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/TextListAssertionGroupFormatterSpec.kt +++ /dev/null @@ -1,53 +0,0 @@ -//TODO remove with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting - -import ch.tutteli.atrium.assertions.BulletPointIdentifier -import ch.tutteli.atrium.assertions.DefaultListAssertionGroupType -import ch.tutteli.atrium.assertions.ListAssertionGroupType -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.ObjectFormatter -import ch.tutteli.atrium.reporting.translating.Translator -import org.spekframework.spek2.Spek -import kotlin.reflect.KClass - -class TextListAssertionGroupFormatterSpec : Spek({ - - include(AtriumsTextListAssertionFormatterSpec) - include(AtriumsSingleAssertionGroupTypeFormatterSpec) - include(AtriumsAssertionFormatterSpec) - -}) { - object AtriumsTextListAssertionFormatterSpec : - ch.tutteli.atrium.specs.reporting.TextListAssertionGroupFormatterSpec( - factoryWithBullet(), "[Atrium's TextList...Spec] " - ) - - object AtriumsSingleAssertionGroupTypeFormatterSpec : - ch.tutteli.atrium.specs.reporting.SingleAssertionGroupTypeFormatterSpec( - factoryWithBullet(), - ListAssertionGroupType::class, - object : ListAssertionGroupType {}, - DefaultListAssertionGroupType, - "[Atrium's SingleAssertionGroupType...Spec] " - ) - - object AtriumsAssertionFormatterSpec : ch.tutteli.atrium.specs.reporting.AssertionFormatterSpec( - factoryWithBullet(), "[Atrium's AssertionFormatterSpec] " - ) - - companion object { - private fun factoryWithBullet() = - { bulletPoints: Map, String>, assertionFormatterController: AssertionFormatterController, objectFormatter: ObjectFormatter, translator: Translator -> - TextListAssertionGroupFormatter( - bulletPoints, - assertionFormatterController, - TextSameLineAssertionPairFormatter( - objectFormatter, - translator - ) - ) - } - } -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesPerEntityAndLocaleTranslationSupplierSpec.kt b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesPerEntityAndLocaleTranslationSupplierSpec.kt deleted file mode 100644 index 5adec5ccf..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesPerEntityAndLocaleTranslationSupplierSpec.kt +++ /dev/null @@ -1,27 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting.translating - -import ch.tutteli.atrium.domain.builders.reporting.ReporterBuilder -import ch.tutteli.atrium.specs.reporting.translating.TranslatorIntSpec - -//cannot be easily migrated to specs-common/spek2 as it depends on JVM resources => need to find a solution first -object PropertiesPerEntityAndLocaleTranslationSupplierSpec : TranslatorIntSpec( - { primaryLocale, fallbackLocales -> - ReporterBuilder.create() - .withTranslationSupplier(PropertiesPerEntityAndLocaleTranslationSupplier()) - .withDefaultLocaleOrderDecider() - .withDefaultTranslator(primaryLocale, *fallbackLocales) - .withDetailedObjectFormatter() - .withDefaultAssertionFormatterController() - .withDefaultAssertionFormatterFacade() - .withTextSameLineAssertionPairFormatter() - .withTextCapabilities() - .withDefaultAtriumErrorAdjusters() - .withOnlyFailureReporter() - .build() - }, - true, - "[Atrium's TranslationIntSpec] " -) diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesPerLocaleTranslationSupplierSpec.kt b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesPerLocaleTranslationSupplierSpec.kt deleted file mode 100644 index 9d47d4dfa..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/PropertiesPerLocaleTranslationSupplierSpec.kt +++ /dev/null @@ -1,27 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting.translating - -import ch.tutteli.atrium.domain.builders.reporting.ReporterBuilder - -//cannot be easily migrated to specs-common/spek2 as it depends on JVM resources => need to find a solution first -object PropertiesPerLocaleTranslationSupplierSpec : ch.tutteli.atrium.specs.reporting.translating.TranslatorIntSpec( - { primaryLocale, fallbackLocales -> - ReporterBuilder.create() - .withTranslationSupplier(PropertiesPerLocaleTranslationSupplier()) - .withDefaultLocaleOrderDecider() - .withDefaultTranslator(primaryLocale, *fallbackLocales) - .withDetailedObjectFormatter() - .withDefaultAssertionFormatterController() - .withDefaultAssertionFormatterFacade() - .withTextSameLineAssertionPairFormatter() - .withTextCapabilities() - .withDefaultAtriumErrorAdjusters() - .withOnlyFailureReporter() - .build() - }, - true, - "[Atrium's TranslationIntSpec] " -) - diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/ResourceBundleBasedTranslatorSpec.kt b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/ResourceBundleBasedTranslatorSpec.kt deleted file mode 100644 index 76ba91698..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/ResourceBundleBasedTranslatorSpec.kt +++ /dev/null @@ -1,36 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting.translating - -import ch.tutteli.atrium.domain.builders.reporting.ReporterBuilder -import org.spekframework.spek2.Spek - -//cannot be easily migrated to specs-common/spek2 as it depends on JVM resources => need to find a solution first -object ResourceBundleBasedTranslatorSpec : Spek({ - include(AtriumsTranslatorErrorCaseSpec) - include(AtriumsTranslatorIntSpec) -}) { - object AtriumsTranslatorErrorCaseSpec : ch.tutteli.atrium.specs.reporting.translating.TranslatorErrorCaseSpec( - ::ResourceBundleBasedTranslator, "[Atrium's TranslatorErrorSpec] " - ) - - object AtriumsTranslatorIntSpec : ch.tutteli.atrium.specs.reporting.translating.TranslatorIntSpec( - { primaryLocale, fallbackLocales -> - ReporterBuilder.create() - .withTranslator(ResourceBundleBasedTranslator.create(primaryLocale, *fallbackLocales)) - .withDetailedObjectFormatter() - .withDefaultAssertionFormatterController() - .withDefaultAssertionFormatterFacade() - .withTextSameLineAssertionPairFormatter() - .withTextCapabilities() - .withDefaultAtriumErrorAdjusters() - .withOnlyFailureReporter() - .build() - }, - // ResourceBundleBasedTranslator is only a reference to assure us that we have a similar implementation - // it could be true if https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8193496 is fixed in JDK8 - false, - "[Atrium's TranslatorIntSpec] " - ) -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/TranslationSupplierBasedTranslatorSpec.kt b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/TranslationSupplierBasedTranslatorSpec.kt deleted file mode 100644 index e99fe1f37..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/TranslationSupplierBasedTranslatorSpec.kt +++ /dev/null @@ -1,29 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll.lib.reporting.translating - -import ch.tutteli.atrium.core.coreFactory -import org.spekframework.spek2.Spek - -object TranslationSupplierBasedTranslatorSpec : Spek({ - include(AtriumsTranslationSupplierBasedTranslatorSpec) - include(AtriumsTranslatorErrorCaseSpec) -}) { - object AtriumsTranslationSupplierBasedTranslatorSpec : - ch.tutteli.atrium.specs.reporting.translating.TranslationSupplierBasedTranslatorSpec( - ::TranslationSupplierBasedTranslator, "[Atrium's TranslatorSpec] " - ) - - object AtriumsTranslatorErrorCaseSpec : ch.tutteli.atrium.specs.reporting.translating.TranslatorErrorCaseSpec( - { primaryLocale, fallbackLocales -> - TranslationSupplierBasedTranslator( - coreFactory.newPropertiesBasedTranslationSupplier(), - coreFactory.newLocaleOrderDecider(), - primaryLocale, - fallbackLocales - ) - }, - "[Atrium's TranslatorErrorCaseSpec] " - ) -} diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_de.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_de.properties deleted file mode 100644 index fecb040d4..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_de.properties +++ /dev/null @@ -1,2 +0,0 @@ -ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=ist (de) -ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE=ist nicht diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_de_CH.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_de_CH.properties deleted file mode 100644 index 3429c2a32..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_de_CH.properties +++ /dev/null @@ -1 +0,0 @@ -ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=ist diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_fr.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_fr.properties deleted file mode 100644 index d202f8882..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_fr.properties +++ /dev/null @@ -1,6 +0,0 @@ -ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=est -ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE=n'est pas -ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_NOT_SAME=n'est pas la m\u00EAme instance que -ch.tutteli.atrium.specs.AssertionVerb-ASSERT=il applique que -ch.tutteli.atrium.specs.reporting.translating.TranslatorIntSpec.TestTranslatable-DATE_KNOWN=%tD \u00E9tait %tA!! -ch.tutteli.atrium.specs.reporting.translating.TranslatorIntSpec.TestTranslatable-PLACEHOLDER=Caract\u00E8re de remplacement %s diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_it.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_it.properties deleted file mode 100644 index 7dab7a2fb..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_it.properties +++ /dev/null @@ -1,2 +0,0 @@ -ch.tutteli.atrium.specs.reporting.translating.TranslatorIntSpec.TestTranslatable-DATE_KNOWN=solo %tA!! -ch.tutteli.atrium.specs.reporting.translating.TranslatorIntSpec.TestTranslatable-DATE_UNKNOWN=solo %tA!! diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh.properties deleted file mode 100644 index 846e033a2..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh.properties +++ /dev/null @@ -1,4 +0,0 @@ -ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=TO_BE zh -ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE=NOT_TO_BE zh -ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_NOT_SAME=IS_NOT_SAME zh -ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_SAME=IS_SAME zh diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_CN.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_CN.properties deleted file mode 100644 index f940587cd..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_CN.properties +++ /dev/null @@ -1,3 +0,0 @@ -ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=TO_BE zh_CN -ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE=NOT_TO_BE zh_CN -ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_NOT_SAME=IS_NOT_SAME zh_CN diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_HK.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_HK.properties deleted file mode 100644 index 40fda728f..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_HK.properties +++ /dev/null @@ -1,3 +0,0 @@ -ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=TO_BE zh_HK -ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE=NOT_TO_BE zh_HK -ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_NOT_SAME=IS_NOT_SAME zh_HK diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hans.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hans.properties deleted file mode 100644 index c0f1dec8f..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hans.properties +++ /dev/null @@ -1,2 +0,0 @@ -ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=TO_BE zh_Hans -ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE=NOT_TO_BE zh_Hans diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hans_CN.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hans_CN.properties deleted file mode 100644 index 4c815f8ed..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hans_CN.properties +++ /dev/null @@ -1 +0,0 @@ -ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=TO_BE zh_Hans_CN diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hans_SG.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hans_SG.properties deleted file mode 100644 index 0853ecb7b..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hans_SG.properties +++ /dev/null @@ -1 +0,0 @@ -ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=TO_BE zh_Hans_SG diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hant.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hant.properties deleted file mode 100644 index 38846c47d..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hant.properties +++ /dev/null @@ -1,2 +0,0 @@ -ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=zh_Hant -ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE=NOT_TO_BE zh_Hant diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hant_HK.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hant_HK.properties deleted file mode 100644 index 618048a4c..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hant_HK.properties +++ /dev/null @@ -1 +0,0 @@ -ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=TO_BE zh_Hant_HK diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hant_MO.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hant_MO.properties deleted file mode 100644 index ad816d083..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hant_MO.properties +++ /dev/null @@ -1 +0,0 @@ -ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=TO_BE zh_Hant_MO diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hant_TW.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hant_TW.properties deleted file mode 100644 index 2c2e01835..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_Hant_TW.properties +++ /dev/null @@ -1 +0,0 @@ -ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=TO_BE zh_Hant_TW diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_MO.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_MO.properties deleted file mode 100644 index 6137c186e..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_MO.properties +++ /dev/null @@ -1,3 +0,0 @@ -ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=TO_BE zh_MO -ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE=NOT_TO_BE zh_MO -ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_NOT_SAME=IS_NOT_SAME zh_MO diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_SG.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_SG.properties deleted file mode 100644 index 1d8451a7e..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_SG.properties +++ /dev/null @@ -1,3 +0,0 @@ -ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=TO_BE zh_SG -ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE=NOT_TO_BE zh_SG -ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_NOT_SAME=IS_NOT_SAME zh_SG diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_TW.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_TW.properties deleted file mode 100644 index 9d9f6caa9..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/core/robstoll/lib/reporting/translating/Atrium_zh_TW.properties +++ /dev/null @@ -1,3 +0,0 @@ -ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=TO_BE zh_TW -ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE=NOT_TO_BE zh_TW -ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_NOT_SAME=IS_NOT_SAME zh_TW diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/specs/AssertionVerb_fr.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/specs/AssertionVerb_fr.properties deleted file mode 100644 index 220dca001..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/specs/AssertionVerb_fr.properties +++ /dev/null @@ -1 +0,0 @@ -ASSERT=il applique que diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/specs/reporting/translating/TranslatorIntSpec$TestTranslatable_fr.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/specs/reporting/translating/TranslatorIntSpec$TestTranslatable_fr.properties deleted file mode 100644 index 4d546cd7b..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/specs/reporting/translating/TranslatorIntSpec$TestTranslatable_fr.properties +++ /dev/null @@ -1,2 +0,0 @@ -DATE_KNOWN=%tD \u00E9tait %tA!! -PLACEHOLDER=Caract\u00E8re de remplacement %s diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/specs/reporting/translating/TranslatorIntSpec$TestTranslatable_it.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/specs/reporting/translating/TranslatorIntSpec$TestTranslatable_it.properties deleted file mode 100644 index a22dc452a..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/specs/reporting/translating/TranslatorIntSpec$TestTranslatable_it.properties +++ /dev/null @@ -1,2 +0,0 @@ -DATE_KNOWN=solo %tA!! -DATE_UNKNOWN=solo %tA!! diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_de.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_de.properties deleted file mode 100644 index ec43ddc46..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_de.properties +++ /dev/null @@ -1,2 +0,0 @@ -TO_BE=ist (de) -NOT_TO_BE=ist nicht diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_de_CH.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_de_CH.properties deleted file mode 100644 index f2469287f..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_de_CH.properties +++ /dev/null @@ -1 +0,0 @@ -TO_BE=ist diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_fr.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_fr.properties deleted file mode 100644 index ef4348010..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_fr.properties +++ /dev/null @@ -1,3 +0,0 @@ -TO_BE=est -NOT_TO_BE=n'est pas -IS_NOT_SAME=n'est pas la m\u00EAme instance que diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh.properties deleted file mode 100644 index 2f0df198c..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh.properties +++ /dev/null @@ -1,4 +0,0 @@ -TO_BE=TO_BE zh_HK -NOT_TO_BE=NOT_TO_BE zh_HK -IS_NOT_SAME=IS_NOT_SAME zh -IS_SAME=IS_SAME zh diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_CN.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_CN.properties deleted file mode 100644 index 3d911d594..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_CN.properties +++ /dev/null @@ -1,3 +0,0 @@ -TO_BE=TO_BE zh_CN -NOT_TO_BE=NOT_TO_BE zh_CN -IS_NOT_SAME=IS_NOT_SAME zh_CN diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_HK.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_HK.properties deleted file mode 100644 index 46c53a5cd..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_HK.properties +++ /dev/null @@ -1,3 +0,0 @@ -TO_BE=TO_BE zh_HL -NOT_TO_BE=NOT_TO_BE zh_HK -IS_NOT_SAME=IS_NOT_SAME zh_HK diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hans.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hans.properties deleted file mode 100644 index cd840519a..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hans.properties +++ /dev/null @@ -1,2 +0,0 @@ -TO_BE=TO_BE zh_Hans -NOT_TO_BE=NOT_TO_BE zh_Hans diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hans_CN.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hans_CN.properties deleted file mode 100644 index 6b2c2c43f..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hans_CN.properties +++ /dev/null @@ -1 +0,0 @@ -TO_BE=TO_BE zh_Hans_CN diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hans_SG.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hans_SG.properties deleted file mode 100644 index 8571c60f2..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hans_SG.properties +++ /dev/null @@ -1 +0,0 @@ -TO_BE=TO_BE zh_Hans_SG diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hant.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hant.properties deleted file mode 100644 index 39a77cbd5..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hant.properties +++ /dev/null @@ -1,2 +0,0 @@ -TO_BE=TO_BE zh_Hant -NOT_TO_BE=NOT_TO_BE zh_Hant diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hant_HK.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hant_HK.properties deleted file mode 100644 index 354de394b..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hant_HK.properties +++ /dev/null @@ -1 +0,0 @@ -TO_BE=TO_BE zh_Hant_HK diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hant_MO.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hant_MO.properties deleted file mode 100644 index ed89748c7..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hant_MO.properties +++ /dev/null @@ -1 +0,0 @@ -TO_BE=TO_BE zh_Hant_MO diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hant_TW.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hant_TW.properties deleted file mode 100644 index ff2832532..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_Hant_TW.properties +++ /dev/null @@ -1 +0,0 @@ -TO_BE=TO_BE zh_Hant_TW diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_MO.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_MO.properties deleted file mode 100644 index 17e7a65eb..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_MO.properties +++ /dev/null @@ -1,3 +0,0 @@ -TO_BE=TO_BE zh_MO -NOT_TO_BE=NOT_TO_BE zh_MO -IS_NOT_SAME=IS_NOT_SAME zh_MO diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_SG.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_SG.properties deleted file mode 100644 index f47210cd6..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_SG.properties +++ /dev/null @@ -1,3 +0,0 @@ -TO_BE=TO_BE zh_SG -NOT_TO_BE=NOT_TO_BE zh_SG -IS_NOT_SAME=IS_NOT_SAME zh_SG diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_TW.properties b/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_TW.properties deleted file mode 100644 index 64fcd5ca9..000000000 --- a/core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/resources/ch/tutteli/atrium/translations/DescriptionAnyAssertion_zh_TW.properties +++ /dev/null @@ -1,3 +0,0 @@ -IS_NOT_SAME=IS_NOT_SAME zh_TW -TO_BE=TO_BE zh_TW -NOT_TO_BE=NOT_TO_BE zh_TW diff --git a/core/robstoll/atrium-core-robstoll-common/build.gradle b/core/robstoll/atrium-core-robstoll-common/build.gradle deleted file mode 100644 index 5a8447ec3..000000000 --- a/core/robstoll/atrium-core-robstoll-common/build.gradle +++ /dev/null @@ -1,6 +0,0 @@ -description = 'robstoll\'s implementation of the core of Atrium as common module.' - -dependencies { - api prefixedProject('core-api-common') - implementation prefixedProject('core-robstoll-lib-common') -} diff --git a/core/robstoll/atrium-core-robstoll-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/CoreFactoryCommonImpl.kt b/core/robstoll/atrium-core-robstoll-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/CoreFactoryCommonImpl.kt deleted file mode 100644 index 76f961222..000000000 --- a/core/robstoll/atrium-core-robstoll-common/src/main/kotlin/ch/tutteli/atrium/core/robstoll/CoreFactoryCommonImpl.kt +++ /dev/null @@ -1,142 +0,0 @@ -//TODO remove with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll - -import ch.tutteli.atrium.assertions.BulletPointIdentifier -import ch.tutteli.atrium.core.CoreFactoryCommon -import ch.tutteli.atrium.core.robstoll.lib.reporting.* -import ch.tutteli.atrium.core.robstoll.lib.reporting.translating.CoroutineBasedLocaleOrderDecider -import ch.tutteli.atrium.core.robstoll.lib.reporting.translating.TranslationSupplierBasedTranslator -import ch.tutteli.atrium.reporting.* -import ch.tutteli.atrium.reporting.translating.Locale -import ch.tutteli.atrium.reporting.translating.LocaleOrderDecider -import ch.tutteli.atrium.reporting.translating.TranslationSupplier -import ch.tutteli.atrium.reporting.translating.Translator -import kotlin.reflect.KClass - -/** - * Robstoll's `abstract factory` for atrium-core. - */ -abstract class CoreFactoryCommonImpl : CoreFactoryCommon { - - final override fun newMethodCallFormatter(): MethodCallFormatter = TextMethodCallFormatter - - final override fun newTranslator( - translationSupplier: TranslationSupplier, - localeOrderDecider: LocaleOrderDecider, - primaryLocale: Locale, - fallbackLocales: List - ): Translator = TranslationSupplierBasedTranslator( - translationSupplier, localeOrderDecider, primaryLocale, fallbackLocales - ) - - final override fun newLocaleOrderDecider(): LocaleOrderDecider = CoroutineBasedLocaleOrderDecider() - - final override fun newDetailedObjectFormatter(translator: Translator): ObjectFormatter = - DetailedObjectFormatter(translator) - - final override fun newAssertionFormatterController(): AssertionFormatterController = - AssertionFormatterControllerImpl() - - final override fun newAssertionFormatterFacade( - assertionFormatterController: AssertionFormatterController - ): AssertionFormatterFacade = AssertionFormatterControllerBasedFacade(assertionFormatterController) - - final override fun newTextSameLineAssertionPairFormatter( - objectFormatter: ObjectFormatter, translator: Translator - ): AssertionPairFormatter = TextSameLineAssertionPairFormatter(objectFormatter, translator) - - final override fun newTextNextLineAssertionPairFormatter( - objectFormatter: ObjectFormatter, translator: Translator - ): AssertionPairFormatter = TextNextLineAssertionPairFormatter(objectFormatter, translator) - - final override fun newTextFallbackAssertionFormatter( - bulletPoints: Map, String>, - assertionFormatterController: AssertionFormatterController, - objectFormatter: ObjectFormatter, translator: Translator - ): AssertionFormatter = TextFallbackAssertionFormatter( - bulletPoints, - assertionFormatterController, - newTextSameLineAssertionPairFormatter(objectFormatter, translator), - objectFormatter - ) - - final override fun newTextFeatureAssertionGroupFormatter( - bulletPoints: Map, String>, - assertionFormatterController: AssertionFormatterController, - objectFormatter: ObjectFormatter, translator: Translator - ): AssertionFormatter = TextFeatureAssertionGroupFormatter( - bulletPoints, - assertionFormatterController, - newTextSameLineAssertionPairFormatter(objectFormatter, translator) - ) - - final override fun newTextListAssertionGroupFormatter( - bulletPoints: Map, String>, - assertionFormatterController: AssertionFormatterController, - objectFormatter: ObjectFormatter, translator: Translator - ): AssertionFormatter = TextListAssertionGroupFormatter( - bulletPoints, - assertionFormatterController, - newTextSameLineAssertionPairFormatter(objectFormatter, translator) - ) - - final override fun newTextSummaryAssertionGroupFormatter( - bulletPoints: Map, String>, - assertionFormatterController: AssertionFormatterController, - objectFormatter: ObjectFormatter, - translator: Translator - ): AssertionFormatter = TextSummaryAssertionGroupFormatter( - bulletPoints, - assertionFormatterController, - newTextSameLineAssertionPairFormatter(objectFormatter, translator) - ) - - final override fun newTextExplanatoryAssertionGroupFormatter( - bulletPoints: Map, String>, - assertionFormatterController: AssertionFormatterController - ): AssertionFormatter = TextExplanatoryAssertionGroupFormatter(bulletPoints, assertionFormatterController) - - final override fun registerTextAssertionFormatterCapabilities( - bulletPoints: Map, String>, - assertionFormatterFacade: AssertionFormatterFacade, - textAssertionPairFormatter: AssertionPairFormatter, - objectFormatter: ObjectFormatter, - translator: Translator - ) { - assertionFormatterFacade.register { - TextListAssertionGroupFormatter(bulletPoints, it, textAssertionPairFormatter) - } - assertionFormatterFacade.register { - TextFeatureAssertionGroupFormatter(bulletPoints, it, textAssertionPairFormatter) - } - assertionFormatterFacade.register { - TextExplanatoryAssertionGroupFormatter(bulletPoints, it) - } - assertionFormatterFacade.register { - TextSummaryAssertionGroupFormatter(bulletPoints, it, textAssertionPairFormatter) - } - assertionFormatterFacade.register { - TextFallbackAssertionFormatter(bulletPoints, it, textAssertionPairFormatter, objectFormatter) - } - } - - final override fun newOnlyFailureReporter( - assertionFormatterFacade: AssertionFormatterFacade, - atriumErrorAdjuster: AtriumErrorAdjuster - ): Reporter = OnlyFailureReporter(assertionFormatterFacade, atriumErrorAdjuster) - - final override fun newNoOpAtriumErrorAdjuster(): AtriumErrorAdjuster = NoOpAtriumErrorAdjuster - - final override fun newRemoveRunnerAtriumErrorAdjuster(): AtriumErrorAdjuster = RemoveRunnerAtriumErrorAdjuster() - - final override fun newRemoveAtriumFromAtriumErrorAdjuster(): AtriumErrorAdjuster = - RemoveAtriumFromAtriumErrorAdjuster() - - final override fun newMultiAtriumErrorAdjuster( - firstAdjuster: AtriumErrorAdjuster, - secondAdjuster: AtriumErrorAdjuster, - otherAdjusters: List - ): AtriumErrorAdjuster = MultiAtriumErrorAdjusterImpl(firstAdjuster, secondAdjuster, otherAdjusters) -} diff --git a/core/robstoll/atrium-core-robstoll-js/build.gradle b/core/robstoll/atrium-core-robstoll-js/build.gradle deleted file mode 100644 index 874c3bb3f..000000000 --- a/core/robstoll/atrium-core-robstoll-js/build.gradle +++ /dev/null @@ -1,6 +0,0 @@ -description = 'robstoll\'s implementation of the core of Atrium for the JS platform.' - -dependencies { - api prefixedProject('core-api-js') - implementation prefixedProject('core-robstoll-lib-js') -} diff --git a/core/robstoll/atrium-core-robstoll-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/CoreFactoryImpl.kt b/core/robstoll/atrium-core-robstoll-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/CoreFactoryImpl.kt deleted file mode 100644 index 265a963ff..000000000 --- a/core/robstoll/atrium-core-robstoll-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/CoreFactoryImpl.kt +++ /dev/null @@ -1,5 +0,0 @@ -package ch.tutteli.atrium.core.robstoll - -import ch.tutteli.atrium.core.CoreFactory - -class CoreFactoryImpl : CoreFactoryCommonImpl(), CoreFactory diff --git a/core/robstoll/atrium-core-robstoll-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/dependOnMe.kt b/core/robstoll/atrium-core-robstoll-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/dependOnMe.kt deleted file mode 100644 index a2978af1f..000000000 --- a/core/robstoll/atrium-core-robstoll-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/dependOnMe.kt +++ /dev/null @@ -1,9 +0,0 @@ -package ch.tutteli.atrium.core.robstoll - -/** - * Dummy function in order that other modules can define a dependency on atrium-core-robstoll-js - */ -@Suppress("FunctionName") -//TODO 0.17.0 deprecated if core-robstoll is deprecated -fun dependOn_atrium_core_robstoll() { -} diff --git a/core/robstoll/atrium-core-robstoll-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/registerServices.kt b/core/robstoll/atrium-core-robstoll-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/registerServices.kt deleted file mode 100644 index 43f4daced..000000000 --- a/core/robstoll/atrium-core-robstoll-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/registerServices.kt +++ /dev/null @@ -1,11 +0,0 @@ -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.core.robstoll - -import ch.tutteli.atrium.core.polyfills.registerService - -@Suppress("unused" /* here in order that the code is executed when module is loaded */) -private val register = run { - - registerService { ch.tutteli.atrium.core.robstoll.CoreFactoryImpl() } -} diff --git a/core/robstoll/atrium-core-robstoll-jvm/build.gradle b/core/robstoll/atrium-core-robstoll-jvm/build.gradle deleted file mode 100644 index c30ae1e0e..000000000 --- a/core/robstoll/atrium-core-robstoll-jvm/build.gradle +++ /dev/null @@ -1,6 +0,0 @@ -description = 'robstoll\'s implementation of the core of Atrium for the JVM platform.' - -dependencies { - api prefixedProject('core-api-jvm') - implementation prefixedProject('core-robstoll-lib-jvm') -} diff --git a/core/robstoll/atrium-core-robstoll-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/CoreFactoryImpl.kt b/core/robstoll/atrium-core-robstoll-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/CoreFactoryImpl.kt deleted file mode 100644 index 95e53bc50..000000000 --- a/core/robstoll/atrium-core-robstoll-jvm/src/main/kotlin/ch/tutteli/atrium/core/robstoll/CoreFactoryImpl.kt +++ /dev/null @@ -1,22 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress( - "DEPRECATION", - // TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed - "JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" -) - -package ch.tutteli.atrium.core.robstoll - -import ch.tutteli.atrium.core.CoreFactory -import ch.tutteli.atrium.core.robstoll.lib.reporting.translating.PropertiesPerEntityAndLocaleTranslationSupplier -import ch.tutteli.atrium.reporting.AssertionFormatterFacade -import ch.tutteli.atrium.reporting.Reporter -import ch.tutteli.atrium.reporting.translating.TranslationSupplier - -class CoreFactoryImpl : CoreFactoryCommonImpl(), CoreFactory { - override fun newOnlyFailureReporter(assertionFormatterFacade: AssertionFormatterFacade): Reporter = - newOnlyFailureReporter(assertionFormatterFacade, newNoOpAtriumErrorAdjuster()) - - override fun newPropertiesBasedTranslationSupplier(): TranslationSupplier = - PropertiesPerEntityAndLocaleTranslationSupplier() -} diff --git a/core/robstoll/atrium-core-robstoll-jvm/src/main/resources/META-INF/services/ch.tutteli.atrium.core.CoreFactory b/core/robstoll/atrium-core-robstoll-jvm/src/main/resources/META-INF/services/ch.tutteli.atrium.core.CoreFactory deleted file mode 100644 index ffe3da1d6..000000000 --- a/core/robstoll/atrium-core-robstoll-jvm/src/main/resources/META-INF/services/ch.tutteli.atrium.core.CoreFactory +++ /dev/null @@ -1 +0,0 @@ -ch.tutteli.atrium.core.robstoll.CoreFactoryImpl diff --git a/core/robstoll/atrium-core-robstoll-jvm/src/module/module-info.java b/core/robstoll/atrium-core-robstoll-jvm/src/module/module-info.java deleted file mode 100644 index 5c43f4518..000000000 --- a/core/robstoll/atrium-core-robstoll-jvm/src/module/module-info.java +++ /dev/null @@ -1,10 +0,0 @@ -module ch.tutteli.atrium.core.robstoll { - requires transitive ch.tutteli.atrium.core.api; - requires ch.tutteli.atrium.core.robstoll.lib; - requires kotlin.stdlib; - - exports ch.tutteli.atrium.core.robstoll; - - provides ch.tutteli.atrium.core.CoreFactory - with ch.tutteli.atrium.core.robstoll.CoreFactoryImpl; -} diff --git a/gradle/scripts/gh-pages.gradle b/gradle/scripts/gh-pages.gradle index 96fd5f45d..819d7d8e5 100644 --- a/gradle/scripts/gh-pages.gradle +++ b/gradle/scripts/gh-pages.gradle @@ -67,8 +67,6 @@ dokka { [ "ch.tutteli.atrium.api.verbs.internal", - //TODO remove the below with 0.17.0 - "ch.tutteli.atrium.domain.builders.reporting.impl", //TODO remove with 0.18.0 "ch.tutteli.atrium.assertions.builders.impl", diff --git a/logic/atrium-logic-common/build.gradle b/logic/atrium-logic-common/build.gradle index 9b851ede2..ac3dcc0c8 100644 --- a/logic/atrium-logic-common/build.gradle +++ b/logic/atrium-logic-common/build.gradle @@ -1,7 +1,7 @@ description = 'The domain logic of Atrium as common module.' dependencies { - api prefixedProject('domain-builders-common') + api prefixedProject('core-api-common') // it is up to the consumer which atrium-translations module is used at runtime compileOnly prefixedProject('translations-en_GB-common') diff --git a/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/creators/IterableLikeContainsAssertions.kt b/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/creators/IterableLikeContainsAssertions.kt index e3d5cda67..cdce9722d 100644 --- a/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/creators/IterableLikeContainsAssertions.kt +++ b/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/creators/IterableLikeContainsAssertions.kt @@ -12,7 +12,7 @@ import ch.tutteli.atrium.logic.creating.typeutils.IterableLike /** * Defines the minimum set of `contains` assertion functions for [Iterable], - * which an implementation of the domain of Atrium has to provide. + * which an implementation of the domain logic of Atrium has to provide. */ interface IterableLikeContainsAssertions { diff --git a/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/creators/IterableLikeContainsInAnyOrderAssertions.kt b/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/creators/IterableLikeContainsInAnyOrderAssertions.kt index 7f9c6fe8b..ccec4a02f 100644 --- a/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/creators/IterableLikeContainsInAnyOrderAssertions.kt +++ b/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/creators/IterableLikeContainsInAnyOrderAssertions.kt @@ -10,7 +10,7 @@ import ch.tutteli.atrium.logic.creating.typeutils.IterableLike /** * Defines the minimum set of `contains` assertion functions for [Iterable], - * which an implementation of the domain of Atrium has to provide. + * which an implementation of the domain logic of Atrium has to provide. */ interface IterableLikeContainsInAnyOrderAssertions { diff --git a/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/creators/MapLikeContainsAssertions.kt b/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/creators/MapLikeContainsAssertions.kt index 6f8ac3517..4f23c0900 100644 --- a/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/creators/MapLikeContainsAssertions.kt +++ b/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/creators/MapLikeContainsAssertions.kt @@ -13,7 +13,7 @@ import kotlin.reflect.KClass /** * Defines the minimum set of `contains` assertion functions for [Iterable], - * which an implementation of the domain of Atrium has to provide. + * which an implementation of the domain logic of Atrium has to provide. */ interface MapLikeContainsAssertions { diff --git a/logic/atrium-logic-js/build.gradle b/logic/atrium-logic-js/build.gradle index 617cff120..26a80844b 100644 --- a/logic/atrium-logic-js/build.gradle +++ b/logic/atrium-logic-js/build.gradle @@ -1,7 +1,7 @@ description = 'The domain logic of Atrium for the JS platform.' dependencies { - api prefixedProject('domain-builders-js') + api prefixedProject('core-api-js') // it is up to the consumer which atrium-translations module is used at runtime compileOnly prefixedProject('translations-en_GB-js') diff --git a/logic/atrium-logic-jvm/build.gradle b/logic/atrium-logic-jvm/build.gradle index fdbafa8e1..d838153ec 100644 --- a/logic/atrium-logic-jvm/build.gradle +++ b/logic/atrium-logic-jvm/build.gradle @@ -1,7 +1,7 @@ description = 'The domain logic of Atrium for the JVM platform.' dependencies { - api prefixedProject('domain-builders-jvm') + api prefixedProject('core-api-jvm') implementation niok() diff --git a/logic/atrium-logic-jvm/src/module/module-info.java b/logic/atrium-logic-jvm/src/module/module-info.java index 2293a3043..1613a11e0 100644 --- a/logic/atrium-logic-jvm/src/module/module-info.java +++ b/logic/atrium-logic-jvm/src/module/module-info.java @@ -1,5 +1,5 @@ module ch.tutteli.atrium.logic { - requires ch.tutteli.atrium.domain.builders; + requires ch.tutteli.atrium.core.api; requires ch.tutteli.niok; requires kotlin.stdlib; diff --git a/misc/deprecated/domain/api/atrium-domain-api-common/build.gradle b/misc/deprecated/domain/api/atrium-domain-api-common/build.gradle deleted file mode 100644 index fd13ecf47..000000000 --- a/misc/deprecated/domain/api/atrium-domain-api-common/build.gradle +++ /dev/null @@ -1,8 +0,0 @@ -description = 'API of the domain of Atrium as common module.' - -dependencies { - api prefixedProject('core-api-common') - - // it is up to the consumer of atrium-domain-api which atrium-translations module is used at runtime - compileOnly prefixedProject('translations-en_GB-common') -} diff --git a/misc/deprecated/domain/api/atrium-domain-api-common/src/main/kotlin/ch/tutteli/atrium/domain/creating/NewFeatureAssertions.kt b/misc/deprecated/domain/api/atrium-domain-api-common/src/main/kotlin/ch/tutteli/atrium/domain/creating/NewFeatureAssertions.kt deleted file mode 100644 index 26a09521d..000000000 --- a/misc/deprecated/domain/api/atrium-domain-api-common/src/main/kotlin/ch/tutteli/atrium/domain/creating/NewFeatureAssertions.kt +++ /dev/null @@ -1,27 +0,0 @@ -//TODO remove file with 1.0.0 -@file:Suppress("DEPRECATION") -package ch.tutteli.atrium.domain.creating - -import ch.tutteli.atrium.core.None -import ch.tutteli.atrium.core.Option -import ch.tutteli.atrium.core.Some -import ch.tutteli.atrium.reporting.translating.Translatable -import ch.tutteli.atrium.reporting.translating.Untranslatable - -/** - * Represents an extracted feature of type [T] defined by the given [maybeSubject] including a [description] - * and a [representation] - * - * @property description Will be used in reporting to describe the feature extraction - e.g. the name of a property, - * a method call etc. - * @property representation The representation of the feature, in most cases the value behind the feature. - * @property maybeSubject The feature as such where it is [Some] in case the extraction was successful or [None] if it - * was not. - */ -@Deprecated("Use MetaFeature from atrium-logic; will be removed with 0.17.0") -data class MetaFeature(val description: Translatable, val representation: Any?, val maybeSubject: Option) { - constructor(description: String, representation: Any?, maybeSubject: Option) : - this(Untranslatable(description), representation, maybeSubject) - - constructor(description: String, subject: T) : this(description, subject, Some(subject)) -} diff --git a/misc/deprecated/domain/api/atrium-domain-api-common/src/main/kotlin/ch/tutteli/atrium/domain/creating/collectors/AssertionCollector.kt b/misc/deprecated/domain/api/atrium-domain-api-common/src/main/kotlin/ch/tutteli/atrium/domain/creating/collectors/AssertionCollector.kt deleted file mode 100644 index 46476e209..000000000 --- a/misc/deprecated/domain/api/atrium-domain-api-common/src/main/kotlin/ch/tutteli/atrium/domain/creating/collectors/AssertionCollector.kt +++ /dev/null @@ -1,80 +0,0 @@ -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.creating.collectors - -import ch.tutteli.atrium.assertions.Assertion -import ch.tutteli.atrium.assertions.AssertionGroup -import ch.tutteli.atrium.assertions.InvisibleAssertionGroupType -import ch.tutteli.atrium.core.None -import ch.tutteli.atrium.core.Option -import ch.tutteli.atrium.core.Some -import ch.tutteli.atrium.core.polyfills.loadSingleService -import ch.tutteli.atrium.creating.Expect - -/** - * The access point to an implementation of [AssertionCollector]. - * - * It loads the implementation lazily via [loadSingleService]. - */ -@Deprecated( - "Use one of the utility functions: collectBasedOnSubject/collectForCompositionBasedOnSubject from atrium-logic; will be removed with 0.17.0", - ReplaceWith("container.assertionCollector", "ch.tutteli.atrium.logic.creating.collectors.assertionCollector") -) -val assertionCollector: AssertionCollector by lazy { loadSingleService(AssertionCollector::class) } - -/** - * Responsible to collect assertions made in an `assertionCreator`-lambda. - */ -@Deprecated("Use one of the utility functions: collectBasedOnSubject/collectForCompositionBasedOnSubject from atrium-logic; will be removed with 0.17.0") -interface AssertionCollector { - - /** - * Uses the [Expect.maybeSubject] and delegates to the other overload. - * - * See the other overload for more information. - */ - @Deprecated( - "Use collect from atrium-logic; will be removed with 0.17.0", - ReplaceWith("_logic.collect(assertionCreator)") - ) - fun collect( - expect: Expect, - assertionCreator: Expect.() -> Unit - ): Assertion = collect(expect.maybeSubject, assertionCreator) - - /** - * Use this function if you want to make [Assertion]s about a feature or you perform a type transformation or any - * other action which results in an assertion container being created and - * you do not require this resulting container. - * - * Or in other words, you do not want to make further assertions about the resulting subject in the resulting sub - * assertion container. - * - * @param maybeSubject Either [Some] wrapping the subject of the current assertion or - * [None] in case a previous subject change was not successful - used as subject for the given [assertionCreator]. - * @param assertionCreator A lambda which defines the assertions for the feature. - * - * @return The collected assertions as an [AssertionGroup] with an [InvisibleAssertionGroupType]. - * - * @throws IllegalArgumentException in case the given [assertionCreator] did not create a single - * assertion. - */ - @Deprecated("Use collectBasedOnSubject from atrium-logic; will be removed with 0.17.0") - fun collect(maybeSubject: Option, assertionCreator: Expect.() -> Unit): Assertion - - - /** - * Use this function if you want to collect [Assertion]s and use it as part of an [AssertionGroup]. - * - * @param maybeSubject Either [Some] wrapping the subject of the current assertion or - * [None] in case a previous subject change was not successful - used as subject for the given [assertionCreator]. - * @param assertionCreator A lambda which defines the assertions for the feature. - * - * @return The collected assertions as a `List<[Assertion]>`. - * - * @throws IllegalArgumentException in case the given [assertionCreator] did not create a single - * assertion. - */ - @Deprecated("Use collectForCompositionBasedOnSubject from atrium-logic; will be removed with 0.17.0") - fun collectForComposition(maybeSubject: Option, assertionCreator: Expect.() -> Unit): List -} diff --git a/misc/deprecated/domain/api/atrium-domain-api-js/build.gradle b/misc/deprecated/domain/api/atrium-domain-api-js/build.gradle deleted file mode 100644 index 835956f0b..000000000 --- a/misc/deprecated/domain/api/atrium-domain-api-js/build.gradle +++ /dev/null @@ -1,8 +0,0 @@ -description = 'API of the domain of Atrium for the JS platform.' - -dependencies { - api prefixedProject('core-api-js') - - // it is up to the consumer of atrium-domain-api which atrium-translations module is used at runtime - compileOnly prefixedProject('translations-en_GB-js') -} diff --git a/misc/deprecated/domain/api/atrium-domain-api-jvm/build.gradle b/misc/deprecated/domain/api/atrium-domain-api-jvm/build.gradle deleted file mode 100644 index 9b44db3b9..000000000 --- a/misc/deprecated/domain/api/atrium-domain-api-jvm/build.gradle +++ /dev/null @@ -1,8 +0,0 @@ -description = 'API of the domain of Atrium for the JVM platform.' - -dependencies { - api prefixedProject('core-api-jvm') - - // it is up to the consumer of atrium-domain-api which atrium-translations module is used at runtime - compileOnly prefixedProject('translations-en_GB-jvm') -} diff --git a/misc/deprecated/domain/api/atrium-domain-api-jvm/src/module/module-info.java b/misc/deprecated/domain/api/atrium-domain-api-jvm/src/module/module-info.java deleted file mode 100644 index 3432648a8..000000000 --- a/misc/deprecated/domain/api/atrium-domain-api-jvm/src/module/module-info.java +++ /dev/null @@ -1,7 +0,0 @@ -module ch.tutteli.atrium.domain.api { - requires transitive ch.tutteli.atrium.core.api; - requires kotlin.stdlib; - - exports ch.tutteli.atrium.domain.creating; - exports ch.tutteli.atrium.domain.creating.collectors; -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/build.gradle b/misc/deprecated/domain/builders/atrium-domain-builders-common/build.gradle deleted file mode 100644 index 0b26b5001..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/build.gradle +++ /dev/null @@ -1,11 +0,0 @@ -description = 'Contains base classes for sophisticated assertion builders which can be re-used in APIs as common module' - -dependencies { - api prefixedProject('domain-api-common') - - // it is up to the consumer of atrium-domain-builders which atrium-translations module is used at runtime - compileOnly prefixedProject('translations-en_GB-common') - - testImplementation prefixedProject('api-fluent-en_GB-common') - testImplementation prefixedProject('specs-common') -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/creating/NewFeatureAssertionsBuilder.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/creating/NewFeatureAssertionsBuilder.kt deleted file mode 100644 index 8163cdbe1..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/creating/NewFeatureAssertionsBuilder.kt +++ /dev/null @@ -1,230 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION", "OVERRIDE_BY_INLINE", "NOTHING_TO_INLINE", "DeprecatedCallableAddReplaceWith") - -package ch.tutteli.atrium.domain.builders.creating - -import ch.tutteli.atrium.core.coreFactory -import ch.tutteli.atrium.creating.Expect -import ch.tutteli.atrium.domain.creating.MetaFeature -import ch.tutteli.atrium.reporting.MethodCallFormatter -import ch.tutteli.atrium.reporting.Reporter -import kotlin.reflect.* - - -/** - * Helper class to circumvent overload bugs and KFunction bugs incorporated in Kotlin -- use [f] and in case you run - * into an overload ambiguity, then either [p] (for property) or one of the `fN` functions (e.g. [f2] for - * a function which expects 2 arguments). - */ -@Deprecated("Use the MetaFeatureOption of your API; will be removed with 0.17.0") -class MetaFeatureOption(private val expect: Expect) { - - /** - * Creates a [MetaFeature] for the given [property] => use [p] in case of ambiguity issues. - * - * Notice for assertion function writers: you should use [ExpectImpl].[feature][ExpectImpl.feature] and pass a - * class reference instead of using this convenience function (e.g. `ExpectImpl.feature(List::size)`). - * This way we are always able to report the property, even if the subject is not defined which occurs if a - * previous transformation of the subject could not be carried out. - */ - @Deprecated("Use the MetaFeatureOption of your API; will be removed with 0.17.0") - fun f(property: KProperty0): MetaFeature = p(property) - - //@formatter:off - /** - * Creates a [MetaFeature] for the given function [f] without arguments => use [f0] in case of - * ambiguity issues. - * - * Notice for assertion function writers: you should use [ExpectImpl].[feature][ExpectImpl.feature] and pass a - * class reference instead of using this convenience function (e.g. `ExpectImpl.feature(MyClass::fun)`). - * This way we are always able to report the function name, even if the subject is not defined which occurs if a - * previous transformation of the subject could not be carried out. - */ - @Deprecated("Use the MetaFeatureOption of your API; will be removed with 0.17.0") - fun f(f: KFunction0): MetaFeature = - f0(f) - - /** - * Creates a [MetaFeature] for the given function [f] which expects 1 argument => use [f1] in case of - * ambiguity issues. - * - * Notice for assertion function writers: you should use [ExpectImpl].[feature][ExpectImpl.feature] and pass a - * class reference instead of using this convenience function (e.g. `ExpectImpl.feature(MyClass::fun, ...)`). - * This way we are always able to report the function name, even if the subject is not defined which occurs if a - * previous transformation of the subject could not be carried out. - */ - @Deprecated("Use the MetaFeatureOption of your API; will be removed with 0.17.0") - fun f(f: KFunction1, a1: A1): MetaFeature = - f1(f, a1) - - /** - * Creates a [MetaFeature] for the given function [f] which expects 2 arguments => use [f2] in case of - * ambiguity issues. - * - * Notice for assertion function writers: you should use [ExpectImpl].[feature][ExpectImpl.feature] and pass a - * class reference instead of using this convenience function (e.g. `ExpectImpl.feature(MyClass::fun, ...)`). - * This way we are always able to report the function name, even if the subject is not defined which occurs if a - * previous transformation of the subject could not be carried out. - */ - @Deprecated("Use the MetaFeatureOption of your API; will be removed with 0.17.0") - fun f(f: KFunction2, a1: A1, a2: A2): MetaFeature = - f2(f, a1, a2) - - /** - * Creates a [MetaFeature] for the given function [f] which expects 3 arguments => use [f3] in case of - * ambiguity issues. - * - * Notice for assertion function writers: you should use [ExpectImpl].[feature][ExpectImpl.feature] and pass a - * class reference instead of using this convenience function (e.g. `ExpectImpl.feature(MyClass::fun, ...)`). - * This way we are always able to report the function name, even if the subject is not defined which occurs if a - * previous transformation of the subject could not be carried out. - */ - @Deprecated("Use the MetaFeatureOption of your API; will be removed with 0.17.0") - fun f(f: KFunction3, a1: A1, a2: A2, a3: A3): MetaFeature = - f3(f, a1, a2, a3) - - /** - * Creates a [MetaFeature] for the given function [f] which expects 4 arguments => use [f4] in case of - * ambiguity issues. - * - * Notice for assertion function writers: you should use [ExpectImpl].[feature][ExpectImpl.feature] and pass a - * class reference instead of using this convenience function (e.g. `ExpectImpl.feature(MyClass::fun, ...)`). - * This way we are always able to report the function name, even if the subject is not defined which occurs if a - * previous transformation of the subject could not be carried out. - */ - @Deprecated("Use the MetaFeatureOption of your API; will be removed with 0.17.0") - fun f(f: KFunction4, a1: A1, a2: A2, a3: A3, a4: A4): MetaFeature = - f4(f, a1, a2, a3, a4) - - /** - * Creates a [MetaFeature] for the given function [f] which expects 5 arguments => use [f5] in case of - * ambiguity issues. - * - * Notice for assertion function writers: you should use [ExpectImpl].[feature][ExpectImpl.feature] and pass a - * class reference instead of using this convenience function (e.g. `ExpectImpl.feature(MyClass::fun, ...)`). - * This way we are always able to report the function name, even if the subject is not defined which occurs if a - * previous transformation of the subject could not be carried out. - */ - @Deprecated("Use the MetaFeatureOption of your API; will be removed with 0.17.0") - fun f(f: KFunction5, a1: A1, a2: A2, a3: A3, a4: A4, a5: A5): MetaFeature = - f5(f, a1, a2, a3, a4, a5) - - //used to distinguish property/functions - - /** - * Creates a [MetaFeature] for the given property [property]. - * - * Notice for assertion function writers: you should use [ExpectImpl].[feature][ExpectImpl.feature] and pass a - * class reference instead of using this convenience function (e.g. `ExpectImpl.feature(List::size)`). - * This way we are always able to report the property, even if the subject is not defined which occurs if a - * previous transformation of the subject could not be carried out. - */ - @Deprecated("Use the MetaFeatureOption of your API; will be removed with 0.17.0") - fun p(property: KProperty0): MetaFeature = - MetaFeatureBuilder.property(property) - - /** - * Creates a [MetaFeature] for the given function [f] without arguments. - * - * Notice for assertion function writers: you should use [ExpectImpl].[feature][ExpectImpl.feature] and pass a - * class reference instead of using this convenience function (e.g. `ExpectImpl.feature(MyClass::fun)`). - * This way we are always able to report the function name, even if the subject is not defined which occurs if a - * previous transformation of the subject could not be carried out. - */ - @Deprecated("Use the MetaFeatureOption of your API; will be removed with 0.17.0") - fun f0(f: KFunction0): MetaFeature = - MetaFeatureBuilder.f0(expect, f) - - /** - * Creates a [MetaFeature] for the given function [f] which expects 1 argument. - * - * Notice for assertion function writers: you should use [ExpectImpl].[feature][ExpectImpl.feature] and pass a - * class reference instead of using this convenience function (e.g. `ExpectImpl.feature(MyClass::fun, ...)`). - * This way we are always able to report the function name, even if the subject is not defined which occurs if a - * previous transformation of the subject could not be carried out. - */ - @Deprecated("Use the MetaFeatureOption of your API; will be removed with 0.17.0") - fun f1(f: KFunction1, a1: A1): MetaFeature = - MetaFeatureBuilder.f1(expect, f, a1) - - /** - * Creates a [MetaFeature] for the given function [f] which expects 2 arguments. - * - * Notice for assertion function writers: you should use [ExpectImpl].[feature][ExpectImpl.feature] and pass a - * class reference instead of using this convenience function (e.g. `ExpectImpl.feature(MyClass::fun, ...)`). - * This way we are always able to report the function name, even if the subject is not defined which occurs if a - * previous transformation of the subject could not be carried out. - */ - @Deprecated("Use the MetaFeatureOption of your API; will be removed with 0.17.0") - fun f2(f: KFunction2, a1: A1, a2: A2): MetaFeature = - MetaFeatureBuilder.f2(expect, f, a1, a2) - - /** - * Creates a [MetaFeature] for the given function [f] which expects 3 arguments. - * - * Notice for assertion function writers: you should use [ExpectImpl].[feature][ExpectImpl.feature] and pass a - * class reference instead of using this convenience function (e.g. `ExpectImpl.feature(MyClass::fun, ...)`). - * This way we are always able to report the function name, even if the subject is not defined which occurs if a - * previous transformation of the subject could not be carried out. - */ - @Deprecated("Use the MetaFeatureOption of your API; will be removed with 0.17.0") - fun f3(f: KFunction3, a1: A1, a2: A2, a3: A3): MetaFeature = - MetaFeatureBuilder.f3(expect, f, a1, a2, a3) - - /** - * Creates a [MetaFeature] for the given function [f] which expects 4 arguments. - * - * Notice for assertion function writers: you should use [ExpectImpl].[feature][ExpectImpl.feature] and pass a - * class reference instead of using this convenience function (e.g. `ExpectImpl.feature(MyClass::fun, ...)`). - * This way we are always able to report the function name, even if the subject is not defined which occurs if a - * previous transformation of the subject could not be carried out. - */ - @Deprecated("Use the MetaFeatureOption of your API; will be removed with 0.17.0") - fun f4(f: KFunction4, a1: A1, a2: A2, a3: A3, a4: A4): MetaFeature = - MetaFeatureBuilder.f4(expect, f, a1, a2, a3, a4) - - /** - * Creates a [MetaFeature] for the given function [f] which expects 5 arguments. - * - * Notice for assertion function writers: you should use [ExpectImpl].[feature][ExpectImpl.feature] and pass a - * class reference instead of using this convenience function (e.g. `ExpectImpl.feature(MyClass::fun, ...)`). - * This way we are always able to report the function name, even if the subject is not defined which occurs if a - * previous transformation of the subject could not be carried out. - */ - @Deprecated("Use the MetaFeatureOption of your API; will be removed with 0.17.0") - fun f5(f: KFunction5, a1: A1, a2: A2, a3: A3, a4: A4, a5: A5): MetaFeature = - MetaFeatureBuilder.f5(expect, f, a1, a2, a3, a4, a5) - - //@formatter:on -} - -/** - * Builder which helps to create [MetaFeature] inter alia by using the [MethodCallFormatter] defined initially by the - * [Reporter] - */ -@Suppress("UNUSED_PARAMETER" /* we will need it as soon as methodCallFormatter is taken from the specified Reporter */) -@Deprecated("Will be removed with 0.17.0 without replacement") -object MetaFeatureBuilder { - - fun property(property: KProperty0) = MetaFeature(property.name, property.invoke()) - - //@formatter:off - fun f0(expect: Expect<*>, f: KFunction0) = - MetaFeature(coreFactory.newMethodCallFormatter().formatCall(f.name, arrayOf()), f.invoke()) - - fun f1(expect: Expect<*>, f: KFunction1, a1: A1) = - MetaFeature(coreFactory.newMethodCallFormatter().formatCall(f.name, arrayOf(a1)), f.invoke(a1)) - - fun f2(expect: Expect<*>, f: KFunction2, a1: A1, a2: A2) = - MetaFeature(coreFactory.newMethodCallFormatter().formatCall(f.name, arrayOf(a1, a2)), f.invoke(a1, a2)) - - fun f3(expect: Expect<*>, f: KFunction3, a1: A1, a2: A2, a3: A3) = - MetaFeature(coreFactory.newMethodCallFormatter().formatCall(f.name, arrayOf(a1, a2, a3)), f.invoke(a1, a2, a3)) - - fun f4(expect: Expect<*>, f: KFunction4, a1: A1, a2: A2, a3: A3, a4: A4) = - MetaFeature(coreFactory.newMethodCallFormatter().formatCall(f.name, arrayOf(a1, a2, a3, a4)), f.invoke(a1, a2, a3, a4)) - - fun f5(expect: Expect<*>, f: KFunction5, a1: A1, a2: A2, a3: A3, a4: A4, a5: A5) = - MetaFeature(coreFactory.newMethodCallFormatter().formatCall(f.name, arrayOf(a1, a2, a3, a4, a5)), f.invoke(a1, a2, a3, a4, a5)) - //@formatter:on -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/creating/PleaseUseReplacementException.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/creating/PleaseUseReplacementException.kt deleted file mode 100644 index 97e446711..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/creating/PleaseUseReplacementException.kt +++ /dev/null @@ -1,15 +0,0 @@ -package ch.tutteli.atrium.domain.builders.creating - -/** - * Indicates a problem which was indicated by a `@Deprecated` annotation but was ignored by you ;-) - */ -@Deprecated( - "Use PleaseUseReplacementException from core; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.creating.PleaseUseReplacementException") -) -class PleaseUseReplacementException -@Deprecated( - "Use PleaseUseReplacementException from core; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.creating.PleaseUseReplacementException(reason)") -) -constructor(reason: String) : Exception(reason) diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/creating/collectors/AssertionOptionExplantoryExtensions.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/creating/collectors/AssertionOptionExplantoryExtensions.kt deleted file mode 100644 index d5ebad7bd..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/creating/collectors/AssertionOptionExplantoryExtensions.kt +++ /dev/null @@ -1,26 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.creating.collectors - -import ch.tutteli.atrium.assertions.AssertionGroup -import ch.tutteli.atrium.assertions.ExplanatoryAssertionGroupType -import ch.tutteli.atrium.assertions.builders.AssertionsOption -import ch.tutteli.atrium.core.Option -import ch.tutteli.atrium.creating.Expect -import ch.tutteli.atrium.domain.creating.collectors.assertionCollector - -/** - * Collects the assertions [assertionCreator] creates and uses them as [AssertionGroup.assertions]. - */ -@Deprecated( - "Use collectAssertions from atrium-logic which requires to pass an instance of an AssertionContainer; will be removed with 0.17.0", - ReplaceWith( - "collectAssertions(container, maybeSubject, assertionCreator)", - "ch.tutteli.atrium.logic.creating.collectors.collectAssertions" - ) -) -fun AssertionsOption.collectAssertions( - maybeSubject: Option, - assertionCreator: Expect.() -> Unit -): R = withAssertions(assertionCollector.collectForComposition(maybeSubject, assertionCreator)) diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AssertionFormatterControllerOption.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AssertionFormatterControllerOption.kt deleted file mode 100644 index a7e68809b..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AssertionFormatterControllerOption.kt +++ /dev/null @@ -1,42 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.core.CoreFactory -import ch.tutteli.atrium.domain.builders.reporting.impl.AssertionFormatterControllerOptionImpl -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.ObjectFormatter -import ch.tutteli.atrium.reporting.translating.Translator - -/** - * Provides options to create an [AssertionFormatterController]. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -interface AssertionFormatterControllerOption { - - /** - * The previously chosen [ObjectFormatter]. - */ - val objectFormatter: ObjectFormatter - - /** - * The previously chosen [Translator]. - */ - val translator: Translator - - /** - * Uses [CoreFactory.newAssertionFormatterController] as [AssertionFormatterController]. - */ - fun withDefaultAssertionFormatterController(): AssertionFormatterFacadeOption - - /** - * Uses the given [assertionFormatterController] as custom [AssertionFormatterController]. - */ - fun withAssertionFormatterController(assertionFormatterController: AssertionFormatterController): AssertionFormatterFacadeOption - - companion object { - fun create(objectFormatter: ObjectFormatter, translator: Translator): AssertionFormatterControllerOption = - AssertionFormatterControllerOptionImpl(objectFormatter, translator) - } -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AssertionFormatterFacadeOption.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AssertionFormatterFacadeOption.kt deleted file mode 100644 index 32fcf62b7..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AssertionFormatterFacadeOption.kt +++ /dev/null @@ -1,52 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.core.CoreFactory -import ch.tutteli.atrium.domain.builders.reporting.impl.AssertionFormatterFacadeOptionImpl -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.AssertionFormatterFacade -import ch.tutteli.atrium.reporting.ObjectFormatter -import ch.tutteli.atrium.reporting.translating.Translator - -/** - * Provides options to create an [AssertionFormatterFacade]. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -interface AssertionFormatterFacadeOption { - - /** - * The previously chosen [AssertionFormatterController] - */ - val assertionFormatterController: AssertionFormatterController - - /** - * The previously chosen [ObjectFormatter] - */ - val objectFormatter: ObjectFormatter - - /** - * The previously chosen [Translator] - */ - val translator: Translator - - /** - * Uses [CoreFactory.newAssertionFormatterFacade] as [AssertionFormatterFacade]. - */ - fun withDefaultAssertionFormatterFacade(): AssertionPairFormatterOption - - /** - * Uses the given [factory] to build a custom [AssertionFormatterFacade]. - */ - fun withAssertionFormatterFacade(factory: (AssertionFormatterController) -> AssertionFormatterFacade): AssertionPairFormatterOption - - companion object { - fun create( - assertionFormatterController: AssertionFormatterController, - objectFormatter: ObjectFormatter, - translator: Translator - ): AssertionFormatterFacadeOption = - AssertionFormatterFacadeOptionImpl(assertionFormatterController, objectFormatter, translator) - } -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AssertionPairFormatterOption.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AssertionPairFormatterOption.kt deleted file mode 100644 index 4000fae78..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AssertionPairFormatterOption.kt +++ /dev/null @@ -1,68 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.core.CoreFactory -import ch.tutteli.atrium.core.coreFactory -import ch.tutteli.atrium.domain.builders.reporting.impl.AssertionPairFormatterOptionImpl -import ch.tutteli.atrium.reporting.AssertionFormatter -import ch.tutteli.atrium.reporting.AssertionFormatterFacade -import ch.tutteli.atrium.reporting.AssertionPairFormatter -import ch.tutteli.atrium.reporting.ObjectFormatter -import ch.tutteli.atrium.reporting.translating.Translator - -/** - * Provides options to create an [AssertionPairFormatter]. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -interface AssertionPairFormatterOption { - - /** - * The so far chosen options which are relevant to create [AssertionFormatter]s. - */ - val options: AssertionFormatterChosenOptions - - /** - * Uses [CoreFactory.newTextSameLineAssertionPairFormatter] as [AssertionPairFormatter]. - */ - fun withTextSameLineAssertionPairFormatter(): TextAssertionFormatterOption = - withTextAssertionPairFormatter(coreFactory::newTextSameLineAssertionPairFormatter) - - /** - * Uses [CoreFactory.newTextNextLineAssertionPairFormatter] as [AssertionPairFormatter]. - */ - fun withTextNextLineAssertionPairFormatter(): TextAssertionFormatterOption = - withTextAssertionPairFormatter(coreFactory::newTextNextLineAssertionPairFormatter) - - /** - * Uses the given [factory] to build a custom [AssertionPairFormatter]. - */ - fun withTextAssertionPairFormatter(factory: (ObjectFormatter, Translator) -> AssertionPairFormatter): TextAssertionFormatterOption - - companion object { - fun create( - assertionFormatterFacade: AssertionFormatterFacade, - objectFormatter: ObjectFormatter, - translator: Translator - ): AssertionPairFormatterOption = create( - AssertionFormatterChosenOptions(assertionFormatterFacade, objectFormatter, translator) - ) - - fun create(options: AssertionFormatterChosenOptions): AssertionPairFormatterOption = - AssertionPairFormatterOptionImpl(options) - } -} - -/** - * Represents the so far chosen options which are relevant to create [AssertionFormatter]s. - * - * @param assertionFormatterFacade The previously chosen [AssertionFormatterFacade] - * @param objectFormatter The previously chosen [ObjectFormatter] - * @param translator The previously chosen [Translator] - */ -data class AssertionFormatterChosenOptions( - val assertionFormatterFacade: AssertionFormatterFacade, - val objectFormatter: ObjectFormatter, - val translator: Translator -) diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AtriumErrorAdjusterCommonOption.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AtriumErrorAdjusterCommonOption.kt deleted file mode 100644 index 8087bf8cd..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AtriumErrorAdjusterCommonOption.kt +++ /dev/null @@ -1,29 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.reporting.AtriumError -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster - -/** - * Provides common options to create an [AtriumErrorAdjuster]. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -interface AtriumErrorAdjusterCommonOption { - - /** - * Uses an [AtriumErrorAdjuster] which removes stackBacktrace frames of test runners from a given [AtriumError]. - */ - fun withRemoveRunnerAtriumErrorAdjuster(): R - - /** - * Uses an [AtriumErrorAdjuster] which removes stackBacktrace frames of Atrium from a given [AtriumError]. - */ - fun withRemoveAtriumFromAtriumErrorAdjuster(): R - - /** - * Uses the given [AtriumErrorAdjuster] as custom [AtriumErrorAdjuster]. - */ - fun withAtriumErrorAdjuster(adjuster: AtriumErrorAdjuster): R -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AtriumErrorAdjusterOption.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AtriumErrorAdjusterOption.kt deleted file mode 100644 index 6e5986af7..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/AtriumErrorAdjusterOption.kt +++ /dev/null @@ -1,101 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.domain.builders.reporting.impl.AtriumErrorAdjusterOptionImpl -import ch.tutteli.atrium.domain.builders.reporting.impl.MultipleAdjustersOptionImpl -import ch.tutteli.atrium.reporting.AssertionFormatterFacade -import ch.tutteli.atrium.reporting.AtriumError -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster -import ch.tutteli.atrium.reporting.Reporter - -/** - * Provides options to create an [AtriumErrorAdjusterOption]. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -interface AtriumErrorAdjusterOption : AtriumErrorAdjusterCommonOption { - - /** - * The previously chosen [AssertionFormatterFacade]. - */ - val assertionFormatterFacade: AssertionFormatterFacade - - /** - * Uses [withMultipleAdjusters] and applies [withRemoveRunnerAtriumErrorAdjuster] - * and [withRemoveAtriumFromAtriumErrorAdjuster] -- the default configuration might change in the future. - */ - fun withDefaultAtriumErrorAdjusters(): ReporterOption = - withMultipleAdjusters { - withRemoveAtriumFromAtriumErrorAdjuster() - withRemoveRunnerAtriumErrorAdjuster() - } - - /** - * Uses an [AtriumErrorAdjuster] which does not adjust a given [AtriumError] but functions as an identity function. - */ - fun withNoOpAtriumErrorAdjuster(): ReporterOption - - - /** - * Uses the [AtriumErrorAdjuster] which are defined via the [configure] lambda. - * - * @throws IllegalArgumentException in case less than two [AtriumErrorAdjuster] are defined. - */ - fun withMultipleAdjusters(configure: MultipleAdjustersOption.() -> Unit): ReporterOption - - @Deprecated( - "Define an AtriumErrorAdjuster or use withDefaultAtriumErrorAdjusters; will be removed latest with 1.0.0", - ReplaceWith("this.withDefaultAtriumErrorAdjusters().withOnlyFailureReporter()") - ) - fun withOnlyFailureReporter(): ReporterBuilderFinalStep - - @Deprecated( - "Define an AtriumErrorAdjuster or use withDefaultAtriumErrorAdjusters; will be removed latest with 1.0.0", - ReplaceWith("this.withDefaultAtriumErrorAdjusters().withCustomReporter(factory)") - ) - fun withCustomReporter(factory: (AssertionFormatterFacade) -> Reporter): ReporterBuilderFinalStep - - - companion object { - fun create(assertionFormatterFacade: AssertionFormatterFacade): AtriumErrorAdjusterOption = - AtriumErrorAdjusterOptionImpl(assertionFormatterFacade) - } -} - -/** - * DSL Marker for [MultipleAdjustersOption] - */ -@DslMarker -annotation class MultipleAdjustersOptionMarker - -/** - * Provides options to combine multiple [AtriumErrorAdjuster]s. - */ -@MultipleAdjustersOptionMarker -interface MultipleAdjustersOption : AtriumErrorAdjusterCommonOption { - - /** - * Uses an [AtriumErrorAdjuster] which removes stack frames of test runners from a given [AtriumError]. - */ - @MultipleAdjustersOptionMarker - override fun withRemoveRunnerAtriumErrorAdjuster() - - /** - * Uses an [AtriumErrorAdjuster] which removes stack frames of Atrium from a given [AtriumError]. - */ - @MultipleAdjustersOptionMarker - override fun withRemoveAtriumFromAtriumErrorAdjuster() - - /** - * Uses the given [AtriumErrorAdjuster] as custom [AtriumErrorAdjuster]. - */ - @MultipleAdjustersOptionMarker - override fun withAtriumErrorAdjuster(adjuster: AtriumErrorAdjuster): Unit - - val adjusters: List - - companion object { - fun create(): MultipleAdjustersOption = MultipleAdjustersOptionImpl() - } -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ExpectBuilder.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ExpectBuilder.kt deleted file mode 100644 index 4d3d436b0..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ExpectBuilder.kt +++ /dev/null @@ -1,278 +0,0 @@ -//TODO remove latest with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.core.* -import ch.tutteli.atrium.creating.* -import ch.tutteli.atrium.domain.builders.reporting.impl.verb.AssertionVerbStepImpl -import ch.tutteli.atrium.domain.builders.reporting.impl.verb.FinalStepImpl -import ch.tutteli.atrium.domain.builders.reporting.impl.verb.OptionsChooserImpl -import ch.tutteli.atrium.domain.builders.reporting.impl.verb.OptionsStepImpl -import ch.tutteli.atrium.reporting.Reporter -import ch.tutteli.atrium.reporting.Text -import ch.tutteli.atrium.reporting.translating.Translatable -import ch.tutteli.atrium.reporting.translating.Untranslatable - -/** - * Defines the contract to create custom assertion verbs, `Expect` respectively. - */ -@Deprecated( - "Use RootExpectBuilder from atrium-logic; will be removed latest with 0.17.0 (maybe earlier)", - ReplaceWith("RootExpectBuilder", "ch.tutteli.atrium.logic.creating.RootExpectBuilder") -) -interface ExpectBuilder { - companion object { - - /** - * Entry point to use the [ExpectBuilder] which helps in creating - * an assertion verb for the given [subject] or in other words an [Expect] for the given [subject]. - */ - @Deprecated( - "Use RootExpectBuilder from atrium-logic; will be removed latest with 0.17.0 (maybe earlier)", - ReplaceWith( - "RootExpectBuilder.forSubject(subject)", - "ch.tutteli.atrium.logic.creating.RootExpectBuilder" - ) - ) - fun forSubject(subject: T): AssertionVerbStep = AssertionVerbStepImpl(Some(subject)) - } - - /** - * Step which allows to specify the assertion verb which shall be used. - * - * @param T the type of the subject. - */ - @Deprecated("Use RootExpectBuilder.ExpectationVerbStep from atrium-logic; will be removed latest with 0.17.0 (maybe earlier)") - interface AssertionVerbStep { - /** - * The previously specified subject of `this` expectation. - */ - val maybeSubject: Option - - /** - * Wraps the given [verb] into an [Untranslatable] and uses it as assertion verb. - */ - fun withVerb(verb: String): OptionsStep = withVerb(Untranslatable(verb)) - - /** - * Uses the given [verb] as assertion verb. - */ - fun withVerb(verb: Translatable): OptionsStep - } - - /** - * Step which allows to override previously defined properties -- such as use a different assertion verb -- but - * also allows to define options where usually a default value is used, such as use a customer [Reporter]. - * - * @param T the type of the subject. - */ - @Deprecated("Use RootExpectBuilder.OptionsStep from atrium-logic; will be removed latest with 0.17.0 (maybe earlier)") - interface OptionsStep { - /** - * The previously specified subject of `this` expectation. - */ - val maybeSubject: Option - - /** - * The previously defined assertion verb. - */ - val assertionVerb: Translatable - - - /** - * Allows to define the [ExpectOptions] via an [OptionsChooser]-lambda which provides convenience functions. - * - * The function usually start with `with...` and are sometimes overloaded to ease the configuration. - */ - fun withOptions(configuration: OptionsChooser.() -> Unit): FinalStep = - withOptions(ExpectOptions(configuration)) - - /** - * Uses the given [expectOptions]. - */ - fun withOptions(expectOptions: ExpectOptions): FinalStep - - /** - * States explicitly that no optional [ExpectOptions] are defined, which means, `build` will create - * a new [Expect] based on the previously defined mandatory options but without any optional options or - * in other words, the default values are used for the optional options. - * - * Use [withOptions] if you want to define optional [ExpectOptions] such as, override the - * verb, define an own representation or use an own [Reporter]. - */ - fun withoutOptions(): FinalStep - - companion object { - @Deprecated( - "Use OptionsStep from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.creating.ExpectBuilder.OptionsStep.create(maybeSubject, assertionVerb)") - ) - fun create( - maybeSubject: Option, - assertionVerb: Translatable - ): OptionsStep = OptionsStepImpl(maybeSubject, assertionVerb) - } - } - - /** - * Helper lambda to specify [ExpectOptions] via convenience methods. - * - * Calling multiple times the same method overrides the previously defined value. - */ - @Deprecated( - "Use RootExpectBuilder.OptionsChooser from atrium-logic; will be removed latest with 0.17.0 (maybe earlier)", - ReplaceWith(" RootExpectBuilder.OptionsChooser", "ch.tutteli.atrium.logic.creating.RootExpectBuilder") - ) - interface OptionsChooser { - - /** - * Wraps the given [verb] into an [Untranslatable] and passes it to the overload - * which expects a [Translatable] -- this is then used as custom assertion verb - * instead of the previously defined verb. - * - */ - fun withVerb(verb: String) { - withVerb(Untranslatable(verb)) - } - - /** - * Uses the given [verb] as assertion verb instead of the previously defined verb. - */ - fun withVerb(verb: Translatable) - - /** - * Wraps the given [textRepresentation] into a [Text] and uses it as representation of the subject - * instead of the representation that has been defined so far (which defaults to the subject itself). - * - * In case [Expect.maybeSubject] is not defined i.e. [None], then the previous representation is used. - */ - fun withRepresentation(textRepresentation: String): Unit = - withRepresentation { Text(textRepresentation) } - - /** - * Uses the given [representationProvider] to retrieve a representation which can be based on the current - * subject where it is used as new representation of the subject - * instead of the representation that has been defined so far (which defaults to the subject itself). - * - * Notice, if you want to use text (a [String] which is treated as raw string in reporting) as representation, - * then wrap it into a [Text] and pass it instead. - * If your text does not include the current subject, then we recommend to use the other overload which expects - * a `String` and does the wrapping for you. - * - * In case [Expect.maybeSubject] is not defined i.e. [None], then the previous representation is used. - */ - fun withRepresentation(representationProvider: (T) -> Any) - - /** - * Uses the given [reporter] instead of the default reporter. - */ - fun withReporter(reporter: Reporter) - - companion object { - @Deprecated( - "Use the helper function OptionsChooser from atrium-logic", - ReplaceWith("RootExpectOptions(configuration)", "ch.tutteli.atrium.logic.creating.RootExpectOptions") - ) - fun createAndBuild(configuration: OptionsChooser.() -> Unit): ExpectOptions = - OptionsChooserImpl().apply(configuration).build() - } - } - - /** - * Final step in the assertion verb building process, creates a new [Expect] based on the so far specified options. - * - * @param T the type of the subject. - */ - @Deprecated("Use RootExpectBuilder.FinalStep from atrium-logic; will be removed latest with 0.17.0 (maybe earlier)") - interface FinalStep { - /** - * The previously specified subject of `this` expectation. - */ - val maybeSubject: Option - - /** - * The previously defined assertion verb. - */ - val assertionVerb: Translatable - - /** - * Either the previously specified [ExpectOptions] or `null`. - */ - val options: ExpectOptions? - - /** - * Creates a new [Expect] based on the previously defined maybeOptions. - */ - fun build(): RootExpect - - companion object { - @Deprecated( - "Use OptionsStep from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.creating.ExpectBuilder.FinalStep.create(maybeSubject, assertionVerb, options)") - ) - fun create( - maybeSubject: Option, - assertionVerb: Translatable, - options: ExpectOptions? - ): FinalStep = FinalStepImpl(maybeSubject, assertionVerb, options) - } - } -} - -/** - * Additional (non-mandatory) options for the [ExpectBuilder] to create an [Expect]. - * - * @property assertionVerb Defines a custom assertion verb if not null. - * @property representationInsteadOfSubject Defines a custom representation based on a present subject if not null. - * @property reporter Defines a custom reporter if not null. - */ -@Deprecated( - "Use RootExpectOptions instead; will be removed latest with 0.17.0 (maybe earlier)", - ReplaceWith( - "RootExpectOptions(assertionVerb, representationInsteadOfSubject, reporter)", - "ch.tutteli.atrium.logic.creating.RootExpectOptions" - ) -) -data class ExpectOptions( - val assertionVerb: Translatable? = null, - val representationInsteadOfSubject: ((T) -> Any)? = null, - val reporter: Reporter? = null -) { - /** - * Merges the given [options] with this object creating a new [ExpectOptions] - * where defined properties in [options] will have precedence over properties defined in this instance. - * - * For instance, this object has defined [representationInsteadOfSubject] (meaning it is not `null`) and - * the given [options] as well, then the resulting [ExpectOptions] will have the - * [representationInsteadOfSubject] of [options]. - */ - fun merge(options: ExpectOptions): ExpectOptions = - ExpectOptions( - options.assertionVerb ?: assertionVerb, - options.representationInsteadOfSubject ?: representationInsteadOfSubject, - options.reporter ?: reporter - ) - - @ExperimentalNewExpectTypes - @Suppress("DEPRECATION" /* RequiresOptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */) - @UseExperimental(ExperimentalComponentFactoryContainer::class) - fun toRootExpectOptions(): RootExpectOptions = - RootExpectOptions( - assertionVerb, - representationInsteadOfSubject, - reporter?.let { r -> - ComponentFactoryContainer.createIfNotEmpty( - mapOf(Reporter::class to ComponentFactory({ r }, producesSingleton = true)), - emptyMap() - ) - }) -} - -@Suppress("FunctionName") -@Deprecated( - "Use RootExpectOptions instead; will be removed latest with 0.17.0 (maybe earlier)", - ReplaceWith("RootExpectOptions(configuration)", "ch.tutteli.atrium.logic.creating.RootExpectOptions") -) -fun ExpectOptions(configuration: ExpectBuilder.OptionsChooser.() -> Unit): ExpectOptions = - ExpectBuilder.OptionsChooser.createAndBuild(configuration) diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/LocaleOrderDeciderOption.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/LocaleOrderDeciderOption.kt deleted file mode 100644 index b18958a5a..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/LocaleOrderDeciderOption.kt +++ /dev/null @@ -1,36 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.core.CoreFactory -import ch.tutteli.atrium.domain.builders.reporting.impl.LocaleOrderDeciderOptionImpl -import ch.tutteli.atrium.reporting.translating.LocaleOrderDecider -import ch.tutteli.atrium.reporting.translating.TranslationSupplier - -/** - * Provides options to create a [LocaleOrderDecider]. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -interface LocaleOrderDeciderOption { - - /** - * The previously chosen [TranslationSupplier]. - */ - val translationSupplier: TranslationSupplier - - /** - * Uses [CoreFactory.newLocaleOrderDecider] as [LocaleOrderDecider]. - */ - fun withDefaultLocaleOrderDecider(): TranslatorOption - - /** - * Uses [localeOrderDecider] as [LocaleOrderDecider]. - */ - fun withLocaleOrderDecider(localeOrderDecider: LocaleOrderDecider): TranslatorOption - - companion object { - fun create(translationSupplier: TranslationSupplier): LocaleOrderDeciderOption = - LocaleOrderDeciderOptionImpl(translationSupplier) - } -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ObjectFormatterOption.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ObjectFormatterOption.kt deleted file mode 100644 index 8b562483a..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ObjectFormatterOption.kt +++ /dev/null @@ -1,35 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.core.CoreFactory -import ch.tutteli.atrium.domain.builders.reporting.impl.ObjectFormatterOptionImpl -import ch.tutteli.atrium.reporting.ObjectFormatter -import ch.tutteli.atrium.reporting.translating.Translator - -/** - * Provides options to create an [ObjectFormatter]. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -interface ObjectFormatterOption { - - /** - * The previously chosen [Translator]. - */ - val translator: Translator - - /** - * Uses [CoreFactory.newDetailedObjectFormatter] as [ObjectFormatter]. - */ - fun withDetailedObjectFormatter(): AssertionFormatterControllerOption - - /** - * Uses the given [factory] to build a custom [ObjectFormatter]. - */ - fun withObjectFormatter(factory: (Translator) -> ObjectFormatter): AssertionFormatterControllerOption - - companion object { - fun create(translator: Translator): ObjectFormatterOption = ObjectFormatterOptionImpl(translator) - } -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterBuilder.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterBuilder.kt deleted file mode 100644 index a75fef2c7..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterBuilder.kt +++ /dev/null @@ -1,82 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.domain.builders.reporting.impl.ReporterBuilderImpl -import ch.tutteli.atrium.reporting.Reporter -import ch.tutteli.atrium.reporting.translating.* - -/** - * Entry point to build a [Reporter] - * -- the first step provides options to create a [Translator] or a [TranslationSupplier]. - */ -@Deprecated( - "Use ReporterBuilder.create() instead; will be removed latest with 1.0.0", - ReplaceWith("ch.tutteli.atrium.domain.builders.reporting.ReporterBuilder.create()") -) -val reporterBuilder: ReporterBuilder = ReporterBuilderImpl - - -/** - * Provides options to create a [Translator] or [TranslationSupplier] -- the platform specific - * interface might provide further options. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -expect interface ReporterBuilder : ReporterBuilderCommon { - companion object { - fun create(): ReporterBuilder - } -} - -/** - * Provides options to create a [Translator] or [TranslationSupplier] -- those options - * have to be provided on all platforms. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -interface ReporterBuilderCommon { - - /** - * Uses [UsingDefaultTranslator] as [Translator] where [getDefaultLocale] is used to format arguments - * of [TranslatableWithArgs]. - * - * [UsingDefaultTranslator] does not require a [TranslationSupplier] nor a [LocaleOrderDecider] and thus - * the options to specify implementations of them are skipped. - * - * Notice that [UsingDefaultTranslator] does not translate but uses what [Translatable.getDefault] returns. - */ - fun withoutTranslationsUseDefaultLocale(): ObjectFormatterOption = withoutTranslations(getDefaultLocale()) - - /** - * Uses [UsingDefaultTranslator] as [Translator] where the given [primaryLocale] is used to format arguments - * of [TranslatableWithArgs]. - * - * [UsingDefaultTranslator] does not require a [TranslationSupplier] nor a [LocaleOrderDecider] and thus - * the options to specify implementations of them are skipped. - * - * Notice that [UsingDefaultTranslator] does not translate but uses what [Translatable.getDefault] returns. - * - * @param primaryLocale The [Locale] used to format arguments of [TranslatableWithArgs]. - */ - fun withoutTranslations(primaryLocale: Locale): ObjectFormatterOption - - /** - * Uses the given [translator] as [Translator] skipping the options for [TranslationSupplier] and - * [LocaleOrderDecider] assuming the given [translator] is implemented differently -- use - * [withDefaultTranslationSupplier] or [withTranslationSupplier] in case the given [translator] requires - * a [TranslationSupplier] or a [LocaleOrderDecider]. - */ - fun withTranslator(translator: Translator): ObjectFormatterOption - - /** - * Uses a predefined method to create a [TranslationSupplier] -- see platform specific interface - * for further information. - */ - fun withDefaultTranslationSupplier(): LocaleOrderDeciderOption - - /** - * Uses the given [translationSupplier] as [TranslationSupplier]. - */ - fun withTranslationSupplier(translationSupplier: TranslationSupplier): LocaleOrderDeciderOption -} - diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterBuilderFinalStep.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterBuilderFinalStep.kt deleted file mode 100644 index 656f61fff..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterBuilderFinalStep.kt +++ /dev/null @@ -1,23 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.domain.builders.reporting.impl.ReporterBuilderFinalStepImpl -import ch.tutteli.atrium.reporting.Reporter - -/** - * Final step in the [ReporterBuilder] process, creates the desired [Reporter]. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -interface ReporterBuilderFinalStep { - - /** - * Creates and returns the new [Reporter]. - */ - fun build(): Reporter - - companion object { - fun create(factory: () -> Reporter): ReporterBuilderFinalStep = ReporterBuilderFinalStepImpl(factory) - } -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterOption.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterOption.kt deleted file mode 100644 index 289ca9cee..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterOption.kt +++ /dev/null @@ -1,46 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.core.CoreFactory -import ch.tutteli.atrium.domain.builders.reporting.impl.ReporterOptionImpl -import ch.tutteli.atrium.reporting.AssertionFormatterFacade -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster -import ch.tutteli.atrium.reporting.Reporter - -/** - * Provides options to finalise the building process, which means creating a [Reporter]. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -interface ReporterOption { - - /** - * The previously chosen [AssertionFormatterFacade]. - */ - val assertionFormatterFacade: AssertionFormatterFacade - - /** - * The previously chosen [AtriumErrorAdjuster]. - */ - val atriumErrorAdjuster: AtriumErrorAdjuster - - /** - * Uses [CoreFactory.newOnlyFailureReporter] as [Reporter]. - */ - fun withOnlyFailureReporter(): ReporterBuilderFinalStep - - /** - * Uses the given [factory] to build a custom [Reporter]. - */ - fun withCustomReporter( - factory: (AssertionFormatterFacade, AtriumErrorAdjuster) -> Reporter - ): ReporterBuilderFinalStep - - companion object { - fun create( - assertionFormatterFacade: AssertionFormatterFacade, - atriumErrorAdjuster: AtriumErrorAdjuster - ): ReporterOption = ReporterOptionImpl(assertionFormatterFacade, atriumErrorAdjuster) - } -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TextAssertionFormatterOption.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TextAssertionFormatterOption.kt deleted file mode 100644 index 61fae52c9..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TextAssertionFormatterOption.kt +++ /dev/null @@ -1,67 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.assertions.BulletPointIdentifier -import ch.tutteli.atrium.core.CoreFactory -import ch.tutteli.atrium.reporting.AssertionFormatter -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.AssertionFormatterFacade -import ch.tutteli.atrium.reporting.AssertionPairFormatter -import kotlin.reflect.KClass - -/** - * Provides options to register [AssertionFormatter]s to the chosen [AssertionFormatterFacade] -- the platform - * specific interface might provide further options. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -expect interface TextAssertionFormatterOption : TextAssertionFormatterOptionCommon { - companion object { - fun create( - options: AssertionFormatterChosenOptions, - assertionPairFormatter: AssertionPairFormatter - ): TextAssertionFormatterOption - } -} - - -/** - * Provides options to register [AssertionFormatter]s to the chosen [AssertionFormatterFacade] -- those options - * have to be provided on all platforms. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -interface TextAssertionFormatterOptionCommon { - - /** - * The so far chosen options which are relevant to create [AssertionFormatter]s. - */ - val options: AssertionFormatterChosenOptions - - /** - * The previously chosen [AssertionPairFormatter]. - */ - val assertionPairFormatter: AssertionPairFormatter - - /** - * Uses [CoreFactory.registerTextAssertionFormatterCapabilities] to register the default [AssertionFormatter]s - * intended for text output -- using the defined [assertionPairFormatter], - * [AssertionFormatterChosenOptions.objectFormatter] and [AssertionFormatterChosenOptions.translator] - * -- to the specified [AssertionFormatterChosenOptions.assertionFormatterFacade] where the given [bulletPoints] can be used to customise - * the predefined bullet points. - * - * Have a look at the sub types of [BulletPointIdentifier] to get a feel for what and how you can customise - * bullet points. - */ - fun withTextCapabilities(vararg bulletPoints: Pair, String>): AtriumErrorAdjusterOption - - /** - * Uses the given [factory] and [otherFactories] to create and register [AssertionFormatter]s to - * the specified [AssertionFormatterChosenOptions.assertionFormatterFacade]. - */ - fun withTextAssertionFormatter( - factory: (AssertionFormatterChosenOptions) -> (AssertionFormatterController) -> AssertionFormatter, - vararg otherFactories: (AssertionFormatterChosenOptions) -> (AssertionFormatterController) -> AssertionFormatter - ): AtriumErrorAdjusterOption -} - diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TranslatorOption.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TranslatorOption.kt deleted file mode 100644 index 838e0ab19..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TranslatorOption.kt +++ /dev/null @@ -1,47 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.core.CoreFactory -import ch.tutteli.atrium.reporting.translating.* - -/** - * Provides options to create a [Translator] -- the platform specific interface might provide further options. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -expect interface TranslatorOption : TranslatorOptionCommon - -/** - * Provides options to create a [Translator] -- those options have to be provided on all platforms. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -interface TranslatorOptionCommon { - - /** - * The previously chosen [TranslationSupplier]. - */ - val translationSupplier: TranslationSupplier - - /** - * The previously chosen [LocaleOrderDecider]. - */ - val localeOrderDecider: LocaleOrderDecider - - /** - * Uses [CoreFactory.newTranslator] as [Translator] where the specified [translationSupplier] is used to - * retrieve translations, the specified [localeOrderDecider] to determine candidate [Locale]s and - * [primaryLocale] is used as primary [Locale] and the optional [fallbackLocales] as fallback [Locale]s. - * - * @param primaryLocale The [Locale] for which the [Translator] will first search translations -- - * it will also be used to format arguments of [TranslatableWithArgs]. - * @param fallbackLocales One [Locale] after another (in the given order) will be considered as primary Locale - * in case no translation was found the previous primary Locale. - */ - fun withDefaultTranslator(primaryLocale: Locale, vararg fallbackLocales: Locale): ObjectFormatterOption - - /** - * Uses the given [factory] to build a [Translator]. - */ - fun withTranslator(factory: (TranslationSupplier, LocaleOrderDecider) -> Translator): ObjectFormatterOption -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/AssertionFormatterControllerOptionImpl.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/AssertionFormatterControllerOptionImpl.kt deleted file mode 100644 index 5dd650316..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/AssertionFormatterControllerOptionImpl.kt +++ /dev/null @@ -1,23 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting.impl - -import ch.tutteli.atrium.core.coreFactory -import ch.tutteli.atrium.domain.builders.reporting.AssertionFormatterControllerOption -import ch.tutteli.atrium.domain.builders.reporting.AssertionFormatterFacadeOption -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.ObjectFormatter -import ch.tutteli.atrium.reporting.translating.Translator - -internal class AssertionFormatterControllerOptionImpl( - override val objectFormatter: ObjectFormatter, - override val translator: Translator -) : AssertionFormatterControllerOption { - - override fun withDefaultAssertionFormatterController() = - withAssertionFormatterController(coreFactory.newAssertionFormatterController()) - - override fun withAssertionFormatterController(assertionFormatterController: AssertionFormatterController) = - AssertionFormatterFacadeOption.create(assertionFormatterController, objectFormatter, translator) -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/AssertionFormatterFacadeOptionImpl.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/AssertionFormatterFacadeOptionImpl.kt deleted file mode 100644 index b18741804..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/AssertionFormatterFacadeOptionImpl.kt +++ /dev/null @@ -1,25 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting.impl - -import ch.tutteli.atrium.core.coreFactory -import ch.tutteli.atrium.domain.builders.reporting.AssertionFormatterFacadeOption -import ch.tutteli.atrium.domain.builders.reporting.AssertionPairFormatterOption -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.AssertionFormatterFacade -import ch.tutteli.atrium.reporting.ObjectFormatter -import ch.tutteli.atrium.reporting.translating.Translator - -internal class AssertionFormatterFacadeOptionImpl( - override val assertionFormatterController: AssertionFormatterController, - override val objectFormatter: ObjectFormatter, - override val translator: Translator -) : AssertionFormatterFacadeOption { - - override fun withDefaultAssertionFormatterFacade() = - withAssertionFormatterFacade(coreFactory::newAssertionFormatterFacade) - - override fun withAssertionFormatterFacade(factory: (AssertionFormatterController) -> AssertionFormatterFacade) = - AssertionPairFormatterOption.create(factory(assertionFormatterController), objectFormatter, translator) -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/AssertionPairFormatterOptionImpl.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/AssertionPairFormatterOptionImpl.kt deleted file mode 100644 index e49f53cef..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/AssertionPairFormatterOptionImpl.kt +++ /dev/null @@ -1,19 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting.impl - -import ch.tutteli.atrium.domain.builders.reporting.AssertionFormatterChosenOptions -import ch.tutteli.atrium.domain.builders.reporting.AssertionPairFormatterOption -import ch.tutteli.atrium.domain.builders.reporting.TextAssertionFormatterOption -import ch.tutteli.atrium.reporting.AssertionPairFormatter -import ch.tutteli.atrium.reporting.ObjectFormatter -import ch.tutteli.atrium.reporting.translating.Translator - -internal class AssertionPairFormatterOptionImpl( - override val options: AssertionFormatterChosenOptions -) : AssertionPairFormatterOption { - - override fun withTextAssertionPairFormatter(factory: (ObjectFormatter, Translator) -> AssertionPairFormatter) = - TextAssertionFormatterOption.create(options, factory(options.objectFormatter, options.translator)) -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/AtriumErrorAdjusterOptionImpl.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/AtriumErrorAdjusterOptionImpl.kt deleted file mode 100644 index 25d0d9672..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/AtriumErrorAdjusterOptionImpl.kt +++ /dev/null @@ -1,52 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting.impl - -import ch.tutteli.atrium.core.coreFactory -import ch.tutteli.atrium.domain.builders.reporting.AtriumErrorAdjusterOption -import ch.tutteli.atrium.domain.builders.reporting.MultipleAdjustersOption -import ch.tutteli.atrium.domain.builders.reporting.ReporterBuilderFinalStep -import ch.tutteli.atrium.domain.builders.reporting.ReporterOption -import ch.tutteli.atrium.reporting.AssertionFormatterFacade -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster -import ch.tutteli.atrium.reporting.Reporter - -internal class AtriumErrorAdjusterOptionImpl( - override val assertionFormatterFacade: AssertionFormatterFacade -) : AtriumErrorAdjusterOption { - - override fun withNoOpAtriumErrorAdjuster(): ReporterOption = - createReporterOption(coreFactory.newNoOpAtriumErrorAdjuster()) - - override fun withRemoveAtriumFromAtriumErrorAdjuster(): ReporterOption = - createReporterOption(coreFactory.newRemoveAtriumFromAtriumErrorAdjuster()) - - override fun withRemoveRunnerAtriumErrorAdjuster(): ReporterOption = - createReporterOption(coreFactory.newRemoveRunnerAtriumErrorAdjuster()) - - override fun withAtriumErrorAdjuster(adjuster: AtriumErrorAdjuster): ReporterOption = - createReporterOption(adjuster) - - override fun withMultipleAdjusters(configure: MultipleAdjustersOption.() -> Unit): ReporterOption { - val adjusters = MultipleAdjustersOption.create() - .apply(configure) - .adjusters - require(adjusters.size > 1) { - "You need to define at least two adjusters, only ${adjusters.size} defined." - } - val first = adjusters.first() - val tail = adjusters.drop(1) - return createReporterOption(coreFactory.newMultiAtriumErrorAdjuster(first, tail.first(), tail.drop(1))) - } - - private fun createReporterOption(atriumErrorAdjuster: AtriumErrorAdjuster) = - ReporterOption.create(assertionFormatterFacade, atriumErrorAdjuster) - - - override fun withOnlyFailureReporter(): ReporterBuilderFinalStep = - withDefaultAtriumErrorAdjusters().withOnlyFailureReporter() - - override fun withCustomReporter(factory: (AssertionFormatterFacade) -> Reporter): ReporterBuilderFinalStep = - withNoOpAtriumErrorAdjuster().withCustomReporter { facade, _ -> factory(facade) } -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/DefaultReporterFactory.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/DefaultReporterFactory.kt deleted file mode 100644 index 764922174..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/DefaultReporterFactory.kt +++ /dev/null @@ -1,41 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting.impl - -import ch.tutteli.atrium.domain.builders.reporting.ReporterBuilder -import ch.tutteli.atrium.reporting.Reporter -import ch.tutteli.atrium.reporting.ReporterFactory - -/** - * Represents the [ReporterFactory] with [ReporterFactory.id] `default`. - * - * It is defined as follows (currently): - * reporterBuilder - * .withoutTranslationsUseDefaultLocale() - * .withDetailedObjectFormatter() - * .withDefaultAssertionFormatterController() - * .withDefaultAssertionFormatterFacade() - * .withTextSameLineAssertionPairFormatter() - * .withTextCapabilities() - * .withDefaultAtriumErrorAdjusters() - * .withOnlyFailureReporter() - * .build() - * - */ -@Deprecated("Will be removed with 0.17.0 without replacement") -class DefaultReporterFactory : ReporterFactory { - override val id = "default" - - override fun create(): Reporter = - ReporterBuilder.create() - .withoutTranslationsUseDefaultLocale() - .withDetailedObjectFormatter() - .withDefaultAssertionFormatterController() - .withDefaultAssertionFormatterFacade() - .withTextSameLineAssertionPairFormatter() - .withTextCapabilities() - .withDefaultAtriumErrorAdjusters() - .withOnlyFailureReporter() - .build() -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/LocaleOrderDeciderOptionImpl.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/LocaleOrderDeciderOptionImpl.kt deleted file mode 100644 index ada6f260c..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/LocaleOrderDeciderOptionImpl.kt +++ /dev/null @@ -1,19 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting.impl - -import ch.tutteli.atrium.core.coreFactory -import ch.tutteli.atrium.domain.builders.reporting.LocaleOrderDeciderOption -import ch.tutteli.atrium.reporting.translating.LocaleOrderDecider -import ch.tutteli.atrium.reporting.translating.TranslationSupplier - -internal class LocaleOrderDeciderOptionImpl( - override val translationSupplier: TranslationSupplier -) : LocaleOrderDeciderOption { - - override fun withDefaultLocaleOrderDecider() = withLocaleOrderDecider(coreFactory.newLocaleOrderDecider()) - - override fun withLocaleOrderDecider(localeOrderDecider: LocaleOrderDecider) = - TranslatorOptionImpl(translationSupplier, localeOrderDecider) -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/MultipleAdjustersOptionImpl.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/MultipleAdjustersOptionImpl.kt deleted file mode 100644 index 1a8a8e260..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/MultipleAdjustersOptionImpl.kt +++ /dev/null @@ -1,27 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting.impl - -import ch.tutteli.atrium.core.coreFactory -import ch.tutteli.atrium.domain.builders.reporting.MultipleAdjustersOption -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster - -internal class MultipleAdjustersOptionImpl : MultipleAdjustersOption { - - private val _adjusters = mutableListOf() - override val adjusters: List - get() = _adjusters - - override fun withRemoveRunnerAtriumErrorAdjuster() { - _adjusters.add(coreFactory.newRemoveRunnerAtriumErrorAdjuster()) - } - - override fun withRemoveAtriumFromAtriumErrorAdjuster() { - _adjusters.add(coreFactory.newRemoveAtriumFromAtriumErrorAdjuster()) - } - - override fun withAtriumErrorAdjuster(adjuster: AtriumErrorAdjuster) { - _adjusters.add(adjuster) - } -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ObjectFormatterOptionImpl.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ObjectFormatterOptionImpl.kt deleted file mode 100644 index 64ab48aab..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ObjectFormatterOptionImpl.kt +++ /dev/null @@ -1,20 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting.impl - -import ch.tutteli.atrium.core.coreFactory -import ch.tutteli.atrium.domain.builders.reporting.AssertionFormatterControllerOption -import ch.tutteli.atrium.domain.builders.reporting.ObjectFormatterOption -import ch.tutteli.atrium.reporting.ObjectFormatter -import ch.tutteli.atrium.reporting.translating.Translator - -internal class ObjectFormatterOptionImpl( - override val translator: Translator -) : ObjectFormatterOption { - - override fun withDetailedObjectFormatter() = withObjectFormatter(coreFactory::newDetailedObjectFormatter) - - override fun withObjectFormatter(factory: (Translator) -> ObjectFormatter) = - AssertionFormatterControllerOption.create(factory(translator), translator) -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterBuilderFinalStepImpl.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterBuilderFinalStepImpl.kt deleted file mode 100644 index 3cc42a550..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterBuilderFinalStepImpl.kt +++ /dev/null @@ -1,11 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting.impl - -import ch.tutteli.atrium.domain.builders.reporting.ReporterBuilderFinalStep -import ch.tutteli.atrium.reporting.Reporter - -class ReporterBuilderFinalStepImpl(private val factory: () -> Reporter) : ReporterBuilderFinalStep { - override fun build(): Reporter = factory() -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterBuilderImpl.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterBuilderImpl.kt deleted file mode 100644 index eed9eb95a..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterBuilderImpl.kt +++ /dev/null @@ -1,8 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting.impl - -import ch.tutteli.atrium.domain.builders.reporting.ReporterBuilder - -internal expect object ReporterBuilderImpl : ReporterBuilder diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterOptionImpl.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterOptionImpl.kt deleted file mode 100644 index 19c31ca39..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterOptionImpl.kt +++ /dev/null @@ -1,26 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting.impl - -import ch.tutteli.atrium.core.coreFactory -import ch.tutteli.atrium.domain.builders.reporting.ReporterBuilderFinalStep -import ch.tutteli.atrium.domain.builders.reporting.ReporterOption -import ch.tutteli.atrium.reporting.AssertionFormatterFacade -import ch.tutteli.atrium.reporting.AtriumErrorAdjuster -import ch.tutteli.atrium.reporting.Reporter - -internal class ReporterOptionImpl( - override val assertionFormatterFacade: AssertionFormatterFacade, - override val atriumErrorAdjuster: AtriumErrorAdjuster -) : ReporterOption { - - override fun withOnlyFailureReporter(): ReporterBuilderFinalStep = - withCustomReporter(coreFactory::newOnlyFailureReporter) - - override fun withCustomReporter( - factory: (AssertionFormatterFacade, AtriumErrorAdjuster) -> Reporter - ): ReporterBuilderFinalStep = ReporterBuilderFinalStep.create { - factory(assertionFormatterFacade, atriumErrorAdjuster) - } -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/TextAssertionFormatterOptionImpl.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/TextAssertionFormatterOptionImpl.kt deleted file mode 100644 index deda7ef72..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/TextAssertionFormatterOptionImpl.kt +++ /dev/null @@ -1,42 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting.impl - -import ch.tutteli.atrium.assertions.BulletPointIdentifier -import ch.tutteli.atrium.core.coreFactory -import ch.tutteli.atrium.domain.builders.reporting.AssertionFormatterChosenOptions -import ch.tutteli.atrium.domain.builders.reporting.AtriumErrorAdjusterOption -import ch.tutteli.atrium.domain.builders.reporting.TextAssertionFormatterOption -import ch.tutteli.atrium.reporting.AssertionFormatter -import ch.tutteli.atrium.reporting.AssertionFormatterController -import ch.tutteli.atrium.reporting.AssertionPairFormatter -import ch.tutteli.kbox.forElementAndForEachIn -import kotlin.reflect.KClass - -internal class TextAssertionFormatterOptionImpl( - override val options: AssertionFormatterChosenOptions, - override val assertionPairFormatter: AssertionPairFormatter -) : TextAssertionFormatterOption { - - override fun withTextCapabilities(vararg bulletPoints: Pair, String>): AtriumErrorAdjusterOption { - coreFactory.registerTextAssertionFormatterCapabilities( - bulletPoints.toMap(), - options.assertionFormatterFacade, - assertionPairFormatter, - options.objectFormatter, - options.translator - ) - return AtriumErrorAdjusterOption.create(options.assertionFormatterFacade) - } - - override fun withTextAssertionFormatter( - factory: (AssertionFormatterChosenOptions) -> (AssertionFormatterController) -> AssertionFormatter, - vararg otherFactories: (AssertionFormatterChosenOptions) -> (AssertionFormatterController) -> AssertionFormatter - ): AtriumErrorAdjusterOption { - forElementAndForEachIn(factory, otherFactories.asIterable()) { - options.assertionFormatterFacade.register(it(options)) - } - return AtriumErrorAdjusterOption.create(options.assertionFormatterFacade) - } -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/TranslatorOptionImpl.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/TranslatorOptionImpl.kt deleted file mode 100644 index 87353fb0e..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/TranslatorOptionImpl.kt +++ /dev/null @@ -1,30 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting.impl - -import ch.tutteli.atrium.core.coreFactory -import ch.tutteli.atrium.domain.builders.reporting.TranslatorOption -import ch.tutteli.atrium.reporting.translating.Locale -import ch.tutteli.atrium.reporting.translating.LocaleOrderDecider -import ch.tutteli.atrium.reporting.translating.TranslationSupplier -import ch.tutteli.atrium.reporting.translating.Translator - -internal class TranslatorOptionImpl( - override val translationSupplier: TranslationSupplier, - override val localeOrderDecider: LocaleOrderDecider -) : TranslatorOption { - - override fun withDefaultTranslator(primaryLocale: Locale, vararg fallbackLocales: Locale) = - ObjectFormatterOptionImpl( - coreFactory.newTranslator( - translationSupplier, - localeOrderDecider, - primaryLocale, - fallbackLocales.toList() - ) - ) - - override fun withTranslator(factory: (TranslationSupplier, LocaleOrderDecider) -> Translator) = - ObjectFormatterOptionImpl(factory(translationSupplier, localeOrderDecider)) -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/verb/OptionsChooserImpl.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/verb/OptionsChooserImpl.kt deleted file mode 100644 index ed3349261..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/verb/OptionsChooserImpl.kt +++ /dev/null @@ -1,30 +0,0 @@ -//TODO remove file with 1.0.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting.impl.verb - -import ch.tutteli.atrium.domain.builders.reporting.ExpectBuilder -import ch.tutteli.atrium.domain.builders.reporting.ExpectOptions -import ch.tutteli.atrium.reporting.Reporter -import ch.tutteli.atrium.reporting.translating.Translatable - -class OptionsChooserImpl : ExpectBuilder.OptionsChooser { - - private var description: Translatable? = null - private var representationInsteadOfSubject: ((T) -> Any)? = null - private var reporter: Reporter? = null - - override fun withVerb(verb: Translatable) { - this.description = verb - } - - override fun withRepresentation(representationProvider: (T) -> Any) { - this.representationInsteadOfSubject = representationProvider - } - - override fun withReporter(reporter: Reporter) { - this.reporter = reporter - } - - fun build(): ExpectOptions = ExpectOptions(description, representationInsteadOfSubject, reporter) -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/verb/defaultImpls.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/verb/defaultImpls.kt deleted file mode 100644 index 9a4b6b2f7..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/verb/defaultImpls.kt +++ /dev/null @@ -1,39 +0,0 @@ -//TODO remove file with 1.0.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting.impl.verb - -import ch.tutteli.atrium.core.ExperimentalNewExpectTypes -import ch.tutteli.atrium.core.Option -import ch.tutteli.atrium.creating.RootExpect -import ch.tutteli.atrium.domain.builders.reporting.ExpectBuilder -import ch.tutteli.atrium.domain.builders.reporting.ExpectOptions -import ch.tutteli.atrium.reporting.translating.Translatable - -class AssertionVerbStepImpl(override val maybeSubject: Option) : ExpectBuilder.AssertionVerbStep { - override fun withVerb(verb: Translatable): ExpectBuilder.OptionsStep = - ExpectBuilder.OptionsStep.create(maybeSubject, verb) -} - -class OptionsStepImpl( - override val maybeSubject: Option, - override val assertionVerb: Translatable -) : ExpectBuilder.OptionsStep { - - override fun withOptions(expectOptions: ExpectOptions): ExpectBuilder.FinalStep = toFinalStep(expectOptions) - override fun withoutOptions(): ExpectBuilder.FinalStep = toFinalStep(null) - - private fun toFinalStep(expectOptions: ExpectOptions?) = - ExpectBuilder.FinalStep.create(maybeSubject, assertionVerb, expectOptions) -} - -class FinalStepImpl( - override val maybeSubject: Option, - override val assertionVerb: Translatable, - override val options: ExpectOptions? -) : ExpectBuilder.FinalStep { - - @Suppress("DEPRECATION" /* OptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */) - @UseExperimental(ExperimentalNewExpectTypes::class) - override fun build(): RootExpect = RootExpect(maybeSubject, assertionVerb, options?.toRootExpectOptions()) -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/VarArgHelper.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/VarArgHelper.kt deleted file mode 100644 index 4e6ed37ab..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/VarArgHelper.kt +++ /dev/null @@ -1,43 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.utils - -import ch.tutteli.kbox.glue - -/** - * Represents a parameter object used to express the arguments `T, vararg T` - * and provides utility functions to transform them. - */ -@Deprecated( - "Use VarArgHelper from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.VarArgHelper") -) -interface VarArgHelper { - /** - * The first argument in the argument list `T, vararg T` - */ - @Deprecated("Extend VarArgHelper from atrium-logic; will be removed with 0.17.0") - val expected: T - - /** - * The second argument in the argument list `T, vararg T` - */ - @Deprecated("Extend VarArgHelper from atrium-logic; will be removed with 0.17.0") - val otherExpected: Array - - /** - * Creates an [ArgumentMapperBuilder] which allows to map [expected] and [otherExpected]. - */ - @Suppress("DeprecatedCallableAddReplaceWith") - @Deprecated("Extend VarArgHelper from atrium-logic; will be removed with 0.17.0") - val mapArguments: ArgumentMapperBuilder - get() = ArgumentMapperBuilder(expected, otherExpected) - - /** - * Returns the arguments as [List]. - */ - @Suppress("DeprecatedCallableAddReplaceWith") - @Deprecated("Extend VarArgHelper from atrium-logic; will be removed with 0.17.0") - fun toList(): List = expected glue otherExpected -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/containsValidators.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/containsValidators.kt deleted file mode 100644 index 682cec84b..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/containsValidators.kt +++ /dev/null @@ -1,46 +0,0 @@ -package ch.tutteli.atrium.domain.builders.utils - -/** - * Validates that times is not `1`; throws an IllegalArgumentException otherwise, pointing the user to use the given - * [exactlyCall] instead of the given [atMostCall]. - */ -@Deprecated( - "Use validateAtMost from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.creating.basic.contains.checkers.validateAtMost(times, atMostCall, atLeastCall, exactlyCall)") -) -fun validateAtMost( - times: Int, - atMostCall: (Int) -> String, - atLeastCall: (Int) -> String, - exactlyCall: (Int) -> String -) { - require(1 != times) { - "use ${exactlyCall(times)} instead of ${atMostCall(times)}; " + - "${atMostCall(times)} defines implicitly ${atLeastCall(1)} as well" - } -} - -/** - * Validates that [atLeastTimes] is not equal to or greater than [butAtMostTimes]; throws IllegalArgumentException - * otherwise, pointing the user to use the given [exactlyCall] in case [atLeastTimes] equals [butAtMostTimes]. - */ -@Deprecated( - "Use validateAtMost from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.creating.basic.contains.checkers.validateButAtMost(atLeastTimes, butAtMostTimes, atLeastButAtMostCall, atLeastCall, butAtMostCall, exactlyCall)") -) -fun validateButAtMost( - atLeastTimes: Int, - butAtMostTimes: Int, - atLeastButAtMostCall: (Int, Int) -> String, - atLeastCall: (Int) -> String, - butAtMostCall: (Int) -> String, - exactlyCall: (Int) -> String -) { - require(atLeastTimes != butAtMostTimes) { - "use ${exactlyCall(butAtMostTimes)} instead of ${atLeastButAtMostCall(butAtMostTimes, butAtMostTimes)}" - } - - require(atLeastTimes < butAtMostTimes) { - "specifying ${butAtMostCall(butAtMostTimes)} does not make sense if ${atLeastCall(atLeastTimes)} was used before" - } -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/groupsToList.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/groupsToList.kt deleted file mode 100644 index 51334adcc..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/groupsToList.kt +++ /dev/null @@ -1,60 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.utils - -/** - * Represents a group of [T]. - */ -@Deprecated( - "Use Group from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.Group") -) -interface Group { - /** - * Returns the members of the group as [List]. - */ - fun toList(): List -} - -/** - * Represents a group of [T] (where `T: Any`) which can be converted to a [List]`` - */ -@Deprecated( - "Use super-type Group instead; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.Group") -) -interface GroupWithoutNullableEntries : Group - -/** - * Represents a group of [T] (where `T: Any?`) which can be converted to a [List]`` - */ -@Deprecated( - "Use super-type Group instead; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.Group") -) -interface GroupWithNullableEntries : Group - -/** - * Adds the given [firstGroup], the [secondGroup] and the [otherGroups] into a new [List] and returns it. - * @return a [List] containing [firstGroup], [secondGroup] and [otherGroups]. - */ -@Deprecated( - "Use groupsToList from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.groupsToList(firstGroup, secondGroup, otherGroups)") -) -fun groupsToList(firstGroup: Group, secondGroup: Group, otherGroups: Array>): List> { - val groups = ArrayList>(otherGroups.size + 2) - requireNotEmptyAndAdd(groups, firstGroup) - requireNotEmptyAndAdd(groups, secondGroup) - otherGroups.forEach { requireNotEmptyAndAdd(groups, it) } - return groups -} - -private fun requireNotEmptyAndAdd(groups: ArrayList>, group: Group) { - val list = group.toList() - require(list.isNotEmpty()) { - "a group of values cannot be empty." - } - groups.add(list) -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/mapArguments.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/mapArguments.kt deleted file mode 100644 index 103d52148..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/mapArguments.kt +++ /dev/null @@ -1,308 +0,0 @@ -@file:Suppress( -/* TODO remove annotation with 0.17.0 */ "DEPRECATION", -/* TODO remove annotation with 0.17.0 */ "TYPEALIAS_EXPANSION_DEPRECATION" -) - -package ch.tutteli.atrium.domain.builders.utils - -import ch.tutteli.atrium.creating.Expect -import ch.tutteli.atrium.creating.PleaseUseReplacementException -import kotlin.js.JsName - -/** - * Creates a [ArgumentMapperBuilder] with the given [first] and [others] as arguments; - * specify the mapping as such using a subsequent step in the building process. - * - * For instance (there are more options as second step to choose from): - * ``` - * fun pairs(pair: Pair, vararg otherPairs: Pair) { - * mapArguments(pair, otherPairs).toExpect> { isKeyValue(it) } - * } - * ``` - */ -@Deprecated( - "Use mapArguments from atrium-logic; will be removed with 0.17.0", - ReplaceWith("mapArguments(first, others)", "ch.tutteli.atrium.logic.utils.mapArguments") -) -fun mapArguments(first: T, others: Array): ArgumentMapperBuilder = ArgumentMapperBuilder(first, others) - -/** - * Maps the given [first] and [others] to the given type [R] with the help of the given [mapper]. - * - * Use the overload without `mapper` in case you want to map to an [Assert][AssertionPlant] lambda with receiver - * and use one of the available options as second step. For instance, `mapArguments(a, aX).toExpect { ... }` - */ -@Deprecated( - "Use mapArguments from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.mapArguments(first, others, mapper)") -) -inline fun mapArguments(first: T, others: Array, mapper: (T) -> R): Pair> = - mapArguments(first, others).to(mapper) - -/** - * Creates a [ArgumentMapperBuilder] with the given [first] and [others] as arguments; - * specify the mapping as such using a subsequent step in the building process. - */ -@Deprecated( - "Use mapArguments from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.mapArguments(first, others)") -) -fun mapArguments(first: Byte, others: ByteArray): ArgumentMapperBuilder = - mapArguments(first, others.toTypedArray()) - -/** - * Maps the given [first] and [others] to the given type [R] with the help of the given [mapper]. - * - * Use the overload without `mapper` in case you want to map to an [Assert][AssertionPlant] lambda with receiver - * and use one of the available options as second step. For instance, `mapArguments(a, aX).toExpect { ... }` - */ -@Deprecated( - "Use mapArguments from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.mapArguments(first, others, mapper)") -) -inline fun mapArguments(first: Byte, others: ByteArray, mapper: (Byte) -> R): Pair> = - mapArguments(first, others).to(mapper) - -/** - * Creates a [ArgumentMapperBuilder] with the given [first] and [others] as arguments; - * specify the mapping as such using a subsequent step in the building process. - */ -@Deprecated( - "Use mapArguments from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.mapArguments(first, others)") -) -fun mapArguments(first: Char, others: CharArray): ArgumentMapperBuilder = - mapArguments(first, others.toTypedArray()) - -/** - * Maps the given [first] and [others] to the given type [R] with the help of the given [mapper]. - * - * Use the overload without `mapper` in case you want to map to an [Assert][AssertionPlant] lambda with receiver - * and use one of the available options as second step. For instance, `mapArguments(a, aX).toExpect { ... }` - */ -@Deprecated( - "Use mapArguments from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.mapArguments(first, others, mapper)") -) -inline fun mapArguments(first: Char, others: CharArray, mapper: (Char) -> R): Pair> = - mapArguments(first, others).to(mapper) - -/** - * Creates a [ArgumentMapperBuilder] with the given [first] and [others] as arguments; - * specify the mapping as such using a subsequent step in the building process. - */ -@Deprecated( - "Use mapArguments from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.mapArguments(first, others)") -) -fun mapArguments(first: Short, others: ShortArray): ArgumentMapperBuilder = - mapArguments(first, others.toTypedArray()) - -/** - * Maps the given [first] and [others] to the given type [R] with the help of the given [mapper]. - * - * Use the overload without `mapper` in case you want to map to an [Assert][AssertionPlant] lambda with receiver - * and use one of the available options as second step. For instance, `mapArguments(a, aX).toExpect { ... }` - */ -@Deprecated( - "Use mapArguments from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.mapArguments(first, others, mapper)") -) -inline fun mapArguments(first: Short, others: ShortArray, mapper: (Short) -> R): Pair> = - mapArguments(first, others).to(mapper) - -/** - * Creates a [ArgumentMapperBuilder] with the given [first] and [others] as arguments; - * specify the mapping as such using a subsequent step in the building process. - */ -@Deprecated( - "Use mapArguments from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.mapArguments(first, others)") -) -fun mapArguments(first: Int, others: IntArray): ArgumentMapperBuilder = mapArguments(first, others.toTypedArray()) - -/** - * Maps the given [first] and [others] to the given type [R] with the help of the given [mapper]. - * - * Use the overload without `mapper` in case you want to map to an [Assert][AssertionPlant] lambda with receiver - * and use one of the available options as second step. For instance, `mapArguments(a, aX).toExpect { ... }` - */ -@Deprecated( - "Use mapArguments from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.mapArguments(first, others, mapper)") -) -inline fun mapArguments(first: Int, others: IntArray, mapper: (Int) -> R): Pair> = - mapArguments(first, others).to(mapper) - -/** - * Creates a [ArgumentMapperBuilder] with the given [first] and [others] as arguments; - * specify the mapping as such using a subsequent step in the building process. - */ -@Deprecated( - "Use mapArguments from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.mapArguments(first, others)") -) -fun mapArguments(first: Long, others: LongArray): ArgumentMapperBuilder = - mapArguments(first, others.toTypedArray()) - -/** - * Maps the given [first] and [others] to the given type [R] with the help of the given [mapper]. - * - * Use the overload without `mapper` in case you want to map to an [Assert][AssertionPlant] lambda with receiver - * and use one of the available options as second step. For instance, `mapArguments(a, aX).toExpect { ... }` - */ -@Deprecated( - "Use mapArguments from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.mapArguments(first, others, mapper)") -) -inline fun mapArguments(first: Long, others: LongArray, mapper: (Long) -> R): Pair> = - mapArguments(first, others).to(mapper) - -/** - * Creates a [ArgumentMapperBuilder] with the given [first] and [others] as arguments; - * specify the mapping as such using a subsequent step in the building process. - */ -@Deprecated( - "Use mapArguments from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.mapArguments(first, others)") -) -fun mapArguments(first: Float, others: FloatArray): ArgumentMapperBuilder = - mapArguments(first, others.toTypedArray()) - -/** - * Maps the given [first] and [others] to the given type [R] with the help of the given [mapper]. - * - * Use the overload without `mapper` in case you want to map to an [Assert][AssertionPlant] lambda with receiver - * and use one of the available options as second step. For instance, `mapArguments(a, aX).toExpect { ... }` - */ -@Deprecated( - "Use mapArguments from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.mapArguments(first, others, mapper)") -) -inline fun mapArguments(first: Float, others: FloatArray, mapper: (Float) -> R): Pair> = - mapArguments(first, others).to(mapper) - -/** - * Creates a [ArgumentMapperBuilder] with the given [first] and [others] as arguments; - * specify the mapping as such using a subsequent step in the building process. - */ -@Deprecated( - "Use mapArguments from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.mapArguments(first, others)") -) -fun mapArguments(first: Double, others: DoubleArray): ArgumentMapperBuilder = - mapArguments(first, others.toTypedArray()) - -/** - * Maps the given [first] and [others] to the given type [R] with the help of the given [mapper]. - * - * Use the overload without `mapper` in case you want to map to an [Assert][AssertionPlant] lambda with receiver - * and use one of the available options as second step. For instance, `mapArguments(a, aX).toExpect { ... }` - */ -@Deprecated( - "Use mapArguments from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.mapArguments(first, others, mapper)") -) -inline fun mapArguments(first: Double, others: DoubleArray, mapper: (Double) -> R): Pair> = - mapArguments(first, others).to(mapper) - -/** - * Creates a [ArgumentMapperBuilder] with the given [first] and [others] as arguments; - * specify the mapping as such using a subsequent step in the building process. - */ -@Deprecated( - "Use mapArguments from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.mapArguments(first, others)") -) -fun mapArguments(first: Boolean, others: BooleanArray): ArgumentMapperBuilder = - mapArguments(first, others.toTypedArray()) - -/** - * Maps the given [first] and [others] to the given type [R] with the help of the given [mapper]. - * - * Use the overload without `mapper` in case you want to map to an [Assert][AssertionPlant] lambda with receiver - * and use one of the available options as second step. For instance, `mapArguments(a, aX).toExpect { ... }` - */ -@Deprecated( - "Use mapArguments from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.mapArguments(first, others, mapper)") -) -inline fun mapArguments( - first: Boolean, - others: BooleanArray, - mapper: (Boolean) -> R -): Pair> = mapArguments(first, others).to(mapper) - -/** - * Builder to map variable length arguments formulated as ([first]: [T], `vararg` [others] : [T]) to something else. - */ -@Deprecated("Use ArgumentMapperBuilder, mapArguments respectively, from atrium-logic; will be removed with 0.17.0") -class ArgumentMapperBuilder( - val first: T, - val others: Array -) { - - /** - * Maps each argument to an [Expect]<[R]> lambda with receiver - * using the given [assertionCreator] (passing in the argument). - * - * @returns The mapped [first] and [others]. - */ - inline fun toExpect( - crossinline assertionCreator: Expect.(T) -> Unit - ): Pair.() -> Unit, Array.() -> Unit>> = to { t -> subExpect { assertionCreator(t) } } - - /** - * Maps each argument to the given type [R] by using the given [mapper] - * - * @returns The mapped [first] and [others]. - */ - inline fun to(mapper: (T) -> R): Pair> = - mapper(first) to others.map { mapper(it) }.toTypedArray() -} - -/** - * Maps each argument to `null` if it is already `null` and if not, then ... - * - * ... what happens otherwise needs to be specified in the next step. - * - * Notice, a future version might constrain [T] with a lower bound `Nothing?`. - * - * @returns The mapped [ArgumentMapperBuilder.first] and [ArgumentMapperBuilder.others]. - */ -@Suppress("DeprecatedCallableAddReplaceWith") -@Deprecated("Use ArgumentMapperBuilder, mapArguments respectively, from atrium-logic; will be removed with 0.17.0") -fun ArgumentMapperBuilder.toNullOr(): ArgumentToNullOrMapperBuilder = - ArgumentToNullOrMapperBuilder(this) - -@JsName("deprecatedToNullOr") -@Suppress("unused") -@Deprecated( - "Since your arguments are not nullable it does not make sense to call this function - use the replacement.", - ReplaceWith("toExpect(assertionCreator)") -) -fun ArgumentMapperBuilder.toNullOr(): Nothing = - throw PleaseUseReplacementException("Since your arguments are not nullable it does not make sense to call this function.") - -/** - * Builder to map variable length arguments formulated as `(first: T, vararg others : T)` to something else. - * - * Its usage is intended to turn the nullable argument type of the given [argumentMapperBuilder] into its non-nullable - * type if the argument is not null in order that the non-nullable type can be used/passed to function which expect - * a non-nullable type. - */ -@Deprecated("Use ArgumentMapperBuilder, mapArguments respectively, from atrium-logic; will be removed with 0.17.0") -class ArgumentToNullOrMapperBuilder( - val argumentMapperBuilder: ArgumentMapperBuilder -) { - /** - * Maps each argument to `null` if it is already `null` and if not, then to an [Expect]<[R]> - * lambda with receiver by using the given [assertionCreator] (passing in the argument). - * - * @returns The mapped arguments. - */ - inline fun toExpect( - crossinline assertionCreator: Expect.(T) -> Unit - ): Pair<(Expect.() -> Unit)?, Array.() -> Unit)?>> = - argumentMapperBuilder.to { nullableT -> nullableT?.let { t -> subExpect { assertionCreator(t) } } } -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/nullable.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/nullable.kt deleted file mode 100644 index bc42062cd..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/nullable.kt +++ /dev/null @@ -1,191 +0,0 @@ -@file:Suppress("NOTHING_TO_INLINE") - -package ch.tutteli.atrium.domain.builders.utils - -import kotlin.jvm.JvmName -import kotlin.reflect.* - - -/** - * Turns the given type into a nullable type. - * - * Intended to be used in conjunction with [platform types](https://kotlinlang.org/docs/reference/java-interop.html#notation-for-platform-types) - * such as `String!` or in other words, when you deal with Java and you want to turn a platform type into a nullable type. - * - * Basically it is a replacement for cast but without introducing one explicitly (we only give an additional hint to the - * compiler that we expect a nullable type and not a non-nullable one). For instance, instead of writing - * `getPersons() as List?` you can write `nullable(getPersons())` - */ -@Deprecated( - "Use nullable from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.nullable(t)") -) -inline fun nullable(t: T): T? = t - -/** - * Turns the given function reference into a function reference with a nullable return type. - * - * Intended to be used in conjunction with [platform types](https://kotlinlang.org/docs/reference/java-interop.html#notation-for-platform-types) - * such as `String!` or in other words, when you deal with Java and you want to turn the return type (which is a platform - * type) of your function into a nullable type. - */ -@Deprecated( - "Use nullable from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.nullable(t)") -) -inline fun nullable(t: KFunction0): KFunction0 = t - -/** - * Turns an [Iterable] into an iterable with a nullable element type. - * - * Intended to be used in conjunction with [platform types](https://kotlinlang.org/docs/reference/java-interop.html#notation-for-platform-types) - * such as `Iterable` or in other words, when you deal with Java and you want to turn a platform type into a nullable type. - * - * Basically it is a replacement for cast but without introducing one explicitly (we only give an additional hint to the - * compiler that we expect a nullable type and not a non-nullable one). For instance, instead of writing - * `getPersons() as Iterable` you can write `nullableContainer(getPersons())` - */ -@Deprecated( - "Use nullable from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.nullable(iterable)") -) -inline fun nullableContainer(iterable: Iterable): Iterable = iterable - -/** - * Turns an [Array] into an array with a nullable element type. - * - * Intended to be used in conjunction with [platform types](https://kotlinlang.org/docs/reference/java-interop.html#notation-for-platform-types) - * such as `Array` or in other words, when you deal with Java and you want to turn a platform type into a nullable type. - * - * Basically it is a replacement for cast but without introducing one explicitly (we only give an additional hint to the - * compiler that we expect a nullable type and not a non-nullable one). For instance, instead of writing - * `getPersons() as Array` you can write `nullableContainer(getPersons())` - */ -@Deprecated( - "Use nullable from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.nullable(arr)") -) -inline fun nullableContainer(arr: Array): Array = arr - - -/** - * Turns a [Map] into a map with a nullable key type. - * - * Intended to be used in conjunction with [platform types](https://kotlinlang.org/docs/reference/java-interop.html#notation-for-platform-types) - * such as `Map! or in other words, when you deal with Java and you want to turn a platform type into a - * nullable type. - * - * Basically it is a replacement for cast but without introducing one explicitly (we only give an additional hint to the - * compiler that we expect a nullable type and not a non-nullable one). For instance, instead of writing - * `getPersons() as Map` you can write `nullableKeyMap(getPersons())` - */ -@Deprecated( - "Use nullable from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.nullable(map)") -) -inline fun nullableKeyMap(map: Map): Map = map - -/** - * Turns a [Map] into a map with a nullable value type. - * - * Intended to be used in conjunction with [platform types](https://kotlinlang.org/docs/reference/java-interop.html#notation-for-platform-types) - * such as `Map! or in other words, when you deal with Java and you want to turn a platform type into a - * nullable type. - * - * Basically it is a replacement for cast but without introducing one explicitly (we only give an additional hint to the - * compiler that we expect a nullable type and not a non-nullable one). For instance, instead of writing - * `getPersons() as Map` you can write `nullableValueMap(getPersons())` - */ -@Deprecated( - "Use nullable from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.nullable(map)") -) -inline fun nullableValueMap(map: Map): Map = map - -/** - * Turns a [Map] into a map with a nullable key and a nullable value type. - * - * Intended to be used in conjunction with [platform types](https://kotlinlang.org/docs/reference/java-interop.html#notation-for-platform-types) - * such as `Map! or in other words, when you deal with Java and you want to turn a platform type into a - * nullable type. - * - * Basically it is a replacement for cast but without introducing one explicitly (we only give an additional hint to the - * compiler that we expect a nullable type and not a non-nullable one). For instance, instead of writing - * `getPersons() as Map` you can write `nullableKeyValueMap(getPersons())` - */ -@Deprecated( - "Use nullable from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.nullable(map)") -) -inline fun nullableKeyValueMap(map: Map): Map = map - -/** - * Turns the given function reference into a function reference with a nullable return type. - * - * Intended to be used in conjunction with [platform types](https://kotlinlang.org/docs/reference/java-interop.html#notation-for-platform-types) - * such as `String!` or in other words, when you deal with Java and you want to turn the return type (which is a platform - * type) of your function into a nullable type. - */ -@JvmName("nullable1") -@Deprecated( - "Use nullable from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.nullable(t)") -) -inline fun nullable(t: KFunction1): KFunction1 = t - -/** - * Turns the given function reference into a function reference with a nullable return type. - * - * Intended to be used in conjunction with [platform types](https://kotlinlang.org/docs/reference/java-interop.html#notation-for-platform-types) - * such as `String!` or in other words, when you deal with Java and you want to turn the return type (which is a platform - * type) of your function into a nullable type. - */ -@JvmName("nullable2") -@Deprecated( - "Use nullable from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.nullable(t)") -) -inline fun nullable(t: KFunction2): KFunction2 = t - -/** - * Turns the given function reference into a function reference with a nullable return type. - * - * Intended to be used in conjunction with [platform types](https://kotlinlang.org/docs/reference/java-interop.html#notation-for-platform-types) - * such as `String!` or in other words, when you deal with Java and you want to turn the return type (which is a platform - * type) of your function into a nullable type. - */ -@JvmName("nullable3") -@Deprecated( - "Use nullable from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.nullable(t)") -) -inline fun nullable(t: KFunction3): KFunction3 = t - -/** - * Turns the given function reference into a function reference with a nullable return type. - * - * Intended to be used in conjunction with [platform types](https://kotlinlang.org/docs/reference/java-interop.html#notation-for-platform-types) - * such as `String!` or in other words, when you deal with Java and you want to turn the return type (which is a platform - * type) of your function into a nullable type. - */ -@JvmName("nullable4") -@Deprecated( - "Use nullable from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.nullable(t)") -) -inline fun nullable(t: KFunction4): KFunction4 = t - -/** - * Turns the given function reference into a function reference with a nullable return type. - * - * Intended to be used in conjunction with [platform types](https://kotlinlang.org/docs/reference/java-interop.html#notation-for-platform-types) - * such as `String!` or in other words, when you deal with Java and you want to turn the return type (which is a platform - * type) of your function into a nullable type. - */ -@JvmName("nullable5") -@Deprecated( - "Use nullable from atrium-logic; will be removed with 0.17.0", - ReplaceWith("ch.tutteli.atrium.logic.utils.nullable(t)") -) -inline fun nullable(t: KFunction5): KFunction5 = - t diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/subAssert.kt b/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/subAssert.kt deleted file mode 100644 index 8b4f51cd0..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-common/src/main/kotlin/ch/tutteli/atrium/domain/builders/utils/subAssert.kt +++ /dev/null @@ -1,16 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress( - "DEPRECATION", - "TYPEALIAS_EXPANSION_DEPRECATION" -) - -package ch.tutteli.atrium.domain.builders.utils - -import ch.tutteli.atrium.creating.Expect - -@Suppress("NOTHING_TO_INLINE") -@Deprecated( - "Use expectLambda from atrium-logic; will be removed with 0.17.0", - ReplaceWith("expectLambda(assertionCreator)", "ch.tutteli.atrium.logic.utils.expectLambda") -) -inline fun subExpect(noinline assertionCreator: Expect.() -> Unit) = assertionCreator diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-js/build.gradle b/misc/deprecated/domain/builders/atrium-domain-builders-js/build.gradle deleted file mode 100644 index 20dcfa8eb..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-js/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -description = 'Contains base classes for sophisticated assertion builders which can be re-used in APIs for the JS platform.' - -dependencies { - api prefixedProject('domain-api-js') - - // it is up to the consumer of atrium-domain-builders which atrium-translations module is used at runtime - compileOnly prefixedProject('translations-en_GB-js') - - testImplementation prefixedProject('specs-js') -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/dependOnMe.kt b/misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/dependOnMe.kt deleted file mode 100644 index 25e292a98..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/dependOnMe.kt +++ /dev/null @@ -1,7 +0,0 @@ -package ch.tutteli.atrium.domain.builders - -@Suppress("FunctionName") -//TODO 0.17.0 remove with 0.17.0 -@Deprecated("Don't start to use, only here as workaround and will be removed with 0.17.0") -fun dependOn_domain_builders() { -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/registerServices.kt b/misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/registerServices.kt deleted file mode 100644 index 4e7499a24..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/registerServices.kt +++ /dev/null @@ -1,11 +0,0 @@ -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders - -import ch.tutteli.atrium.core.polyfills.registerService - -@Suppress("unused" /* here in order that the code is executed when module is loaded */) -private val register = run { - - registerService { ch.tutteli.atrium.domain.builders.reporting.impl.DefaultReporterFactory() } -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterBuilder.kt b/misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterBuilder.kt deleted file mode 100644 index cb45d62cd..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterBuilder.kt +++ /dev/null @@ -1,18 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.domain.builders.reporting.impl.ReporterBuilderImpl -import ch.tutteli.atrium.reporting.translating.TranslationSupplier -import ch.tutteli.atrium.reporting.translating.Translator - -/** - * Provides options to create a [Translator] or [TranslationSupplier]. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -actual interface ReporterBuilder : ReporterBuilderCommon { - actual companion object { - actual fun create(): ReporterBuilder = ReporterBuilderImpl - } -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TextAssertionFormatterOption.kt b/misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TextAssertionFormatterOption.kt deleted file mode 100644 index ee221ad38..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TextAssertionFormatterOption.kt +++ /dev/null @@ -1,24 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.domain.builders.reporting.impl.TextAssertionFormatterOptionImpl -import ch.tutteli.atrium.reporting.AssertionFormatter -import ch.tutteli.atrium.reporting.AssertionFormatterFacade -import ch.tutteli.atrium.reporting.AssertionPairFormatter - -/** - * Provides options to register [AssertionFormatter]s to the chosen [AssertionFormatterFacade]. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -actual interface TextAssertionFormatterOption : TextAssertionFormatterOptionCommon { - - actual companion object { - actual fun create( - options: AssertionFormatterChosenOptions, - assertionPairFormatter: AssertionPairFormatter - ): TextAssertionFormatterOption = TextAssertionFormatterOptionImpl(options, assertionPairFormatter) - } -} - diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TranslatorOption.kt b/misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TranslatorOption.kt deleted file mode 100644 index 9928b64cf..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TranslatorOption.kt +++ /dev/null @@ -1,12 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.reporting.translating.Translator - -/** - * Provides options to create a [Translator]. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -actual interface TranslatorOption : TranslatorOptionCommon diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterBuilderImpl.kt b/misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterBuilderImpl.kt deleted file mode 100644 index 0f9e6e2aa..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-js/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterBuilderImpl.kt +++ /dev/null @@ -1,25 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.builders.reporting.impl - -import ch.tutteli.atrium.domain.builders.reporting.LocaleOrderDeciderOption -import ch.tutteli.atrium.domain.builders.reporting.ObjectFormatterOption -import ch.tutteli.atrium.domain.builders.reporting.ReporterBuilder -import ch.tutteli.atrium.reporting.translating.Locale -import ch.tutteli.atrium.reporting.translating.TranslationSupplier -import ch.tutteli.atrium.reporting.translating.Translator -import ch.tutteli.atrium.reporting.translating.UsingDefaultTranslator - -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -internal actual object ReporterBuilderImpl : ReporterBuilder { - - override fun withoutTranslations(primaryLocale: Locale) = withTranslator(UsingDefaultTranslator(primaryLocale)) - - override fun withTranslator(translator: Translator) = ObjectFormatterOption.create(translator) - - override fun withDefaultTranslationSupplier() = TODO("we have to implement a translation supplier for JS") - - override fun withTranslationSupplier(translationSupplier: TranslationSupplier) = - LocaleOrderDeciderOption.create(translationSupplier) -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-jvm/build.gradle b/misc/deprecated/domain/builders/atrium-domain-builders-jvm/build.gradle deleted file mode 100644 index e0d719578..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-jvm/build.gradle +++ /dev/null @@ -1,17 +0,0 @@ -description = 'Contains base classes for sophisticated assertion builders which can be re-used in APIs for the JVM platform.' - -dependencies { - api prefixedProject('domain-api-jvm') - - // it is up to the consumer of atrium-domain-builders which atrium-translations module is used at runtime - compileOnly prefixedProject('translations-en_GB-jvm') - - testImplementation prefixedProject('specs-jvm') -} - -//TODO should not be necessary https://youtrack.jetbrains.com/issue/KT-28124 -compileTestKotlin.dependsOn( - prefixedProject('core-robstoll-jvm').compileKotlin, - prefixedProject('core-robstoll-jvm').processResources, -) - diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterBuilder.kt b/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterBuilder.kt deleted file mode 100644 index a8859b89b..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/ReporterBuilder.kt +++ /dev/null @@ -1,46 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress( - // TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed - "JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE", - "DEPRECATION" -) - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.core.migration.toAtriumLocale -import ch.tutteli.atrium.domain.builders.reporting.impl.ReporterBuilderImpl -import ch.tutteli.atrium.reporting.translating.* - -/** - * Provides options to create a [Translator] or [TranslationSupplier]. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -actual interface ReporterBuilder : ReporterBuilderCommon { - actual companion object { - actual fun create(): ReporterBuilder = ReporterBuilderImpl - } - - /** - * Uses [UsingDefaultTranslator] as [Translator] where the given [primaryLocale] is used to format arguments - * of [TranslatableWithArgs]. - * - * [UsingDefaultTranslator] does not require a [TranslationSupplier] nor a [LocaleOrderDecider] and thus - * the options to specify implementations of them are skipped. - * - * Notice that [UsingDefaultTranslator] does not translate but uses what [Translatable.getDefault] returns. - * Also notice, that if you omit the [primaryLocale] then [java.util.Locale.getDefault] is used. - * - * @param primaryLocale The [Locale] used to format arguments of [TranslatableWithArgs]. - */ - @Deprecated( - "Use the overload which uses Atrium's [Locale] or `withoutTranslationsUseDefaultLocale`; will be removed latest with 1.0.0", - ReplaceWith( - "this.withoutTranslations(primaryLocale.toAtriumLocale())", - "ch.tutteli.atrium.core.migration.toAtriumLocale" - ) - ) - //TODO only here to retain backward compatibility - remove with 1.0.0 and move companion object to common - fun withoutTranslations(primaryLocale: java.util.Locale = java.util.Locale.getDefault()): ObjectFormatterOption = - @Suppress("DEPRECATION" /* TODO remove with 1.0.0 */) - withoutTranslations(primaryLocale.toAtriumLocale()) -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TextAssertionFormatterOption.kt b/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TextAssertionFormatterOption.kt deleted file mode 100644 index 6e39cae9e..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TextAssertionFormatterOption.kt +++ /dev/null @@ -1,48 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress( - // TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed - "JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE", - "DEPRECATION" -) - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.assertions.BulletPointIdentifier -import ch.tutteli.atrium.core.CoreFactory -import ch.tutteli.atrium.domain.builders.reporting.impl.TextAssertionFormatterOptionImpl -import ch.tutteli.atrium.reporting.AssertionFormatter -import ch.tutteli.atrium.reporting.AssertionFormatterFacade -import ch.tutteli.atrium.reporting.AssertionPairFormatter - -/** - * Provides options to register [AssertionFormatter]s to the chosen [AssertionFormatterFacade]. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -actual interface TextAssertionFormatterOption : TextAssertionFormatterOptionCommon { - - /** - * Uses [CoreFactory.registerTextAssertionFormatterCapabilities] to register the default [AssertionFormatter]s - * intended for text output -- using the defined [assertionPairFormatter], - * [AssertionFormatterChosenOptions.objectFormatter] and [AssertionFormatterChosenOptions.translator] - * -- to the specified [AssertionFormatterChosenOptions.assertionFormatterFacade] where the given [bulletPoints] can be used to customise - * the predefined bullet points. - * - * Have a look at the sub types of [BulletPointIdentifier] to get a feel for what and how you can customise - * bullet points. - */ - @Deprecated( - "Use the overload which expects KClass instead; will be removed latest with 1.0.0", - ReplaceWith("this.withTextCapabilities(*bulletPoints.asSequence().associate { it.first.kotlin to it.second }.toList().toTypedArray()).withDefaultAtriumErrorAdjusters()") - ) - fun withDefaultTextCapabilities(vararg bulletPoints: Pair, String>): ReporterOption = - withTextCapabilities(*bulletPoints.asSequence().associate { it.first.kotlin to it.second }.toList().toTypedArray()) - .withDefaultAtriumErrorAdjusters() - - actual companion object { - actual fun create( - options: AssertionFormatterChosenOptions, - assertionPairFormatter: AssertionPairFormatter - ): TextAssertionFormatterOption = TextAssertionFormatterOptionImpl(options, assertionPairFormatter) - } -} - diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TranslatorOption.kt b/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TranslatorOption.kt deleted file mode 100644 index 504fa91f1..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/TranslatorOption.kt +++ /dev/null @@ -1,48 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress( - // TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed - "JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE", - "DEPRECATION" -) - -package ch.tutteli.atrium.domain.builders.reporting - -import ch.tutteli.atrium.core.CoreFactory -import ch.tutteli.atrium.core.migration.toAtriumLocale -import ch.tutteli.atrium.reporting.translating.TranslatableWithArgs -import ch.tutteli.atrium.reporting.translating.Translator - -/** - * Provides options to create a [Translator]. - */ -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -actual interface TranslatorOption : TranslatorOptionCommon { - - /** - * Uses [CoreFactory.newTranslator] as [Translator] where the specified [translationSupplier] is used to - * retrieve translations, the specified [localeOrderDecider] to determine candidate [java.util.Locale]s and - * [primaryLocale] is used as primary [java.util.Locale] and the optional [fallbackLocales] - * as fallback [java.util.Locale]s. - * - * @param primaryLocale The [java.util.Locale] for which the [Translator] will first search translations -- - * it will also be used to format arguments of [TranslatableWithArgs]. - * @param fallbackLocales One [java.util.Locale] after another (in the given order) will be considered as primary - * Locale in case no translation was found the previous primary Locale. - */ - @Deprecated( - "Use the overload which uses Atrium's [Locale]; will be removed latest with 1.0.0", - ReplaceWith( - "this.withDefaultTranslator(primaryLocale.toAtriumLocale(), *fallbackLocales.map { it.toAtriumLocale() }.toTypedArray())", - "ch.tutteli.atrium.core.migration.toAtriumLocale" - ) - ) - fun withDefaultTranslator( - primaryLocale: java.util.Locale, - vararg fallbackLocales: java.util.Locale - ): ObjectFormatterOption = - @Suppress("DEPRECATION" /* TODO remove with 1.0.0 */) - withDefaultTranslator( - primaryLocale.toAtriumLocale(), - *fallbackLocales.map { it.toAtriumLocale() }.toTypedArray() - ) -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterBuilderImpl.kt b/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterBuilderImpl.kt deleted file mode 100644 index a805db727..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/kotlin/ch/tutteli/atrium/domain/builders/reporting/impl/ReporterBuilderImpl.kt +++ /dev/null @@ -1,30 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress( - // TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed - "JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE", "DEPRECATION" -) - -package ch.tutteli.atrium.domain.builders.reporting.impl - -import ch.tutteli.atrium.core.coreFactory -import ch.tutteli.atrium.domain.builders.reporting.LocaleOrderDeciderOption -import ch.tutteli.atrium.domain.builders.reporting.ObjectFormatterOption -import ch.tutteli.atrium.domain.builders.reporting.ReporterBuilder -import ch.tutteli.atrium.reporting.translating.Locale -import ch.tutteli.atrium.reporting.translating.TranslationSupplier -import ch.tutteli.atrium.reporting.translating.Translator -import ch.tutteli.atrium.reporting.translating.UsingDefaultTranslator - -@Deprecated("Configure components via withOptions when creating an expectation verb instead; will be removed with 0.17.0") -internal actual object ReporterBuilderImpl : ReporterBuilder { - - override fun withoutTranslations(primaryLocale: Locale) = withTranslator(UsingDefaultTranslator(primaryLocale)) - - override fun withTranslator(translator: Translator) = ObjectFormatterOption.create(translator) - - override fun withDefaultTranslationSupplier() = - withTranslationSupplier(coreFactory.newPropertiesBasedTranslationSupplier()) - - override fun withTranslationSupplier(translationSupplier: TranslationSupplier) = - LocaleOrderDeciderOption.create(translationSupplier) -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/resources/META-INF/services/ch.tutteli.atrium.reporting.ReporterFactory b/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/resources/META-INF/services/ch.tutteli.atrium.reporting.ReporterFactory deleted file mode 100644 index b0e8da851..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/main/resources/META-INF/services/ch.tutteli.atrium.reporting.ReporterFactory +++ /dev/null @@ -1 +0,0 @@ -ch.tutteli.atrium.domain.builders.reporting.impl.DefaultReporterFactory diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/module/module-info.java b/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/module/module-info.java deleted file mode 100644 index 369de5079..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/module/module-info.java +++ /dev/null @@ -1,15 +0,0 @@ -module ch.tutteli.atrium.domain.builders { - requires transitive ch.tutteli.atrium.domain.api; - requires transitive ch.tutteli.atrium.core.api; - requires static ch.tutteli.atrium.translations.en_GB; - requires kotlin.stdlib; - - exports ch.tutteli.atrium.domain.builders.creating; - exports ch.tutteli.atrium.domain.builders.creating.collectors; - exports ch.tutteli.atrium.domain.builders.reporting; - exports ch.tutteli.atrium.domain.builders.utils; - - //TODO 0.17.0 remove - provides ch.tutteli.atrium.reporting.ReporterFactory - with ch.tutteli.atrium.domain.builders.reporting.impl.DefaultReporterFactory; -} diff --git a/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/test/java/ch/tutteli/atrium/domain/builders/utils/Test.java b/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/test/java/ch/tutteli/atrium/domain/builders/utils/Test.java deleted file mode 100644 index d4c4e1451..000000000 --- a/misc/deprecated/domain/builders/atrium-domain-builders-jvm/src/test/java/ch/tutteli/atrium/domain/builders/utils/Test.java +++ /dev/null @@ -1,57 +0,0 @@ -package ch.tutteli.atrium.domain.builders.utils; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class Test { - - public List getStrings() { - ArrayList list = new ArrayList<>(); - list.add(null); - list.add("hello"); - return list; - } - - public String[] getStringArray() { - String[] arr = new String[2]; - return getStrings().toArray(arr); - } - - public String getString() { - return null; - } - - public Map getNumbersWithString() { - HashMap map = new HashMap<>(); - map.put(1, null); - map.put(2, "hello"); - map.put(null, "tada"); - return map; - } - - public Integer arg0() { - return 0; - } - - public Integer arg1(int a1) { - return 1; - } - - public Integer arg2(int a1, int a2) { - return 2; - } - - public Integer arg3(int a1, int a2, int a3) { - return 3; - } - - public Integer arg4(int a1, int a2, int a3, int a4) { - return 4; - } - - public Integer arg5(int a1, int a2, int a3, int a4, int a5) { - return 5; - } -} diff --git a/misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-common/build.gradle b/misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-common/build.gradle deleted file mode 100644 index aaa08cf64..000000000 --- a/misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-common/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ -description = 'Contains the bits and pieces behind robstoll\'s implementation' + - 'of the domain of Atrium as common module. You should only depend on this module if you are ' + - 'providing an implementation as well and want to reuse certain artifacts. ' + - 'If you are a consumer of Atrium, then you should depend on atrium-domain-robstoll instead.' - -dependencies { - api prefixedProject('domain-builders-common') - - // it is up to the consumer of atrium-domain-robstoll-lib which atrium-translations module is used at runtime - compileOnly prefixedProject('translations-en_GB-common') - - testImplementation prefixedProject('specs-common') -} diff --git a/misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/domain/robstoll/lib/creating/collectors/collectAssertions.kt b/misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/domain/robstoll/lib/creating/collectors/collectAssertions.kt deleted file mode 100644 index 4b6fc784b..000000000 --- a/misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-common/src/main/kotlin/ch/tutteli/atrium/domain/robstoll/lib/creating/collectors/collectAssertions.kt +++ /dev/null @@ -1,70 +0,0 @@ -package ch.tutteli.atrium.domain.robstoll.lib.creating.collectors - -import ch.tutteli.atrium.assertions.Assertion -import ch.tutteli.atrium.assertions.AssertionGroup -import ch.tutteli.atrium.assertions.builders.assertionBuilder -import ch.tutteli.atrium.assertions.builders.invisibleGroup -import ch.tutteli.atrium.core.ExperimentalNewExpectTypes -import ch.tutteli.atrium.core.Option -import ch.tutteli.atrium.creating.CollectingExpect -import ch.tutteli.atrium.creating.Expect -import ch.tutteli.atrium.creating.ExperimentalComponentFactoryContainer -import ch.tutteli.atrium.creating.impl.DefaultComponentFactoryContainer -import ch.tutteli.atrium.reporting.Text -import ch.tutteli.atrium.translations.DescriptionBasic - -fun _collect( - maybeSubject: Option, - assertionCreator: Expect.() -> Unit -): Assertion { - @Suppress("DEPRECATION" /* OptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */) - @UseExperimental(ExperimentalNewExpectTypes::class, ExperimentalComponentFactoryContainer::class) - //we shouldn't use DefaultComponentFactoryContainer but the one from the container. - // Yet, since we remove this with 0.17.0 we don't fix it. - val collectedAssertions = CollectingExpect(maybeSubject, DefaultComponentFactoryContainer) - .addAssertionsCreatedBy(assertionCreator) - .getAssertions() - return if (collectedAssertions.size > 1) { - assertionBuilder.invisibleGroup.withAssertions(collectedAssertions).build() - } else { - collectedAssertions[0] - } -} - -fun _collectForComposition( - maybeSubject: Option, - assertionCreatorOrNull: (Expect.() -> Unit)? -): List = collectAssertions(maybeSubject, assertionCreatorOrNull) - -private fun collectAssertions( - maybeSubject: Option, - assertionCreatorOrNull: (Expect.() -> Unit)? -): List { - return if (assertionCreatorOrNull != null) { - @Suppress("DEPRECATION" /* OptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */) - @UseExperimental(ExperimentalNewExpectTypes::class, ExperimentalComponentFactoryContainer::class) - CollectingExpect(maybeSubject, DefaultComponentFactoryContainer) - .addAssertionsCreatedBy(assertionCreatorOrNull) - .getAssertions() - } else { - listOf(assertionBuilder.createDescriptive(DescriptionBasic.IS, Text.NULL) { - maybeSubject.isDefined() - }) - } -} - - -/** - * Calls recursively [AssertionGroup.assertions] on every assertion group contained in [assertions]. - */ -internal tailrec fun expandAssertionGroups(assertions: List) { - if (assertions.isEmpty()) return - - expandAssertionGroups( - assertions - .asSequence() - .filterIsInstance() - .flatMap { it.assertions.asSequence() } - .toList() - ) -} diff --git a/misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-js/build.gradle b/misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-js/build.gradle deleted file mode 100644 index 48a7cd20a..000000000 --- a/misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-js/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ -description = 'Contains the bits and pieces behind robstoll\'s implementation' + - 'of the domain of Atrium for the JS platform. You should only depend on this module if you are ' + - 'providing an implementation as well and want to reuse certain artifacts. ' + - 'If you are a consumer of Atrium, then you should depend on atrium-domain-robstoll instead.' - -dependencies { - api prefixedProject('domain-builders-js') - - // it is up to the consumer of atrium-domain-robstoll-lib which atrium-translations module is used at runtime - compileOnly prefixedProject('translations-en_GB-js') - - testImplementation prefixedProject('specs-js') -} diff --git a/misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-jvm/build.gradle b/misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-jvm/build.gradle deleted file mode 100644 index fce9718e5..000000000 --- a/misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-jvm/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -description = 'Contains the bits and pieces behind robstoll\'s implementation' + - 'of the domain of Atrium for the JVM platform. You should only depend on this module if you are ' + - 'providing an implementation as well and want to reuse certain artifacts. ' + - 'If you are a consumer of Atrium, then you should depend on atrium-domain-robstoll instead.' - -ext.jacoco_additional = [ - prefixedProject('core-robstoll-jvm'), - prefixedProject('core-robstoll-lib-jvm'), -] - -dependencies { - api prefixedProject('domain-builders-jvm') - - implementation niok() - - // it is up to the consumer of atrium-domain-robstoll-lib which atrium-translations module is used at runtime - compileOnly prefixedProject('translations-en_GB-jvm') - - testImplementation prefixedProject('specs-jvm') -} - -//TODO should not be necessary https://youtrack.jetbrains.com/issue/KT-28124 -compileTestKotlin.dependsOn( - prefixedProject('core-robstoll-jvm').compileKotlin, - prefixedProject('core-robstoll-jvm').processResources, - prefixedProject('domain-robstoll-jvm').compileKotlin, - prefixedProject('domain-robstoll-jvm').processResources -) diff --git a/misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-jvm/src/module/module-info.java b/misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-jvm/src/module/module-info.java deleted file mode 100644 index 88a20790a..000000000 --- a/misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-jvm/src/module/module-info.java +++ /dev/null @@ -1,8 +0,0 @@ -module ch.tutteli.atrium.domain.robstoll.lib { - requires ch.tutteli.atrium.domain.builders; - requires static ch.tutteli.atrium.translations.en_GB; - requires kotlin.stdlib; - requires ch.tutteli.niok; - - exports ch.tutteli.atrium.domain.robstoll.lib.creating.collectors; -} diff --git a/misc/deprecated/domain/robstoll/atrium-domain-robstoll-common/build.gradle b/misc/deprecated/domain/robstoll/atrium-domain-robstoll-common/build.gradle deleted file mode 100644 index a0e5e3f70..000000000 --- a/misc/deprecated/domain/robstoll/atrium-domain-robstoll-common/build.gradle +++ /dev/null @@ -1,6 +0,0 @@ -description = 'robstoll\'s implementation of the domain of Atrium as common module' - -dependencies { - api prefixedProject('domain-api-common') - implementation prefixedProject('domain-robstoll-lib-common') -} diff --git a/misc/deprecated/domain/robstoll/atrium-domain-robstoll-common/src/main/kotlin/ch/tutteli/atrium/domain/robstoll/creating/collectors/AssertionCollectorImpl.kt b/misc/deprecated/domain/robstoll/atrium-domain-robstoll-common/src/main/kotlin/ch/tutteli/atrium/domain/robstoll/creating/collectors/AssertionCollectorImpl.kt deleted file mode 100644 index 0d24796c5..000000000 --- a/misc/deprecated/domain/robstoll/atrium-domain-robstoll-common/src/main/kotlin/ch/tutteli/atrium/domain/robstoll/creating/collectors/AssertionCollectorImpl.kt +++ /dev/null @@ -1,24 +0,0 @@ -//TODO remove file with 0.17.0 -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.robstoll.creating.collectors - -import ch.tutteli.atrium.core.Option -import ch.tutteli.atrium.creating.Expect -import ch.tutteli.atrium.domain.creating.collectors.AssertionCollector -import ch.tutteli.atrium.domain.robstoll.lib.creating.collectors._collect -import ch.tutteli.atrium.domain.robstoll.lib.creating.collectors._collectForComposition - -@Deprecated("Use assertionCollector from atrium-logic; will be removed with 0.17.0") -class AssertionCollectorImpl : AssertionCollector { - - override fun collect( - maybeSubject: Option, - assertionCreator: Expect.() -> Unit - ) = _collect(maybeSubject, assertionCreator) - - override fun collectForComposition( - maybeSubject: Option, - assertionCreator: Expect.() -> Unit - ) = _collectForComposition(maybeSubject, assertionCreator) -} diff --git a/misc/deprecated/domain/robstoll/atrium-domain-robstoll-js/build.gradle b/misc/deprecated/domain/robstoll/atrium-domain-robstoll-js/build.gradle deleted file mode 100644 index c78f4cc46..000000000 --- a/misc/deprecated/domain/robstoll/atrium-domain-robstoll-js/build.gradle +++ /dev/null @@ -1,6 +0,0 @@ -description = 'robstoll\'s implementation of the domain (assertion functions and builders) of Atrium for the JS platform.' - -dependencies { - api prefixedProject('domain-api-js') - implementation prefixedProject('domain-robstoll-lib-js') -} diff --git a/misc/deprecated/domain/robstoll/atrium-domain-robstoll-js/src/main/kotlin/ch/tutteli/atrium/domain/robstoll/dependOnMe.kt b/misc/deprecated/domain/robstoll/atrium-domain-robstoll-js/src/main/kotlin/ch/tutteli/atrium/domain/robstoll/dependOnMe.kt deleted file mode 100644 index c5f08b8ec..000000000 --- a/misc/deprecated/domain/robstoll/atrium-domain-robstoll-js/src/main/kotlin/ch/tutteli/atrium/domain/robstoll/dependOnMe.kt +++ /dev/null @@ -1,9 +0,0 @@ -package ch.tutteli.atrium.domain.robstoll - -/** - * Dummy function in order that other modules can define a dependency on atrium-domain-robstoll-js - */ -@Suppress("FunctionName") -@Deprecated("switch from domain-robstoll to atrium-logic and this is not necessary any more; will be removed latest with 1.0.0") -fun dependOn_atrium_domain_robstoll() { -} diff --git a/misc/deprecated/domain/robstoll/atrium-domain-robstoll-js/src/main/kotlin/ch/tutteli/atrium/domain/robstoll/registerServices.kt b/misc/deprecated/domain/robstoll/atrium-domain-robstoll-js/src/main/kotlin/ch/tutteli/atrium/domain/robstoll/registerServices.kt deleted file mode 100644 index 1b5636fc7..000000000 --- a/misc/deprecated/domain/robstoll/atrium-domain-robstoll-js/src/main/kotlin/ch/tutteli/atrium/domain/robstoll/registerServices.kt +++ /dev/null @@ -1,11 +0,0 @@ -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.domain.robstoll - -import ch.tutteli.atrium.core.polyfills.registerService - -@Suppress("unused" /* here in order that the code is executed when module is loaded */) -private val register = run { - - registerService { ch.tutteli.atrium.domain.robstoll.creating.collectors.AssertionCollectorImpl() } -} diff --git a/misc/deprecated/domain/robstoll/atrium-domain-robstoll-jvm/build.gradle b/misc/deprecated/domain/robstoll/atrium-domain-robstoll-jvm/build.gradle deleted file mode 100644 index 94cce41c4..000000000 --- a/misc/deprecated/domain/robstoll/atrium-domain-robstoll-jvm/build.gradle +++ /dev/null @@ -1,6 +0,0 @@ -description = 'robstoll\'s implementation of the domain (assertion functions and builders) of Atrium for the JVM platform.' - -dependencies { - api prefixedProject('domain-api-jvm') - implementation prefixedProject('domain-robstoll-lib-jvm') -} diff --git a/misc/deprecated/domain/robstoll/atrium-domain-robstoll-jvm/src/main/resources/META-INF/services/ch.tutteli.atrium.domain.creating.collectors.AssertionCollector b/misc/deprecated/domain/robstoll/atrium-domain-robstoll-jvm/src/main/resources/META-INF/services/ch.tutteli.atrium.domain.creating.collectors.AssertionCollector deleted file mode 100644 index 2a0d0ecbc..000000000 --- a/misc/deprecated/domain/robstoll/atrium-domain-robstoll-jvm/src/main/resources/META-INF/services/ch.tutteli.atrium.domain.creating.collectors.AssertionCollector +++ /dev/null @@ -1 +0,0 @@ -ch.tutteli.atrium.domain.robstoll.creating.collectors.AssertionCollectorImpl diff --git a/misc/deprecated/domain/robstoll/atrium-domain-robstoll-jvm/src/module/module-info.java b/misc/deprecated/domain/robstoll/atrium-domain-robstoll-jvm/src/module/module-info.java deleted file mode 100644 index 7d45a2946..000000000 --- a/misc/deprecated/domain/robstoll/atrium-domain-robstoll-jvm/src/module/module-info.java +++ /dev/null @@ -1,8 +0,0 @@ -module ch.tutteli.atrium.domain.robstoll { - requires transitive ch.tutteli.atrium.domain.api; - requires ch.tutteli.atrium.domain.robstoll.lib; - requires kotlin.stdlib; - - provides ch.tutteli.atrium.domain.creating.collectors.AssertionCollector - with ch.tutteli.atrium.domain.robstoll.creating.collectors.AssertionCollectorImpl; -} diff --git a/misc/kdoc/packages.md b/misc/kdoc/packages.md index c67f5d6be..b82e23de6 100644 --- a/misc/kdoc/packages.md +++ b/misc/kdoc/packages.md @@ -7,9 +7,9 @@ The following names do not include the platform specific suffixes which are `-co Bundle modules: - **atrium-fluent-en_GB** defines to have a dependency on - atrium-api-fluent-en_GB, atrium-translations-en_GB, atrium-logic and atrium-core-robstoll + atrium-api-fluent-en_GB, atrium-translations-en_GB and atrium-logic - **atrium-infix-en_GB-robstoll** defines to have a dependency on - atrium-api-infix-en_GB, atrium-translations-en_GB, atrium-logic and atrium-core-robstoll + atrium-api-infix-en_GB, atrium-translations-en_GB and atrium-logic API modules: - **atrium-api-fluent-en_GB** provides an assertion function API in English where the main @@ -47,15 +47,6 @@ Misc modules: - **atrium-verbs-internal** contains the assertion verbs Atrium uses internally - use with care, no backward compatibility guarantees. -Atrium has currently several modules to retain backward compatibility. -You should not rely on them and move to the suggested predecessor: -- **atrium-core-robstoll** use `atrium-api-core` instead. -- **atrium-core-robstoll-lib** use `atrium-logic` instead. -- **atrium-domain-api** use `atrium-logic` instead. -- **atrium-domain-robstoll** use `atrium-logic` instead. -- **atrium-domain-robstoll-lib** use `atrium-logic` instead. -- **atrium-domain-builders** use `atrium-logic` instead. - # ch.tutteli.atrium.api.fluent.en_GB Contains API which provides a pure fluent API in English and which has its design focus on usability in conjunction with code completion. @@ -135,27 +126,6 @@ Contains (default) implementations for feature related contracts. # ch.tutteli.atrium.creating.impl Contains (default) implementations for things like [Expect](./ch.tutteli.atrium.creating/-expect/index.html). - -# ch.tutteli.atrium.domain.builders.creating -**Deprecated** - will be removed with 0.17.0. Contains builders involved in delegating to assertion implementations. - -# ch.tutteli.atrium.domain.builders.creating.collectors -**Deprecated** - will be removed with 0.17.0. Contains the builder behind -[ExpectImpl.collector](./ch.tutteli.atrium.domain.builders.creating.collectors/-assertion-collector-builder/index.html) - -# ch.tutteli.atrium.domain.builders.reporting -**Deprecated** - will be removed with 0.17.0. Contains the [ReporterBuilder](./ch.tutteli.atrium.domain.builders.reporting/-reporter-builder/index.html). - -# ch.tutteli.atrium.domain.builders.utils -**Deprecated** - will be removed with 0.17.0. Contains utility functions for APIs. - -# ch.tutteli.atrium.domain.creating -**Deprecated** - will be removed with 0.17.0. Contains interfaces defining the minimum set of assertion functions (on level domain) which an implementation has to provide. - -# ch.tutteli.atrium.domain.creating.collectors -**Deprecated** - will be removed with 0.17.0. Contains [AssertionCollector](./ch.tutteli.atrium.domain.creating.collectors/-assertion-collector/index.html). - - # ch.tutteli.atrium.logic Contains all the assertion interfaces (e.g. [AnyAssertions](./ch.tutteli.atrium.logic/-any-assertions/index.html) as well as [_logic](./ch.tutteli.atrium.logic/_logic.html) and helper functions for [AssertionContainer](./ch.tutteli.atrium.creating/-assertion-container/index.html) diff --git a/misc/specs/atrium-specs-common/build.gradle b/misc/specs/atrium-specs-common/build.gradle index 3523d5468..25d0c8579 100644 --- a/misc/specs/atrium-specs-common/build.gradle +++ b/misc/specs/atrium-specs-common/build.gradle @@ -1,21 +1,14 @@ description = 'Provides specifications of Atrium (as common module) which can be reused by ' + - 'APIs and domain/core-implementations of Atrium, to verify that they fulfill the specification.' + 'APIs and logic/core implementations of Atrium, to verify that they fulfill the specification.' dependencies { - api prefixedProject('domain-api-common') api prefixedProject('core-api-common') - api prefixedProject('domain-builders-common') // exclude this dependency in case you want to use another translation api prefixedProject('translations-en_GB-common') api prefixedProject('verbs-internal-common') api "io.mockk:mockk-common:$mockkVersion" implementation prefixedProject('api-fluent-en_GB-common') - - // exclude this dependency in case you want to use another implementation - runtimeOnly prefixedProject('core-robstoll-common') - //TODO remove with 0.17.0 - runtimeOnly prefixedProject('domain-robstoll-common') } dependencies { diff --git a/misc/specs/atrium-specs-js/build.gradle b/misc/specs/atrium-specs-js/build.gradle index 9cdcb6636..283c9465e 100644 --- a/misc/specs/atrium-specs-js/build.gradle +++ b/misc/specs/atrium-specs-js/build.gradle @@ -1,20 +1,13 @@ description = 'Provides specifications of Atrium (for the JS platforms) which can be reused by ' + - 'APIs and domain/core-implementations of Atrium, to verify that they fulfill the specification.' + 'APIs and logic/core implementations of Atrium, to verify that they fulfill the specification.' dependencies { - api prefixedProject('domain-api-js') api prefixedProject('core-api-js') - api prefixedProject('domain-builders-js') // exclude this dependency in case you want to use another translation api prefixedProject('translations-en_GB-js') api prefixedProject('verbs-internal-js') api "io.mockk:mockk-dsl-js:$mockkVersion" - // exclude these dependencies in case you want to use another implementation - // `api` and not `implementation` in order that a depending module can use dependOn_... - api prefixedProject('core-robstoll-js') - api prefixedProject('domain-robstoll-js') - implementation prefixedProject('api-fluent-en_GB-js') } diff --git a/misc/specs/atrium-specs-jvm/build.gradle b/misc/specs/atrium-specs-jvm/build.gradle index 49a949800..a0fa6e37b 100644 --- a/misc/specs/atrium-specs-jvm/build.gradle +++ b/misc/specs/atrium-specs-jvm/build.gradle @@ -1,10 +1,8 @@ description = 'Provides specifications of Atrium (for the JVM platform) which can be reused by ' + - 'APIs and domain/core-implementations of Atrium, to verify that they fulfill the specification.' + 'APIs and logic/core implementations of Atrium, to verify that they fulfill the specification.' dependencies { - api prefixedProject('domain-api-jvm') api prefixedProject('core-api-jvm') - api prefixedProject('domain-builders-jvm') // exclude this dependency in case you want to use another translation api prefixedProject('translations-en_GB-jvm') api prefixedProject('verbs-internal-jvm') @@ -12,10 +10,6 @@ dependencies { api "io.mockk:mockk:$mockkVersion" implementation prefixedProject('api-fluent-en_GB-jvm') - - // exclude this dependency in case you want to use another implementation - runtimeOnly prefixedProject('core-robstoll-jvm') - runtimeOnly prefixedProject('domain-robstoll-jvm') } dependencies { diff --git a/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/reporting/TextFeatureAssertionGroupFormatterSpec.kt b/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/reporting/TextFeatureAssertionGroupFormatterSpec.kt index a1dd03686..08b383080 100644 --- a/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/reporting/TextFeatureAssertionGroupFormatterSpec.kt +++ b/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/reporting/TextFeatureAssertionGroupFormatterSpec.kt @@ -7,6 +7,7 @@ import ch.tutteli.atrium.assertions.BulletPointIdentifier import ch.tutteli.atrium.assertions.DefaultListAssertionGroupType import ch.tutteli.atrium.assertions.FeatureAssertionGroupType import ch.tutteli.atrium.assertions.builders.assertionBuilder +import ch.tutteli.atrium.creating.ExperimentalComponentFactoryContainer import ch.tutteli.atrium.reporting.AssertionFormatter import ch.tutteli.atrium.reporting.AssertionFormatterController import ch.tutteli.atrium.reporting.ObjectFormatter @@ -24,6 +25,8 @@ import ch.tutteli.atrium.specs.reporting.translating.TranslatorIntSpec import org.spekframework.spek2.style.specification.Suite import kotlin.reflect.KClass +@Suppress("DEPRECATION" /* OptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */) +@UseExperimental(ExperimentalComponentFactoryContainer::class) abstract class TextFeatureAssertionGroupFormatterSpec( testeeFactory: (Map, String>, AssertionFormatterController, ObjectFormatter, Translator) -> AssertionFormatter, describePrefix: String = "[Atrium] " diff --git a/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/reporting/TextListBasedAssertionGroupFormatterSpec.kt b/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/reporting/TextListBasedAssertionGroupFormatterSpec.kt index d2effcdf8..b9cc2e643 100644 --- a/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/reporting/TextListBasedAssertionGroupFormatterSpec.kt +++ b/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/reporting/TextListBasedAssertionGroupFormatterSpec.kt @@ -4,6 +4,7 @@ import ch.tutteli.atrium.api.fluent.en_GB.toBe import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.assertions.* import ch.tutteli.atrium.assertions.builders.assertionBuilder +import ch.tutteli.atrium.creating.ExperimentalComponentFactoryContainer import ch.tutteli.atrium.reporting.AssertionFormatter import ch.tutteli.atrium.reporting.AssertionFormatterController import ch.tutteli.atrium.reporting.ObjectFormatter @@ -21,6 +22,8 @@ import ch.tutteli.atrium.specs.reporting.translating.TranslatorIntSpec import org.spekframework.spek2.style.specification.Suite import kotlin.reflect.KClass +@Suppress("DEPRECATION" /* OptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */) +@UseExperimental(ExperimentalComponentFactoryContainer::class) abstract class TextListBasedAssertionGroupFormatterSpec( testeeFactory: (Map, String>, AssertionFormatterController, ObjectFormatter, Translator) -> AssertionFormatter, assertionGroupClass: Class, diff --git a/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/reporting/translating/RealTranslatorIntSpec.kt b/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/reporting/translating/RealTranslatorIntSpec.kt deleted file mode 100644 index bad01dba5..000000000 --- a/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/reporting/translating/RealTranslatorIntSpec.kt +++ /dev/null @@ -1,335 +0,0 @@ -package ch.tutteli.atrium.specs.reporting.translating - -import ch.tutteli.atrium.api.fluent.en_GB.* -import ch.tutteli.atrium.api.verbs.internal.expect -import ch.tutteli.atrium.core.ExperimentalNewExpectTypes -import ch.tutteli.atrium.creating.ExperimentalComponentFactoryContainer -import ch.tutteli.atrium.logic.creating.RootExpectBuilder -import ch.tutteli.atrium.reporting.translating.Locale -import ch.tutteli.atrium.reporting.translating.StringBasedTranslatable -import ch.tutteli.atrium.reporting.translating.TranslatableWithArgs -import ch.tutteli.atrium.specs.AssertionVerb -import ch.tutteli.atrium.specs.prefixedDescribeTemplate -import ch.tutteli.atrium.translations.DescriptionAnyAssertion -import ch.tutteli.atrium.translations.DescriptionComparableAssertion -import org.spekframework.spek2.Spek -import org.spekframework.spek2.style.specification.Suite -import java.text.SimpleDateFormat - -/** - * If you use this Spec then your reporter needs to use a translator which uses the following translations - * which should be in - * - * the primary local: de_CH - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE = ist - * - * the primary Locale's natural first fallback: de - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE = ist (de) - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE = ist nicht - * - * the fallback Locale: fr - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE = est - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE = n'est pas - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_NOT_SAME = n'est pas la même instance que - * ch.tutteli.atrium.spec.AssertionVerb-ASSERT = il applique que - * ch.tutteli.atrium.spec.reporting.translating.TranslatorIntSpec.TestTranslatable-DATE_KNOWN = %tD était %tA - * ch.tutteli.atrium.spec.reporting.translating.TranslatioIntSpec.TestTranslatable-PLACEHOLDER = Caractère de remplacement %s - * - * the Locale it: - * ch.tutteli.atrium.spec.reporting.translating.TranslatorIntSpec.TestTranslatable-DATE_KNOWN = solo %tA!! - * ch.tutteli.atrium.spec.reporting.translating.TranslatorIntSpec.TestTranslatable-DATE_UNKNOWN = solo %tA!! - * - * the Locale zh_Hant_TW: - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE = TO_BE zh_Hant_TW - * - * the Locale zh_TW: - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=TO_BE zh_TW - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE=NOT_TO_BE zh_TW - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_NOT_SAME=IS_NOT_SAME zh_TW - * - * the Locale zh_Hant_HK: - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE = TO_BE zh_Hant_HK - * - * the Locale zh_HK: - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=TO_BE zh_HK - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE=NOT_TO_BE zh_HK - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_NOT_SAME=IS_NOT_SAME zh_HK - * - * the Locale zh_Hant_MO: - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE = TO_BE zh_Hant_MO - * - * the Locale zh_MO: - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=TO_BE zh_MO - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE=NOT_TO_BE zh_MO - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_NOT_SAME=IS_NOT_SAME zh_MO - * - * the natural first fallback of zh_TW, zh_TK, zh_MO: zh_Hant - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE = zh_Hant - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE = NOT_TO_BE zh_Hant - * - * the Locale zh_Hans_CN: - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE = TO_BE zh_Hans_CN - * - * the Locale zh_CN: - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=TO_BE zh_CN - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE=NOT_TO_BE zh_CN - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_NOT_SAME=IS_NOT_SAME zh_CN - * - * the Locale zh_Hans_SG: - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE = TO_BE zh_Hans_SG - * - * the Locale zh_SG: - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE=TO_BE zh_SG - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE=NOT_TO_BE zh_SG - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_NOT_SAME=IS_NOT_SAME zh_SG - * - * the natural first fallback of zh_CN and zh_SG: zh_Hans - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE = TO_BE zh_Hans - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE = NOT_TO_BE zh_Hans - * - * the natural second fallback for zh_... => zh - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-TO_BE =TO_BE zh - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-NOT_TO_BE=NOT_TO_BE zh - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_NOT_SAME=IS_NOT_SAME zh - * ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_SAME=IS_SAME zh - */ -//TODO 1.0.0 rename to TranslatorIntSpec -@ExperimentalComponentFactoryContainer -abstract class RealTranslatorIntSpec( - translatorConfiguration: (RootExpectBuilder.OptionsChooser<*>, Locale, List) -> Unit, - //TODO Remove as soon as https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8193496 is fixed in JDK8 - withSpecialCases: Boolean = true, - describePrefix: String = "[Atrium] " -) : Spek({ - - fun prefixedDescribe(description: String, body: Suite.() -> Unit) = - prefixedDescribeTemplate(describePrefix, description, body) - - @Suppress("DEPRECATION" /* OptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */) - @UseExperimental(ExperimentalNewExpectTypes::class, ExperimentalComponentFactoryContainer::class) - fun assertWithDeCh_Fr(subject: T) = - RootExpectBuilder.forSubject(subject) - .withVerb(AssertionVerb.ASSERT) - .withOptions { - translatorConfiguration(this, Locale("de", "CH"), listOf(Locale("fr"))) - } - .build() - - @Suppress("DEPRECATION" /* OptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */) - @UseExperimental(ExperimentalNewExpectTypes::class, ExperimentalComponentFactoryContainer::class) - fun assertWithDeCh_FrCh_ItCh(subject: T) = - RootExpectBuilder.forSubject(subject) - .withVerb(AssertionVerb.ASSERT) - .withOptions { - translatorConfiguration(this, Locale("de", "CH"), listOf(Locale("fr", "CH"), Locale("it", "CH"))) - } - .build() - - val descriptionAnyAssertion = DescriptionAnyAssertion::class.simpleName - val testTranslatable = TestTranslatable::class.simpleName - - val descriptionComparableAssertion = DescriptionComparableAssertion::class.simpleName - val toBe = DescriptionAnyAssertion.TO_BE - val notToBe = DescriptionAnyAssertion.NOT_TO_BE - val isNotSame = DescriptionAnyAssertion.IS_NOT_SAME - val isSame = DescriptionAnyAssertion.IS_SAME - val firstOfFeb2017 = SimpleDateFormat("dd.MM.yyyy").parse("01.02.2017") - - prefixedDescribe("primary locale is 'de_CH' and fallback is 'fr'") { - - context("properties file for $descriptionAnyAssertion is provided for 'de_CH'") { - - describe("translation for $descriptionAnyAssertion.$toBe is provided for 'de_CH'") { - it("a failing assertion contains 'ist' instead of 'to be' in the error message") { - expect { - assertWithDeCh_Fr(1).toBe(2) - }.toThrow { messageContains("ist: 2") } - } - } - - describe("translation for $descriptionAnyAssertion.$notToBe is provided for 'de'") { - val text = "ist nicht" - it("a failing assertion contains '$text' instead of 'not to be' in the error message") { - expect { - assertWithDeCh_Fr(1).notToBe(1) - }.toThrow { messageContains("$text: 1") } - } - } - - describe("translation for $descriptionAnyAssertion.$isNotSame is provided 'fr'") { - val text = "n'est pas la même instance que" - it("a failing assertion contains '$text' instead of 'assert' in the error message") { - expect { - assertWithDeCh_Fr(1).isNotSameAs(1) - }.toThrow { messageContains("$text: 1") } - } - } - } - - context("properties file for ${AssertionVerb::class.simpleName} is not provided for 'de_CH' nor one of its parents") { - describe("translation for ${AssertionVerb::class.simpleName}.${AssertionVerb.ASSERT} is provided for 'fr'") { - val text = "il applique que" - it("a failing assertion contains '$text' instead of 'assert' in the error message") { - expect { - assertWithDeCh_Fr(1).toBe(2) - }.toThrow { messageContains("$text: 1") } - } - } - - describe("translation for $descriptionComparableAssertion.${DescriptionComparableAssertion.IS_LESS_THAN} is not provided for 'fr'") { - it("throws an AssertionError which message contains the default of $descriptionComparableAssertion.${DescriptionComparableAssertion.IS_LESS_THAN}") { - expect { - assertWithDeCh_Fr(1).isLessThan(1) - }.toThrow { messageContains("${DescriptionComparableAssertion.IS_LESS_THAN.getDefault()}: 1") } - } - } - - - describe("translation for $testTranslatable.${TestTranslatable.DATE_KNOWN} (with a date as parameter) is provided for 'fr' and 'it'") { - it("uses the translation form 'fr' but the primary Locale to format the date") { - expect { - assertWithDeCh_Fr(1).createAndAddAssertion( - TranslatableWithArgs( - TestTranslatable.DATE_KNOWN, - firstOfFeb2017, - firstOfFeb2017 - ), 1 - ) { false } - }.toThrow { messageContains("02/01/17 était Mittwoch!!") } - } - } - - describe("translation for $testTranslatable.${TestTranslatable.DATE_UNKNOWN} (with a date as parameter) is provided for 'it' but not for 'fr'") { - it("uses default translation but the primary Locale to format the date") { - expect { - assertWithDeCh_Fr(1).createAndAddAssertion( - TranslatableWithArgs( - TestTranslatable.DATE_UNKNOWN, - firstOfFeb2017 - ), 1 - ) { false } - }.toThrow { messageContains("only Mittwoch") } - } - } - - describe( - "translation for $testTranslatable.${TestTranslatable.PLACEHOLDER} " - + "with $descriptionAnyAssertion.$toBe as Placeholder" - ) { - it( - "uses the translation from 'fr' for $testTranslatable.${TestTranslatable.PLACEHOLDER} " - + "and the translation from 'ch' for $descriptionAnyAssertion.$toBe" - ) { - expect { - assertWithDeCh_Fr(1).createAndAddAssertion( - TranslatableWithArgs( - TestTranslatable.PLACEHOLDER, - toBe - ), 1 - ) { false } - }.toThrow { messageContains("Caractère de remplacement ist") } - } - } - } - } - - prefixedDescribe("primary locale is 'de_CH', fallback is 'fr' and then 'it'") { - context("properties file for ${AssertionVerb::class.simpleName} is not provided for 'de_CH' nor one of its parents") { - describe("translation for $descriptionComparableAssertion.${DescriptionComparableAssertion.IS_LESS_THAN} is not provided for 'fr' nor for 'it'") { - it("throws an AssertionError which message contains the default of $descriptionComparableAssertion.${DescriptionComparableAssertion.IS_LESS_THAN}") { - expect { - assertWithDeCh_FrCh_ItCh(1).isLessThan(1) - }.toThrow { messageContains("${DescriptionComparableAssertion.IS_LESS_THAN.getDefault()}: 1") } - } - } - describe("translation for $testTranslatable.${TestTranslatable.DATE_KNOWN} (with a date as parameter) is provided for 'fr' and 'it'") { - it("uses the translation form 'fr' but the primary Locale to format the date") { - expect { - assertWithDeCh_FrCh_ItCh(1).createAndAddAssertion( - TranslatableWithArgs( - TestTranslatable.DATE_KNOWN, - firstOfFeb2017, - firstOfFeb2017 - ), 1 - ) { false } - }.toThrow { messageContains("02/01/17 était Mittwoch!!") } - } - } - - describe("translation for $testTranslatable.${TestTranslatable.DATE_UNKNOWN} (with a date as parameter) is provided for 'it' but not for 'fr'") { - it("uses 'it' but the primary Locale to format the date") { - expect { - assertWithDeCh_FrCh_ItCh(1).createAndAddAssertion( - TranslatableWithArgs( - TestTranslatable.DATE_UNKNOWN, - firstOfFeb2017 - ), 1 - ) { false } - }.toThrow { messageContains("solo Mittwoch!!") } - } - } - } - } - - mapOf( - "Hant" to listOf("TW", "HK", "MO"), - "Hans" to listOf("CN", "SG") - ).forEach { (script, countries) -> - val zhWithScript = "zh_$script" - countries.forEach { country -> - val locale = Locale("zh", country) - - - @Suppress("DEPRECATION" /* OptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */) - @UseExperimental(ExperimentalNewExpectTypes::class, ExperimentalComponentFactoryContainer::class) - val assert = RootExpectBuilder.forSubject(1) - .withVerb(AssertionVerb.ASSERT) - .withOptions { - translatorConfiguration(this, locale, emptyList()) - } - .build() - - prefixedDescribe("primary locale is 'zh_$country' and no fallback defined") { - if (withSpecialCases) { - describe("translation for $descriptionAnyAssertion.$toBe is provided for 'zh_$country' and for ${zhWithScript}_$country") { - it("a failing assertion contains '$toBe ${zhWithScript}_$country' instead of 'to be' in the error message") { - expect { - assert.toBe(2) - }.toThrow { messageContains("$toBe ${zhWithScript}_$country: 2") } - } - } - describe("translation for $descriptionAnyAssertion.$notToBe is provided for 'zh_$country' and for $zhWithScript") { - it("a failing assertion contains '$notToBe $zhWithScript' instead of 'to be' in the error message") { - expect { - assert.notToBe(1) - }.toThrow { messageContains("$notToBe $zhWithScript: 1") } - } - } - } - describe("translation for $descriptionAnyAssertion.$isNotSame is provided for 'zh_$country' and zh") { - it("a failing assertion contains '$isNotSame zh_$country' instead of 'to be' in the error message") { - expect { - assert.isNotSameAs(1) - }.toThrow { messageContains("$isNotSame zh_$country: 1") } - } - } - describe("translation for $descriptionAnyAssertion.$isSame is not provided for 'zh_$country' but for zh") { - it("a failing assertion contains '$isSame zh' instead of 'to be' in the error message") { - expect { - assert.isSameAs(2) - }.toThrow { messageContains("$isSame zh: 2") } - } - } - } - } - } -}) { - /** - * Contains [StringBasedTranslatable]s which are used in [RealTranslatorIntSpec]. - */ - enum class TestTranslatable(override val value: String) : StringBasedTranslatable { - DATE_KNOWN("%tD is a %tA"), - DATE_UNKNOWN("only %tA"), - PLACEHOLDER("placeholder %s") - } -} diff --git a/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/reporting/translating/TranslatorIntSpec.kt b/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/reporting/translating/TranslatorIntSpec.kt index fa02a51f8..440086302 100644 --- a/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/reporting/translating/TranslatorIntSpec.kt +++ b/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/reporting/translating/TranslatorIntSpec.kt @@ -5,7 +5,6 @@ import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.core.ExperimentalNewExpectTypes import ch.tutteli.atrium.creating.ExperimentalComponentFactoryContainer import ch.tutteli.atrium.logic.creating.RootExpectBuilder -import ch.tutteli.atrium.reporting.Reporter import ch.tutteli.atrium.reporting.translating.Locale import ch.tutteli.atrium.reporting.translating.StringBasedTranslatable import ch.tutteli.atrium.reporting.translating.TranslatableWithArgs @@ -94,8 +93,10 @@ import java.text.SimpleDateFormat * ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_NOT_SAME=IS_NOT_SAME zh * ch.tutteli.atrium.translations.DescriptionAnyAssertion-IS_SAME=IS_SAME zh */ +//TODO 1.0.0 rename to TranslatorIntSpec +@ExperimentalComponentFactoryContainer abstract class TranslatorIntSpec( - reporterFactory: (Locale, Array) -> Reporter, + translatorConfiguration: (RootExpectBuilder.OptionsChooser<*>, Locale, List) -> Unit, //TODO Remove as soon as https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8193496 is fixed in JDK8 withSpecialCases: Boolean = true, describePrefix: String = "[Atrium] " @@ -110,21 +111,17 @@ abstract class TranslatorIntSpec( RootExpectBuilder.forSubject(subject) .withVerb(AssertionVerb.ASSERT) .withOptions { - withComponent(Reporter::class) { _ -> - reporterFactory(Locale("de", "CH"), arrayOf(Locale("fr"))) - } + translatorConfiguration(this, Locale("de", "CH"), listOf(Locale("fr"))) } .build() @Suppress("DEPRECATION" /* OptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */) @UseExperimental(ExperimentalNewExpectTypes::class, ExperimentalComponentFactoryContainer::class) - fun assertWithDeCh_Fr_It(subject: T) = + fun assertWithDeCh_FrCh_ItCh(subject: T) = RootExpectBuilder.forSubject(subject) .withVerb(AssertionVerb.ASSERT) .withOptions { - withComponent(Reporter::class) { _ -> - reporterFactory(Locale("de", "CH"), arrayOf(Locale("fr", "CH"), Locale("it", "CH"))) - } + translatorConfiguration(this, Locale("de", "CH"), listOf(Locale("fr", "CH"), Locale("it", "CH"))) } .build() @@ -241,14 +238,14 @@ abstract class TranslatorIntSpec( describe("translation for $descriptionComparableAssertion.${DescriptionComparableAssertion.IS_LESS_THAN} is not provided for 'fr' nor for 'it'") { it("throws an AssertionError which message contains the default of $descriptionComparableAssertion.${DescriptionComparableAssertion.IS_LESS_THAN}") { expect { - assertWithDeCh_Fr_It(1).isLessThan(1) + assertWithDeCh_FrCh_ItCh(1).isLessThan(1) }.toThrow { messageContains("${DescriptionComparableAssertion.IS_LESS_THAN.getDefault()}: 1") } } } describe("translation for $testTranslatable.${TestTranslatable.DATE_KNOWN} (with a date as parameter) is provided for 'fr' and 'it'") { it("uses the translation form 'fr' but the primary Locale to format the date") { expect { - assertWithDeCh_Fr_It(1).createAndAddAssertion( + assertWithDeCh_FrCh_ItCh(1).createAndAddAssertion( TranslatableWithArgs( TestTranslatable.DATE_KNOWN, firstOfFeb2017, @@ -262,7 +259,7 @@ abstract class TranslatorIntSpec( describe("translation for $testTranslatable.${TestTranslatable.DATE_UNKNOWN} (with a date as parameter) is provided for 'it' but not for 'fr'") { it("uses 'it' but the primary Locale to format the date") { expect { - assertWithDeCh_Fr_It(1).createAndAddAssertion( + assertWithDeCh_FrCh_ItCh(1).createAndAddAssertion( TranslatableWithArgs( TestTranslatable.DATE_UNKNOWN, firstOfFeb2017 @@ -288,9 +285,7 @@ abstract class TranslatorIntSpec( val assert = RootExpectBuilder.forSubject(1) .withVerb(AssertionVerb.ASSERT) .withOptions { - withComponent(Reporter::class) { _ -> - reporterFactory(locale, arrayOf()) - } + translatorConfiguration(this, locale, emptyList()) } .build() diff --git a/misc/tools/bc-tests/build.gradle.kts b/misc/tools/bc-tests/build.gradle.kts index 9b5d3b702..7562304c0 100644 --- a/misc/tools/bc-tests/build.gradle.kts +++ b/misc/tools/bc-tests/build.gradle.kts @@ -100,7 +100,8 @@ bcConfigs.forEach { (oldVersion, apis, pair) -> module: String, specifier: String, sourceSet: String, - target: String + target: String, + applyFixSrcIfDefined: Boolean ): TaskProvider<*> { val confName = "bcConf_${oldVersion}_${module}_${target}" configurations { @@ -126,7 +127,7 @@ bcConfigs.forEach { (oldVersion, apis, pair) -> // solved like this in order that we don't change the content after the unzip task because otherwise // we have to re-run unzip on every execution where it should suffice to do it once - if (project.extra.has(fixSrcPropertyName)) { + if (applyFixSrcIfDefined && project.extra.has(fixSrcPropertyName)) { fixSrc() } } @@ -138,8 +139,8 @@ bcConfigs.forEach { (oldVersion, apis, pair) -> fun compileTask(target: String) = tasks.named(if (sourceSet == "Main") "compileKotlin${target.capitalize()}" else "compile${sourceSet}Kotlin${target.capitalize()}") - targets.forEach { target -> - val unzip = createUnzipTask(module, specifier, sourceSet, target) + targets.forEachIndexed { index, target -> + val unzip = createUnzipTask(module, specifier, sourceSet, target, index == targets.size - 1) val compileTasks = when (target) { "common" -> targets.filter { it != "common" }.map { compileTask(it) } else -> listOf(compileTask(target)) @@ -579,17 +580,6 @@ listOf("0.14.0", "0.15.0").forEach { version -> } } - rewriteFile("src/commonMain/kotlin/main/kotlin/ch/tutteli/atrium/specs/verbs/VerbSpec.kt") { - it.replaceFirst("import ch.tutteli.atrium.domain.builders.ExpectImpl", "") - } - - rewriteFile("src/commonMain/kotlin/main/kotlin/ch/tutteli/atrium/specs/testutils/AsciiBulletPointReporterFactory.kt") { - it.replaceFirst( - " @Suppress(\"DEPRECATION\" /* TODO remove together with entry with 1.0.0 */)\n" + - " IndentAssertionGroupType::class to \"| \",", "" - ) - } - // fix specs, was a wrong implementation and the specs tested the wrong thing rewriteFile("src/commonMain/kotlin/main/kotlin/ch/tutteli/atrium/specs/integration/IterableAssertionsSpec.kt") { it.replaceFirst( @@ -615,6 +605,78 @@ listOf("0.14.0", "0.15.0").forEach { version -> file("src/commonMain/kotlin/main/kotlin/ch/tutteli/atrium/specs/checking/").deleteRecursively() file("src/commonMain/kotlin/main/kotlin/ch/tutteli/atrium/specs/creating/").deleteRecursively() file("src/commonMain/kotlin/main/kotlin/ch/tutteli/atrium/specs/reporting/TextIndentAssertionGroupFormatterSpec.kt").delete() + + // we removed ExpectBuilder in 0.17.0 + rewriteFile("src/commonMain/kotlin/main/kotlin/ch/tutteli/atrium/specs/SubjectLessSpec.kt") { + it + .replaceFirst("import ch.tutteli.atrium.core.coreFactory", "") + .replaceFirst( + "import ch.tutteli.atrium.domain.builders.reporting.ExpectBuilder\n" + + "import ch.tutteli.atrium.domain.builders.reporting.ExpectOptions", + "import ch.tutteli.atrium.logic.creating.RootExpectBuilder\n" + + "import ch.tutteli.atrium.creating.ExperimentalComponentFactoryContainer\n" + + "import ch.tutteli.atrium.core.ExperimentalNewExpectTypes\n" + + "import ch.tutteli.atrium.reporting.AtriumErrorAdjuster\n" + + "import ch.tutteli.atrium.reporting.erroradjusters.NoOpAtriumErrorAdjuster\n" + ) + .replaceFirst( + "val container = ExpectBuilder.forSubject(1.0)", + "@Suppress(\"DEPRECATION\" /* OptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */)\n" + + " @UseExperimental(ExperimentalNewExpectTypes::class, ExperimentalComponentFactoryContainer::class)\n" + + " val container = RootExpectBuilder.forSubject(1.0)" + ) + .replaceFirst( + ".withOptions(\n" + + " ExpectOptions(\n" + + " reporter = coreFactory.newOnlyFailureReporter(\n" + + " coreFactory.newAssertionFormatterFacade(coreFactory.newAssertionFormatterController()),\n" + + " coreFactory.newNoOpAtriumErrorAdjuster()\n" + + " )\n" + + " )\n" + + " )", ".withOptions {\n" + + " withComponent(AtriumErrorAdjuster::class) { _ -> NoOpAtriumErrorAdjuster }\n" + + " }" + ) + + } + + // ReporterFactory removed, needs to be done via ComponentFactoryContainer + file("src/commonMain/kotlin/main/kotlin/ch/tutteli/atrium/specs/testutils/AsciiBulletPointReporterFactory.kt").toPath() + .deleteIfExists() + //just don't bother to rewrite it and this one is not that important + file("src/commonMain/kotlin/main/kotlin/ch/tutteli/atrium/specs/verbs/VerbSpec.kt").toPath() + .deleteIfExists() + + rewriteFile("src/jvmMain/kotlin/main/kotlin/ch/tutteli/atrium/specs/integration/BigDecimalAssertionsSpec.kt") { + it.replaceFirst( + "import ch.tutteli.atrium.domain.builders.creating.PleaseUseReplacementException", + "import ch.tutteli.atrium.creating.PleaseUseReplacementException" + ) + } + + rewriteFile("src/jvmMain/kotlin/main/kotlin/ch/tutteli/atrium/specs/reporting/translating/TranslatorIntSpec.kt") { + it + .replaceFirst( + "import ch.tutteli.atrium.domain.builders.reporting.ExpectBuilder\n" + + "import ch.tutteli.atrium.domain.builders.reporting.ExpectOptions", + "import ch.tutteli.atrium.logic.creating.RootExpectBuilder\n" + + "import ch.tutteli.atrium.creating.ExperimentalComponentFactoryContainer\n" + + "import ch.tutteli.atrium.core.ExperimentalNewExpectTypes\n" + ) + .replaceFirst( + "abstract class TranslatorIntSpec(", + "@Suppress(\"DEPRECATION\" /* OptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */)\n" + + "@UseExperimental(ExperimentalNewExpectTypes::class, ExperimentalComponentFactoryContainer::class)\n" + + "abstract class TranslatorIntSpec(" + ) + .replace(Regex("ExpectBuilder\\.forSubject\\(([^\\)]+)\\)"), "RootExpectBuilder.forSubject\\($1\\)") + .replace( + Regex("\\.withOptions\\(ExpectOptions\\(reporter = ([^\\)]+)\\)\\)"), + ".withOptions\\{\n" + + " withComponent\\(Reporter::class\\) \\{ _ -> $1\\}\n" + + " \\}" + ) + } } } @@ -665,24 +727,115 @@ listOf("0.14.0", "0.15.0").forEach { version -> targetDir.resolve("META-INF") ) } + + // we removed WithAsciiReporter in 0.17.0 + listOf( + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/AnyAssertionsSpec.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ArrayAsListAssertionsSpec.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CharSequenceAssertionsSpec.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CharSequenceContainsSpecBase.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CollectionAssertionsSpec.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ComparableAssertionsSpec.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FeatureAssertionsBoundedReferenceAlternativeSpec.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FeatureAssertionsBoundedReferenceSpec.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FeatureAssertionsClassReferenceSpec.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FeatureAssertionsManualSpec.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/Fun0AssertionsSpec.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableAllAssertionsSpec.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableAssertionsSpec.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableContainsSpecBase.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IteratorAssertionSpec.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ListAssertionsSpec.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapAsEntriesAssertionsSpec.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapAssertionsSpec.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapEntryAssertionsSpec.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/PairAssertionsSpec.kt", + "src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ThrowableAssertionsSpec.kt", + "src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/BigDecimalAssertionsSpec.kt", + "src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoLocalDateAssertionsSpec.kt", + "src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoLocalDateTimeAssertionSpec.kt", + "src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoZonedDateTimeAssertionSpec.kt", + "src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FileAsPathAssertionsSpec.kt", + "src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/Fun0AssertionsJvmSpec.kt", + "src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/LocalDateAssertionsSpec.kt", + "src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/LocalDateTimeAssertionsSpec.kt", + "src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/OptionalAssertionsSpec.kt", + "src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/PathAssertionsSpec.kt", + "src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/PathFeatureAssertionsSpec.kt", + "src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ZonedDateTimeAssertionsSpec.kt" + ).forEach { file -> + rewriteFile(file) { + it + .replaceFirst("import ch.tutteli.atrium.specs.testutils.WithAsciiReporter", "") + .replaceFirst(": WithAsciiReporter()", "") + } + } } } - // we removed ch/tutteli/atrium/assertions/IndentAssertionGroupType in 0.16.0 but it is required for the setup in - // 0.14.0 and 0.15.0 in the AsciiBulletPointReporterFactory - with(project(":bc-tests:$version-api-infix-en_GB-bbc")) { - the().apply { - sourceSets { - val main = file("src/main/kotlin/") - val jvmTest by getting { - kotlin.srcDir(main) + + + listOf("fluent", "infix").forEach { apiShortName -> + with(project(":bc-tests:$version-api-$apiShortName-en_GB-bbc")) { + the().apply { + sourceSets { + val main = file("src/main/kotlin/") + val jvmTest by getting { + kotlin.srcDir(main) + } + main.mkdirs() + + // we removed ch.tutteli.atrium.domain.builders.utils.Group in 0.17.0 but it is + // required for the setup of bbc version 0.14.0 and 0.15.0. E.g. it is used in + // ch.tutteli.atrium.api.fluent.en_GB.IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec + main.resolve("Group.kt").writeText( + """ + package ch.tutteli.atrium.domain.builders.utils + interface Group { + /** + * Returns the members of the group as [List]. + */ + fun toList(): List + } + """.trimIndent() + ) + + //we removed PleaseUseReplacementException and it is used in a test - we could also forgive but + //this seems to be easier + main.resolve("PleaseUseReplacementException.kt").writeText( + """ + package ch.tutteli.atrium.domain.builders.creating + class PleaseUseReplacementException(reason: String) : Exception(reason) + """.trimIndent() + ) + // infix is using ReportFactory since it is using the AsciiReportFactory + main.resolve("ReporterFactory.kt").writeText( + """ + @file:Suppress("UNUSED_PARAMETER") + package ch.tutteli.atrium.reporting + import ch.tutteli.atrium.core.polyfills.loadServices + + val reporter: Reporter by lazy { + val id = "ascii" + val factory = loadServices(ReporterFactory::class) + .firstOrNull { it.id == id } + ?: throw IllegalStateException("Could not find ...") + + factory.create() + } + interface ReporterFactory { + val id: String + fun create(): Reporter + + companion object { + const val ATRIUM_PROPERTY_KEY = "ch.tutteli.atrium.reporting.reporterFactory" + fun specifyFactory(reporterFactoryId: String) {} + fun specifyFactoryIfNotYetSet(reporterFactoryId: String) {} + } + } + + """.trimIndent() + ) } - main.mkdirs() - main.resolve("IndentAssertionGroupType.kt").writeText( - """ - package ch.tutteli.atrium.assertions - class IndentAssertionGroupType - """.trimIndent() - ) } } } @@ -695,6 +848,12 @@ with(project(":bc-tests:0.15.0-api-infix-en_GB")) { .replace("import ch.tutteli.atrium.api.infix.en_GB.creating.map.KeyWithValueCreator", "") .replace("KeyWithValueCreator", "keyValue") } + + rewriteFile("src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapContainsSpecBase.kt") { + it + .replaceFirst("import ch.tutteli.atrium.specs.testutils.WithAsciiReporter", "") + .replaceFirst(": WithAsciiReporter()", "") + } } } diff --git a/misc/tools/readme-examples/build.gradle b/misc/tools/readme-examples/build.gradle index 717d027d8..fc4b930bf 100644 --- a/misc/tools/readme-examples/build.gradle +++ b/misc/tools/readme-examples/build.gradle @@ -14,7 +14,6 @@ dependencies { implementation kotlinStdlib() implementation prefixedProject('fluent-en_GB-jvm') - implementation prefixedProject('core-robstoll-lib-jvm') implementation niok() implementation spekExtensions() } diff --git a/misc/verbs-internal/atrium-verbs-internal-common/src/main/kotlin/ch.tutteli.atrium.api.verbs.internal/atriumVerbs.kt b/misc/verbs-internal/atrium-verbs-internal-common/src/main/kotlin/ch.tutteli.atrium.api.verbs.internal/atriumVerbs.kt index 95ca5d2c8..6865fbf66 100644 --- a/misc/verbs-internal/atrium-verbs-internal-common/src/main/kotlin/ch.tutteli.atrium.api.verbs.internal/atriumVerbs.kt +++ b/misc/verbs-internal/atrium-verbs-internal-common/src/main/kotlin/ch.tutteli.atrium.api.verbs.internal/atriumVerbs.kt @@ -3,15 +3,12 @@ package ch.tutteli.atrium.api.verbs.internal import ch.tutteli.atrium.api.verbs.internal.AssertionVerb.EXPECT import ch.tutteli.atrium.assertions.Assertion import ch.tutteli.atrium.core.ExperimentalNewExpectTypes -import ch.tutteli.atrium.core.polyfills.getAtriumProperty import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.creating.ExperimentalComponentFactoryContainer import ch.tutteli.atrium.creating.RootExpect import ch.tutteli.atrium.logic.creating.RootExpectBuilder import ch.tutteli.atrium.reporting.AtriumErrorAdjuster -import ch.tutteli.atrium.reporting.Reporter import ch.tutteli.atrium.reporting.erroradjusters.NoOpAtriumErrorAdjuster -import ch.tutteli.atrium.reporting.reporter import ch.tutteli.atrium.reporting.translating.StringBasedTranslatable /** @@ -29,11 +26,6 @@ fun expect(subject: T): RootExpect = .withVerb(EXPECT) .withOptions { withComponent(AtriumErrorAdjuster::class) { _ -> NoOpAtriumErrorAdjuster } - - // TODO 0.17.0 remove with removing getAtriumProperty (also means we cannot run bc for 0.14.0 and 0.15.0) - getAtriumProperty(ch.tutteli.atrium.reporting.ReporterFactory.ATRIUM_PROPERTY_KEY)?.let { - withComponent(Reporter::class) { reporter } - } } .build() diff --git a/misc/verbs-internal/atrium-verbs-internal-js/build.gradle b/misc/verbs-internal/atrium-verbs-internal-js/build.gradle index 8d4d367b1..01cf94010 100644 --- a/misc/verbs-internal/atrium-verbs-internal-js/build.gradle +++ b/misc/verbs-internal/atrium-verbs-internal-js/build.gradle @@ -4,7 +4,5 @@ dependencies { api prefixedProject('core-api-js') api prefixedProject('logic-js') - runtimeOnly prefixedProject('core-robstoll-js') - testImplementation prefixedProject('specs-js') } diff --git a/misc/verbs-internal/atrium-verbs-internal-jvm/build.gradle b/misc/verbs-internal/atrium-verbs-internal-jvm/build.gradle index 8744a8684..a3222c099 100644 --- a/misc/verbs-internal/atrium-verbs-internal-jvm/build.gradle +++ b/misc/verbs-internal/atrium-verbs-internal-jvm/build.gradle @@ -4,7 +4,5 @@ dependencies { api prefixedProject('core-api-jvm') api prefixedProject('logic-jvm') - runtimeOnly prefixedProject('core-robstoll-jvm') - testImplementation prefixedProject('specs-jvm') } diff --git a/misc/verbs-internal/atrium-verbs-internal-jvm/src/module/module-info.java b/misc/verbs-internal/atrium-verbs-internal-jvm/src/module/module-info.java index a908d9e65..d2acb6d2e 100644 --- a/misc/verbs-internal/atrium-verbs-internal-jvm/src/module/module-info.java +++ b/misc/verbs-internal/atrium-verbs-internal-jvm/src/module/module-info.java @@ -1,9 +1,6 @@ module ch.tutteli.atrium.verbs.internal { - requires ch.tutteli.atrium.domain.builders; + requires ch.tutteli.atrium.core.api; requires kotlin.stdlib; - //TODO 0.17.0 remove - uses ch.tutteli.atrium.reporting.ReporterFactory; - exports ch.tutteli.atrium.api.verbs.internal; } diff --git a/misc/verbs/atrium-verbs-jvm/build.gradle b/misc/verbs/atrium-verbs-jvm/build.gradle index 2e03eb4f6..f1dcc5b72 100644 --- a/misc/verbs/atrium-verbs-jvm/build.gradle +++ b/misc/verbs/atrium-verbs-jvm/build.gradle @@ -5,5 +5,4 @@ dependencies { api prefixedProject('core-api-jvm') testImplementation prefixedProject('specs-jvm') - testRuntimeOnly prefixedProject('core-robstoll-jvm') } diff --git a/misc/verbs/atrium-verbs-jvm/src/module/module-info.java b/misc/verbs/atrium-verbs-jvm/src/module/module-info.java index 86db9f6ca..5daac368f 100644 --- a/misc/verbs/atrium-verbs-jvm/src/module/module-info.java +++ b/misc/verbs/atrium-verbs-jvm/src/module/module-info.java @@ -1,9 +1,6 @@ module ch.tutteli.atrium.verbs { - requires ch.tutteli.atrium.domain.builders; + requires ch.tutteli.atrium.core.api; requires kotlin.stdlib; - //TODO 0.17.0 remove - uses ch.tutteli.atrium.reporting.ReporterFactory; - exports ch.tutteli.atrium.api.verbs; } diff --git a/samples/js/src/test/kotlin/testSetup.kt b/samples/js/src/test/kotlin/testSetup.kt deleted file mode 100644 index 10196e352..000000000 --- a/samples/js/src/test/kotlin/testSetup.kt +++ /dev/null @@ -1,4 +0,0 @@ -import ch.tutteli.atrium.fluent.en_GB.dependOnAtrium - -@Suppress("unused") -private val establishDependencyToAtrium = dependOnAtrium() diff --git a/samples/multiplatform/src/jsTest/kotlin/testSetup.kt b/samples/multiplatform/src/jsTest/kotlin/testSetup.kt deleted file mode 100644 index deb1129d0..000000000 --- a/samples/multiplatform/src/jsTest/kotlin/testSetup.kt +++ /dev/null @@ -1,4 +0,0 @@ - import ch.tutteli.atrium.fluent.en_GB.dependOnAtrium - - @Suppress("unused") - private val establishDependencyToAtrium = dependOnAtrium() diff --git a/settings.gradle.kts b/settings.gradle.kts index ca8c5db0f..d25e3aa77 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -15,21 +15,32 @@ buildscript { "0.14.0", allApisAllTargets, // forgive for bc and bbc - ("(ch/tutteli/atrium/api/(fluent|infix)/en_GB/" + - or( - // improved reporting - "IterableContainsInOrderOnly.*Spec", - "IterableContainsInAnyOrder.*error cases", - "IterableContainsInAnyOrderOnlyEntriesAssertionsSpec.*nullable cases", - // implementation and spec was wrong - "IterableAssertionsSpec/.*`" + or( - "containsNoDuplicates", - "contains noDuplicates" - ) + "`/list with duplicates", - // changed reporting as most of it is no longer based on IterableLike.contains - "MapAssertionsSpec.*", - "BigDecimalAssertionsSpec.*overload throws PleaseUseReplacementException.*" - ) + ".*)").let { commonPatterns -> + or( + "(ch/tutteli/atrium/api/(fluent|infix)/en_GB/" + + or( + // improved reporting + "IterableContainsInOrderOnly.*Spec", + "IterableContainsInAnyOrder.*error cases", + "IterableContainsInAnyOrderOnlyEntriesAssertionsSpec.*nullable cases", + // implementation and spec was wrong + "IterableAssertionsSpec/.*`" + or( + "containsNoDuplicates", + "contains noDuplicates" + ) + "`/list with duplicates", + // changed reporting as most of it is no longer based on IterableLike.contains + "MapAssertionsSpec.*", + "BigDecimalAssertionsSpec.*overload throws PleaseUseReplacementException.*" + ) + ".*)", + // we don't use asci bullet points in reporting since 0.17.0 + // but have own tests to assure that changing bullet points work + "(ch/tutteli/atrium/api/infix/en_GB/.*Spec.*" + or( + "throws", + "is thrown", + "error message contains", + "shows (all )?suppressed", + "null was missing", "failing cases" + ) + ".*)" + ).let { commonPatterns -> Pair( // bc commonPatterns, @@ -50,7 +61,9 @@ buildscript { "IterableContainsInOrderOnlyEntriesAssertionsSpec" ) + ".*/returnValueOf", // we moved MetaFeature and MetaFeatureOptions - "FeatureAssertions.*(Manual|Reference).*Spec" + "FeatureAssertions.*(Manual|Reference).*Spec", + // we removed ExpectBuilder and SubjectLessSpec uses it + ".*assertion function can be used in an AssertionGroup with an ExplanatoryAssertionGroupType and reportBuilder without failure.*" ) + ".*)", // removed overload which expects kClass "ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples#toBeNullIfNullGivenElse" @@ -62,18 +75,30 @@ buildscript { "0.15.0", allApisAllTargets, // forgive for bc and bbc - ("(ch/tutteli/atrium/api/(fluent|infix)/en_GB/" + - or( - "IterableContainsInOrderOnly.*error cases", - "IterableContainsInAnyOrder.*error cases", - "IterableContainsInAnyOrderOnlyEntriesAssertionsSpec.*nullable cases", - // implementation and spec was wrong - "IterableAssertionsSpec/.*`" + or( - "containsNoDuplicates", - "contains noDuplicates" - ) + "`/list with duplicates", - "BigDecimalAssertionsSpec.*overload throws PleaseUseReplacementException.*" - ) + ".*)").let { commonPatterns -> + or( + "(ch/tutteli/atrium/api/(fluent|infix)/en_GB/" + + or( + "IterableContainsInOrderOnly.*error cases", + "IterableContainsInAnyOrder.*error cases", + "IterableContainsInAnyOrderOnlyEntriesAssertionsSpec.*nullable cases", + // implementation and spec was wrong + "IterableAssertionsSpec/.*`" + or( + "containsNoDuplicates", + "contains noDuplicates" + ) + "`/list with duplicates", + "BigDecimalAssertionsSpec.*overload throws PleaseUseReplacementException.*" + ) + ".*)", + // we don't use asci bullet points in reporting since 0.17.0 + // but have own tests to assure that changing bullet points work + "(ch/tutteli/atrium/api/infix/en_GB/.*Spec.*" + or( + "throws", + "is thrown", + "error message contains", + "shows (all )?suppressed", + "null was missing", "failing cases", + "provoke the failing" + ) + ".*)" + ).let { commonPatterns -> Pair( //bc or( @@ -104,7 +129,9 @@ buildscript { "IterableContainsInOrderOnlyEntriesAssertionsSpec" ) + ".*/returnValueOf", // we moved MetaFeature and MetaFeatureOptions - "FeatureAssertions.*(Manual|Reference).*Spec" + "FeatureAssertions.*(Manual|Reference).*Spec", + // we removed ExpectBuilder and SubjectLessSpec uses it + ".*assertion function can be used in an AssertionGroup with an ExplanatoryAssertionGroupType and report without failure.*" ) + ".*)" ) ) @@ -160,8 +187,6 @@ if (System.getenv("BC") != null) { includeBundleAndApisWithExtensionsAndSmokeTest("fluent-en_GB", "infix-en_GB") includeKotlinJvmJs("core/api", "atrium-core-api") -includeKotlinJvmJs("core/robstoll", "atrium-core-robstoll") -includeKotlinJvmJs("core/robstoll-lib", "atrium-core-robstoll-lib") includeKotlinJvmJsWithExtensions("logic", "atrium-logic") @@ -173,12 +198,6 @@ include("misc/tools", "readme-examples") includeKotlinJvmJs("translations/de_CH", "atrium-translations-de_CH") includeKotlinJvmJs("translations/en_GB", "atrium-translations-en_GB") -//TODO 0.17.0 remove -includeKotlinJvmJs("misc/deprecated/domain/api", "atrium-domain-api") -includeKotlinJvmJs("misc/deprecated/domain/robstoll", "atrium-domain-robstoll") -includeKotlinJvmJs("misc/deprecated/domain/robstoll-lib", "atrium-domain-robstoll-lib") -includeKotlinJvmJs("misc/deprecated/domain/builders", "atrium-domain-builders") - fun Settings_gradle.includeBc(oldVersion: String, module: String) { val projectName = "$oldVersion-$module" include("bc-tests:$projectName")