From dbd45962ace13b9fcc1e505539c1c384d2257e74 Mon Sep 17 00:00:00 2001 From: toronik Date: Fri, 9 Aug 2024 21:05:31 +0300 Subject: [PATCH] 2024.0.8 --- .../concordion/extensions/exam/core/commands/ExamCommand.kt | 4 +--- .../adven27/concordion/extensions/exam/db/DbPlugin.kt | 2 +- .../adven27/concordion/extensions/exam/db/DbTester.kt | 6 +++++- .../extensions/exam/db/commands/check/DbCheckParser.kt | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/exam-core/src/main/java/io/github/adven27/concordion/extensions/exam/core/commands/ExamCommand.kt b/exam-core/src/main/java/io/github/adven27/concordion/extensions/exam/core/commands/ExamCommand.kt index d88e966a..ae60173f 100644 --- a/exam-core/src/main/java/io/github/adven27/concordion/extensions/exam/core/commands/ExamCommand.kt +++ b/exam-core/src/main/java/io/github/adven27/concordion/extensions/exam/core/commands/ExamCommand.kt @@ -53,9 +53,7 @@ abstract class ExamCommand( } listener.executeCompleted(ExecuteEvent(commandCall.element)) }.onFailure { - if (inBeforeExample(commandCall)) { - throw FailFastException("Failed before example", it) - } else throw it + if (inBeforeExample(commandCall)) throw FailFastException("Failed before example", it) else throw it } } diff --git a/exam-db/src/main/java/io/github/adven27/concordion/extensions/exam/db/DbPlugin.kt b/exam-db/src/main/java/io/github/adven27/concordion/extensions/exam/db/DbPlugin.kt index 8509dc41..878d8002 100644 --- a/exam-db/src/main/java/io/github/adven27/concordion/extensions/exam/db/DbPlugin.kt +++ b/exam-db/src/main/java/io/github/adven27/concordion/extensions/exam/db/DbPlugin.kt @@ -6,10 +6,10 @@ import io.github.adven27.concordion.extensions.exam.core.ExamPlugin import io.github.adven27.concordion.extensions.exam.core.html.pre import io.github.adven27.concordion.extensions.exam.core.html.span import io.github.adven27.concordion.extensions.exam.db.commands.DbCleanCommand -import io.github.adven27.concordion.extensions.exam.db.commands.set.DbSetCommand import io.github.adven27.concordion.extensions.exam.db.commands.DbShowCommand import io.github.adven27.concordion.extensions.exam.db.commands.ExamMatchersAwareValueComparer import io.github.adven27.concordion.extensions.exam.db.commands.check.DbCheckCommand +import io.github.adven27.concordion.extensions.exam.db.commands.set.DbSetCommand import mu.KLogging import org.concordion.api.Command import org.concordion.api.Element diff --git a/exam-db/src/main/java/io/github/adven27/concordion/extensions/exam/db/DbTester.kt b/exam-db/src/main/java/io/github/adven27/concordion/extensions/exam/db/DbTester.kt index d70bc1de..84c45034 100644 --- a/exam-db/src/main/java/io/github/adven27/concordion/extensions/exam/db/DbTester.kt +++ b/exam-db/src/main/java/io/github/adven27/concordion/extensions/exam/db/DbTester.kt @@ -224,7 +224,11 @@ open class DbTester @JvmOverloads constructor( sortedTable(actual.getTable(table), sortCols, dbUnitConfig.overrideRowSortingComparer), columns(expectedTable, sortCols).toTypedArray() ) - expectedTable = sortedTable(CompositeTable(actualTable.tableMetaData, expectedTable), sortCols, dbUnitConfig.overrideRowSortingComparer) + expectedTable = sortedTable( + table = CompositeTable(actualTable.tableMetaData, expectedTable), + columns = sortCols, + rowComparator = dbUnitConfig.overrideRowSortingComparer + ) if (compareOperation == CompareOperation.CONTAINS) { actualTable = ContainsFilterTable(actualTable, expectedTable, excludeCols.toList()) } diff --git a/exam-db/src/main/java/io/github/adven27/concordion/extensions/exam/db/commands/check/DbCheckParser.kt b/exam-db/src/main/java/io/github/adven27/concordion/extensions/exam/db/commands/check/DbCheckParser.kt index f9269ff6..d4f61163 100644 --- a/exam-db/src/main/java/io/github/adven27/concordion/extensions/exam/db/commands/check/DbCheckParser.kt +++ b/exam-db/src/main/java/io/github/adven27/concordion/extensions/exam/db/commands/check/DbCheckParser.kt @@ -21,7 +21,7 @@ class DbCheckParser(val dbTester: DbTester) : DbCheckCommand.Parser, BaseParser( ds = context[DS], await = context.awaitConfig, compareOperation = compareStrategy(context), - orderBy = orderBy(context), + orderBy = orderBy(context) ) isBlock(context) -> DataSetExpectation( @@ -29,7 +29,7 @@ class DbCheckParser(val dbTester: DbTester) : DbCheckCommand.Parser, BaseParser( ds = context[DS], await = context.awaitConfig, compareOperation = compareStrategy(context), - orderBy = orderBy(context), + orderBy = orderBy(context) ) isTable(context) -> TableExpectation(