You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by gi...@apache.org on 2024/05/06 16:02:09 UTC
(incubator-kie-drools) branch main updated: [incubator-kie-issues#1104] Migrate Junit inside DMN (#5883)
This is an automated email from the ASF dual-hosted git repository.
gitgabrio pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-drools.git
The following commit(s) were added to refs/heads/main by this push:
new b1dea90077 [incubator-kie-issues#1104] Migrate Junit inside DMN (#5883)
b1dea90077 is described below
commit b1dea9007715dcdbe0590deed7a012a47475f887
Author: Gabriele Cardosi <ga...@gmail.com>
AuthorDate: Mon May 6 18:02:05 2024 +0200
[incubator-kie-issues#1104] Migrate Junit inside DMN (#5883)
* [incubator-kie-issues#1104] Moved to junit 6 /jupiter
* [incubator-kie-issues#1104] Fix formatting
* [incubator-kie-issues#1104] Fix formatting
* [incubator-kie-issues#1104] Fix merge. BAn junit 4 from kie-dmn modules
* [incubator-kie-issues#1104] Fix format - attempt
* [incubator-kie-issues#1104] Fix xml format
---------
Co-authored-by: Gabriele-Cardosi <ga...@ibm.com>
---
bom/kie-dmn-bom/pom.xml | 1 -
build-parent/pom.xml | 5 +
kie-dmn/kie-dmn-backend/pom.xml | 16 +-
.../backend/marshalling/v1_1/DMNXMLLoaderTest.java | 17 +-
.../marshalling/v1_1/MarshallingUtilsTest.java | 16 +-
.../marshalling/v1_1/UnmarshalMarshalTest.java | 46 +-
.../marshalling/v1_2/UnmarshalMarshalTest.java | 24 +-
.../marshalling/v1_3/UnmarshalMarshalTest.java | 20 +-
.../marshalling/v1_4/UnmarshalMarshalTest.java | 28 +-
.../marshalling/v1_5/UnmarshalMarshalTest.java | 57 +-
.../java/org/kie/dmn/core/jsr223/jq/BasicTest.java | 16 +-
.../java/org/kie/dmn/core/jsr223/EscapeTest.java | 4 +-
.../java/org/kie/dmn/core/jsr223/GraalJSTest.java | 12 +-
.../test/java/org/kie/dmn/core/jsr223/JQTest.java | 16 +-
.../java/org/kie/dmn/core/jsr223/NashornTest.java | 16 +-
kie-dmn/kie-dmn-core/pom.xml | 11 +-
.../core/BaseInterpretedVsAlphaNetworkTest.java | 18 +-
.../dmn/core/BaseInterpretedVsCompiledTest.java | 19 +-
...nterpretedVsCompiledTestCanonicalKieModule.java | 21 +-
.../kie/dmn/core/BaseVariantNonTypeSafeTest.java | 6 -
.../java/org/kie/dmn/core/BaseVariantTest.java | 13 +-
.../org/kie/dmn/core/DMNAndCanonicalModelTest.java | 19 +-
.../java/org/kie/dmn/core/DMNAssemblerTest.java | 37 +-
.../org/kie/dmn/core/DMNBuildFromReaderTest.java | 6 +-
.../java/org/kie/dmn/core/DMNCompilerTest.java | 97 +-
.../dmn/core/DMNDecisionTableHitPolicyTest.java | 171 ++--
.../kie/dmn/core/DMNDecisionTableRuntimeTest.java | 246 +++--
.../dmn/core/DMNDecisionTableWithSymbolsTest.java | 13 +-
.../java/org/kie/dmn/core/DMNInputRuntimeTest.java | 126 ++-
.../java/org/kie/dmn/core/DMNMessagesAPITest.java | 39 +-
.../test/java/org/kie/dmn/core/DMNRuntimeTest.java | 1036 +++++++++++++-------
.../org/kie/dmn/core/DMNRuntimeTypeCheckTest.java | 74 +-
.../kie/dmn/core/DMNStronglyTypedSupportTest.java | 60 +-
.../org/kie/dmn/core/DMNTwoValueLogicTest.java | 87 +-
.../test/java/org/kie/dmn/core/DMNTypeTest.java | 20 +-
.../test/java/org/kie/dmn/core/DMNUpdateTest.java | 54 +-
.../java/org/kie/dmn/core/FlightRebookingTest.java | 40 +-
.../java/org/kie/dmn/core/OnlineDatingTest.java | 13 +-
.../java/org/kie/dmn/core/VacationDaysTest.java | 52 +-
.../kie/dmn/core/WBCommonServicesBackendTest.java | 22 +-
...lphaNetworkSupportInLargeDecisionTableTest.java | 17 +-
.../DMNDecisionTableAlphaSupportingTest.java | 23 +-
.../kie/dmn/core/ast/DMNContextEvaluatorTest.java | 10 +-
.../dmn/core/classloader/DMNClassloaderTest.java | 19 +-
.../DMNEvalHelperAccessorCacheTest.java | 12 +-
.../classloader/DMNRuntimeListenerBKMTest.java | 4 +-
.../core/classloader/DMNRuntimeListenerDSTest.java | 6 +-
.../DMNRuntimeListenerPropertyTest.java | 4 +-
.../core/classloader/DMNRuntimeListenerTest.java | 34 +-
.../core/classloader/DTAnnotationListenerTest.java | 12 +-
.../core/compiler/ImportDMNResolverUtilTest.java | 28 +-
.../ItemDefinitionDependenciesGeneratedTest.java | 19 +-
.../compiler/ItemDefinitionDependenciesTest.java | 28 +-
.../dmn/core/compiler/UnnamedImportUtilsTest.java | 22 +-
.../extensions/DMNExtensionRegisterTest.java | 10 +-
.../core/compiler/profiles/DMNProfilesTest.java | 19 +-
.../compiler/profiles/ExtendedDMNProfileTest.java | 38 +-
.../decisionservices/DMNDecisionServicesTest.java | 139 ++-
.../DMNDecisionServicesTypecheckDSxyTest.java | 37 +-
.../kie/dmn/core/decisiontable/DTListenerTest.java | 18 +-
.../org/kie/dmn/core/extra/DMNRecursionTest.java | 15 +-
.../org/kie/dmn/core/extra/YCombinatorTest.java | 19 +-
.../core/impl/DMNContextFEELCtxWrapperTest.java | 42 +-
.../org/kie/dmn/core/impl/DMNContextImplTest.java | 10 +-
.../java/org/kie/dmn/core/imports/ImportsTest.java | 118 ++-
.../DMNIncrementalCompilationTest.java | 21 +-
.../incrementalcompilation/WBCompilationTest.java | 8 +-
.../core/internal/utils/DMNRuntimeBuilderTest.java | 12 +-
.../core/internal/utils/DRGAnalysisUtilsTest.java | 4 +-
.../utils/DynamicDMNContextBuilderTest.java | 20 +-
.../internal/utils/MapBackedDMNContextTest.java | 10 +-
.../internal/utils/MarshallingStubUtilsTest.java | 14 +-
.../DMNKiePMMLTrustyInvocationEvaluatorTest.java | 20 +-
.../dmn/core/stronglytyped/AnnotationsTest.java | 28 +-
.../core/stronglytyped/DMNRuntimeTypesTest.java | 150 ++-
.../dmn/core/stronglytyped/DMNTypeSafeTest.java | 35 +-
.../kie/dmn/core/stronglytyped/JavadocTest.java | 15 +-
.../org/kie/dmn/core/typeref/DMNTyperefTest.java | 98 +-
.../java/org/kie/dmn/core/util/CoerceUtilTest.java | 22 +-
.../org/kie/dmn/core/v1_2/DMN12specificTest.java | 31 +-
.../kie/dmn/core/v1_2/DMNDecisionServicesTest.java | 13 +-
.../org/kie/dmn/core/v1_3/DMN13specificTest.java | 55 +-
.../core/v1_3/DMN13specificTestNonTypesafe.java | 13 +-
.../kie/dmn/core/v1_4/DMN14ExpressionsTest.java | 95 +-
.../kie/dmn/core/v1_4/DMN14GenericSynthTest.java | 33 +-
.../org/kie/dmn/core/v1_4/DMN14specificTest.java | 75 +-
kie-dmn/kie-dmn-feel/pom.xml | 21 +-
.../feel/codegen/feel11/DirectCompilerTest.java | 97 +-
.../feel11/DirectCompilerUnaryTestsTest.java | 18 +-
.../feel11/ManualBasicFunctionInvocationTest.java | 4 +-
.../dmn/feel/codegen/feel11/ManualContextTest.java | 4 +-
.../dmn/feel/codegen/feel11/ManualFilterTest.java | 4 +-
.../kie/dmn/feel/codegen/feel11/ManualForTest.java | 4 +-
.../feel11/ManualNamedFunctionInvocationTest.java | 4 +-
.../dmn/feel/codegen/feel11/ManualQuantTest.java | 4 +-
.../feel/codegen/feel11/ManualUnaryTestsTest.java | 4 +-
.../feel/documentation/ADocFEELExamplesTest.java | 7 +-
.../FromSpecificationNotInAdocTest.java | 13 +-
.../kie/dmn/feel/jandex/AbstractJandexTest.java | 5 +-
.../kie/dmn/feel/lang/ast/InfixOperatorTest.java | 14 +-
.../BigDecimalRangeIteratorTest.java | 20 +-
.../forexpressioniterators/ForIterationTest.java | 18 +-
.../ForIterationUtilsTest.java | 32 +-
.../LocalDateRangeIteratorTest.java | 26 +-
.../ZonedDateTimeRangeIteratorTest.java | 31 +-
.../ast/infixexecutors/InfixExecutorUtilsTest.java | 27 +-
.../feel/lang/examples/CompileEvaluateTest.java | 59 +-
.../kie/dmn/feel/lang/examples/ExamplesTest.java | 36 +-
.../kie/dmn/feel/lang/impl/FEELProfileTest.java | 7 +-
.../kie/dmn/feel/lang/impl/JavaBackedTypeTest.java | 10 +-
.../kie/dmn/feel/lang/impl/MapBackedTypeTest.java | 13 +-
.../impl/TemporalConstantFoldingParserTest.java | 26 +-
.../types/impl/ImmutableFPAWrappingPOJOTest.java | 6 +-
.../feel/marshaller/FEELCodeMarshallerTest.java | 41 +-
.../FEELCodeMarshallerUnmarshallTest.java | 27 +-
.../feel/marshaller/FEELStringMarshallerTest.java | 41 +-
.../FEELStringMarshallerUnmarshallTest.java | 27 +-
.../feel/parser/feel11/FEELParserSeverityTest.java | 12 +-
.../kie/dmn/feel/parser/feel11/FEELParserTest.java | 173 ++--
.../kie/dmn/feel/runtime/BaseFEELCompilerTest.java | 21 +-
.../org/kie/dmn/feel/runtime/BaseFEELTest.java | 22 +-
.../feel/runtime/FEEL12ExtendedForLoopTest.java | 18 +-
.../feel/runtime/FEEL12ExtendedFunctionsTest.java | 12 +-
.../feel/runtime/FEELConditionsAndLoopsTest.java | 13 +-
.../org/kie/dmn/feel/runtime/FEELContextsTest.java | 12 +-
.../dmn/feel/runtime/FEELDateTimeDurationTest.java | 12 +-
.../dmn/feel/runtime/FEELErrorMessagesTest.java | 15 +-
.../dmn/feel/runtime/FEELEventListenerTest.java | 16 +-
.../kie/dmn/feel/runtime/FEELExpressionsTest.java | 12 +-
.../feel/runtime/FEELFunctionDefinitionTest.java | 12 +-
.../kie/dmn/feel/runtime/FEELFunctionsTest.java | 12 +-
.../org/kie/dmn/feel/runtime/FEELListsTest.java | 12 +-
.../dmn/feel/runtime/FEELMathOperationsTest.java | 12 +-
.../dmn/feel/runtime/FEELNumberCoercionTest.java | 14 +-
.../kie/dmn/feel/runtime/FEELOperatorsTest.java | 12 +-
.../org/kie/dmn/feel/runtime/FEELRangesTest.java | 12 +-
.../kie/dmn/feel/runtime/FEELStaticTypeTest.java | 12 +-
.../dmn/feel/runtime/FEELStringOperationsTest.java | 13 +-
.../kie/dmn/feel/runtime/FEELTernaryLogicTest.java | 13 +-
.../dmn/feel/runtime/FEELValuesComparisonTest.java | 13 +-
.../dmn/feel/runtime/FEELValuesConstantsTest.java | 12 +-
.../feel/runtime/KieFEELExtendedFunctionsTest.java | 12 +-
.../kie/dmn/feel/runtime/TCFoldNotTCFoldTest.java | 13 +-
.../feel/runtime/functions/AbsFunctionTest.java | 20 +-
.../feel/runtime/functions/AllFunctionTest.java | 41 +-
.../feel/runtime/functions/AnyFunctionTest.java | 41 +-
.../feel/runtime/functions/AppendFunctionTest.java | 19 +-
.../runtime/functions/BuiltInFunctionsTest.java | 16 +-
.../runtime/functions/CeilingFunctionTest.java | 19 +-
.../feel/runtime/functions/CodeFunctionTest.java | 62 +-
.../functions/ComposingDifferentFunctionsTest.java | 20 +-
.../runtime/functions/ConcatenateFunctionTest.java | 20 +-
.../runtime/functions/ContainsFunctionTest.java | 16 +-
.../feel/runtime/functions/CountFunctionTest.java | 22 +-
.../feel/runtime/functions/DateFunctionTest.java | 30 +-
.../runtime/functions/DateTimeFunctionTest.java | 31 +-
.../dmn/feel/runtime/functions/DayOfWeekTest.java | 12 +-
.../dmn/feel/runtime/functions/DayOfYearTest.java | 12 +-
.../runtime/functions/DecimalFunctionTest.java | 23 +-
.../functions/DistinctValuesFunctionTest.java | 20 +-
.../runtime/functions/DurationFunctionTest.java | 24 +-
.../runtime/functions/EndsWithFunctionTest.java | 16 +-
.../runtime/functions/FlattenFunctionTest.java | 17 +-
.../feel/runtime/functions/FloorFunctionTest.java | 19 +-
.../runtime/functions/IndexOfFunctionTest.java | 18 +-
.../functions/InsertBeforeFunctionTest.java | 26 +-
.../functions/ListContainsFunctionTest.java | 20 +-
.../runtime/functions/ListReplaceFunctionTest.java | 32 +-
.../runtime/functions/MatchesFunctionTest.java | 26 +-
.../feel/runtime/functions/MaxFunctionTest.java | 34 +-
.../feel/runtime/functions/MeanFunctionTest.java | 45 +-
.../feel/runtime/functions/MinFunctionTest.java | 34 +-
.../feel/runtime/functions/MonthOfYearTest.java | 12 +-
.../feel/runtime/functions/NotFunctionTest.java | 19 +-
.../feel/runtime/functions/NowFunctionTest.java | 13 +-
.../feel/runtime/functions/NumberFunctionTest.java | 44 +-
.../feel/runtime/functions/RemoveFunctionTest.java | 21 +-
.../runtime/functions/ReplaceFunctionTest.java | 26 +-
.../runtime/functions/ReverseFunctionTest.java | 19 +-
.../feel/runtime/functions/SortFunctionTest.java | 26 +-
.../runtime/functions/StartsWithFunctionTest.java | 18 +-
.../feel/runtime/functions/StringFunctionTest.java | 66 +-
.../functions/StringLengthFunctionTest.java | 17 +-
.../functions/StringLowerCaseFunctionTest.java | 18 +-
.../functions/StringUpperCaseFunctionTest.java | 18 +-
.../runtime/functions/SublistFunctionTest.java | 25 +-
.../functions/SubstringAfterFunctionTest.java | 16 +-
.../functions/SubstringBeforeFunctionTest.java | 16 +-
.../runtime/functions/SubstringFunctionTest.java | 26 +-
.../feel/runtime/functions/SumFunctionTest.java | 33 +-
.../feel/runtime/functions/TimeFunctionTest.java | 54 +-
.../feel/runtime/functions/TodayFunctionTest.java | 12 +-
.../feel/runtime/functions/UnionFunctionTest.java | 37 +-
.../dmn/feel/runtime/functions/WeekOfYearTest.java | 12 +-
.../functions/YearsAndMonthsFunctionTest.java | 26 +-
.../functions/extended/RangeFunctionTest.java | 79 +-
.../functions/interval/AfterFunctionTest.java | 26 +-
.../functions/interval/BeforeFunctionTest.java | 26 +-
.../functions/interval/CoincidesFunctionTest.java | 22 +-
.../functions/interval/DuringFunctionTest.java | 18 +-
.../interval/FEELTemporalFunctionsTest.java | 13 +-
.../functions/interval/FinishedByFunctionTest.java | 18 +-
.../functions/interval/FinishesFunctionTest.java | 18 +-
.../runtime/functions/interval/FormulasTest.java | 8 +-
.../functions/interval/IncludesFunctionTest.java | 18 +-
.../functions/interval/MeetsFunctionTest.java | 16 +-
.../functions/interval/MetByFunctionTest.java | 16 +-
.../functions/interval/OverlapsFunctionTest.java | 16 +-
.../functions/interval/StartedByFunctionTest.java | 18 +-
.../functions/interval/StartsFunctionTest.java | 18 +-
.../functions/twovaluelogic/CountFunctionTest.java | 26 +-
.../functions/twovaluelogic/MaxFunctionTest.java | 36 +-
.../functions/twovaluelogic/MeanFunctionTest.java | 54 +-
.../twovaluelogic/MedianFunctionTest.java | 40 +-
.../functions/twovaluelogic/MinFunctionTest.java | 36 +-
.../functions/twovaluelogic/ModeFunctionTest.java | 32 +-
.../functions/twovaluelogic/NNAllFunctionTest.java | 46 +-
.../functions/twovaluelogic/NNAnyFunctionTest.java | 41 +-
.../twovaluelogic/StddevFunctionTest.java | 40 +-
.../functions/twovaluelogic/SumFunctionTest.java | 42 +-
.../kie/dmn/feel/runtime/impl/RangeImplTest.java | 18 +-
.../java/org/kie/dmn/feel/util/CoerceUtilTest.java | 26 +-
.../java/org/kie/dmn/feel/util/EvalHelperTest.java | 19 +-
kie-dmn/kie-dmn-legacy-tests/pom.xml | 11 +-
.../tests/core/v1_1/BaseDMN1_1VariantTest.java | 6 -
.../legacy/tests/core/v1_1/DMNAssemblerTest.java | 40 +-
.../legacy/tests/core/v1_1/DMNCompilerTest.java | 37 +-
.../core/v1_1/DMNDecisionTableHitPolicyTest.java | 145 ++-
.../core/v1_1/DMNDecisionTableRuntimeTest.java | 126 ++-
.../core/v1_1/DMNDecisionTableWithSymbolsTest.java | 13 +-
.../tests/core/v1_1/DMNInputRuntimeTest.java | 97 +-
.../dmn/legacy/tests/core/v1_1/DMNRuntimeTest.java | 753 +++++++++-----
.../tests/core/v1_1/FlightRebookingTest.java | 37 +-
.../legacy/tests/core/v1_1/OnlineDatingTest.java | 13 +-
.../legacy/tests/core/v1_1/VacationDaysTest.java | 42 +-
.../decisionservices/DMNDecisionServicesTest.java | 81 +-
.../tests/core/v1_1/imports/ImportsTest.java | 88 +-
.../validation/v1_1/ValidatorArtifactTest.java | 10 +-
.../v1_1/ValidatorAuthorityRequirementTest.java | 40 +-
.../v1_1/ValidatorBusinessContextTest.java | 22 +-
.../v1_1/ValidatorBusinessKnowledgeModelTest.java | 22 +-
.../validation/v1_1/ValidatorContextTest.java | 34 +-
.../v1_1/ValidatorDMNElementReferenceTest.java | 10 +-
.../v1_1/ValidatorDecisionTableTest.java | 28 +-
.../validation/v1_1/ValidatorDecisionTest.java | 76 +-
.../tests/validation/v1_1/ValidatorImportTest.java | 30 +-
.../v1_1/ValidatorInformationRequirementTest.java | 28 +-
.../validation/v1_1/ValidatorInputDataTest.java | 16 +-
.../v1_1/ValidatorKnowledgeRequirementTest.java | 16 +-
.../v1_1/ValidatorKnowledgeSourceTest.java | 16 +-
.../tests/validation/v1_1/ValidatorTest.java | 93 +-
.../validation/v1_1/ValidatorTypeRefTest.java | 32 +-
kie-dmn/kie-dmn-model/pom.xml | 10 +-
.../dmn/model/api/AssociationDirectionTest.java | 6 +-
.../model/api/DecisionTableOrientationTest.java | 6 +-
.../org/kie/dmn/model/api/FunctionKindTest.java | 6 +-
.../java/org/kie/dmn/model/api/HitPolicyTest.java | 8 +-
.../org/kie/dmn/model/api/RowLocationTest.java | 6 +-
.../org/kie/dmn/model/api/TUnaryTestsTest.java | 6 +-
.../kie/dmn/model/api/dmndi/AlignmentKindTest.java | 6 +-
.../kie/dmn/model/api/dmndi/KnownColorTest.java | 6 +-
.../dmn/model/jandex/KieDMNModelJandexTest.java | 5 +-
.../java/org/kie/dmn/openapi/AllowNullTest.java | 6 +-
.../test/java/org/kie/dmn/openapi/CH11Test.java | 2 +-
.../org/kie/dmn/openapi/EnumGenerationTest.java | 14 +-
.../java/org/kie/dmn/openapi/ImportingTest.java | 9 +-
.../org/kie/dmn/openapi/MultipleModelsTest.java | 8 +-
.../kie/dmn/openapi/NumberAllowedValuesTest.java | 13 +-
.../test/java/org/kie/dmn/openapi/PersonsTest.java | 2 +-
.../java/org/kie/dmn/openapi/ProcessItemTest.java | 4 +-
.../java/org/kie/dmn/openapi/UndefinedTest.java | 2 +-
.../kie/dmn/openapi/impl/DMNTypeSchemasTest.java | 8 +-
.../dmn/openapi/impl/DMNUnaryTestsMapperTest.java | 10 +-
.../openapi/impl/RangeNodeSchemaMapperTest.java | 12 +-
.../kie-dmn-pmml-tests-trusty/pom.xml | 5 -
.../kie-dmn-pmml-tests/pom.xml | 8 +-
.../org/kie/dmn/pmml/DMNKMeansModelPMMLTest.java | 4 +-
.../org/kie/dmn/pmml/DMNMiningModelPMMLTest.java | 4 +-
.../org/kie/dmn/pmml/DMNNaiveBayesPMMLTest.java | 4 +-
.../org/kie/dmn/pmml/DMNNeuralNetworkPMMLTest.java | 4 +-
.../org/kie/dmn/pmml/DMNRegressionPMMLTest.java | 4 +-
.../java/org/kie/dmn/pmml/DMNRuntimePMMLTest.java | 13 +-
.../java/org/kie/dmn/pmml/DMNTreePMMLTest.java | 6 +-
.../test/java/org/kie/dmn/pmml/PMMLInfoTest.java | 8 +-
.../org/kie/dmn/pmml/PMMLValidatorImportTest.java | 14 +-
.../kie-dmn-ruleset2dmn/pom.xml | 10 +-
.../java/org/kie/dmn/ruleset2dmn/AdultTest.java | 7 +-
.../ruleset2dmn/ChurnRulesFromSPSSModelerTest.java | 9 +-
.../java/org/kie/dmn/ruleset2dmn/ChurnTest.java | 7 +-
.../java/org/kie/dmn/ruleset2dmn/IrisTest.java | 7 +-
.../java/org/kie/dmn/ruleset2dmn/MiniloanTest.java | 9 +-
.../java/org/kie/dmn/ruleset2dmn/TotoTest.java | 9 +-
.../java/org/kie/dmn/ruleset2dmn/WifiTest.java | 9 +-
kie-dmn/kie-dmn-signavio/pom.xml | 18 +-
.../signavio/MultiInstanceDecisionLogicTest.java | 25 +-
.../java/org/kie/dmn/signavio/SignavioTest.java | 56 +-
.../runtime/ExtendedFunctionsBaseFEELTest.java | 21 +-
.../feel/runtime/FEELExtendedFunctionsTest.java | 13 +-
kie-dmn/kie-dmn-trisotech/pom.xml | 13 +-
.../v1_3/xstream/UnmarshalMarshalTest.java | 8 +-
.../dmn/trisotech/core/DMN14ExpressionsTest.java | 83 +-
.../dmn/trisotech/core/DMN14GenericSynthTest.java | 10 +-
.../validation/TrisotechValidationTest.java | 26 +-
kie-dmn/kie-dmn-validation/pom.xml | 10 +-
.../kie/dmn/validation/AbstractValidatorTest.java | 8 +-
.../kie/dmn/validation/MessageReporterTest.java | 10 +-
.../dmn/validation/UsingResourceValidatorTest.java | 26 +-
.../kie/dmn/validation/ValidatorArtifactTest.java | 10 +-
.../ValidatorAuthorityRequirementTest.java | 40 +-
.../validation/ValidatorBusinessContextTest.java | 22 +-
.../ValidatorBusinessKnowledgeModelTest.java | 30 +-
.../kie/dmn/validation/ValidatorContextTest.java | 42 +-
.../org/kie/dmn/validation/ValidatorDMN14Test.java | 23 +-
.../org/kie/dmn/validation/ValidatorDMNDITest.java | 10 +-
.../ValidatorDMNElementReferenceTest.java | 10 +-
.../validation/ValidatorDecisionServiceTest.java | 38 +-
.../dmn/validation/ValidatorDecisionTableTest.java | 28 +-
.../kie/dmn/validation/ValidatorDecisionTest.java | 88 +-
.../kie/dmn/validation/ValidatorImportTest.java | 52 +-
.../ValidatorInformationRequirementTest.java | 28 +-
.../kie/dmn/validation/ValidatorInputDataTest.java | 27 +-
.../ValidatorKnowledgeRequirementTest.java | 24 +-
.../validation/ValidatorKnowledgeSourceTest.java | 16 +-
.../java/org/kie/dmn/validation/ValidatorTest.java | 145 +--
.../kie/dmn/validation/ValidatorTypeRefTest.java | 32 +-
.../classloader/ValidatorClassloaderTest.java | 6 +-
.../dtanalysis/AK0100domainOnTableTest.java | 6 +-
.../dtanalysis/AK0100v2domainOnTableTest.java | 6 +-
.../dmn/validation/dtanalysis/AgeKittenTest.java | 10 +-
.../dtanalysis/BuiltinAndOtherValuesTest.java | 12 +-
.../dtanalysis/Check1stNFViolationTest.java | 12 +-
.../dtanalysis/Check2ndNFViolationTest.java | 12 +-
.../dtanalysis/ContractionRulesTest.java | 6 +-
.../DMNDTAnalyserValueFromNodeVisitorTest.java | 6 +-
.../dtanalysis/DMNDTAnalysisExceptionTest.java | 6 +-
.../dmn/validation/dtanalysis/DTNestingTest.java | 7 +-
.../kie/dmn/validation/dtanalysis/DTinBKMTest.java | 6 +-
.../dtanalysis/EnumerationWithNullTest.java | 7 +-
.../dtanalysis/FailingOutputConstraintsTest.java | 10 +-
.../dtanalysis/Gaps0100domainOnTableTest.java | 6 +-
.../dtanalysis/GapsAndOverlaps1Test.java | 6 +-
.../GapsAndOverlaps1domainOnTableTest.java | 6 +-
.../dmn/validation/dtanalysis/GapsCube3Test.java | 6 +-
.../dtanalysis/GapsOverlapsBooleanTest.java | 6 +-
.../kie/dmn/validation/dtanalysis/GapsXYTest.java | 14 +-
.../validation/dtanalysis/HitPolicyFirstTest.java | 6 +-
.../dmn/validation/dtanalysis/IntervalTest.java | 40 +-
.../kie/dmn/validation/dtanalysis/MaskTest.java | 8 +-
.../validation/dtanalysis/MisleadingRulesTest.java | 8 +-
.../validation/dtanalysis/MultipleModelsTest.java | 11 +-
.../dtanalysis/NoGapsDateAdjacentTest.java | 6 +-
.../dtanalysis/NoGapsDomainOnTypeRefTest.java | 8 +-
.../org/kie/dmn/validation/dtanalysis/NotTest.java | 18 +-
.../kie/dmn/validation/dtanalysis/NullTest.java | 25 +-
.../dtanalysis/OverlapHitPolicyTest.java | 19 +-
.../dmn/validation/dtanalysis/OverlapsMsgTest.java | 6 +-
.../org/kie/dmn/validation/dtanalysis/PiTest.java | 7 +-
.../dtanalysis/PosDoubleNegHalfTest.java | 7 +-
.../dtanalysis/RecommenderHitPolicyTest.java | 16 +-
.../validation/dtanalysis/RuleOrderDashTest.java | 6 +-
.../dtanalysis/SRGapsOverlapsSubsumption2Test.java | 6 +-
.../validation/dtanalysis/SameMsgInAllAPITest.java | 8 +-
.../dtanalysis/SimpleStringNoGapTest.java | 6 +-
.../dmn/validation/dtanalysis/SomeProblemTest.java | 30 +-
.../SomeProblemruleOutsideDomainTest.java | 6 +-
.../dtanalysis/StringWithoutEnumNoGapTest.java | 6 +-
.../dtanalysis/SubsumptionRulesTest.java | 6 +-
.../dmn/validation/dtanalysis/SymbolInDTTest.java | 10 +-
.../dtanalysis/mcdc/ExampleMCDCTest.java | 6 +-
.../dtanalysis/model/NullBoundImplTest.java | 6 +-
.../dmn/validation/v1_5/DMN15ValidationsTest.java | 24 +-
kie-dmn/kie-dmn-xls2dmn-cli/pom.xml | 8 +-
.../org/kie/dmn/xls2dmn/cli/CardApprovalTest.java | 11 +-
.../kie/dmn/xls2dmn/cli/ChineseLunarYearsTest.java | 9 +-
.../org/kie/dmn/xls2dmn/cli/XLS2DMNParserTest.java | 33 +-
kie-dmn/pom.xml | 29 +
376 files changed, 6281 insertions(+), 4846 deletions(-)
diff --git a/bom/kie-dmn-bom/pom.xml b/bom/kie-dmn-bom/pom.xml
index 8258db48be..a448cd4a15 100644
--- a/bom/kie-dmn-bom/pom.xml
+++ b/bom/kie-dmn-bom/pom.xml
@@ -190,7 +190,6 @@
<version>${project.version}</version>
<classifier>sources</classifier>
</dependency>
-
</dependencies>
</dependencyManagement>
diff --git a/build-parent/pom.xml b/build-parent/pom.xml
index b73c9c3767..f91ddc9fbe 100644
--- a/build-parent/pom.xml
+++ b/build-parent/pom.xml
@@ -473,6 +473,11 @@
<artifactId>junit-jupiter-api</artifactId>
<version>${version.org.junit}</version>
</dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <version>${version.org.junit}</version>
+ </dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
diff --git a/kie-dmn/kie-dmn-backend/pom.xml b/kie-dmn/kie-dmn-backend/pom.xml
index f4e3e5ef29..64c6793d64 100644
--- a/kie-dmn/kie-dmn-backend/pom.xml
+++ b/kie-dmn/kie-dmn-backend/pom.xml
@@ -61,24 +61,22 @@
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
</dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<scope>test</scope>
</dependency>
-
+
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.slf4j</groupId>
diff --git a/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_1/DMNXMLLoaderTest.java b/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_1/DMNXMLLoaderTest.java
index 4528dace13..8c88edee19 100644
--- a/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_1/DMNXMLLoaderTest.java
+++ b/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_1/DMNXMLLoaderTest.java
@@ -20,12 +20,11 @@ package org.kie.dmn.backend.marshalling.v1_1;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.util.Arrays;
import java.util.List;
import javax.xml.XMLConstants;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.api.marshalling.DMNMarshaller;
import org.kie.dmn.backend.marshalling.v1_1.xstream.extensions.DecisionServicesExtensionRegister;
import org.kie.dmn.backend.marshalling.v1x.DMNMarshallerFactory;
@@ -37,10 +36,10 @@ import org.kie.dmn.model.api.LiteralExpression;
import static org.assertj.core.api.Assertions.assertThat;
-public class DMNXMLLoaderTest {
+class DMNXMLLoaderTest {
@Test
- public void testLoadingDefinitions() {
+ void loadingDefinitions() {
final DMNMarshaller DMNMarshaller = DMNMarshallerFactory.newDefaultMarshaller();
final InputStream is = this.getClass().getResourceAsStream( "0001-input-data-string.dmn" );
@@ -81,7 +80,7 @@ public class DMNXMLLoaderTest {
}
@Test
- public void testLoadingDecisionServices() {
+ void loadingDecisionServices() {
final DMNMarshaller DMNMarshaller = DMNMarshallerFactory.newMarshallerWithExtensions(List.of(new DecisionServicesExtensionRegister()));
final InputStream is = this.getClass().getResourceAsStream("0004-decision-services.dmn");
@@ -113,7 +112,7 @@ public class DMNXMLLoaderTest {
}
@Test
- public void testLoadingWithNoDecisionServices() {
+ void loadingWithNoDecisionServices() {
final DMNMarshaller DMNMarshaller = DMNMarshallerFactory.newMarshallerWithExtensions(List.of(new DecisionServicesExtensionRegister()));
final InputStream is = this.getClass().getResourceAsStream("0001-input-data-string.dmn");
@@ -124,7 +123,7 @@ public class DMNXMLLoaderTest {
}
@Test
- public void test0004_multiple_extensions() throws Exception {
+ void test0004_multiple_extensions() throws Exception {
DMNMarshaller marshaller = DMNMarshallerFactory.newMarshallerWithExtensions(List.of(new DecisionServicesExtensionRegister()));
final InputStream is = this.getClass().getResourceAsStream("0004-decision-services_multiple_extensions.dmn");
@@ -136,7 +135,7 @@ public class DMNXMLLoaderTest {
}
@Test
- public void testLoadingExample() {
+ void loadingExample() {
final DMNMarshaller DMNMarshaller = DMNMarshallerFactory.newDefaultMarshaller();
final InputStream is = this.getClass().getResourceAsStream("ch11example.xml");
@@ -149,7 +148,7 @@ public class DMNXMLLoaderTest {
}
@Test
- public void testLoadingDishDecision() {
+ void loadingDishDecision() {
final DMNMarshaller DMNMarshaller = DMNMarshallerFactory.newDefaultMarshaller();
final InputStream is = this.getClass().getResourceAsStream("dish-decision.xml");
diff --git a/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_1/MarshallingUtilsTest.java b/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_1/MarshallingUtilsTest.java
index af054ae7d2..45fda62471 100644
--- a/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_1/MarshallingUtilsTest.java
+++ b/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_1/MarshallingUtilsTest.java
@@ -21,7 +21,7 @@ package org.kie.dmn.backend.marshalling.v1_1;
import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.backend.marshalling.v1_1.xstream.MarshallingUtils;
import org.kie.dmn.model.api.DMNModelInstrumentedBase;
import org.slf4j.Logger;
@@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory;
import static org.assertj.core.api.Assertions.assertThat;
-public class MarshallingUtilsTest {
+class MarshallingUtilsTest {
protected static final Logger logger = LoggerFactory.getLogger(MarshallingUtilsTest.class);
@@ -65,32 +65,32 @@ public class MarshallingUtilsTest {
}
}
- @Test
- public void testLocal() throws Exception {
+ @Test
+ void local() throws Exception {
QName qname = new QName("local1");
checkAndRoundTrip(qname, "local1");
}
@Test
- public void testPrefixLocal() throws Exception {
+ void prefixLocal() throws Exception {
QName qname = new QName(XMLConstants.NULL_NS_URI, "local2", "prefix");
checkAndRoundTrip(qname, "prefix:local2");
}
@Test
- public void testNamespaceLocal() throws Exception {
+ void namespaceLocal() throws Exception {
QName qname = new QName("http://namespace", "local3");
checkAndRoundTrip(qname, "{http://namespace}local3");
}
@Test
- public void testNamespaceLocal_b() throws Exception {
+ void namespaceLocalB() throws Exception {
QName qname = new QName("http://namespace", "local3", XMLConstants.DEFAULT_NS_PREFIX);
checkAndRoundTrip(qname, "{http://namespace}local3");
}
@Test
- public void testNamespacePrefixLocal() throws Exception {
+ void namespacePrefixLocal() throws Exception {
QName qname = new QName("http://namespace", "local4", "prefix");
checkAndRoundTrip(qname, "prefix:local4");
}
diff --git a/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_1/UnmarshalMarshalTest.java b/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_1/UnmarshalMarshalTest.java
index 4ba4abd217..75c8f52b86 100644
--- a/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_1/UnmarshalMarshalTest.java
+++ b/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_1/UnmarshalMarshalTest.java
@@ -33,8 +33,8 @@ import javax.xml.namespace.QName;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.api.marshalling.DMNMarshaller;
import org.kie.dmn.backend.marshalling.v1_1.extensions.MyTestRegister;
import org.kie.dmn.backend.marshalling.v1_1.xstream.extensions.DecisionServicesExtensionRegister;
@@ -63,99 +63,99 @@ public class UnmarshalMarshalTest {
protected static final Logger LOG = LoggerFactory.getLogger(UnmarshalMarshalTest.class);
@Test
- public void test0001() throws Exception {
+ void test0001() throws Exception {
testRoundTrip("org/kie/dmn/backend/marshalling/v1_1/", "0001-input-data-string.dmn");
}
@Test
- public void test0002() throws Exception {
+ void test0002() throws Exception {
testRoundTrip("org/kie/dmn/backend/marshalling/v1_1/", "0002-input-data-number.dmn");
}
@Test
- public void test0003() throws Exception {
+ void test0003() throws Exception {
testRoundTrip("org/kie/dmn/backend/marshalling/v1_1/", "0003-input-data-string-allowed-values.dmn");
}
@Test
- public void test0004() throws Exception {
+ void test0004() throws Exception {
DMNMarshaller marshaller = DMNMarshallerFactory.newMarshallerWithExtensions(List.of(new DecisionServicesExtensionRegister()));
testRoundTrip("org/kie/dmn/backend/marshalling/v1_1/", "0004-decision-services.dmn", marshaller);
}
@Test
- public void test0004_ns_other_location() throws Exception {
+ void test0004_ns_other_location() throws Exception {
DMNMarshaller marshaller = DMNMarshallerFactory.newMarshallerWithExtensions(List.of(new DecisionServicesExtensionRegister()));
testRoundTrip("org/kie/dmn/backend/marshalling/v1_1/", "0004-decision-services_ns_other_location.dmn", marshaller);
}
@Test
- public void test0005_decision_list() throws Exception {
+ void test0005_decision_list() throws Exception {
testRoundTrip("org/kie/dmn/backend/marshalling/v1_1/", "0005-decision-list.dmn");
}
@Test
- public void test_hardcoded_java_max_call() throws Exception {
+ void hardcoded_java_max_call() throws Exception {
testRoundTrip("org/kie/dmn/backend/marshalling/v1_1/", "hardcoded-java-max-call.dmn");
}
@Test
- public void testDish() throws Exception {
+ void dish() throws Exception {
testRoundTrip("org/kie/dmn/backend/marshalling/v1_1/", "dish-decision.xml");
}
- @Ignore("failing to compare over a xsi:type=\"tImport\" attribute, but why content generated 'control' need to explicit it ?")
+ @Disabled("failing to compare over a xsi:type=\"tImport\" attribute, but why content generated 'control' need to explicit it ?")
@Test
- public void testDummyDefinitions() throws Exception {
+ void dummyDefinitions() throws Exception {
testRoundTrip("org/kie/dmn/backend/marshalling/v1_1/", "dummy-definitions.xml");
}
@Test
- public void testDummyRelation() throws Exception {
+ void dummyRelation() throws Exception {
testRoundTrip("org/kie/dmn/backend/marshalling/v1_1/", "dummy-relation.xml");
}
@Test
- public void testCh11() throws Exception {
+ void ch11() throws Exception {
testRoundTrip("org/kie/dmn/backend/marshalling/v1_1/", "ch11example.xml");
}
@Test
- public void testHello_World_semantic_namespace() throws Exception {
+ void helloWorldSemanticNamespace() throws Exception {
testRoundTrip("org/kie/dmn/backend/marshalling/v1_1/", "Hello_World_semantic_namespace.dmn");
}
@Test
- public void testHello_World_semantic_namespace_with_extensions() throws Exception {
+ void helloWorldSemanticNamespaceWithExtensions() throws Exception {
DMNMarshaller marshaller = DMNMarshallerFactory.newMarshallerWithExtensions(List.of(new MyTestRegister()));
testRoundTrip("org/kie/dmn/backend/marshalling/v1_1/", "Hello_World_semantic_namespace_with_extensions.dmn", marshaller);
}
@Test
- public void testHello_World_semantic_namespace_with_extensions_other_ns_location() throws Exception {
+ void helloWorldSemanticNamespaceWithExtensionsOtherNsLocation() throws Exception {
DMNMarshaller marshaller = DMNMarshallerFactory.newMarshallerWithExtensions(List.of(new MyTestRegister()));
testRoundTrip("org/kie/dmn/backend/marshalling/v1_1/", "Hello_World_semantic_namespace_with_extensions_other_ns_location.dmn", marshaller);
}
@Test
- public void testSemanticNamespace() throws Exception {
+ void semanticNamespace() throws Exception {
testRoundTrip("org/kie/dmn/backend/marshalling/v1_1/", "semantic-namespace.xml");
}
- @Ignore("The current file cannot marshal back extension elements because they don't provide converters.")
+ @Disabled("The current file cannot marshal back extension elements because they don't provide converters.")
@Test
- public void test20161014() throws Exception {
+ void test20161014() throws Exception {
testRoundTrip("org/kie/dmn/backend/marshalling/v1_1/", "test20161014.xml");
}
@Test
- public void testQNameSerialization() throws Exception {
+ void qNameSerialization() throws Exception {
testRoundTrip("org/kie/dmn/backend/marshalling/v1_1/", "hardcoded_function_definition.dmn");
}
- @Ignore("A problem with the StaxDriver has still to be resolved.")
+ @Disabled("A problem with the StaxDriver has still to be resolved.")
@Test
- public void testFAILforMissingNamespaces() {
+ void faiLforMissingNamespaces() {
fail("PERFORM A MANUAL CHECK: does now the Stax driver do output the namespace for 'feel:' ?? ");
}
diff --git a/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_2/UnmarshalMarshalTest.java b/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_2/UnmarshalMarshalTest.java
index 9d6979b25d..2fc9d16586 100644
--- a/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_2/UnmarshalMarshalTest.java
+++ b/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_2/UnmarshalMarshalTest.java
@@ -33,7 +33,7 @@ import javax.xml.namespace.QName;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.api.marshalling.DMNMarshaller;
import org.kie.dmn.backend.marshalling.v1_2.extensions.MyTestRegister;
import org.kie.dmn.backend.marshalling.v1x.DMNMarshallerFactory;
@@ -65,49 +65,49 @@ public class UnmarshalMarshalTest {
protected static final Logger LOG = LoggerFactory.getLogger(UnmarshalMarshalTest.class);
@Test
- public void testV12_simple() throws Exception {
+ void v12Simple() throws Exception {
testRoundTripV12("org/kie/dmn/backend/marshalling/v1_2/", "simple.dmn");
}
@Test
- public void testV12_ch11example() throws Exception {
+ void v12Ch11example() throws Exception {
testRoundTripV12("org/kie/dmn/backend/marshalling/v1_2/", "ch11example.dmn");
}
@Test
- public void testV12_ImportName() throws Exception {
+ void v12_ImportName() throws Exception {
testRoundTripV12("org/kie/dmn/backend/marshalling/v1_2/", "ImportName.dmn");
}
@Test
- public void testV12_DecisionService20180911v12() throws Exception {
+ void v12_DecisionService20180911v12() throws Exception {
// DROOLS-2987 DMN v1.2 marshaller failing marshalling DecisionService node and dmndi:DMNDecisionServiceDividerLine
testRoundTripV12("org/kie/dmn/backend/marshalling/v1_2/", "DecisionService20180911v12.dmn");
}
@Test
- public void testV12_DiamondWithColors() throws Exception {
+ void v12_DiamondWithColors() throws Exception {
testRoundTripV12("org/kie/dmn/backend/marshalling/v1_2/", "diamondWithColors.dmn");
}
@Test
- public void testV12_DMNDIDiagramElementExtension() throws Exception {
+ void v12_dmndiDiagramElementExtension() throws Exception {
testRoundTripV12("org/kie/dmn/backend/marshalling/v1_2/", "DMNDIDiagramElementExtension.dmn");
}
@Test
- public void testV12_DMNDIDiagramElementExtension_withContent() throws Exception {
+ void v12_dmndiDiagramElementExtensionWithContent() throws Exception {
DMNMarshaller marshaller = DMNMarshallerFactory.newMarshallerWithExtensions(List.of(new MyTestRegister()));
testRoundTrip("org/kie/dmn/backend/marshalling/v1_2/", "DMNDIDiagramElementExtension_withContent.dmn", marshaller, DMN12_SCHEMA_SOURCE);
}
@Test
- public void test_hardcoded_java_max_call() throws Exception {
+ void hardcoded_java_max_call() throws Exception {
testRoundTripV12("org/kie/dmn/backend/marshalling/v1_2/", "hardcoded-java-max-call.dmn");
}
@Test
- public void test_FontSize_sharedStyle() throws Exception {
+ void font_size_shared_style() throws Exception {
testRoundTripV12("org/kie/dmn/backend/marshalling/v1_2/", "test-FontSize-sharedStyle.dmn");
Definitions definitions = MARSHALLER.unmarshal(new InputStreamReader(this.getClass().getResourceAsStream("test-FontSize-sharedStyle.dmn")));
DMNShape shape0 = (DMNShape) definitions.getDMNDI().getDMNDiagram().get(0).getDMNDiagramElement().get(0);
@@ -117,12 +117,12 @@ public class UnmarshalMarshalTest {
}
@Test
- public void test_DMNLabel_Text() throws Exception {
+ void dmnlabel_text() throws Exception {
testRoundTripV12("org/kie/dmn/backend/marshalling/v1_2/", "DMNLabel-Text.dmn");
}
@Test
- public void testV12_decision_list() throws Exception {
+ void v12DecisionList() throws Exception {
testRoundTripV12("org/kie/dmn/backend/marshalling/v1_2/", "decision-list.dmn");
}
diff --git a/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_3/UnmarshalMarshalTest.java b/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_3/UnmarshalMarshalTest.java
index ba2c5e3700..151ea9aa7e 100644
--- a/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_3/UnmarshalMarshalTest.java
+++ b/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_3/UnmarshalMarshalTest.java
@@ -33,7 +33,7 @@ import javax.xml.namespace.QName;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.api.marshalling.DMNMarshaller;
import org.kie.dmn.backend.marshalling.v1_3.extensions.TrisoExtensionRegister;
import org.kie.dmn.backend.marshalling.v1x.DMNMarshallerFactory;
@@ -62,48 +62,48 @@ public class UnmarshalMarshalTest {
protected static final Logger LOG = LoggerFactory.getLogger(UnmarshalMarshalTest.class);
@Test
- public void testV13_simple() throws Exception {
+ void v13Simple() throws Exception {
testRoundTripV13("org/kie/dmn/backend/marshalling/v1_3/", "simple.dmn");
}
@Test
- public void testV13_ch11example_asFromOMG() throws Exception {
+ void v13Ch11exampleAsFromOMG() throws Exception {
DMNMarshaller marshaller = DMNMarshallerFactory.newMarshallerWithExtensions(List.of(new TrisoExtensionRegister())); // as the example from OMG contains example of extension element, preserving.
testRoundTrip("org/kie/dmn/backend/marshalling/v1_3/", "Chapter 11 Example.dmn", marshaller, DMN13_SCHEMA_SOURCE);
}
@Test
- public void testV13_financial() throws Exception {
+ void v13Financial() throws Exception {
testRoundTripV13("org/kie/dmn/backend/marshalling/v1_3/", "Financial.dmn");
}
@Test
- public void testV13_loan_info() throws Exception {
+ void v13LoanInfo() throws Exception {
testRoundTripV13("org/kie/dmn/backend/marshalling/v1_3/", "Loan info.dmn");
}
@Test
- public void testV13_recommended_loan_product() throws Exception {
+ void v13RecommendedLoanProduct() throws Exception {
testRoundTripV13("org/kie/dmn/backend/marshalling/v1_3/", "Recommended Loan Products.dmn");
}
@Test
- public void testV13_group() throws Exception {
+ void v13Group() throws Exception {
testRoundTripV13("org/kie/dmn/backend/marshalling/v1_3/", "group.dmn");
}
@Test
- public void testV13_dmnedge() throws Exception {
+ void v13Dmnedge() throws Exception {
testRoundTripV13("org/kie/dmn/backend/marshalling/v1_3/", "dmnedge.dmn");
}
@Test
- public void testV13_functionItem() throws Exception {
+ void v13FunctionItem() throws Exception {
testRoundTripV13("org/kie/dmn/backend/marshalling/v1_3/", "functionItem.dmn");
}
@Test
- public void testV13_decision_list() throws Exception {
+ void v13DecisionList() throws Exception {
testRoundTripV13("org/kie/dmn/backend/marshalling/v1_3/", "decision-list.dmn");
}
diff --git a/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_4/UnmarshalMarshalTest.java b/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_4/UnmarshalMarshalTest.java
index 214c1f0d56..629dcfc282 100644
--- a/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_4/UnmarshalMarshalTest.java
+++ b/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_4/UnmarshalMarshalTest.java
@@ -33,7 +33,7 @@ import javax.xml.namespace.QName;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.api.marshalling.DMNMarshaller;
import org.kie.dmn.backend.marshalling.v1_3.extensions.TrisoExtensionRegister;
import org.kie.dmn.backend.marshalling.v1x.DMNMarshallerFactory;
@@ -62,48 +62,48 @@ public class UnmarshalMarshalTest {
protected static final Logger LOG = LoggerFactory.getLogger(UnmarshalMarshalTest.class);
@Test
- public void testV14_simple() throws Exception {
+ void v14Simple() throws Exception {
testRoundTripV14("org/kie/dmn/backend/marshalling/v1_4/", "simple.dmn");
}
@Test
- public void testV14_ch11example_asFromOMG() throws Exception {
+ void v14Ch11exampleAsFromOMG() throws Exception {
DMNMarshaller marshaller = DMNMarshallerFactory.newMarshallerWithExtensions(List.of(new TrisoExtensionRegister())); // as the example from OMG contains example of extension element, preserving (re-using from package of 1.3)
testRoundTrip("org/kie/dmn/backend/marshalling/v1_4/", "Chapter 11 Example.dmn", marshaller, DMN14_SCHEMA_SOURCE);
}
@Test
- public void testV14_financial() throws Exception {
+ void v14Financial() throws Exception {
testRoundTripV14("org/kie/dmn/backend/marshalling/v1_4/", "Financial.dmn");
}
@Test
- public void testV14_loan_info() throws Exception {
+ void v14LoanInfo() throws Exception {
testRoundTripV14("org/kie/dmn/backend/marshalling/v1_4/", "Loan info.dmn");
}
@Test
- public void testV14_recommended_loan_product() throws Exception {
+ void v14RecommendedLoanProduct() throws Exception {
testRoundTripV14("org/kie/dmn/backend/marshalling/v1_4/", "Recommended Loan Products.dmn");
}
-
+
@Test
- public void testV14_for() throws Exception {
+ void v14For() throws Exception {
testRoundTripV14("org/kie/dmn/backend/marshalling/v1_4/", "sampleFor.dmn");
}
-
+
@Test
- public void testV14_quantified() throws Exception {
+ void v14Quantified() throws Exception {
testRoundTripV14("org/kie/dmn/backend/marshalling/v1_4/", "sampleQuantified.dmn");
}
-
+
@Test
- public void testV14_conditional() throws Exception {
+ void v14Conditional() throws Exception {
testRoundTripV14("org/kie/dmn/backend/marshalling/v1_4/", "sampleConditional.dmn");
}
-
+
@Test
- public void testV14_filter() throws Exception {
+ void v14Filter() throws Exception {
testRoundTripV14("org/kie/dmn/backend/marshalling/v1_4/", "sampleFilter.dmn");
}
diff --git a/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_5/UnmarshalMarshalTest.java b/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_5/UnmarshalMarshalTest.java
index de59347f50..54ade650d4 100644
--- a/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_5/UnmarshalMarshalTest.java
+++ b/kie-dmn/kie-dmn-backend/src/test/java/org/kie/dmn/backend/marshalling/v1_5/UnmarshalMarshalTest.java
@@ -18,7 +18,22 @@
*/
package org.kie.dmn.backend.marshalling.v1_5;
-import org.junit.Test;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.InputStreamReader;
+import java.nio.file.Files;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+
+import org.junit.jupiter.api.Test;
import org.kie.dmn.api.marshalling.DMNMarshaller;
import org.kie.dmn.backend.marshalling.v1_3.extensions.TrisoExtensionRegister;
import org.kie.dmn.backend.marshalling.v1x.DMNMarshallerFactory;
@@ -38,20 +53,6 @@ import org.xmlunit.validation.ValidationProblem;
import org.xmlunit.validation.ValidationResult;
import org.xmlunit.validation.Validator;
-import javax.xml.namespace.QName;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.InputStreamReader;
-import java.nio.file.Files;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
import static org.assertj.core.api.Assertions.assertThat;
public class UnmarshalMarshalTest {
@@ -61,48 +62,48 @@ public class UnmarshalMarshalTest {
protected static final Logger LOG = LoggerFactory.getLogger(UnmarshalMarshalTest.class);
@Test
- public void testv15_simple() throws Exception {
+ void testv15_simple() throws Exception {
testRoundTripV15("org/kie/dmn/backend/marshalling/v1_5/", "simple.dmn");
}
@Test
- public void testv15_ch11example_asFromOMG() throws Exception {
+ void testv15_ch11example_asFromOMG() throws Exception {
DMNMarshaller marshaller = DMNMarshallerFactory.newMarshallerWithExtensions(List.of(new TrisoExtensionRegister())); // as the example from OMG contains example of extension element, preserving (re-using from package of 1.3)
testRoundTrip("org/kie/dmn/backend/marshalling/v1_5/", "Chapter 11 Example.dmn", marshaller, DMN15_SCHEMA_SOURCE);
}
@Test
- public void testv15_financial() throws Exception {
+ void testv15_financial() throws Exception {
testRoundTripV15("org/kie/dmn/backend/marshalling/v1_5/", "Financial.dmn");
}
@Test
- public void testv15_loan_info() throws Exception {
+ void testv15_loan_info() throws Exception {
testRoundTripV15("org/kie/dmn/backend/marshalling/v1_5/", "Loan info.dmn");
}
@Test
- public void testv15_recommended_loan_product() throws Exception {
+ void testv15_recommended_loan_product() throws Exception {
testRoundTripV15("org/kie/dmn/backend/marshalling/v1_5/", "Recommended Loan Products.dmn");
}
-
+
@Test
- public void testv15_for() throws Exception {
+ void testv15_for() throws Exception {
testRoundTripV15("org/kie/dmn/backend/marshalling/v1_5/", "sampleFor.dmn");
}
-
+
@Test
- public void testv15_quantified() throws Exception {
+ void testv15_quantified() throws Exception {
testRoundTripV15("org/kie/dmn/backend/marshalling/v1_5/", "sampleQuantified.dmn");
}
-
+
@Test
- public void testv15_conditional() throws Exception {
+ void testv15_conditional() throws Exception {
testRoundTripV15("org/kie/dmn/backend/marshalling/v1_5/", "sampleConditional.dmn");
}
-
+
@Test
- public void testv15_filter() throws Exception {
+ void testv15_filter() throws Exception {
testRoundTripV15("org/kie/dmn/backend/marshalling/v1_5/", "sampleFilter.dmn");
}
diff --git a/kie-dmn/kie-dmn-core-jsr223-jq/src/test/java/org/kie/dmn/core/jsr223/jq/BasicTest.java b/kie-dmn/kie-dmn-core-jsr223-jq/src/test/java/org/kie/dmn/core/jsr223/jq/BasicTest.java
index 1748472b97..f5931ceea8 100644
--- a/kie-dmn/kie-dmn-core-jsr223-jq/src/test/java/org/kie/dmn/core/jsr223/jq/BasicTest.java
+++ b/kie-dmn/kie-dmn-core-jsr223-jq/src/test/java/org/kie/dmn/core/jsr223/jq/BasicTest.java
@@ -33,7 +33,7 @@ import org.slf4j.LoggerFactory;
import static org.assertj.core.api.Assertions.assertThat;
-public class BasicTest {
+class BasicTest {
private static final Logger LOG = LoggerFactory.getLogger( BasicTest.class );
private static final ScriptEngineManager SEMANAGER = new ScriptEngineManager();
@@ -41,12 +41,12 @@ public class BasicTest {
private ScriptEngine engine;
@BeforeEach
- public void init() {
+ void init() {
engine = SEMANAGER.getEngineByName("jq");
}
-
+
@Test
- public void testEval() throws ScriptException {
+ void eval() throws ScriptException {
Map<String, Object> ctx = new HashMap<>();
ctx.put("a", 1);
ctx.put("b", 2);
@@ -54,9 +54,9 @@ public class BasicTest {
LOG.info("{}", result);
assertThat(result).asString().isEqualTo("3");
}
-
+
@Test
- public void testEvalJSONKey() throws ScriptException {
+ void evalJSONKey() throws ScriptException {
Map<String, Object> ctx = new HashMap<>();
ctx.put("Age", 1);
ctx.put("Previous incidents?", false);
@@ -64,9 +64,9 @@ public class BasicTest {
LOG.info("{}", result);
assertThat(result).isEqualTo(false);
}
-
+
@Test
- public void testTest() throws ScriptException {
+ void test() throws ScriptException {
evalToStringEquals(testCtx(1), " . > 10 ", false);
evalToStringEquals(testCtx(47), " . > 10 ", true);
evalToStringEquals(testCtx(47), " . > $a ", true);
diff --git a/kie-dmn/kie-dmn-core-jsr223/src/test/java/org/kie/dmn/core/jsr223/EscapeTest.java b/kie-dmn/kie-dmn-core-jsr223/src/test/java/org/kie/dmn/core/jsr223/EscapeTest.java
index 694522bcb1..aff1f511de 100644
--- a/kie-dmn/kie-dmn-core-jsr223/src/test/java/org/kie/dmn/core/jsr223/EscapeTest.java
+++ b/kie-dmn/kie-dmn-core-jsr223/src/test/java/org/kie/dmn/core/jsr223/EscapeTest.java
@@ -23,10 +23,10 @@ import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.kie.dmn.core.jsr223.JSR223Utils.escapeIdentifierForBinding;
-public class EscapeTest {
+class EscapeTest {
@Test
- public void test() {
+ void test() {
assertThat(escapeIdentifierForBinding("123abc")).isEqualTo("_123abc");
assertThat(escapeIdentifierForBinding("a+bc")).isEqualTo("a_bc");
assertThat(escapeIdentifierForBinding("full name")).isEqualTo("full_name");
diff --git a/kie-dmn/kie-dmn-core-jsr223/src/test/java/org/kie/dmn/core/jsr223/GraalJSTest.java b/kie-dmn/kie-dmn-core-jsr223/src/test/java/org/kie/dmn/core/jsr223/GraalJSTest.java
index 05be4d764d..686d662cb7 100644
--- a/kie-dmn/kie-dmn-core-jsr223/src/test/java/org/kie/dmn/core/jsr223/GraalJSTest.java
+++ b/kie-dmn/kie-dmn-core-jsr223/src/test/java/org/kie/dmn/core/jsr223/GraalJSTest.java
@@ -31,28 +31,28 @@ import org.slf4j.LoggerFactory;
import static org.assertj.core.api.Assertions.assertThat;
-public class GraalJSTest {
+class GraalJSTest {
private static final Logger LOG = LoggerFactory.getLogger( GraalJSTest.class );
private static final String POLYGLOT_ENGINE_WARN_INTERPRETER_ONLY = "polyglot.engine.WarnInterpreterOnly";
private String warnFlag;
@BeforeEach
- public void init() {
+ void init() {
warnFlag = System.getProperty(POLYGLOT_ENGINE_WARN_INTERPRETER_ONLY);
System.setProperty(POLYGLOT_ENGINE_WARN_INTERPRETER_ONLY, "false");
}
-
+
@AfterEach
- public void end() {
+ void end() {
if (warnFlag != null) {
System.setProperty(POLYGLOT_ENGINE_WARN_INTERPRETER_ONLY, warnFlag);
} else {
System.clearProperty(POLYGLOT_ENGINE_WARN_INTERPRETER_ONLY);
}
}
-
+
@Test
- public void testNashorn() {
+ void nashorn() {
DMNRuntime dmnRuntime = DMNRuntimeBuilder.fromDefaults()
.setDecisionLogicCompilerFactory(new JSR223EvaluatorCompilerFactory())
.buildConfiguration()
diff --git a/kie-dmn/kie-dmn-core-jsr223/src/test/java/org/kie/dmn/core/jsr223/JQTest.java b/kie-dmn/kie-dmn-core-jsr223/src/test/java/org/kie/dmn/core/jsr223/JQTest.java
index e7d9ad0622..a2113c3e28 100644
--- a/kie-dmn/kie-dmn-core-jsr223/src/test/java/org/kie/dmn/core/jsr223/JQTest.java
+++ b/kie-dmn/kie-dmn-core-jsr223/src/test/java/org/kie/dmn/core/jsr223/JQTest.java
@@ -29,11 +29,11 @@ import org.slf4j.LoggerFactory;
import static org.assertj.core.api.Assertions.assertThat;
-public class JQTest {
+class JQTest {
private static final Logger LOG = LoggerFactory.getLogger( JQTest.class );
@Test
- public void testJQ_BMI() {
+ void jqBmi() {
DMNRuntime dmnRuntime = DMNRuntimeBuilder.fromDefaults()
.setDecisionLogicCompilerFactory(new JSR223EvaluatorCompilerFactory())
.buildConfiguration()
@@ -48,9 +48,9 @@ public class JQTest {
LOG.info("{}", evaluateAll.getMessages());
assertThat(evaluateAll.getDecisionResultByName("BMI value classification").getResult()).isEqualTo("Normal range");
}
-
+
@Test
- public void testJQ_isAdult() {
+ void jQIsAdult() {
DMNRuntime dmnRuntime = DMNRuntimeBuilder.fromDefaults()
.setDecisionLogicCompilerFactory(new JSR223EvaluatorCompilerFactory())
.buildConfiguration()
@@ -64,9 +64,9 @@ public class JQTest {
LOG.info("{}", evaluateAll.getMessages());
assertThat(evaluateAll.getDecisionResultByName("Is Adult?").getResult()).isEqualTo(true);
}
-
+
@Test
- public void testJQ_isAdult2() {
+ void jQIsAdult2() {
DMNRuntime dmnRuntime = DMNRuntimeBuilder.fromDefaults()
.setDecisionLogicCompilerFactory(new JSR223EvaluatorCompilerFactory())
.buildConfiguration()
@@ -80,9 +80,9 @@ public class JQTest {
LOG.info("{}", evaluateAll.getMessages());
assertThat(evaluateAll.getDecisionResultByName("Is Adult?").getResult()).isEqualTo(false);
}
-
+
@Test
- public void testIsPersonNameAnAdult() {
+ void isPersonNameAnAdult() {
DMNRuntime dmnRuntime = DMNRuntimeBuilder.fromDefaults()
.setDecisionLogicCompilerFactory(new JSR223EvaluatorCompilerFactory())
.buildConfiguration()
diff --git a/kie-dmn/kie-dmn-core-jsr223/src/test/java/org/kie/dmn/core/jsr223/NashornTest.java b/kie-dmn/kie-dmn-core-jsr223/src/test/java/org/kie/dmn/core/jsr223/NashornTest.java
index 6c6a04ae73..e31b0ec632 100644
--- a/kie-dmn/kie-dmn-core-jsr223/src/test/java/org/kie/dmn/core/jsr223/NashornTest.java
+++ b/kie-dmn/kie-dmn-core-jsr223/src/test/java/org/kie/dmn/core/jsr223/NashornTest.java
@@ -31,19 +31,19 @@ import org.slf4j.LoggerFactory;
import static org.assertj.core.api.Assertions.assertThat;
-public class NashornTest {
+class NashornTest {
private static final Logger LOG = LoggerFactory.getLogger( NashornTest.class );
private static final String NASHORN_ARGS = "nashorn.args";
private String nashornArgsFromSys;
-
+
@BeforeEach
- public void init() {
+ void init() {
nashornArgsFromSys = System.getProperty(NASHORN_ARGS);
System.setProperty(NASHORN_ARGS, "--language=es6"); // TODO document: anyway is a partial ES6 support.
}
-
+
@AfterEach
- public void end() {
+ void end() {
if (nashornArgsFromSys != null) {
System.setProperty(NASHORN_ARGS, nashornArgsFromSys);
} else {
@@ -52,7 +52,7 @@ public class NashornTest {
}
@Test
- public void testNashorn() {
+ void nashorn() {
DMNRuntime dmnRuntime = DMNRuntimeBuilder.fromDefaults()
.setDecisionLogicCompilerFactory(new JSR223EvaluatorCompilerFactory())
.buildConfiguration()
@@ -67,9 +67,9 @@ public class NashornTest {
LOG.info("{}", evaluateAll.getMessages());
assertThat(evaluateAll.getDecisionResultByName("BMI value classification").getResult()).isEqualTo("Normal range");
}
-
+
@Test
- public void testIsPersonNameAnAdult() {
+ void isPersonNameAnAdult() {
DMNRuntime dmnRuntime = DMNRuntimeBuilder.fromDefaults()
.setDecisionLogicCompilerFactory(new JSR223EvaluatorCompilerFactory())
.buildConfiguration()
diff --git a/kie-dmn/kie-dmn-core/pom.xml b/kie-dmn/kie-dmn-core/pom.xml
index 092bb3931b..ab4f01aae2 100644
--- a/kie-dmn/kie-dmn-core/pom.xml
+++ b/kie-dmn/kie-dmn-core/pom.xml
@@ -156,13 +156,13 @@
<artifactId>pmml-model</artifactId>
</dependency>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
+ <artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@@ -202,6 +202,11 @@
<artifactId>yasson</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency> <!-- rely on SmallRye OpenAPI to define the Eclipse MP OAS API to be using for the tests -->
<groupId>io.smallrye</groupId>
<artifactId>smallrye-open-api-core</artifactId>
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseInterpretedVsAlphaNetworkTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseInterpretedVsAlphaNetworkTest.java
index 2bf656bc0e..19ba278049 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseInterpretedVsAlphaNetworkTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseInterpretedVsAlphaNetworkTest.java
@@ -18,32 +18,24 @@
*/
package org.kie.dmn.core;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
import org.kie.dmn.core.compiler.AlphaNetworkOption;
-@RunWith(Parameterized.class)
public abstract class BaseInterpretedVsAlphaNetworkTest {
- @Parameterized.Parameters(name = "{0}")
public static Object[] params() {
return new Object[]{true, false};
}
- private final boolean alphaNetwork;
+ protected boolean alphaNetwork;
- public BaseInterpretedVsAlphaNetworkTest(final boolean useAlphaNetwork) {
- this.alphaNetwork = useAlphaNetwork;
- }
-
- @Before
+ @BeforeEach
public void before() {
System.setProperty(AlphaNetworkOption.PROPERTY_NAME, Boolean.toString(alphaNetwork));
}
- @After
+ @AfterEach
public void after() {
System.clearProperty(AlphaNetworkOption.PROPERTY_NAME);
}
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseInterpretedVsCompiledTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseInterpretedVsCompiledTest.java
index 345ab0f38a..830b4c2131 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseInterpretedVsCompiledTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseInterpretedVsCompiledTest.java
@@ -18,32 +18,23 @@
*/
package org.kie.dmn.core;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.api.AfterEach;
import org.kie.dmn.core.compiler.ExecModelCompilerOption;
-@RunWith(Parameterized.class)
public abstract class BaseInterpretedVsCompiledTest {
- @Parameterized.Parameters(name = "{0}")
- public static Object[] params() {
+ protected static Object[] params() {
return new Object[]{false};
}
- private final boolean useExecModelCompiler;
+ protected boolean useExecModelCompiler;
- public BaseInterpretedVsCompiledTest(final boolean useExecModelCompiler) {
+ protected void init(boolean useExecModelCompiler){
this.useExecModelCompiler = useExecModelCompiler;
- }
-
- @Before
- public void before() {
System.setProperty(ExecModelCompilerOption.PROPERTY_NAME, Boolean.toString(useExecModelCompiler));
}
- @After
+ @AfterEach
public void after() {
System.clearProperty(ExecModelCompilerOption.PROPERTY_NAME);
}
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseInterpretedVsCompiledTestCanonicalKieModule.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseInterpretedVsCompiledTestCanonicalKieModule.java
index c35fb4e07d..b9758e6e0e 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseInterpretedVsCompiledTestCanonicalKieModule.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseInterpretedVsCompiledTestCanonicalKieModule.java
@@ -23,10 +23,7 @@ import java.util.Arrays;
import java.util.List;
import org.drools.modelcompiler.CanonicalKieModule;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.api.AfterEach;
import org.kie.api.KieServices;
import org.kie.api.builder.ReleaseId;
import org.kie.api.io.Resource;
@@ -39,28 +36,22 @@ import org.kie.dmn.core.compiler.ExecModelCompilerOption;
* running alongside the CanonicalKieModule, which is needed while using the executable model for DRL file.<br/><br/>
* <i>Please note that these tests don't actually verify the correct behaviour of the compiled DRL files, but they only verify the DMN model.</i> Ref: https://github.com/kiegroup/drools/pull/2460#issue-298982811
*/
-@RunWith(Parameterized.class)
public abstract class BaseInterpretedVsCompiledTestCanonicalKieModule {
- @Parameterized.Parameters
- public static Object[] params() {
+ protected static Object[] params() {
return new Object[][]{ { false, true}, {false, false} };
}
- private final boolean useExecModelCompiler;
- protected final boolean canonicalKieModule;
+ private boolean useExecModelCompiler;
+ protected boolean canonicalKieModule;
- public BaseInterpretedVsCompiledTestCanonicalKieModule(boolean useExecModelCompiler, boolean canonicalKieModule) {
+ protected void init(boolean useExecModelCompiler, boolean canonicalKieModule) {
this.useExecModelCompiler = useExecModelCompiler;
this.canonicalKieModule = canonicalKieModule;
- }
-
- @Before
- public void before() {
System.setProperty(ExecModelCompilerOption.PROPERTY_NAME, Boolean.toString(useExecModelCompiler));
}
- @After
+ @AfterEach
public void after() {
System.clearProperty(ExecModelCompilerOption.PROPERTY_NAME);
}
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseVariantNonTypeSafeTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseVariantNonTypeSafeTest.java
index 3e69ddaffb..36934d6568 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseVariantNonTypeSafeTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseVariantNonTypeSafeTest.java
@@ -18,19 +18,13 @@
*/
package org.kie.dmn.core;
-import org.junit.runners.Parameterized;
-
import static org.kie.dmn.core.BaseVariantTest.VariantTestConf.BUILDER_DEFAULT_NOCL_TYPECHECK;
import static org.kie.dmn.core.BaseVariantTest.VariantTestConf.BUILDER_STRICT;
import static org.kie.dmn.core.BaseVariantTest.VariantTestConf.KIE_API_TYPECHECK;
public abstract class BaseVariantNonTypeSafeTest extends BaseVariantTest {
- public BaseVariantNonTypeSafeTest(VariantTestConf testConfig) {
- super(testConfig);
- }
- @Parameterized.Parameters(name = "{0}")
public static Object[] params() {
return new Object[]{KIE_API_TYPECHECK, BUILDER_STRICT, BUILDER_DEFAULT_NOCL_TYPECHECK};
}
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseVariantTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseVariantTest.java
index 227a8cd613..585262a0fa 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseVariantTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/BaseVariantTest.java
@@ -21,13 +21,12 @@ package org.kie.dmn.core;
import java.util.HashMap;
import java.util.Map;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
import org.kie.dmn.api.core.DMNRuntime;
import org.kie.dmn.api.core.FEELPropertyAccessible;
+import org.kie.dmn.core.compiler.ExecModelCompilerOption;
import org.kie.dmn.core.compiler.RuntimeTypeCheckOption;
import org.kie.dmn.core.impl.DMNContextFPAImpl;
import org.kie.dmn.core.impl.DMNResultImpl;
@@ -46,7 +45,6 @@ import static org.kie.dmn.core.BaseVariantTest.VariantTestConf.BUILDER_STRICT;
import static org.kie.dmn.core.BaseVariantTest.VariantTestConf.KIE_API_TYPECHECK;
import static org.kie.dmn.core.BaseVariantTest.VariantTestConf.KIE_API_TYPECHECK_TYPESAFE;
-@RunWith(Parameterized.class)
public abstract class BaseVariantTest {
private DMNTypeSafePackageName.Factory factory;
@@ -146,16 +144,11 @@ public abstract class BaseVariantTest {
}
}
- @Parameterized.Parameters(name = "{0}")
- public static Object[] params() {
+ protected static Object[] params() {
return new Object[]{KIE_API_TYPECHECK, BUILDER_STRICT, BUILDER_DEFAULT_NOCL_TYPECHECK, BUILDER_DEFAULT_NOCL_TYPECHECK_TYPESAFE, KIE_API_TYPECHECK_TYPESAFE};
}
- private final VariantTestConf testConfig;
-
- public BaseVariantTest(final VariantTestConf testConfig) {
- this.testConfig = testConfig;
- }
+ protected VariantTestConf testConfig;
public boolean isTypeSafe() {
return testConfig.isTypeSafe();
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNAndCanonicalModelTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNAndCanonicalModelTest.java
index e23afdf106..1e0d92cf94 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNAndCanonicalModelTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNAndCanonicalModelTest.java
@@ -18,7 +18,8 @@
*/
package org.kie.dmn.core;
-import org.junit.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.api.KieServices;
import org.kie.api.builder.ReleaseId;
import org.kie.api.runtime.KieContainer;
@@ -36,12 +37,10 @@ public class DMNAndCanonicalModelTest extends BaseInterpretedVsCompiledTestCanon
public static final Logger LOG = LoggerFactory.getLogger(DMNAndCanonicalModelTest.class);
- public DMNAndCanonicalModelTest(final boolean useExecModelCompiler, boolean canonicalKieModule) {
- super(useExecModelCompiler, canonicalKieModule);
- }
-
- @Test
- public void testDMNAndCanonicalModel() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dmnAndCanonicalModel(boolean useExecModelCompiler, boolean canonicalKieModule) {
+ init(useExecModelCompiler, canonicalKieModule);
final KieServices ks = KieServices.Factory.get();
ReleaseId releaseId = ks.newReleaseId("org.kie", "dmn-and-canonical", "1.0.0");
@@ -62,8 +61,10 @@ public class DMNAndCanonicalModelTest extends BaseInterpretedVsCompiledTestCanon
assertThat(evaluateAll.getDecisionResultByName("Greeting Message").getResult()).isEqualTo("Hello John Doe");
}
- @Test
- public void testDTAndCanonicalModel() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dTAndCanonicalModel(boolean useExecModelCompiler, boolean canonicalKieModule) {
+ init(useExecModelCompiler, canonicalKieModule);
final KieServices ks = KieServices.Factory.get();
ReleaseId releaseId = ks.newReleaseId("org.kie", "dmn-and-canonical", "1.0.0");
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNAssemblerTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNAssemblerTest.java
index 55b1f59f24..c73e5c21b1 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNAssemblerTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNAssemblerTest.java
@@ -21,8 +21,9 @@ package org.kie.dmn.core;
import java.time.OffsetTime;
import java.time.format.DateTimeFormatter;
-import org.junit.After;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.api.KieServices;
import org.kie.api.builder.KieFileSystem;
import org.kie.api.builder.Message.Level;
@@ -42,12 +43,10 @@ import static org.assertj.core.api.Assertions.assertThat;
public class DMNAssemblerTest extends BaseInterpretedVsCompiledTest {
public static final Logger LOG = LoggerFactory.getLogger(DMNAssemblerTest.class);
- public DMNAssemblerTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
-
- @Test
- public void testDuplicateModel() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void duplicateModel(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final KieServices ks = KieServices.Factory.get();
final KieFileSystem kfs = ks.newKieFileSystem();
@@ -62,8 +61,10 @@ public class DMNAssemblerTest extends BaseInterpretedVsCompiledTest {
assertThat(results.getMessages(Level.ERROR)).hasSizeGreaterThan(0);
}
- @Test
- public void testExtendedMode() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void extendedMode(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("strictMode.dmn", this.getClass() );
final DMNModel model = runtime.getModel("http://www.trisotech.com/dmn/definitions/_ecf4ea54-2abc-4e2f-a101-4fe14e356a46", "strictMode" );
final DMNContext ctx = runtime.newContext();
@@ -72,8 +73,10 @@ public class DMNAssemblerTest extends BaseInterpretedVsCompiledTest {
assertThat(result.getDecisionResultByName("time").getResult()).isEqualTo(DateTimeFormatter.ISO_TIME.parse("14:30:22z", OffsetTime::from));
}
- @Test
- public void testStrictMode() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void strictMode(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
System.setProperty("org.kie.dmn.strictConformance", "true");
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("strictMode.dmn", this.getClass() );
final DMNModel model = runtime.getModel("http://www.trisotech.com/dmn/definitions/_ecf4ea54-2abc-4e2f-a101-4fe14e356a46", "strictMode" );
@@ -83,8 +86,10 @@ public class DMNAssemblerTest extends BaseInterpretedVsCompiledTest {
assertThat(result.getDecisionResultByName("time").getResult()).isNull();
}
- @Test
- public void testStrictModeProp() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void strictModeProp(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final KieServices services = KieServices.Factory.get();
final KieFileSystem fileSystem = services.newKieFileSystem();
final KieModuleModel moduleModel = services.newKieModuleModel();
@@ -101,8 +106,8 @@ public class DMNAssemblerTest extends BaseInterpretedVsCompiledTest {
assertThat(result.getDecisionResultByName("time").getResult()).isNull();
}
- @After
- public void clearSystemProperty() {
+ @AfterEach
+ void clearSystemProperty() {
System.clearProperty("org.kie.dmn.strictConformance");
}
}
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNBuildFromReaderTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNBuildFromReaderTest.java
index 42e3631090..9f5130b4a9 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNBuildFromReaderTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNBuildFromReaderTest.java
@@ -20,7 +20,7 @@ package org.kie.dmn.core;
import java.io.StringReader;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.api.KieBase;
import org.kie.api.KieServices;
import org.kie.api.io.Resource;
@@ -29,10 +29,10 @@ import org.kie.internal.utils.KieHelper;
import static org.assertj.core.api.Assertions.assertThat;
-public class DMNBuildFromReaderTest {
+class DMNBuildFromReaderTest {
@Test
- public void test() {
+ void test() {
// DROOLS-5127
String dmn =
"<definitions id=\"business-knowledge-model\" name=\"business-knowledge-model\"\n" +
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNCompilerTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNCompilerTest.java
index a6b8480ddd..20ca1cbe85 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNCompilerTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNCompilerTest.java
@@ -18,7 +18,11 @@
*/
package org.kie.dmn.core;
-import org.junit.Test;
+import java.util.Arrays;
+import java.util.Map;
+
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNMessage;
import org.kie.dmn.api.core.DMNModel;
@@ -43,9 +47,6 @@ import org.kie.dmn.feel.util.ClassLoaderUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.Arrays;
-import java.util.Map;
-
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.kie.dmn.core.util.DynamicTypeUtils.entry;
@@ -56,12 +57,10 @@ public class DMNCompilerTest extends BaseVariantTest {
public static final Logger LOG = LoggerFactory.getLogger(DMNCompilerTest.class);
- public DMNCompilerTest(VariantTestConf testConfig) {
- super(testConfig);
- }
-
- @Test
- public void testJavadocSimple() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void javadocSimple(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("javadocSimple.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_55F8F74F-3E9F-4FAA-BBF4-E6F9534B6B19", "new-file");
assertThat(dmnModel).isNotNull();
@@ -90,8 +89,10 @@ public class DMNCompilerTest extends BaseVariantTest {
assertThat(evaluateAll.hasErrors()).isFalse();
}
- @Test
- public void testJavadocComposite() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void javadocComposite(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("javadocComposite.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_7EC096B1-878B-4E85-8334-58B440BB6AD9", "new-file");
assertThat(dmnModel).isNotNull();
@@ -111,8 +112,10 @@ public class DMNCompilerTest extends BaseVariantTest {
assertThat(evaluateAll.hasErrors()).as(DMNRuntimeUtil.formatMessages(evaluateAll.getMessages())).isFalse();
}
- @Test
- public void testJavadocInnerComposite() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void javadocInnerComposite(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("javadocInnerComposite.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_7EC096B1-878B-4E85-8334-58B440BB6AD9bis", "new-file");
assertThat(dmnModel).isNotNull();
@@ -151,8 +154,10 @@ public class DMNCompilerTest extends BaseVariantTest {
assertThat(evaluateAll.hasErrors()).as(DMNRuntimeUtil.formatMessages(evaluateAll.getMessages())).isFalse();
}
- @Test
- public void testItemDefAllowedValuesString() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void itemDefAllowedValuesString(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("0003-input-data-string-allowed-values.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "0003-input-data-string-allowed-values" );
assertThat(dmnModel).isNotNull();
@@ -181,8 +186,10 @@ public class DMNCompilerTest extends BaseVariantTest {
assertThat(feelType.getAllowedValuesFEEL().get(3).apply(ctx, "STUDENT")).isTrue();
}
- @Test
- public void testCompositeItemDefinition() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void compositeItemDefinition(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("0008-LX-arithmetic.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "0008-LX-arithmetic" );
assertThat(dmnModel).isNotNull();
@@ -218,8 +225,10 @@ public class DMNCompilerTest extends BaseVariantTest {
assertThat(((SimpleTypeImpl)termMonths).getFeelType()).isEqualTo(BuiltInType.NUMBER);
}
- @Test
- public void testCompilationThrowsNPE() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void compilationThrowsNPE(VariantTestConf conf) {
+ testConfig = conf;
try {
createRuntime("compilationThrowsNPE.dmn", this.getClass());
fail("shouldn't have reached here.");
@@ -228,8 +237,10 @@ public class DMNCompilerTest extends BaseVariantTest {
}
}
- @Test
- public void testRecursiveFunctions() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void recursiveFunctions(VariantTestConf conf) {
+ testConfig = conf;
// DROOLS-2161
final DMNRuntime runtime = createRuntime("Recursive.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "Recursive" );
@@ -237,8 +248,10 @@ public class DMNCompilerTest extends BaseVariantTest {
assertThat(evaluateModel(runtime, dmnModel, DMNFactory.newContext()).hasErrors()).isFalse();
}
- @Test
- public void testImport() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void testImport(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntimeWithAdditionalResources("Importing_Model.dmn",
this.getClass(),
"Imported_Model.dmn");
@@ -274,18 +287,24 @@ public class DMNCompilerTest extends BaseVariantTest {
}
}
- @Test
- public void testEmptyNamedModelImportWithHrefNamespace() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void emptyNamedModelImportWithHrefNamespace(VariantTestConf conf) {
+ testConfig = conf;
commonValidateUnnamedImport("valid_models/DMNv1_5/Importing_EmptyNamed_Model_With_Href_Namespace.dmn", "valid_models/DMNv1_5/Imported_Model_Unamed.dmn");
}
- @Test
- public void testEmptyNamedModelImportWithoutHrefNamespace() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void emptyNamedModelImportWithoutHrefNamespace(VariantTestConf conf) {
+ testConfig = conf;
commonValidateUnnamedImport("valid_models/DMNv1_5/Importing_EmptyNamed_Model_Without_Href_Namespace.dmn", "valid_models/DMNv1_5/Imported_Model_Unamed.dmn");
}
- @Test
- public void testOverridingEmptyNamedModelImport() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void overridingEmptyNamedModelImport(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntimeWithAdditionalResources("valid_models/DMNv1_5/Importing_OverridingEmptyNamed_Model.dmn",
this.getClass(),
"valid_models/DMNv1_5/Imported_Model_Unamed.dmn");
@@ -330,8 +349,10 @@ public class DMNCompilerTest extends BaseVariantTest {
}
}
- @Test
- public void testWrongComparisonOps() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void wrongComparisonOps(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("WrongComparisonOps.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_a937d093-86d3-4306-8db8-1e7a33588b68", "Drawing 1");
assertThat(dmnModel).isNotNull();
@@ -347,8 +368,10 @@ public class DMNCompilerTest extends BaseVariantTest {
.count()).as(DMNRuntimeUtil.formatMessages(dmnModel.getMessages())).isEqualTo(4L);
}
- @Test
- public void testAllowedValuesForSimpleTypeInherited() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void allowedValuesForSimpleTypeInherited(VariantTestConf conf) {
+ testConfig = conf;
String nameSpace = "http://www.trisotech.com/definitions/_238bd96d-47cd-4746-831b-504f3e77b442";
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("valid_models/DMNv1_5/InheritedConstraints.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel(
@@ -364,8 +387,10 @@ public class DMNCompilerTest extends BaseVariantTest {
assertThat(aConstrainedStringType.isAssignableValue("Joe")).isFalse();
}
- @Test
- public void testAllowedValuesForComplexTypeInherited() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void allowedValuesForComplexTypeInherited(VariantTestConf conf) {
+ testConfig = conf;
String nameSpace = "http://www.trisotech.com/definitions/_238bd96d-47cd-4746-831b-504f3e77b442";
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("valid_models/DMNv1_5/InheritedConstraints.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel(
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNDecisionTableHitPolicyTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNDecisionTableHitPolicyTest.java
index 2972ec3b46..1c7836004c 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNDecisionTableHitPolicyTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNDecisionTableHitPolicyTest.java
@@ -23,7 +23,8 @@ import java.util.List;
import java.util.Map;
import org.assertj.core.api.InstanceOfAssertFactories;
-import org.junit.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNDecisionResult.DecisionEvaluationStatus;
import org.kie.dmn.api.core.DMNMessage;
@@ -43,12 +44,10 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
public static final Logger LOG = LoggerFactory.getLogger(DMNDecisionTableHitPolicyTest.class);
- public DMNDecisionTableHitPolicyTest(final boolean useExecModelCompiler ) {
- super( useExecModelCompiler );
- }
-
- @Test
- public void testSimpleDecisionTableHitPolicyUnique() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyUnique(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0004-simpletable-U.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "0004-simpletable-U");
assertThat(dmnModel).isNotNull();
@@ -58,8 +57,10 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
assertThat(result.get("Approval Status")).isEqualTo("Approved");
}
- @Test
- public void testSimpleDecisionTableHitPolicyUniqueSatisfies() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyUniqueSatisfies(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0004-simpletable-U.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "0004-simpletable-U");
assertThat(dmnModel).isNotNull();
@@ -75,8 +76,10 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
assertThat(message.getText()).isEqualTo("DMN: RiskCategory='ASD' does not match any of the valid values \"High\", \"Low\", \"Medium\" for decision table '_0004-simpletable-U'. (DMN id: _0004-simpletable-U, FEEL expression evaluation error) ");
}
- @Test
- public void testSimpleDecisionTableHitPolicyUniqueNullWarn() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyUniqueNullWarn(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0004-simpletable-U-noinputvalues.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "0004-simpletable-U-noinputvalues");
assertThat(dmnModel).isNotNull();
@@ -94,8 +97,10 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
assertThat(dmnResult.getMessages().stream().anyMatch(dm -> dm.getSeverity().equals(DMNMessage.Severity.WARN) && dm.getFeelEvent() instanceof HitPolicyViolationEvent && dm.getFeelEvent().getSeverity().equals(FEELEvent.Severity.WARN))).isTrue();
}
- @Test
- public void testSimpleDecisionTableHitPolicyUniqueNullWarn_ctxe() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyUniqueNullWarnCtxe(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0004-simpletable-U-noinputvalues-ctxe.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "0004-simpletable-U-noinputvalues");
assertThat(dmnModel).isNotNull();
@@ -103,8 +108,10 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
check_testSimpleDecisionTableHitPolicyUniqueNullWarn(runtime, dmnModel);
}
- @Test
- public void testSimpleDecisionTableHitPolicyUniqueNullWarn_ctxr() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyUniqueNullWarnCtxr(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0004-simpletable-U-noinputvalues-ctxr.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "0004-simpletable-U-noinputvalues");
assertThat(dmnModel).isNotNull();
@@ -112,8 +119,10 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
check_testSimpleDecisionTableHitPolicyUniqueNullWarn(runtime, dmnModel);
}
- @Test
- public void testDecisionTableHitPolicyUnique() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTableHitPolicyUnique(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("BranchDistribution.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_cdf29af2-959b-4004-8271-82a9f5a62147", "Dessin 1");
assertThat(dmnModel).isNotNull();
@@ -129,8 +138,10 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
assertThat(result.get("Branches distribution")).isEqualTo("Medium");
}
- @Test
- public void testSimpleDecisionTableHitPolicyFirst() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyFirst(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0004-simpletable-F.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "0004-simpletable-F");
assertThat(dmnModel).isNotNull();
@@ -143,13 +154,17 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
assertThat(decisionResult).containsEntry("Decision Review", "Decision final");
}
- @Test
- public void testSimpleDecisionTableHitPolicyAnyEqualRules() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyAnyEqualRules(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testSimpleDecisionTableHitPolicyAny("0004-simpletable-A.dmn", "0004-simpletable-A", true);
}
- @Test
- public void testSimpleDecisionTableHitPolicyAnyNonEqualRules() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyAnyNonEqualRules(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testSimpleDecisionTableHitPolicyAny("0004-simpletable-A-non-equal.dmn", "0004-simpletable-A-non-equal", false);
}
@@ -169,8 +184,10 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
}
}
- @Test
- public void testSimpleDecisionTableHitPolicyPriority() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyPriority(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0004-simpletable-P.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "0004-simpletable-P");
assertThat(dmnModel).isNotNull();
@@ -180,8 +197,10 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
assertThat(result.get("Approval Status")).isEqualTo("Declined");
}
- @Test
- public void testSimpleDecisionTableHitPolicyPriorityMultipleOutputs() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyPriorityMultipleOutputs(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0004-simpletable-P-multiple-outputs.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "0004-simpletable-P-multiple-outputs");
assertThat(dmnModel).isNotNull();
@@ -194,8 +213,10 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
assertThat(decisionResult).containsEntry("Decision Review", "Needs verification");
}
- @Test
- public void testSimpleDecisionTableHitPolicyOutputOrder() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyOutputOrder(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0004-simpletable-O.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "0004-simpletable-O");
assertThat(dmnModel).isNotNull();
@@ -207,8 +228,10 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
assertThat(decisionResults).contains("Declined", "Declined", "Approved");
}
- @Test
- public void testSimpleDecisionTableHitPolicyOutputOrderMultipleOutputs() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyOutputOrderMultipleOutputs(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0004-simpletable-O-multiple-outputs.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "0004-simpletable-O-multiple-outputs");
assertThat(dmnModel).isNotNull();
@@ -230,8 +253,10 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
assertThat(outputResult).containsEntry("Decision Review", expectedDecisionReview);
}
- @Test
- public void testSimpleDecisionTableHitPolicyRuleOrder() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyRuleOrder(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0004-simpletable-R.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "0004-simpletable-R");
assertThat(dmnModel).isNotNull();
@@ -243,15 +268,19 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
assertThat(decisionResults).contains("Approved", "Needs review", "Declined");
}
- @Test
- public void testSimpleDecisionTableHitPolicyCollect() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyCollect(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<BigDecimal> decisionResults = executeTestDecisionTableHitPolicyCollect(getSimpleTableContext(BigDecimal.valueOf(70 ), "Medium", true));
assertThat(decisionResults).hasSize(3);
assertThat(decisionResults).contains(BigDecimal.valueOf(10), BigDecimal.valueOf(25), BigDecimal.valueOf(13));
}
- @Test
- public void testSimpleDecisionTableHitPolicyCollectNoHits() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyCollectNoHits(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<BigDecimal> decisionResults = executeTestDecisionTableHitPolicyCollect(getSimpleTableContext(BigDecimal.valueOf(5 ), "Medium", true));
assertThat(decisionResults).hasSize(0);
}
@@ -266,15 +295,19 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
return (List<BigDecimal>) result.get( "Status number");
}
- @Test
- public void testSimpleDecisionTableHitPolicyCollectSum() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyCollectSum(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testSimpleDecisionTableHitPolicyCollectAggregateFunction(
"0004-simpletable-C-sum.dmn", "0004-simpletable-C-sum", BigDecimal.valueOf(48),
getSimpleTableContext(BigDecimal.valueOf(70), "Medium", true));
}
- @Test
- public void testSimpleDecisionTableHitPolicyCollectSumMultipleOutputs() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyCollectSumMultipleOutputs(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0004-simpletable-C-sum-multiple-outputs.dmn", this.getClass());
final DMNModel dmnModel =
runtime.getModel("https://github.com/kiegroup/kie-dmn", "0004-simpletable-C-sum-multiple-outputs");
@@ -290,29 +323,37 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
assertThat(decisionResult).containsEntry("Value2", BigDecimal.valueOf(32));
}
- @Test
- public void testSimpleDecisionTableHitPolicyCollectMin() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyCollectMin(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testSimpleDecisionTableHitPolicyCollectAggregateFunction(
"0004-simpletable-C-min.dmn", "0004-simpletable-C-min", BigDecimal.valueOf(10),
getSimpleTableContext(BigDecimal.valueOf(70), "Medium", true));
}
- @Test
- public void testSimpleDecisionTableHitPolicyCollectMax() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyCollectMax(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testSimpleDecisionTableHitPolicyCollectAggregateFunction(
"0004-simpletable-C-max.dmn", "0004-simpletable-C-max", BigDecimal.valueOf(25),
getSimpleTableContext(BigDecimal.valueOf(70), "Medium", true));
}
- @Test
- public void testSimpleDecisionTableHitPolicyCollectCount() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyCollectCount(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testSimpleDecisionTableHitPolicyCollectAggregateFunction(
"0004-simpletable-C-count.dmn", "0004-simpletable-C-count", BigDecimal.valueOf(3),
getSimpleTableContext(BigDecimal.valueOf(70), "Medium", true));
}
- @Test
- public void testSimpleDecisionTableHitPolicyCollectCountNoHits() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableHitPolicyCollectCountNoHits(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testSimpleDecisionTableHitPolicyCollectAggregateFunction(
"0004-simpletable-C-count.dmn", "0004-simpletable-C-count", BigDecimal.valueOf(0),
getSimpleTableContext(BigDecimal.valueOf(5), "Medium", true));
@@ -341,8 +382,10 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
return context;
}
- @Test
- public void testDecisionTableHitPolicyCollect() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTableHitPolicyCollect(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Collect_Hit_Policy.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_da1a4dcb-01bf-4dee-9be8-f498bc68178c", "Collect Hit Policy");
assertThat(dmnModel).isNotNull();
@@ -357,8 +400,10 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
assertThat(result.get("Collect")).isEqualTo(BigDecimal.valueOf(50));
}
- @Test
- public void testDecisionTableHitPolicyAnyWithOverlap_DoOverlap() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTableHitPolicyAnyWithOverlapDoOverlap(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNResult dmnResult = executeHitPolicyAnyWithOverlap(20);
assertThat(dmnResult.hasErrors()).isTrue();
assertThat(dmnResult.getMessages()).hasSizeGreaterThan(0);
@@ -366,8 +411,10 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
assertThat(dmnResult.getDecisionResultByName("a decision").getResult()).isNull();
}
- @Test
- public void testDecisionTableHitPolicyAnyWithOverlap_NoOverlap() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTableHitPolicyAnyWithOverlapNoOverlap(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNResult dmnResult = executeHitPolicyAnyWithOverlap(-1);
assertThat(dmnResult.hasErrors()).isFalse();
assertThat(dmnResult.getDecisionResultByName("a decision").getResult()).isEqualTo("boh");
@@ -384,9 +431,11 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
final DMNResult dmnResult = runtime.evaluateAll(dmnModel, context);
return dmnResult;
}
-
- @Test
- public void testShortCircuitFIRST() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void shortCircuitFIRST(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("First DT not stopping.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_e56151c4-d522-4974-88e8-f6c88ffaaba4", "Drawing 1");
assertThat(dmnModel).isNotNull();
@@ -403,8 +452,10 @@ public class DMNDecisionTableHitPolicyTest extends BaseInterpretedVsCompiledTest
assertThat(decisionTable).containsEntry("nn abs", BigDecimal.ZERO);
}
- @Test
- public void testShortCircuitFIRST_withNullResults() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void shortCircuitFIRSTWithNullResults(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("First DT not stopping - null result.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_e56151c4-d522-4974-88e8-f6c88ffaaba4", "Drawing 1");
assertThat(dmnModel).isNotNull();
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNDecisionTableRuntimeTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNDecisionTableRuntimeTest.java
index e5960b6fda..b184e95f8c 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNDecisionTableRuntimeTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNDecisionTableRuntimeTest.java
@@ -28,8 +28,11 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
-import org.junit.Test;
+import org.junit.jupiter.api.Timeout;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.api.KieServices;
import org.kie.api.builder.KieBuilder;
import org.kie.api.builder.KieFileSystem;
@@ -74,12 +77,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
public static final Logger LOG = LoggerFactory.getLogger(DMNDecisionTableRuntimeTest.class);
- public DMNDecisionTableRuntimeTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
-
- @Test
- public void testDecisionTableWithCalculatedResult() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTableWithCalculatedResult(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime( "calculation1.dmn", this.getClass() );
checkDecisionTableWithCalculatedResult(runtime);
}
@@ -99,9 +100,12 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
final DMNContext result = dmnResult.getContext();
assertThat( ((BigDecimal) result.get( "Logique de décision 1" )).setScale( 1, RoundingMode.CEILING )).isEqualTo(BigDecimal.valueOf( 0.5 ) );
}
-
- @Test(timeout = 30_000L)
- public void testDecisionTableWithCalculatedResult_parallel() throws Throwable {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ @Timeout(value = 30_000L, unit = TimeUnit.MILLISECONDS)
+ void decisionTableWithCalculatedResultParallel(boolean useExecModelCompiler) throws Throwable {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime( "calculation1.dmn", this.getClass() );
final Runnable task = () -> checkDecisionTableWithCalculatedResult(runtime);
final List<Throwable> problems = Collections.synchronizedList(new ArrayList<>());
@@ -118,8 +122,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
}
}
- @Test
- public void testDecisionTableMultipleResults() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTableMultipleResults(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime( "car_damage_responsibility.dmn", this.getClass() );
final DMNRuntimeEventListener listener = Mockito.mock( DMNRuntimeEventListener.class );
runtime.addListener( listener );
@@ -152,8 +158,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( second.getSelected()).containsExactly(3);
}
- @Test
- public void testSimpleDecisionTableMultipleOutputWrongOutputType() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleDecisionTableMultipleOutputWrongOutputType(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime( "0004-simpletable-P-multiple-outputs-wrong-output.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel( "https://github.com/kiegroup/kie-dmn", "0004-simpletable-P-multiple-outputs-wrong-output" );
assertThat(dmnModel).isNotNull();
@@ -169,8 +177,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
message -> message.getFeelEvent().getSourceException() instanceof NullPointerException ).count()).isEqualTo(0L );
}
- @Test
- public void testDecisionTableInvalidInputErrorMessage() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTableInvalidInputErrorMessage(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNContext context = DMNFactory.newContext();
context.set( "Branches dispersion", "Province" );
context.set( "Number of Branches", BigDecimal.valueOf( 10 ) );
@@ -178,8 +188,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
testDecisionTableInvalidInput( context );
}
- @Test
- public void testDecisionTableInvalidInputTypeErrorMessage() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTableInvalidInputTypeErrorMessage(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNContext context = DMNFactory.newContext();
context.set( "Branches dispersion", 1 );
context.set( "Number of Branches", BigDecimal.valueOf( 10 ) );
@@ -187,8 +199,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
testDecisionTableInvalidInput( context );
}
- @Test
- public void testDecisionTableNonexistingInputErrorMessage() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTableNonexistingInputErrorMessage(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNContext context = DMNFactory.newContext();
context.set( "Not exists", "Province" );
context.set( "Number of Branches", BigDecimal.valueOf( 10 ) );
@@ -208,8 +222,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.isDefined( "Branches distribution" )).isEqualTo(Boolean.FALSE);
}
- @Test
- public void testDecisionTableDefaultValue() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTableDefaultValue(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime( "decisiontable-default-value.dmn", this.getClass() );
final DMNRuntimeEventListener listener = Mockito.mock( DMNRuntimeEventListener.class );
runtime.addListener( listener );
@@ -236,8 +252,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( captor.getValue().getSelected()).isEmpty();
}
- @Test
- public void testTwoDecisionTables() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void twoDecisionTables(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime( "two_decision_tables.dmn", this.getClass() );
final DMNRuntimeEventListener listener = Mockito.mock( DMNRuntimeEventListener.class );
runtime.addListener( listener );
@@ -263,8 +281,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( captor.getAllValues().get( 1 ).getDecisionTableName()).isEqualTo("b" );
}
- @Test
- public void testDTInputExpressionLocalXmlnsInference() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dTInputExpressionLocalXmlnsInference(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("drools1502-InputExpression.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"https://www.drools.org/kie-dmn/definitions",
@@ -282,8 +302,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "MyDecision" )).isEqualTo("Decision taken" );
}
- @Test
- public void testDTInContext() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dTInContext(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DT_in_context.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_4acdcb25-b298-435e-abd5-efd00ed686a5", "Drawing 1" );
assertThat(dmnModel).isNotNull();
@@ -298,8 +320,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( ((Map) result.get( "D1" )).get( "Text color" )).isEqualTo("red" );
}
- @Test
- public void testDTUsingEqualsUnaryTestWithVariable1() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dTUsingEqualsUnaryTestWithVariable1(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DT_using_variables.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_ed1ec15b-40aa-424d-b1d0-4936df80b135", "DT Using variables" );
assertThat(dmnModel).isNotNull();
@@ -323,8 +347,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "Compare String" )).isEqualTo("Same String" );
}
- @Test
- public void testDTUsingEqualsUnaryTestWithVariable2() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dTUsingEqualsUnaryTestWithVariable2(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DT_using_variables.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_ed1ec15b-40aa-424d-b1d0-4936df80b135", "DT Using variables" );
assertThat(dmnModel).isNotNull();
@@ -348,8 +374,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "Compare String" )).isEqualTo("Different String" );
}
- @Test
- public void testEmptyOutputCell() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void emptyOutputCell(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime( "DT_empty_output_cell.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel( "http://www.trisotech.com/definitions/_77ae284e-ce52-4579-a50f-f3cc584d7f4b", "Calculation1" );
assertThat(dmnModel).isNotNull();
@@ -363,8 +391,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getContext().get("Logique de décision 1")).isNull();
}
- @Test
- public void testNullRelation() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void nullRelation(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("nullrelation.dmn", getClass());
final DMNModel model = runtime.getModel("http://www.trisotech.com/definitions/_946a2145-89ae-4197-88b4-40e6f88c8101", "Null in relations");
assertThat(model).isNotNull();
@@ -375,8 +405,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.hasErrors()).as(DMNRuntimeUtil.formatMessages(result.getMessages())).isFalse();
}
- @Test
- public void testDecisionTableOutputDMNTypeCollection() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTableOutputDMNTypeCollection(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2359
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DecisionTableOutputDMNTypeCollection.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_ae5d2033-c6d0-411f-a394-da33a70e5638", "Drawing 1");
@@ -393,8 +425,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("a decision")).asList().containsExactly("abc", "xyz");
}
- @Test
- public void testDecisionTableOutputDMNTypeCollection_NOtypecheck() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTableOutputDMNTypeCollectionNOtypecheck(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2359
// do NOT use the DMNRuntimeUtil as that enables typeSafe check override for runtime.
final KieServices ks = KieServices.Factory.get();
@@ -415,8 +449,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("a decision")).asList().containsExactly("abc", "xyz");
}
- @Test
- public void testDecisionTableOutputDMNTypeCollectionWithLOV() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTableOutputDMNTypeCollectionWithLOV(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2359
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DecisionTableOutputDMNTypeCollectionWithLOV.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_ae5d2033-c6d0-411f-a394-da33a70e5638", "List of Words in DT");
@@ -433,8 +469,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("a decision")).asList().containsExactly("abc", "a");
}
- @Test
- public void testDecisionTableOutputDMNTypeCollectionWithLOV_NOtypecheck() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTableOutputDMNTypeCollectionWithLOVNOtypecheck(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2359
// do NOT use the DMNRuntimeUtil as that enables typeSafe check override for runtime.
final KieServices ks = KieServices.Factory.get();
@@ -455,15 +493,19 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("a decision")).asList().containsExactly("abc", "a");
}
- @Test
- public void testDecisionTablesQuestionMarkVariableCorrectEvaluation() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTablesQuestionMarkVariableCorrectEvaluation(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testDecisionTablesQuestionMarkVariable("questionmarkunarytest/qmark.dmn",
"OK",
DMNDecisionResult.DecisionEvaluationStatus.SUCCEEDED);
}
- @Test
- public void testDecisionTablesQuestionMarkAsString() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTablesQuestionMarkAsString(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testDecisionTablesQuestionMarkVariable("questionmarkunarytest/qmarkAsString.dmn",
"NOT OK",
DMNDecisionResult.DecisionEvaluationStatus.SUCCEEDED);
@@ -475,99 +517,127 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
DMNDecisionResult.DecisionEvaluationStatus.SUCCEEDED);
}
- @Test
- public void testDecisionTablesQuestionMarkVariableVsQuestionMarkString() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTablesQuestionMarkVariableVsQuestionMarkString(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testDecisionTablesQuestionMarkVariable("questionmarkunarytest/qmarkVsQmarkString.dmn",
"OK",
DMNDecisionResult.DecisionEvaluationStatus.SUCCEEDED);
}
- @Test
- public void testDecisionTablesQuestionMarkOnly() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTablesQuestionMarkOnly(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testDecisionTablesQuestionMarkVariable("questionmarkunarytest/qmarkonly.dmn",
null,
DMNDecisionResult.DecisionEvaluationStatus.FAILED);
}
- @Test
- public void testDecisionTablesQuestionMarkMultivalue() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTablesQuestionMarkMultivalue(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testDecisionTablesQuestionMarkVariable("questionmarkunarytest/qmarkMultivalue.dmn",
"OK",
DMNDecisionResult.DecisionEvaluationStatus.SUCCEEDED);
}
- @Test
- public void testDecisionTablesQuestionMarkMultivalueWithBrackets() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTablesQuestionMarkMultivalueWithBrackets(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testDecisionTablesQuestionMarkVariable("questionmarkunarytest/qmarkMultivalueWithBrackets.dmn",
"OK",
DMNDecisionResult.DecisionEvaluationStatus.SUCCEEDED);
}
- @Test
- public void testDecisionTablesQuestionMarkWithNot() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTablesQuestionMarkWithNot(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testDecisionTablesQuestionMarkVariable("questionmarkunarytest/qmarkWithNot.dmn",
"OK",
DMNDecisionResult.DecisionEvaluationStatus.SUCCEEDED);
}
- @Test
- public void testDecisionTablesQuestionMarkWithContext() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTablesQuestionMarkWithContext(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testDecisionTablesQuestionMarkVariable("questionmarkunarytest/qmarkWithContext.dmn",
"OK",
DMNDecisionResult.DecisionEvaluationStatus.SUCCEEDED);
}
- @Test
- public void testDecisionTablesQuestionMarkWithQuantifiedExpression() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTablesQuestionMarkWithQuantifiedExpression(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testDecisionTablesQuestionMarkVariable("questionmarkunarytest/qmarkWithQuantifiedExpr.dmn",
"OK",
DMNDecisionResult.DecisionEvaluationStatus.SUCCEEDED);
}
- @Test
- public void testDecisionTablesQuestionMarkWithForExpression() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTablesQuestionMarkWithForExpression(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testDecisionTablesQuestionMarkVariable("questionmarkunarytest/qmarkWithForExpr.dmn",
"OK",
DMNDecisionResult.DecisionEvaluationStatus.SUCCEEDED);
}
- @Test
- public void testDecisionTablesQuestionMarkWithFuncDef() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTablesQuestionMarkWithFuncDef(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testDecisionTablesQuestionMarkVariable("questionmarkunarytest/qmarkWithFuncDef.dmn",
"OK",
DMNDecisionResult.DecisionEvaluationStatus.SUCCEEDED);
}
- @Test
- public void testDecisionTablesQuestionMarkInstanceOf() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTablesQuestionMarkInstanceOf(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testDecisionTablesQuestionMarkVariable("questionmarkunarytest/qmarkInstanceOf.dmn",
"NOT OK",
DMNDecisionResult.DecisionEvaluationStatus.SUCCEEDED);
}
- @Test
- public void testDecisionTablesQuestionMarkInWithUnaryTests() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTablesQuestionMarkInWithUnaryTests(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testDecisionTablesQuestionMarkVariable("questionmarkunarytest/qmarkInWithUnaryTest.dmn",
"OK",
DMNDecisionResult.DecisionEvaluationStatus.SUCCEEDED);
}
- @Test
- public void testDecisionTablesQuestionMarkWithRange() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTablesQuestionMarkWithRange(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testDecisionTablesQuestionMarkVariable("questionmarkunarytest/qmarkWithRange.dmn",
"OK",
DMNDecisionResult.DecisionEvaluationStatus.SUCCEEDED);
}
- @Test
- public void testDecisionTablesQuestionMarkWithAnd() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTablesQuestionMarkWithAnd(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testDecisionTablesQuestionMarkVariable("questionmarkunarytest/qmarkWithAnd.dmn",
"OK",
DMNDecisionResult.DecisionEvaluationStatus.SUCCEEDED);
}
- @Test
- public void testDecisionTablesQuestionMarkInNonBooleanFunction() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTablesQuestionMarkInNonBooleanFunction(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testDecisionTablesQuestionMarkVariable("questionmarkunarytest/qmarkInNonBooleanFunction.dmn",
null,
DMNDecisionResult.DecisionEvaluationStatus.FAILED);
@@ -587,8 +657,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.getResult()).isEqualTo(expectedResult);
}
- @Test
- public void testDecisionTableOutputMessageRowIndex() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTableOutputMessageRowIndex(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-5606 DMN wrong rule index in message when not conforming
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DecisionTableOutputMessageRowIndex.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_D7A4B999-3178-4929-834F-8979E3C5000F", "DecisionTableOutputMessageRowIndex");
@@ -606,8 +678,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(msg0.getText()).containsIgnoringCase("Invalid result value on rule #1, output #1."); // there is only 1 row, 1 output column
}
- @Test
- public void testDTand() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dTand(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DTand.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_6697FFDC-B3D9-4B0B-BC07-AE5E5AC96CB4", "DTand");
assertThat(dmnModel).isNotNull();
@@ -621,8 +695,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("out1").getResult()).isEqualTo("PASS");
}
- @Test
- public void testQMarkAndNullShouldNotThrowNPEs() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void qMarkAndNullShouldNotThrowNPEs(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("questionmarkunarytest/qmarkMatches.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_D1CF8332-8443-41C8-B214-D282B82C7632", "qmarkMatches");
assertThat(dmnModel).isNotNull();
@@ -654,8 +730,10 @@ public class DMNDecisionTableRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(feelNPEs).as("while it's okay to have error-ed on evaluation of FEEL, there should not be any sort of NPEs when reporting the human friendly message").isEmpty();
}
- @Test
- public void testDTCollectOperatorsMultipleOutputs() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dTCollectOperatorsMultipleOutputs(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
checkDTCollectOperatorsMultipleOutputs(BuiltinAggregator.SUM, 100, 111, 18);
checkDTCollectOperatorsMultipleOutputs(BuiltinAggregator.COUNT, 10, 2, 2);
checkDTCollectOperatorsMultipleOutputs(BuiltinAggregator.MIN, 100, 1, 3);
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNDecisionTableWithSymbolsTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNDecisionTableWithSymbolsTest.java
index faac733058..902cbd3454 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNDecisionTableWithSymbolsTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNDecisionTableWithSymbolsTest.java
@@ -18,7 +18,8 @@
*/
package org.kie.dmn.core;
-import org.junit.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -30,12 +31,10 @@ import static org.assertj.core.api.Assertions.assertThat;
public class DMNDecisionTableWithSymbolsTest extends BaseInterpretedVsCompiledTest {
- public DMNDecisionTableWithSymbolsTest(final boolean useExecModelCompiler ) {
- super( useExecModelCompiler );
- }
-
- @Test
- public void testDecisionWithArgumentsOnOutput() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionWithArgumentsOnOutput(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Decide with symbols.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_79b16a68-013b-484c-98f5-49ff77808800", "Decide with symbols");
assertThat(dmnModel).isNotNull();
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNInputRuntimeTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNInputRuntimeTest.java
index b9bfcf98d9..4feaac9d57 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNInputRuntimeTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNInputRuntimeTest.java
@@ -24,7 +24,9 @@ import java.util.Collections;
import java.util.List;
import java.util.Set;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNDecisionResult;
import org.kie.dmn.api.core.DMNMessage;
@@ -46,12 +48,10 @@ import static org.kie.dmn.core.util.DynamicTypeUtils.prototype;
public class DMNInputRuntimeTest extends BaseInterpretedVsCompiledTest {
- public DMNInputRuntimeTest(final boolean useExecModelCompiler ) {
- super( useExecModelCompiler );
- }
-
- @Test
- public void testInputStringEvaluateAll() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void inputStringEvaluateAll(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime( "0001-input-data-string.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel( "https://github.com/kiegroup/drools/kie-dmn", "_0001-input-data-string" );
assertThat(dmnModel).isNotNull();
@@ -69,8 +69,10 @@ public class DMNInputRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "Greeting Message" )).isEqualTo("Hello John Doe" );
}
- @Test
- public void testInputStringEvaluateDecisionByName() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void inputStringEvaluateDecisionByName(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime( "0001-input-data-string.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel( "https://github.com/kiegroup/drools/kie-dmn", "_0001-input-data-string" );
assertThat(dmnModel).isNotNull();
@@ -100,8 +102,10 @@ public class DMNInputRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( dmnResult.getDecisionResultByName( "Greeting Message" ).getEvaluationStatus()).isEqualTo(DMNDecisionResult.DecisionEvaluationStatus.NOT_EVALUATED );
}
- @Test
- public void testInputStringEvaluateDecisionById() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void inputStringEvaluateDecisionById(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime( "0001-input-data-string.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel( "https://github.com/kiegroup/drools/kie-dmn", "_0001-input-data-string" );
assertThat(dmnModel).isNotNull();
@@ -131,8 +135,10 @@ public class DMNInputRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( dmnResult.getDecisionResultByName( "Greeting Message" ).getEvaluationStatus()).isEqualTo(DMNDecisionResult.DecisionEvaluationStatus.NOT_EVALUATED );
}
- @Test
- public void testInputStringAllowedValuesEvaluateAll() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void inputStringAllowedValuesEvaluateAll(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime( "0003-input-data-string-allowed-values.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel( "https://github.com/kiegroup/kie-dmn", "0003-input-data-string-allowed-values" );
assertThat(dmnModel).isNotNull();
@@ -147,13 +153,17 @@ public class DMNInputRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "Employment Status Statement" )).isEqualTo("You are SELF-EMPLOYED" );
}
- @Test
- public void testInputStringNotInTypeScopeEvaluateAll() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void inputStringNotInTypeScopeEvaluateAll(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testInputStringNotAllowedValuesEvaluateAll("NOT-ALLOWED-VALUE");
}
- @Test
- public void testInputStringWrongTypeEvaluateAll() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void inputStringWrongTypeEvaluateAll(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
testInputStringNotAllowedValuesEvaluateAll(new Object());
}
@@ -175,15 +185,19 @@ public class DMNInputRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResults().get(0).getMessages().get(0).getSeverity()).isEqualTo(DMNMessage.Severity.ERROR);
}
- @Test
- public void testInputNumberEvaluateAll() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void inputNumberEvaluateAll(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
inputNumberEvaluateAll(
"0002-input-data-number.dmn",
"0002-input-data-number");
}
- @Test
- public void testInputNumberEvaluateAllDMNWithScientificNotation() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void inputNumberEvaluateAllDMNWithScientificNotation(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
inputNumberEvaluateAll(
"0002-input-data-number-scientific-notation.dmn",
"0002-input-data-number-scientific-notation");
@@ -206,8 +220,10 @@ public class DMNInputRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat((BigDecimal) resultValue).usingComparator(BigDecimal::compareTo).isEqualTo(new BigDecimal(12000));
}
- @Test
- public void testGetRequiredInputsByName() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void getRequiredInputsByName(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime( "0001-input-data-string.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel( "https://github.com/kiegroup/drools/kie-dmn", "_0001-input-data-string" );
assertThat(dmnModel).isNotNull();
@@ -221,8 +237,10 @@ public class DMNInputRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( inputs).hasSize(0);
}
- @Test
- public void testGetRequiredInputsById() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void getRequiredInputsById(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime( "0001-input-data-string.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel( "https://github.com/kiegroup/drools/kie-dmn", "_0001-input-data-string" );
assertThat(dmnModel).isNotNull();
@@ -236,8 +254,10 @@ public class DMNInputRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( inputs).hasSize(0);
}
- @Test
- public void testNonexistantInputNodeName() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void nonexistantInputNodeName(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime( "0001-input-data-string.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel( "https://github.com/kiegroup/drools/kie-dmn", "_0001-input-data-string" );
assertThat(dmnModel).isNotNull();
@@ -255,8 +275,10 @@ public class DMNInputRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( dmnResult.getDecisionResults().get(0).getMessages().get(0).getSeverity()).isEqualTo(DMNMessage.Severity.ERROR);
}
- @Test
- public void testAllowedValuesChecksInsideCollectionElement() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void allowedValuesChecksInsideCollectionElement(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime( "AllowedValuesChecks.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"http://www.trisotech.com/definitions/_238bd96d-47cd-4746-831b-504f3e77b442",
@@ -289,8 +311,10 @@ public class DMNInputRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult4.getMessages().stream().anyMatch(m -> m.getMessageType().equals(DMNMessageType.ERROR_EVAL_NODE))).isTrue();
}
- @Test
- public void testAllowedValuesChecksInsideCollection() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void allowedValuesChecksInsideCollection(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("valid_models/DMNv1_5/AllowedValuesChecksInsideCollection.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"http://www.trisotech.com/definitions/_238bd96d-47cd-4746-831b-504f3e77b442",
@@ -323,8 +347,10 @@ public class DMNInputRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult4.getMessages().stream().anyMatch(m -> m.getMessageType().equals(DMNMessageType.ERROR_EVAL_NODE))).isTrue();
}
- @Test
- public void testTypeConstraintsChecks() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void typeConstraintsChecks(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("valid_models/DMNv1_5/TypeConstraintsChecks.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"http://www.trisotech.com/definitions/_238bd96d-47cd-4746-831b-504f3e77b442",
@@ -351,8 +377,10 @@ public class DMNInputRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult3.getMessages().stream().anyMatch(m -> m.getMessageType().equals(DMNMessageType.ERROR_EVAL_NODE))).isTrue();
}
- @Test
- public void testDMNInputDataNodeTypeTest() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dmnInputDataNodeTypeTest(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-1569
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DMNInputDataNodeTypeTest.dmn", this.getClass());
final String MODEL_NAMESPACE = "http://www.trisotech.com/definitions/_17396034-163a-48aa-9a7f-c6eb17f9cc6c";
@@ -392,8 +420,10 @@ public class DMNInputRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(idnCarDamageResponsibility.getType().isComposite()).isTrue();
}
- @Test
- public void testInputClauseTypeRefWithAllowedValues() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void inputClauseTypeRefWithAllowedValues(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("actualInputMatchInputValues-forTypeRef.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://www.drools.org/kie-dmn/definitions", "definitions");
assertThat(dmnModel).isNotNull();
@@ -409,8 +439,10 @@ public class DMNInputRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("MyDecision")).isEqualTo("Decision taken");
}
- @Test
- public void testInputDataTypeRefWithAllowedValues() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void inputDataTypeRefWithAllowedValues(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("actualInputMatchInputValues-forTypeRef.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://www.drools.org/kie-dmn/definitions", "definitions");
assertThat(dmnModel).isNotNull();
@@ -425,15 +457,19 @@ public class DMNInputRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getMessages().get(0).getSourceId()).isEqualTo("_3d560678-a126-4654-a686-bc6d941fe40b");
}
- @Test
- public void testMissingInputData() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void missingInputData(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("missing_input_data.dmn", getClass());
assertThat(messages.get(0).getMessageType()).isEqualTo(DMNMessageType.ERR_COMPILING_FEEL);
}
-
-
- @Test
- public void testOrdering() {
+
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void ordering(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Order.dmn", this.getClass());
final DMNModel dmnModel = runtime .getModel("http://www.trisotech.com/definitions/_6318588b-c32f-4070-848b-bd8017e6b94e", "Drawing 1");
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNMessagesAPITest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNMessagesAPITest.java
index 7900c830c0..5f8bd50161 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNMessagesAPITest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNMessagesAPITest.java
@@ -22,7 +22,7 @@ import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.api.KieServices;
import org.kie.api.builder.KieBuilder;
import org.kie.api.builder.KieFileSystem;
@@ -38,13 +38,14 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertThrows;
public class DMNMessagesAPITest {
public static final Logger LOG = LoggerFactory.getLogger(DMNMessagesAPITest.class);
@Test
- public void testAPIUsage() {
+ void apiUsage() {
// DROOLS-3335 Broken DMN resource should inhibit KJAR and report KieBuilder message
final KieServices ks = KieServices.Factory.get();
final KieContainer kieContainer = DMNRuntimeUtil.getKieContainerIgnoringErrors(ks.newReleaseId("org.kie", "dmn-test-" + UUID.randomUUID(), "1.0"),
@@ -69,21 +70,23 @@ public class DMNMessagesAPITest {
assertThat(dmnMessage.getPath()).isEqualTo("incomplete_expression.dmn");
}
- @Test(expected = IllegalStateException.class)
- public void testAPIUsageSnippetForDocumentation() {
- KieServices ks = KieServices.Factory.get();
-
- ReleaseId releaseId = ks.newReleaseId("org.kie", "dmn-test-" + UUID.randomUUID(), "1.0");
- Resource dmnResource = ks.getResources().newClassPathResource("incomplete_expression.dmn", this.getClass());
-
- KieFileSystem kfs = ks.newKieFileSystem()
- .generateAndWritePomXML(releaseId)
- .write(dmnResource);
- KieBuilder kieBuilder = ks.newKieBuilder(kfs)
- .buildAll();
- Results results = kieBuilder.getResults();
- if (results.hasMessages(Message.Level.ERROR)) {
- throw new IllegalStateException(results.getMessages(Message.Level.ERROR).toString());
- }
+ @Test
+ void apiUsageSnippetForDocumentation() {
+ assertThrows(IllegalStateException.class, () -> {
+ KieServices ks = KieServices.Factory.get();
+
+ ReleaseId releaseId = ks.newReleaseId("org.kie", "dmn-test-" + UUID.randomUUID(), "1.0");
+ Resource dmnResource = ks.getResources().newClassPathResource("incomplete_expression.dmn", this.getClass());
+
+ KieFileSystem kfs = ks.newKieFileSystem()
+ .generateAndWritePomXML(releaseId)
+ .write(dmnResource);
+ KieBuilder kieBuilder = ks.newKieBuilder(kfs)
+ .buildAll();
+ Results results = kieBuilder.getResults();
+ if (results.hasMessages(Message.Level.ERROR)) {
+ throw new IllegalStateException(results.getMessages(Message.Level.ERROR).toString());
+ }
+ });
}
}
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNRuntimeTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNRuntimeTest.java
index 4ea5f5acc8..990c6bc158 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNRuntimeTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNRuntimeTest.java
@@ -37,10 +37,14 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
+import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.api.KieServices;
import org.kie.api.runtime.KieContainer;
import org.kie.dmn.api.core.DMNContext;
@@ -81,6 +85,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.kie.dmn.core.util.DMNTestUtil.getAndAssertModelNoErrors;
import static org.kie.dmn.core.util.DynamicTypeUtils.entry;
import static org.kie.dmn.core.util.DynamicTypeUtils.mapOf;
@@ -92,14 +97,12 @@ import static org.mockito.internal.verification.VerificationModeFactory.times;
public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
- public DMNRuntimeTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
-
public static final Logger LOG = LoggerFactory.getLogger(DMNRuntimeTest.class);
- @Test
- public void testSimpleItemDefinition() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleItemDefinition(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("simple-item-def.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn/itemdef", "simple-item-def" );
assertThat(dmnModel).isNotNull();
@@ -116,8 +119,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "Yearly Salary" )).isEqualTo(new BigDecimal( "12000" ) );
}
- @Test
- public void testCompositeItemDefinition() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void compositeItemDefinition(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0008-LX-arithmetic.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "0008-LX-arithmetic" );
assertThat(dmnModel).isNotNull();
@@ -136,8 +141,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "payment" )).isEqualTo(new BigDecimal( "2778.693549432766768088520383236299" ) );
}
- @Test
- public void testTrisotechNamespace() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void trisotechNamespace(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("trisotech_namespace.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_b8feec86-dadf-4051-9feb-8e6093bbb530", "Solution 3" );
assertThat(dmnModel).isNotNull();
@@ -155,8 +162,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "Ship can enter a Dutch port" )).isEqualTo(Boolean.TRUE);
}
- @Test
- public void testEmptyDecision1() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void emptyDecision1(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("empty_decision.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_ba9fc4b1-5ced-4d00-9b61-290de4bf3213", "Solution 3" );
assertThat(dmnModel).isNotNull();
@@ -176,8 +185,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "Ship Can Enter v2" )).isEqualTo(Boolean.TRUE);
}
- @Test
- public void testEmptyDecision2() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void emptyDecision2(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("empty_decision.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_ba9fc4b1-5ced-4d00-9b61-290de4bf3213", "Solution 3" );
assertThat(dmnModel).isNotNull();
@@ -205,8 +216,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "Ship Can Enter v2" )).isEqualTo(Boolean.TRUE);
}
- @Test
- public void testEventListeners() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void eventListeners(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("car_damage_responsibility.dmn", this.getClass() );
final DMNRuntimeEventListener listener = mock(DMNRuntimeEventListener.class );
@@ -249,8 +262,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get( "Payment method")).isEqualTo("Check");
}
- @Test
- public void testContextEventListeners() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void contextEventListeners(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("context_listener.dmn", this.getClass() );
final DMNRuntimeEventListener listener = mock(DMNRuntimeEventListener.class );
@@ -316,14 +331,18 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "d1" )).isEqualTo("a");
}
- @Test
- public void testErrorMessages() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void errorMessages(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("car_damage_responsibility2.dmn", this.getClass());
assertThat(messages).isNotEmpty();
}
- @Test
- public void testOutputReuse() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void outputReuse(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Input_reuse_in_output.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_098bb607-eff7-4772-83ac-6ded8b371fa7", "Input reuse in output" );
assertThat(dmnModel).isNotNull();
@@ -339,8 +358,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "My Decision" )).isEqualTo("Fixed30");
}
- @Test
- public void testSimpleNot() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleNot(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Simple_Not.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_98436ebb-7c42-48c0-8d11-d693e2a817c9", "Simple Not" );
assertThat(dmnModel).isNotNull();
@@ -355,8 +376,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "a" )).isEqualTo("Is Student" );
}
- @Test
- public void testSimpleNot2() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void simpleNot2(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Simple_Not.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_98436ebb-7c42-48c0-8d11-d693e2a817c9", "Simple Not" );
assertThat(dmnModel).isNotNull();
@@ -371,8 +394,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "a" )).isEqualTo("Is not a Student" );
}
- @Test
- public void testDinner() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dinner(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Dinner.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_0c45df24-0d57-4acc-b296-b4cba8b71a36", "Dinner" );
assertThat(dmnModel).isNotNull();
@@ -392,8 +417,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( dmnResult.getContext().get("Drinks")).asList().containsExactly("Apero", "Ale", "Juice Boxes");
}
- @Test
- public void testNotificationsApproved2() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void notificationsApproved2(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("NotificationsTest2.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "building-structure-rules" );
assertThat(dmnModel).isNotNull();
@@ -409,8 +436,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "Permit Status" )).isEqualTo("Building Activity Province Permit Required" );
}
- @Test
- public void testBoxedContext() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void boxedContext(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("BoxedContext.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_0de36357-fec0-4b4e-b7f1-382d381e06e9", "Dessin 1" );
assertThat(dmnModel).isNotNull();
@@ -426,8 +455,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( (Map<String, Object>) dmnResult.getContext().get( "Math" )).containsEntry( "Product", BigDecimal.valueOf( 50 ));
}
- @Test
- public void testFunctionDefAndInvocation() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void functionDefAndInvocation(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("FunctionDefinition.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_0de36357-fec0-4b4e-b7f1-382d381e06e9", "Dessin 1" );
assertThat(dmnModel).isNotNull();
@@ -442,8 +473,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat((Map<String, Object>) dmnResult.getContext().get("Math")).containsEntry("Sum", BigDecimal.valueOf(15));
}
- @Test
- public void testBuiltInFunctionInvocation() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void builtInFunctionInvocation(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("BuiltInFunctionInvocation.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_b77219ee-ec28-48e3-b240-8e0dbbabefeb", "built in function invocation" );
assertThat(dmnModel).isNotNull();
@@ -461,8 +494,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( dmnResult.getContext().get( "out of order" )).isEqualTo(BigDecimal.valueOf( 5 ) );
}
- @Test
- public void testBKMNode() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void bkmNode(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0009-invocation-arithmetic.dmn", getClass() );
// runtime.addListener( DMNRuntimeUtil.createListener() );
@@ -485,8 +520,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
isEqualTo(new BigDecimal("2878.69354943277").setScale(8, BigDecimal.ROUND_DOWN));
}
- @Test
- public void testItemDefCollection() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void itemDefCollection(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0001-filter.dmn", getClass() );
// runtime.addListener( DMNRuntimeUtil.createListener() );
@@ -515,8 +552,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( dmnResult.getContext().get( "filter01" )).asList().containsExactly("Mary");
}
- @Test
- public void testList() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void list(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("list-expression.dmn", getClass() );
// runtime.addListener( DMNRuntimeUtil.createListener() );
@@ -530,8 +569,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( dmnResult.getContext().get( "Name list" )).asList().containsExactly("John", "Mary");
}
- @Test
- public void testRelation() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void relation(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("relation-expression.dmn", getClass() );
// runtime.addListener( DMNRuntimeUtil.createListener() );
@@ -556,8 +597,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( e.get( "Salary" )).isEqualTo(BigDecimal.valueOf( 120000 ) );
}
- @Test
- public void testLendingExample() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void lendingExample(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0004-lending.dmn", getClass() );
// runtime.addListener( DMNRuntimeUtil.createListener() );
@@ -605,8 +648,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(ctx.get("Routing" )).isEqualTo("ACCEPT");
}
- @Test
- public void testDateAndTime() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dateAndTime(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0007-date-time.dmn", getClass() );
runtime.addListener( DMNRuntimeUtil.createListener() );
@@ -659,8 +704,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
}
- @Test
- public void testDateToDateTimeFunction() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dateToDateTimeFunction(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("valid_models/DMNv1_5/DateToDateTimeFunction.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_A7F17D7B-F0AB-4C0B-B521-02EA26C2FBEE",
"new-file");
@@ -677,8 +724,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("usingNormal").getResult()).isEqualTo(expected);
}
- @Test
- public void testFiltering() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void filtering(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Person_filtering_by_age.dmn", getClass() );
runtime.addListener( DMNRuntimeUtil.createListener() );
@@ -692,8 +741,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(((List)dmnResult.getContext().get("Filtering"))).as(DMNRuntimeUtil.formatMessages(dmnResult.getMessages())).hasSize(2);
}
- @Test
- public void testNowFunction() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void nowFunction(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("today_function_test.dmn", getClass() );
runtime.addListener( DMNRuntimeUtil.createListener() );
@@ -707,8 +758,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getContext().get("When is it")).as(DMNRuntimeUtil.formatMessages( dmnResult.getMessages())).isEqualTo("It is in the past");
}
- @Test
- public void testTimeFunction() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void timeFunction(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("TimeFromDate.dmn", getClass() );
runtime.addListener( DMNRuntimeUtil.createListener() );
@@ -722,8 +775,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getContext().get("time")).as(DMNRuntimeUtil.formatMessages(dmnResult.getMessages())).isEqualTo(LocalTime.of(5, 48, 23));
}
- @Test
- public void testAlternativeNSDecl() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void alternativeNSDecl(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("alternative_feel_ns_declaration.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "0001-input-data-string" );
assertThat(dmnModel).isNotNull();
@@ -741,8 +796,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "Greeting Message" )).isEqualTo("Hello John Doe" );
}
- @Test
- public void testLoanComparison() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void loanComparison(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("loanComparison.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_3a1fd8f4-ea04-4453-aa30-ff14140e3441", "loanComparison" );
assertThat(dmnModel).isNotNull();
@@ -755,8 +812,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.hasErrors()).as(DMNRuntimeUtil.formatMessages(dmnResult.getMessages())).isFalse();
}
- @Test
- public void testGetViableLoanProducts() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void getViableLoanProducts(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Get_Viable_Loan_Products.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_3e1a628d-36bc-45f1-8464-b201735e5ce0", "Get Viable Loan Products" );
assertThat(dmnModel).isNotNull();
@@ -779,8 +838,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( (Collection<Object>) result.get( "LoanTypes" )).hasSize(3);
}
- @Test
- public void testYearsAndMonthsDuration() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void yearsAndMonthsDuration(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("yearMonthDuration.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_6eda1490-21ca-441e-8a26-ab3ca800e43c", "Drawing 1" );
assertThat(dmnModel).isNotNull();
@@ -799,14 +860,18 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "How long" )).isEqualTo("Longer than a year" );
}
- @Test
- public void testInvalidVariableNames() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void invalidVariableNames(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("invalid-variable-names.dmn", this.getClass());
assertThat(messages).isNotEmpty();
}
- @Test
- public void testNull() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void testNull(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("null_values.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "Null values model" );
assertThat(dmnModel).isNotNull();
@@ -830,8 +895,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
}
- @Test
- public void testInvalidUHitPolicy() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void invalidUHitPolicy(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Invalid_U_hit_policy.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_7cf49108-9b55-4f35-b5ef-f83448061757", "Greater than 5 - Invalid U hit policy" );
assertThat(dmnModel).isNotNull();
@@ -847,16 +914,20 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( dmnResult.getMessages().get( 1 ).getSourceId()).isEqualTo("_5bac3e4c-b59a-4f14-b5cf-d4d88c60877f" );
}
- @Test
- public void testInvalidModel() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void invalidModel(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("Loan_Prequalification_Condensed_Invalid.dmn", this.getClass());
assertThat(messages).hasSize(2);
assertThat(messages.get(0).getSourceId()).isEqualTo("_8b5cac9e-c8ca-4817-b05a-c70fa79a8d48");
assertThat(messages.get(1).getSourceId()).isEqualTo("_ef09d90e-e1a4-4ec9-885b-482d1f4a1cee");
}
- @Test
- public void testNullOnNumber() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void nullOnNumber(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Number_and_null_entry.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_a293b9f9-c912-41ee-8147-eae59ba86ac5", "Number and null entry" );
assertThat(dmnModel).isNotNull();
@@ -880,8 +951,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "Decision Logic 1" )).isEqualTo("Positive number" );
}
- @Test
- public void testLoan_Recommendation2() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void loanRecommendation2(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Loan_Recommendation2.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_35c7339b-b868-43da-8f06-eb481708c73c", "Loan Recommendation2" );
assertThat(dmnModel).isNotNull();
@@ -912,9 +985,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
final DMNContext result = dmnResult.getContext();
assertThat( result.get( "Loan Recommendation" )).isEqualTo("Decline");
}
-
- @Test
- public void testPriority_table() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void priorityTable(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("priority_table.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"http://www.trisotech.com/definitions/_ff54a44d-b8f5-48fc-b2b7-43db767e8a1c",
@@ -930,9 +1005,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
final DMNContext result = dmnResult.getContext();
assertThat( result.get( "Approval Status" )).isEqualTo("Declined");
}
-
- @Test
- public void testPriority_table_context_recursion() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void priorityTableContextRecursion(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("priority_table_context_recursion.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"http://www.trisotech.com/definitions/_ff54a44d-b8f5-48fc-b2b7-43db767e8a1c",
@@ -948,15 +1025,19 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
final DMNContext result = dmnResult.getContext();
assertThat( result.get( "Approval Status" )).isEqualTo("Declined");
}
-
- @Test
- public void testPriority_table_missing_output_values() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void priorityTableMissingOutputValues(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("DTABLE_PRIORITY_MISSING_OUTVALS.dmn", this.getClass());
assertThat(messages).hasSize(1);
}
- @Test
- public void test_non_Priority_table_missing_output_values() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void non_priority_table_missing_output_values(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DTABLE_NON_PRIORITY_MISSING_OUTVALS.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"https://github.com/kiegroup/kie-dmn",
@@ -965,8 +1046,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnModel.hasErrors()).as(DMNRuntimeUtil.formatMessages(dmnModel.getMessages())).isFalse();
}
- @Test
- public void testPriority_table_one_output_value() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void priorityTableOneOutputValue(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DTABLE_PRIORITY_ONE_OUTVAL.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"https://github.com/kiegroup/kie-dmn",
@@ -974,9 +1057,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnModel).isNotNull();
assertThat(dmnModel.hasErrors()).as(DMNRuntimeUtil.formatMessages(dmnModel.getMessages())).isFalse();
}
-
- @Test
- public void testNoPrefix() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void noPrefix(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("drools1502-noprefix.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"https://www.drools.org/kie-dmn/definitions",
@@ -993,9 +1078,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
final DMNContext result = dmnResult.getContext();
assertThat( result.get( "MyDecision" )).isEqualTo("Decision taken" );
}
-
- @Test
- public void testWrongConstraintsInItemDefinition() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void wrongConstraintsInItemDefinition(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-1503
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("WrongConstraintsInItemDefinition.dmn", this.getClass());
assertThat(messages).as(DMNRuntimeUtil.formatMessages(messages)).hasSize(3);
@@ -1008,9 +1095,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(messages.get(2).getSourceId()).isEqualTo("_31911de7-e184-411c-99d1-f33977971270");
assertThat(messages.get(2).getMessageType()).isEqualTo(DMNMessageType.MISSING_TYPE_REF);
}
-
- @Test
- public void testResolutionOfVariableWithLeadingOrTrailingSpaces() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void resolutionOfVariableWithLeadingOrTrailingSpaces(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-1504
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("variableLeadingTrailingSpaces.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
@@ -1032,8 +1121,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "Further Decision" )).isEqualTo( "The person was greeted with: 'Ciao John Doe'");
}
- @Test
- public void testOutOfOrderItemsNPE() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void outOfOrderItemsNPE(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("out-of-order-items.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"https://github.com/kiegroup/kie-dmn",
@@ -1042,9 +1133,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnModel.getMessages().stream().anyMatch( m -> m.getMessageType().equals( DMNMessageType.FAILED_VALIDATOR)))
.as(DMNRuntimeUtil.formatMessages(dmnModel.getMessages())).isFalse();
}
-
- @Test
- public void testItemDefDependencies() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void itemDefDependencies(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-1505
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("itemDef-dependency.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
@@ -1065,9 +1158,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
final DMNContext result = dmnResult.getContext();
assertThat( result.get( "My Decision" )).isEqualTo("The person John Doe is located at 100 East Davie Street" );
}
-
- @Test
- public void testDecisionResultTypeCheck() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionResultTypeCheck(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-1513
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("LoanRecommendationWrongOutputType.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
@@ -1091,8 +1186,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( dmnResult.getMessages().get( 0 ).getMessageType()).isEqualTo(DMNMessageType.ERROR_EVAL_NODE);
}
- @Test
- public void testNPE() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void npe(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-1512
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("NPE.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
@@ -1107,9 +1204,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.hasErrors()).as(dmnResult.getMessages().toString()).isTrue();
assertThat(dmnResult.getMessages().stream().anyMatch( m -> m.getMessageType().equals( DMNMessageType.REQ_NOT_FOUND))).isTrue();
}
-
- @Test
- public void testUnionofLetters() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void unionofLetters(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Union_of_letters.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"http://www.trisotech.com/definitions/_76362694-41e8-400c-8dea-e5f033d4f405",
@@ -1132,23 +1231,29 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult2.getMessages().stream().anyMatch(m -> m.getMessageType().equals(DMNMessageType.ERROR_EVAL_NODE))).isTrue();
}
- @Test
- public void testUnknownVariable1() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void unknownVariable1(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("unknown_variable1.dmn", this.getClass());
assertThat(messages.stream().filter(m -> m.getMessageType().equals(DMNMessageType.ERR_COMPILING_FEEL))
.filter(m -> m.getMessage().contains("Unknown variable 'NonSalaryPct'"))
.count()).isEqualTo(1);
}
- @Test
- public void testUnknownVariable2() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void unknownVariable2(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("unknown_variable2.dmn", this.getClass());
assertThat(messages.get(0).getMessageType()).isEqualTo(DMNMessageType.ERR_COMPILING_FEEL);
assertThat(messages.get(0).getMessage()).containsSequence("Unknown variable 'Borrower.liquidAssetsAmt'");
}
- @Test
- public void testSingleDecisionWithContext() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void singleDecisionWithContext(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("SingleDecisionWithContext.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"http://www.trisotech.com/definitions/_71af58db-e1df-4b0f-aee2-48e0e8d89672",
@@ -1164,8 +1269,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "MyDecision" )).isEqualTo("Hello John Doe" );
}
- @Test
- public void testEx_6_1() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void ex61(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Ex_6_1.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"http://www.trisotech.com/definitions/_5f1269c8-1e6f-4748-9eca-26aa1b1278ef",
@@ -1199,9 +1306,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "Number of teams" )).isEqualTo(new BigDecimal(2) );
assertThat( result.get( "Sum of bonus points" )).isEqualTo(new BigDecimal(47) );
}
-
- @Test
- public void testSingletonlist_function_call() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void singletonlistFunctionCall(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("singletonlist_fuction_call.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"http://www.trisotech.com/definitions/_0768879b-5ee1-410f-92f0-7732573b069d",
@@ -1228,8 +1337,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
);
}
- @Test
- public void testJavaFunctionContext() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void javaFunctionContext(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("java_function_context.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"http://www.trisotech.com/dmn/definitions/_b42317c4-4f0c-474e-a0bf-2895b0b3c314",
@@ -1246,9 +1357,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( ((BigDecimal) result.get( "D1" )).setScale( 4, BigDecimal.ROUND_HALF_UP )).isEqualTo(new BigDecimal( "-1.0000" ) );
assertThat( ((BigDecimal) result.get( "D2" )).setScale( 4, BigDecimal.ROUND_HALF_UP )).isEqualTo(new BigDecimal( "-1.0000" ) );
}
-
- @Test
- public void testJavaFunctionContext_withErrors() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void javaFunctionContextWithErrors(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-1568
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("java_function_context_with_errors.dmn", this.getClass());
assertThat(messages).hasSize(1);
@@ -1259,9 +1372,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(sourceIDs).contains("_a72a7aff-48c3-4806-83ca-fc1f1fe34321");
assertThat(messages).anyMatch(m -> m.getText().contains("java.lang.Mathhh"));
}
-
- @Test
- public void testJavaFunctionContext_withErrorsInParamType() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void javaFunctionContextWithErrorsInParamType(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("java_function_context_with_errors_in_param_type.dmn", this.getClass());
assertThat(messages).hasSize(1);
@@ -1270,8 +1385,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(messages).anyMatch(m -> m.getText().contains("max(int,int)") && m.getText().contains("max(long,long)"));
}
- @Test
- public void testNestingFnDef() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void nestingFnDef(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("nestingFnDef.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_FC72DC4B-DC64-4E43-9685-945FC3B7E4BC",
"new-file");
@@ -1286,8 +1403,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("Decision-1").getResult()).isEqualTo(new BigDecimal(3));
}
- @Test
- public void testBkmCurried() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void bkmCurried(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("bkmCurried.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_A7F17D7B-F0AB-4C0B-B521-02EA26C2FB7D",
"new-file");
@@ -1303,8 +1422,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("usingCurried").getResult()).isEqualTo(new BigDecimal(3));
}
- @Test
- public void testBkmWithDotsInName() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void bkmWithDotsInName(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("bkmWithDotsInName.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_E035C5C5-3571-453D-BD8F-FFF30E74A7F8",
"bkmWithDotsInName");
@@ -1321,9 +1442,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("Total Sum").getResult()).isEqualTo(new BigDecimal(3));
}
- @Ignore("the purpose of this work is to enable PMML execution.")
- @Test
- public void testPMMLFunctionContext() {
+ @Disabled("the purpose of this work is to enable PMML execution.")
+ @ParameterizedTest
+ @MethodSource("params")
+ void pmmlFunctionContext(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("pmml_function_context.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"http://www.trisotech.com/dmn/definitions/_b42317c4-4f0c-474e-a0bf-2895b0b3c314",
@@ -1334,9 +1457,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( dmnModel.getMessages().get( 0 ).getMessageType()).isEqualTo(DMNMessageType.INVALID_ATTRIBUTE_VALUE);
assertThat( dmnModel.getMessages().get( 0 ).getSeverity()).isEqualTo(DMNMessage.Severity.WARN);
}
-
- @Test
- public void test_countCSATradeRatings() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void count_csatrade_ratings(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-1563
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("countCSATradeRatings.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
@@ -1369,9 +1494,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult3.hasErrors()).as(DMNRuntimeUtil.formatMessages( dmnResult3.getMessages())).isTrue();
assertThat(dmnResult3.getMessages().stream().anyMatch( m -> m.getMessageType().equals( DMNMessageType.REQ_NOT_FOUND ) )).isTrue();
}
-
- @Test
- public void testForLoopTypeCheck() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void forLoopTypeCheck(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-1580
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("PersonListHelloBKM.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
@@ -1393,9 +1520,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( (List<?>)result.get("My Decision")).asList().contains( "The person named John Doe is 33 years old.",
"The person named 47 is 47 years old.");
}
-
- @Test
- public void testTypeInferenceForNestedContextAnonymousEntry() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void typeInferenceForNestedContextAnonymousEntry(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-1585
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("PersonListHelloBKM2.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
@@ -1418,8 +1547,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
prototype( entry("Full Name", "Prof. 47"), entry("Age", EvalHelper.coerceNumber(47))));
}
- @Test
- public void testSameEveryTypeCheck() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void sameEveryTypeCheck(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-1587
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("same_every_type_check.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
@@ -1441,8 +1572,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get("Every are negative")).isEqualTo(Boolean.FALSE);
}
- @Test
- public void testDateAllowedValues() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dateAllowedValues(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("date_allowed_values.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"http://www.trisotech.com/definitions/_fbf002a3-615b-4f02-98e4-c28d4676225a",
@@ -1462,9 +1595,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat((Map<String,Object>) result.get( "Decision Logic 1")).containsEntry("years and months", duration);
assertThat((Map<String,Object>) result.get( "Decision Logic 1")).containsEntry("Date Time", dateTime);
}
-
- @Test
- public void testArtificialAttributes() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void artificialAttributes(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0001-input-data-string-artificial-attributes.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/drools", "0001-input-data-string" );
assertThat(dmnModel).isNotNull();
@@ -1481,9 +1616,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "Greeting Message" )).isEqualTo("Hello John Doe" );
}
-
- @Test
- public void testInvokeFunctionSuccess() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void invokeFunctionSuccess(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Caller.dmn", this.getClass(), "Calling.dmn" );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_b0a696d6-3d57-4e97-b5d4-b44a63909d67", "Caller" );
assertThat(dmnModel).isNotNull();
@@ -1502,8 +1639,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat( result.get( "Final decision" )).isEqualTo( "The final decision is: Hello, John Doe your number once double is equal to: 6");
}
- @Test
- public void testInvokeFunctionWrongNamespace() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void invokeFunctionWrongNamespace(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Caller.dmn", this.getClass(), "Calling.dmn" );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_b0a696d6-3d57-4e97-b5d4-b44a63909d67", "Caller" );
assertThat(dmnModel).isNotNull();
@@ -1521,8 +1660,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getMessages()).as(DMNRuntimeUtil.formatMessages( dmnResult.getMessages())).hasSize(2);
}
- @Test
- public void testInvokeFunctionWrongDecisionName() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void invokeFunctionWrongDecisionName(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Caller.dmn", this.getClass(), "Calling.dmn" );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_b0a696d6-3d57-4e97-b5d4-b44a63909d67", "Caller" );
assertThat(dmnModel).isNotNull();
@@ -1541,8 +1682,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
}
- @Test
- public void testInvokeFunctionCallerError() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void invokeFunctionCallerError(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Caller.dmn", this.getClass(), "Calling.dmn" );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_b0a696d6-3d57-4e97-b5d4-b44a63909d67", "Caller" );
@@ -1562,8 +1705,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getMessages()).as(DMNRuntimeUtil.formatMessages( dmnResult.getMessages())).hasSize(2);
}
- @Test
- public void testInvalidFunction() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void invalidFunction(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources( "InvalidFunction.dmn", this.getClass() );
final DMNModel model = runtime.getModel( "http://www.trisotech.com/definitions/_84453b71-5d23-479f-9481-5196d92bacae", "0003-iteration-augmented" );
assertThat(model).isNotNull();
@@ -1591,8 +1736,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
return new DecisionNodeImpl(def.getDrgElement().stream().filter(drg -> drg.getName().equals(name)).filter(Decision.class::isInstance).map(Decision.class::cast).findFirst().get());
}
- @Test
- public void testCycleDetection() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void cycleDetection(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final Definitions defs = buildSimplifiedDefinitions("ns", "a", "b");
final DecisionNodeImpl a = buildSimplifiedDecisionNode(defs, "a");
final DecisionNodeImpl b = buildSimplifiedDecisionNode(defs, "b");
@@ -1607,8 +1754,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.hasErrors()).isTrue();
}
- @Test
- public void testCycleDetectionSelfReference() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void cycleDetectionSelfReference(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final Definitions defs = buildSimplifiedDefinitions("ns", "self");
final DecisionNodeImpl decision = buildSimplifiedDecisionNode(defs, "self");
decision.addDependency("self", decision);
@@ -1620,8 +1769,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.hasErrors()).isTrue();
}
- @Test
- public void testSharedDependency() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void sharedDependency(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final Definitions defs = buildSimplifiedDefinitions("ns", "a", "b", "c");
final DecisionNodeImpl a = buildSimplifiedDecisionNode(defs, "a");
final DecisionNodeImpl b = buildSimplifiedDecisionNode(defs, "b");
@@ -1638,8 +1789,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.hasErrors()).isFalse();
}
- @Test
- public void testCycleDetectionDeadlyDiamond() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void cycleDetectionDeadlyDiamond(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final Definitions defs = buildSimplifiedDefinitions("ns", "a", "b", "c", "d");
final DecisionNodeImpl a = buildSimplifiedDecisionNode(defs, "a");
final DecisionNodeImpl b = buildSimplifiedDecisionNode(defs, "b");
@@ -1660,8 +1813,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.hasErrors()).isFalse();
}
- @Test
- public void testEx_4_3simplified() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void ex43simplified(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Ex_4_3simplified.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_5c5a9c72-627e-4666-ae85-31356fed3658", "Ex_4_3simplified");
assertThat(dmnModel).isNotNull();
@@ -1679,8 +1834,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("Formatted Monthly Payment")).isEqualTo("€123.12");
}
- @Test
- public void testEx_4_3simplifiedASD() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void ex43simplifiedASD(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2117 improve Msg.ERROR_EVAL_NODE_DEP_WRONG_TYPE
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Ex_4_3simplified.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_5c5a9c72-627e-4666-ae85-31356fed3658", "Ex_4_3simplified");
@@ -1700,8 +1857,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getMessages().stream().filter(m -> m.getMessageType() == DMNMessageType.ERROR_EVAL_NODE).anyMatch(m -> m.getMessage().contains("is not allowed by the declared type"))).isTrue();
}
- @Test
- public void testDrools2125() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void drools2125(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2125
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("drools2125.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_9f976b29-4cdd-42e9-8737-0ccbc2ad9498", "drools2125");
@@ -1723,8 +1882,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("person is person")).isEqualTo("yes");
}
- @Test
- public void testDROOLS2147() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void drools2147(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2147
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DROOLS-2147.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_cbdacb7b-f72d-457d-b4f4-54020a06db24", "Drawing 1");
@@ -1748,8 +1909,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(((List) peopleGroups.get(2))).hasSize(2);
}
- @Test
- public void testDROOLS2147_message() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void drools2147Message(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2147 truncate message length
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Ex_4_3simplified.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_5c5a9c72-627e-4666-ae85-31356fed3658", "Ex_4_3simplified");
@@ -1770,8 +1933,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getMessages().stream().filter(m -> m.getMessageType() == DMNMessageType.ERROR_EVAL_NODE).anyMatch(m -> m.getMessage().contains("... [string clipped after 50 chars, total length is"))).isTrue();
}
- @Test
- public void testDROOLS2192() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void drools2192(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2192
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("hardcoded_function_definition.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_99854980-65c8-4e9b-b365-bd30ded69f40", "hardcoded_function_definition");
@@ -1787,8 +1952,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(((BigDecimal) resultContext.get("hardcoded decision")).intValue()).isEqualTo(47);
}
- @Test
- public void testDROOLS2200() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void drools2200(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2200
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("will_be_null_if_negative.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_c5889555-7ae5-4a67-a872-3a9492caf6e7", "will be null if negative");
@@ -1806,8 +1973,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(((Map) resultContext.get("will be null if negative")).get("s2")).isEqualTo("negative");
}
- @Test
- public void testDROOLS2201() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void drools2201(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2201
// do NOT use the DMNRuntimeUtil as that enables typeSafe check override for runtime.
final KieServices ks = KieServices.Factory.get();
@@ -1829,8 +1998,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(((Map<String, Object>) resultContext.get("an hardcoded person with no name"))).containsKeys("age");
}
- @Test
- public void testDROOLS2201b() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void drools2201b(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2201
// do NOT use the DMNRuntimeUtil as that enables typeSafe check override for runtime.
final KieServices ks = KieServices.Factory.get();
@@ -1871,8 +2042,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
}
- @Test
- public void testDROOLS2286() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void drools2286(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2286
final DROOLS2286 johnCena = new DROOLS2286("John", "Cena");
final DROOLS2286 leslieBrown = new DROOLS2286("Leslie", "Brown");
@@ -1888,8 +2061,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertDROOLS2286(context);
}
- @Test
- public void testDROOLS2286bis() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void drools2286bis(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2286 (map case)
final Map<String, Object> johnCena = prototype(entry("name", "John"), entry("surname", "Cena"));
final Map<String, Object> leslieBrown = prototype(entry("name", "Leslie"), entry("surname", "Brown"));
@@ -1915,8 +2090,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(resultObject).hasSize(2);
}
- @Test
- public void testVerifyExtendedKieFEELFunction_now() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void verifyExtendedKieFEELFunctionNow(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2322
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("just_now.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_56fd6445-ff6a-4c28-8206-71fce7f80436", "just now");
@@ -1931,8 +2108,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("a decision just now").getResult()).isNotNull();
}
- @Test
- public void testNowBetweenTwoDates() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void nowBetweenTwoDates(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-3670 DMN `between` FEEL operator alignments
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("is office open.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/drools/kie-dmn/_19170B18-B561-4EB2-9D38-714E2442710E",
@@ -1950,8 +2129,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("is open").getResult()).isNotNull();
}
- @Test
- public void testVerifyExtendedKieFEELFunction_today() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void verifyExtendedKieFEELFunctionToday(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2322
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("just_today.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_56fd6445-ff6a-4c28-8206-71fce7f80436", "just today");
@@ -1966,8 +2147,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("a decision just today").getResult()).isNotNull();
}
- @Test
- public void testEnhancedForLoop() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void enhancedForLoop(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2307
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("drools2307.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_03d9481e-dcfc-4a59-9bdd-4f021cb2f0d8", "Drawing 1");
@@ -1983,8 +2166,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("an hardcoded forloop")).asList().containsExactly(new BigDecimal(2), new BigDecimal(3), new BigDecimal(4));
}
- @Test
- public void testList_of_Vowels() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void listOfVowels(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2357
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("List_of_Vowels.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_c5f007ce-4d45-4aac-8729-991d4abc7826", "List of Vowels");
@@ -2005,8 +2190,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("Decide BAD")).isNull();
}
- @Test
- public void testEnhancedForLoop2() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void enhancedForLoop2(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("MACD-enhanced_iteration.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_6cfe7d88-6741-45d1-968c-b61a597d0964", "MACD-enhanced iteration");
assertThat(dmnModel).isNotNull();
@@ -2028,8 +2215,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(((Map<String, Object>) ((List) resultContext.get("MACDTable")).get(2)).get("aDate")).isEqualTo(LocalDate.of(2018, 3, 7));
}
- @Test
- public void testNotListInDT() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void notListInDT(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2416
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("anot.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_292c1c7b-6b38-415d-938f-e9ca51d30b2b", "anot");
@@ -2046,8 +2235,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("what letter decision")).isEqualTo("vowel");
}
- @Test
- public void testListContainmentDT() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void listContainmentDT(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2416
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("list_containment_DT.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_6ab2bd6d-adaa-45c4-a141-a84382a201eb", "list containment DT");
@@ -2064,8 +2255,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("Boarding Status")).isEqualTo("Denied");
}
- @Test
- public void testStructureContainment() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void structureContainment(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("structure-containtment.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/drools/kie-dmn/_7FB5C3E4-4DF8-42A6-A7FA-28315DECCDD0",
"structure-containtment");
@@ -2082,8 +2275,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("is there")).isEqualTo(Boolean.TRUE);
}
- @Test
- public void testRelationwithemptycell() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void relationwithemptycell(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2439
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("relation_with_empty_cell.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_99a00903-2943-47df-bab1-a32f276617ea", "Relation with empty cell");
@@ -2103,8 +2298,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
prototype(entry("name", "Matteo"), entry("age", null)));
}
- @Test
- public void testFor() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void testFor(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2317
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Dynamic composition.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_c2d86765-c3c7-4e1d-b1fa-b830fa5bc529", "Dynamic composition");
@@ -2112,8 +2309,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnModel.hasErrors()).as(DMNRuntimeUtil.formatMessages(dmnModel.getMessages())).isFalse();
}
- @Test
- public void testUsingReusableKeywordAsPartOfBKMName() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void usingReusableKeywordAsPartOfBKMName(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2317 FEEL Syntax error on function(bkm) containing `for` keyword
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("say_for_hello.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_b6f2a9ca-a246-4f27-896a-e8ef04ea439c", "say for hello");
@@ -2129,8 +2328,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("just say")).asList().containsExactly("Hello", "Hello", "Hello");
}
- @Test
- public void testProductFunction() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void productFunction(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("product.dmn", this.getClass() );
final DMNModel model = runtime.getModel("http://www.trisotech.com/dmn/definitions/_40fdbc2c-a631-4ba4-8435-17571b5d1942", "Drawing 1" );
assertThat(model).isNotNull();
@@ -2145,8 +2346,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.getResult()).isEqualTo("This is product 1");
}
- @Test
- public void testNotWithPredicates20180601() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void notWithPredicates20180601(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2605
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("test20180601.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_9b8f2642-2597-4a99-9fcd-f9302692d3dc", "Drawing 1");
@@ -2168,8 +2371,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult10.getDecisionResultByName("my decision").getResult()).isEqualTo(Boolean.TRUE);
}
- @Test
- public void testNotWithPredicates20180601b() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void notWithPredicates20180601b(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2605
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("BruceTask20180601.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_3802fcb2-5b93-4502-aff4-0f5c61244eab", "Bruce Task");
@@ -2214,9 +2419,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(((List) bruce.get("six")).stream().anyMatch(e -> ((Map<String, Object>) e).get("Title").equals("85"))).isTrue();
assertThat(((List) bruce.get("six")).stream().anyMatch(e -> ((Map<String, Object>) e).get("Title").equals("66"))).isTrue();
}
-
- @Test
- public void testModelById() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void modelById(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("simple-item-def.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModelById("https://github.com/kiegroup/kie-dmn/itemdef", "_simple-item-def" );
assertThat(dmnModel).isNotNull();
@@ -2224,8 +2431,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
}
- @Test
- public void testWeekdayOnDateDMN12() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void weekdayOnDateDMN12(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2648 DMN v1.2 weekday on 'date', 'date and time'
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("weekday-on-date.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_55a2dafd-ab4d-4154-bace-826d426da251", "weekday on date");
@@ -2245,8 +2454,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
}
}
- @Test
- public void testDMN_Vs_FEEL_instanceof_interaction() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dmn_VsFEELInstanceofInteraction(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2665
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Instance_of.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_b5c4d644-5a15-4528-8028-86537cb1c836", "Instance of");
@@ -2270,8 +2481,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("Decision Logic 4")).isEqualTo(Boolean.TRUE);
}
- @Test
- public void testInvokingAFunctionOnALiteralContext() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void invokingAFunctionOnALiteralContext(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2732 FEEL invoking a function on a literal context
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("invokingAFunctionOnALiteralContext.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_781968dd-64dc-4231-9cd0-2ce590881f2c", "Drawing 1");
@@ -2288,16 +2501,20 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("invoking a function on a literal context")).isEqualTo(new BigDecimal(3));
}
- @Test
- public void testBoxedInvocationMissingExpression() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void boxedInvocationMissingExpression(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2813 DMN boxed invocation missing expression NPE and Validator issue
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("DROOLS-2813-NPE-BoxedInvocationMissingExpression.dmn", this.getClass());
assertThat(messages.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.MISSING_EXPRESSION) && p.getSourceId().equals("_a111c4df-c5b5-4d84-81e7-3ec735b50d06"))).isTrue();
}
- @Test
- public void testNotHeuristicForFunctionInvocation() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void notHeuristicForFunctionInvocation(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2822 FEEL augment not() heuristic for function invocation
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Not-heuristic-for-function-invocation-drools-2822.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_82f7e67e-0a8c-492d-aa78-94851c10eee6", "Drawing 1");
@@ -2314,8 +2531,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("Not working")).isEqualTo(Boolean.FALSE);
}
- @Test
- public void testDMNv1_2_ch11Modified() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dMNv12Ch11Modified(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("v1_2/ch11MODIFIED.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_3068644b-d2c7-4b81-ab9d-64f011f81f47", "DMN Specification Chapter 11 Example");
assertThat(dmnModel).isNotNull();
@@ -2344,9 +2563,12 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("Strategy")).isEqualTo("THROUGH");
assertThat(result.get("Routing")).isEqualTo("ACCEPT");
}
-
- @Test(timeout = 30_000L)
- public void testAccessorCache() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ @Timeout(value = 30_000L, unit = TimeUnit.MILLISECONDS)
+ void accessorCache(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("20180731-pr1997.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_7a39d775-bce9-45e3-aa3b-147d6f0028c7", "20180731-pr1997");
assertThat(dmnModel).isNotNull();
@@ -2365,8 +2587,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
}
}
- @Test
- public void testWrongTypeRefForDRGElement() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void wrongTypeRefForDRGElement(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2917 DMN resolveTypeRef returning null in BKM causes NPE during KieContainer compilation
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("WrongTypeRefForDRGElement.dmn", this.getClass());
DMNRuntimeUtil.formatMessages(messages);
@@ -2376,8 +2600,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(messages.stream().anyMatch(m -> m.getSourceId().equals("_45fa8674-f4f0-4c06-b2fd-52bbd17d8550"))).isEqualTo(Boolean.TRUE);
}
- @Test
- public void testDecisionTableInputClauseImportingItemDefinition() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTableInputClauseImportingItemDefinition(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2927 DMN DecisionTable inputClause importing ItemDefinition throws NPE at compilation
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("imports/Imported_Model.dmn",
this.getClass(),
@@ -2398,8 +2624,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("A Decision Table")).isEqualTo("NOT Allowed");
}
- @Test
- public void testAssignNullToAllowedValues() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void assignNullToAllowedValues(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-3132 DMN assign null to ItemDefinition with allowedValues
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("assignNullToAllowedValues.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_700a46e0-01ed-4361-9034-4afdb2537ea4", "Drawing 1");
@@ -2416,8 +2644,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getMessages().stream().anyMatch(m -> m.getSourceId().equals("_09945fda-2b89-4148-8758-0bcb91a66e4a"))).isEqualTo(Boolean.TRUE);
}
- @Test
- public void testAssignNullToAllowedValuesExplicitingNull() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void assignNullToAllowedValuesExplicitingNull(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-3132 DMN assign null to ItemDefinition with allowedValues
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("assignNullToAllowedValuesExplicitingNull.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_700a46e0-01ed-4361-9034-4afdb2537ea4", "Drawing 1");
@@ -2435,8 +2665,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("decision over the input letter").getResult()).isNull();
}
- @Test
- public void testEmptyinputValuesoutputValuesdefaultOutputEntry() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void emptyinputValuesoutputValuesdefaultOutputEntry(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("EmptyinputValuesoutputValuesdefaultOutputEntry.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_31f2dde9-b27c-41f8-97b4-5c8dd728942e", "Drawing 1");
@@ -2459,8 +2691,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("my DT")).isEqualTo(my_DT);
}
- @Test
- public void testAnyExpression() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void anyExpression(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-3279 DMN DRGElement typeRef to allow FEEL Any
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("any-expression.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/drools/kie-dmn/_D8154592-7406-4E5A-B7F7-347984A92288", "_40F20B8D-84C1-4AC2-B28C-267892C15077");
@@ -2475,8 +2709,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("Decision-1").getResult()).isEqualTo("Hello World");
}
- @Test
- public void testGetEntries() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void getEntries(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-3308 DMN implement missing functions only described in chapter "10.3.2.6 Context"
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("getentriesgetvalue.dmn", this.getClass());
final DMNModel dmnModel = getAndAssertModelNoErrors(runtime, "http://www.trisotech.com/dmn/definitions/_0fad1a80-0642-4278-ac3d-47668c4f689a", "Drawing 1");
@@ -2489,8 +2725,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("using get entries").getResult()).asList().containsExactly("value2");
}
- @Test
- public void testGetValue() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void getValue(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-3308 DMN implement missing functions only described in chapter "10.3.2.6 Context"
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("getentriesgetvalue.dmn", this.getClass());
final DMNModel dmnModel = getAndAssertModelNoErrors(runtime, "http://www.trisotech.com/dmn/definitions/_0fad1a80-0642-4278-ac3d-47668c4f689a", "Drawing 1");
@@ -2502,9 +2740,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("using get value").getEvaluationStatus()).isEqualTo(DecisionEvaluationStatus.SUCCEEDED);
assertThat(dmnResult.getDecisionResultByName("using get value").getResult()).isEqualTo("value2");
}
-
- @Test
- public void testGetEntriesGetValueUsingDTO() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void getEntriesGetValueUsingDTO(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-7139 FEEL context functions `get value` and `get entries` should support Java POJO as argument
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("getentriesgetvalue_Dto.dmn", this.getClass());
final DMNModel dmnModel = getAndAssertModelNoErrors(runtime, "http://www.trisotech.com/dmn/definitions/_0fad1a80-0642-4278-ac3d-47668c4f689a", "Drawing 1");
@@ -2520,8 +2760,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("using get value").getResult()).isEqualTo("John");
}
- @Test
- public void testChronoPeriod() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void chronoPeriod(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-3848 DMN Years and Months internals expect value is Comparable
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("ChronoPeriod.dmn", this.getClass());
final DMNModel dmnModel = getAndAssertModelNoErrors(runtime, "http://www.trisotech.com/definitions/_f6036734-c7b3-42d2-adde-d7db17953114", "Drawing 1");
@@ -2571,8 +2813,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(((ChronoPeriod) dmnResult.getDecisionResultByName("Decision2").getResult()).get(ChronoUnit.MONTHS)).isEqualTo(1L);
}
- @Test
- public void testTable61ForAliasFeelType() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void table61ForAliasFeelType(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-3998 DMN FEEL parser Table61 error with aliased type
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Table61ForAliasFeelType.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_aaff9a5f-a654-40d3-a209-8a7dc1d74eeb", "Drawing 1");
@@ -2591,8 +2835,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("my decision")).isEqualTo(new BigDecimal("2019"));
}
- @Test
- public void testcItemDef() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void testcItemDef(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-4173 DMN composite recursive ItemDefinition
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("cItemDef.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_f776b6fb-31bc-43b6-9c89-2bbc2973babf", "Drawing 1");
@@ -2611,14 +2857,18 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat((Map<String, Object>) ((Map<?, ?>) result.get("hardcoded decision")).get("supervisor")).containsEntry("supervisor", null);
}
- @Test
- public void testDTinputExprCollectionWithAllowedValuesA() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dTinputExprCollectionWithAllowedValuesA(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DROOLS-4379.dmn", this.getClass());
testDTinputExprCollectionWithAllowedValues(runtime);
}
- @Test
- public void testDTinputExprCollectionWithAllowedValuesB() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dTinputExprCollectionWithAllowedValuesB(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DROOLS-4379b.dmn", this.getClass());
testDTinputExprCollectionWithAllowedValues(runtime);
}
@@ -2640,8 +2890,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat((List<?>) result.get("D5")).asList().contains("r1", "r2");
}
- @Test
- public void testInputDataWithSlash() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void inputDataWithSlash(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-4390 DMN correct FEEL grammar exclusion
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Slash.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_efb0df9e-cd3a-4bda-b731-e6b184a6cd73", "Drawing 1");
@@ -2660,8 +2912,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("Litteral Expression")).isEqualTo("A");
}
- @Test
- public void testTimeOffsetAccessorFromDeclVariable() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void timeOffsetAccessorFromDeclVariable(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-4504 DMN time offset accessor from decl variable type
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("ContextEntryTypeCascade.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_8a15bd3c-c732-42c8-a2e4-60f1a23a1c5a", "Drawing 1");
@@ -2681,8 +2935,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(((Map<?, ?>) result.get("Time")).get("Not working Time hours from Variable")).isEqualTo(new BigDecimal("-11"));
}
- @Test
- public void testSO58507157() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void so58507157(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-4679 DMN FEEL list contains() invocation from DMN layer fixes
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("so58507157.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://sample.dmn", "DecisionNumberInList");
@@ -2704,8 +2960,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat((Map<String, Object>) result.get("DecisionNumberInList")).containsEntry("Result_4",Boolean.TRUE);
}
- @Test
- public void testNoExpr() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void noExpr(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-4765 DMN validation rule alignment for missing expression
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("noExpr.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_461041dc-9ab9-4e23-ae01-3366a7544cd3", "Drawing 1");
@@ -2727,15 +2985,19 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("what to do today?").getEvaluationStatus()).isEqualTo(DecisionEvaluationStatus.SKIPPED);
}
- @Test
- public void testItemDefinitionInXmlns_dmn() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void itemDefinitionInXmlnsDmn(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-4797 DMN itemdef resolution in xml namespaces
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("itemDefXmlns_dmn.dmn", this.getClass());
verify_testItemDefinitionInXmlns(runtime);
}
- @Test
- public void testItemDefinitionInXmlns_model() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void itemDefinitionInXmlnsModel(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-4797 DMN itemdef resolution in xml namespaces
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("itemDefXmlns_model.dmn", this.getClass());
verify_testItemDefinitionInXmlns(runtime);
@@ -2755,8 +3017,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("greet").getResult()).as(DMNRuntimeUtil.formatMessages(dmnResult.getMessages())).isEqualTo("Hello, John");
}
- @Test
- public void testOpInNames1() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void opInNames1(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("OpInNames1.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_dae806ec-f00e-41a8-b6d1-2754fcd7fa2d", "Drawing 1");
assertThat(dmnModel).isNotNull();
@@ -2770,8 +3034,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("decision1").getResult()).as(DMNRuntimeUtil.formatMessages(dmnResult.getMessages())).isEqualTo("make and model");
}
- @Test
- public void testOpInNames2() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void opInNames2(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("OpInNames2.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_dae806ec-f00e-41a8-b6d1-2754fcd7fa2d", "Drawing 1");
assertThat(dmnModel).isNotNull();
@@ -2785,8 +3051,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("decision1").getResult()).as(DMNRuntimeUtil.formatMessages(dmnResult.getMessages())).isEqualTo("DMN");
}
- @Test
- public void testBindingContextTypeCheck() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void bindingContextTypeCheck(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-4825 DMN v1.3 verify DMN13-132 type conversions
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("v1_3/DMN13-132.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_9d01a0c4-f529-4ad8-ad8e-ec5fb5d96ad4", "DMN13-132");
@@ -2806,8 +3074,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("decision_003").getResult()).isNull();
}
- @Test
- public void testClassicComparisonVsRange() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void classicComparisonVsRange(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("classicComparisonVsRange.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_ac6efb68-08ed-43ec-b427-e99e78f51ba1", "Drawing 1");
assertThat(dmnModel).isNotNull();
@@ -2833,8 +3103,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
}
}
- @Test
- public void testFunctionDefinitionParameterTrailingSpace() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void functionDefinitionParameterTrailingSpace(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DROOLS4555.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_e1645e17-7e28-4226-ad60-95e6f81cb50b", "Drawing 1");
assertThat(dmnModel).isNotNull();
@@ -2848,32 +3120,40 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("hardcoded").getResult()).as(DMNRuntimeUtil.formatMessages(dmnResult.getMessages())).isEqualTo("Hello, x");
}
- @Test(expected = IllegalArgumentException.class)
- public void testEvaluateByNameWithEmptyParam() {
- final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("simple-item-def.dmn", this.getClass());
- final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn/itemdef", "simple-item-def");
- assertThat(dmnModel).isNotNull();
- assertThat(dmnModel.hasErrors()).as(DMNRuntimeUtil.formatMessages(dmnModel.getMessages())).isFalse();
+ @ParameterizedTest
+ @MethodSource("params")
+ void evaluateByNameWithEmptyParam(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
+ assertThrows(IllegalArgumentException.class, () -> {
+ final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("simple-item-def.dmn", this.getClass());
+ final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn/itemdef", "simple-item-def");
+ assertThat(dmnModel).isNotNull();
+ assertThat(dmnModel.hasErrors()).as(DMNRuntimeUtil.formatMessages(dmnModel.getMessages())).isFalse();
- final DMNContext context = DMNFactory.newContext();
- context.set("Monthly Salary", 1000);
+ final DMNContext context = DMNFactory.newContext();
+ context.set("Monthly Salary", 1000);
- String[] decisionNames = new String[]{};
- runtime.evaluateByName(dmnModel, context, decisionNames);
+ String[] decisionNames = new String[]{};
+ runtime.evaluateByName(dmnModel, context, decisionNames);
+ });
}
- @Test(expected = IllegalArgumentException.class)
- public void testEvaluateByIdWithEmptyParam() {
- final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("simple-item-def.dmn", this.getClass());
- final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn/itemdef", "simple-item-def");
- assertThat(dmnModel).isNotNull();
- assertThat(dmnModel.hasErrors()).as(DMNRuntimeUtil.formatMessages(dmnModel.getMessages())).isFalse();
+ @ParameterizedTest
+ @MethodSource("params")
+ void evaluateByIdWithEmptyParam(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
+ assertThrows(IllegalArgumentException.class, () -> {
+ final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("simple-item-def.dmn", this.getClass());
+ final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn/itemdef", "simple-item-def");
+ assertThat(dmnModel).isNotNull();
+ assertThat(dmnModel.hasErrors()).as(DMNRuntimeUtil.formatMessages(dmnModel.getMessages())).isFalse();
- final DMNContext context = DMNFactory.newContext();
- context.set("Monthly Salary", 1000);
+ final DMNContext context = DMNFactory.newContext();
+ context.set("Monthly Salary", 1000);
- String[] decisionIds = new String[]{};
- runtime.evaluateById(dmnModel, context, decisionIds);
+ String[] decisionIds = new String[]{};
+ runtime.evaluateById(dmnModel, context, decisionIds);
+ });
}
public static class JavaPojoCharUtilDate {
@@ -2903,8 +3183,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
}
}
- @Test
- public void testJavaPojoCharUtilDate() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void javaPojoCharUtilDate(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("javaPojoCharUtilDate.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_5eaccc88-cbf0-4c58-945a-952d8bf974ed", "Drawing 1");
assertThat(dmnModel).isNotNull();
@@ -2919,8 +3201,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("my decision").getResult()).as(DMNRuntimeUtil.formatMessages(dmnResult.getMessages())).isEqualTo("The person: Doe J., on the 28 of the month 1 at the 10 hour.");
}
- @Test
- public void testInstanceOfItemDefBasic() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void instanceOfItemDefBasic(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("instanceOfItemDefBasic.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_CF9357D4-C83F-4F7E-83E3-510310EB16F4", "testItemDefName");
assertThat(dmnModel).isNotNull();
@@ -2935,8 +3219,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("Decision-2").getResult()).isEqualTo(Boolean.TRUE);
}
- @Test
- public void testUniqueMissingMatchDefaultEmpty() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void uniqueMissingMatchDefaultEmpty(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("uniqueNoMatch.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://activiti.org/schema/1.0/dmn", "decisionmulti");
assertThat(dmnModel).isNotNull();
@@ -2956,8 +3242,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("Decision_decisionboolean").getResult()).isEqualTo(output);
}
- @Test
- public void testErrorWhileLiteral() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void errorWhileLiteral(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("errorWhileLiteral.dmn", this.getClass());
runtime.addListener(new DMNRuntimeEventListener() {});
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_8DF63435-B34B-4C19-A06B-C6A3416194A9", "testBasic");
@@ -2972,8 +3260,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("Decision-1").getEvaluationStatus()).isEqualTo(DecisionEvaluationStatus.FAILED);
}
- @Test
- public void testXAsType() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void xAsType(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("xAsType.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_CA816D47-2D7A-41AA-B019-E4B4C5488385", "FEC85B35-BAC9-4FCC-A446-0D546CCAD1A4");
assertThat(dmnModel).isNotNull();
@@ -2989,8 +3279,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("Decision-1").getResult()).isEqualTo("a x, 2020");
}
- @Test
- public void testExceptionInContextEntry() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void exceptionInContextEntry(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// the scope of this test: if an exception occurs while evaluating a ContextEntry, report a DMN message. Before was only SLF4j logged so user no DMN Message at all just null.
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("exceptionInContextEntry.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_001031e1-9f0e-4156-afad-3ee970139021", "Drawing 1");
@@ -3004,8 +3296,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("hardcoded").getEvaluationStatus()).isEqualTo(DecisionEvaluationStatus.FAILED);
}
- @Test
- public void testPersonInReq1() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void personInReq1(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("personInReq1.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_EA9DA906-5A01-4AAA-B341-792486A67097", "personInReq1");
assertThat(dmnModel).isNotNull();
@@ -3023,8 +3317,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("Decision-1").getResult()).isEqualTo(Boolean.TRUE);
}
- @Test
- public void testArthimeticSub1() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void arthimeticSub1(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("arithmeticSub1.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_7B82BF58-74D1-4727-820F-9925FA3F7812", "arithmeticSub1");
assertThat(dmnModel).isNotNull();
@@ -3040,8 +3336,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("ExpressionTest").getResult()).isEqualTo(new BigDecimal("-10"));
}
- @Test
- public void testArthimeticSub2() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void arthimeticSub2(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("arithmeticSub2.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_FCE6849C-6535-4629-A132-8DFD292A4765", "arithmeticSub2");
assertThat(dmnModel).isNotNull();
@@ -3054,8 +3352,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("ExpressionTest").getResult()).isEqualTo(new BigDecimal("-3"));
}
- @Test
- public void testInvokeJavaReturnArray() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void invokeJavaReturnArray(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("invokeJavaReturnArray.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_C90046D5-8581-4B16-992D-0472F840EFAF", "invokeJavaReturnArray");
assertThat(dmnModel).isNotNull();
@@ -3069,9 +3369,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("Decision1").getResult()).isNotNull();
assertThat(dmnResult.getDecisionResultByName("Decision2").getResult()).isEqualTo("cd");
}
-
- @Test
- public void testNotInvocable() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void notInvocable(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("notInvocable.dmn", this.getClass());
runtime.addListener(new DMNRuntimeEventListener() {});
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_4B70E98C-E74E-48A1-88C6-F3FB1F0C026B", "notInvocable");
@@ -3087,9 +3389,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.hasErrors()).as(DMNRuntimeUtil.formatMessages(dmnResult.getMessages())).isTrue();
assertThat(dmnResult.getDecisionResultByName("Decision-1").getEvaluationStatus()).isEqualTo(DecisionEvaluationStatus.FAILED);
}
-
- @Test
- public void testDecisionTableWithNow() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionTableWithNow(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("decisiontable-with-now.dmn", this.getClass());
runtime.addListener(new DMNRuntimeEventListener() {});
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_fce3104a-30df-41f4-8c8f-0b67d4d996d4", "Drawing 1");
@@ -3103,9 +3407,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.hasErrors()).as(DMNRuntimeUtil.formatMessages(dmnResult.getMessages())).isFalse();
assertThat(dmnResult.getDecisionResultByName("Compare").getResult()).isEqualTo(Boolean.TRUE);
}
-
- @Test
- public void testDupContextEntryKey() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void dupContextEntryKey(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("dupContextEntryKey.dmn", this.getClass());
runtime.addListener(new DMNRuntimeEventListener() {});
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_730A7A75-F473-4083-93B9-85E0DAF7F4BD", "dupContextEntryKey");
@@ -3119,9 +3425,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.hasErrors()).as(DMNRuntimeUtil.formatMessages(dmnResult.getMessages())).isTrue();
assertThat(dmnResult.getDecisionResultByName("hardcoded").getEvaluationStatus()).isEqualTo(DecisionEvaluationStatus.FAILED);
}
-
- @Test
- public void testHyphenInPropertyOfCollectionForAccessor() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void hyphenInPropertyOfCollectionForAccessor(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("testHyphenInPropertyOfCollectionForAccessor.dmn", this.getClass());
runtime.addListener(new DMNRuntimeEventListener() {});
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_b5362305-17be-42d8-acec-f2621e3cc0e0", "Drawing 1");
@@ -3140,9 +3448,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
*/
assertThat((Map<String, Object>) dmnResult.getDecisionResultByName("decision").getResult()).containsExactly(entry("correct", List.of("k987")), entry("incorrect", "k987"));
}
-
- @Test
- public void testHyphenInPropertyOfCollectionForAccessorMultiple() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void hyphenInPropertyOfCollectionForAccessorMultiple(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("testHyphenInPropertyOfCollectionForAccessorMultiple.dmn", this.getClass());
runtime.addListener(new DMNRuntimeEventListener() {});
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_b5362305-17be-42d8-acec-f2621e3cc0e0", "Drawing 1");
@@ -3161,9 +3471,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
*/
assertThat((Map<String, Object>)dmnResult.getDecisionResultByName("decision").getResult()).containsExactly(entry("correct", Arrays.asList("k1", "k2", "k3")),entry("incorrect", Arrays.asList("k1", "k3")));
}
-
- @Test
- public void testSoundLevelAllowNull() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void soundLevelAllowNull(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("RecommenderHitPolicy1_allowNull.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_50aea0bb-4482-48f6-acfe-4abc1a1bd0d6", "Drawing 1");
assertThat(dmnModel).isNotNull();
@@ -3177,9 +3489,11 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.hasErrors()).as(DMNRuntimeUtil.formatMessages(dmnResult.getMessages())).isFalse();
assertThat(dmnResult.getDecisionResultByName("Evaluation").getResult()).isEqualTo("Unknown");
}
-
- @Test
- public void testSoundLevelAllowNullItemDef() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void soundLevelAllowNullItemDef(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("RecommenderHitPolicy1_allowNull_itemDef.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_50aea0bb-4482-48f6-acfe-4abc1a1bd0d6", "Drawing 1");
assertThat(dmnModel).isNotNull();
@@ -3194,8 +3508,10 @@ public class DMNRuntimeTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getDecisionResultByName("Evaluation").getResult()).isEqualTo("Unknown");
}
- @Test
- public void testKieIssue270() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void kieIssue270(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("habitability.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_93836704-04E9-45B6-8D10-51409FEBDF25", "habitability" );
assertThat(dmnModel).isNotNull();
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNRuntimeTypeCheckTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNRuntimeTypeCheckTest.java
index 27b622d47a..7b81e00196 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNRuntimeTypeCheckTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNRuntimeTypeCheckTest.java
@@ -22,7 +22,9 @@ import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.api.KieServices;
import org.kie.api.builder.KieBuilder;
import org.kie.api.builder.KieFileSystem;
@@ -54,12 +56,10 @@ public class DMNRuntimeTypeCheckTest extends BaseInterpretedVsCompiledTest {
private static final KieServices ks = KieServices.Factory.get();
- public DMNRuntimeTypeCheckTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
-
- @Test
- public void testDefaultNoTypeCheck() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void defaultNoTypeCheck(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// do NOT use the DMNRuntimeUtil as that enables typeSafe check override for runtime.
final KieContainer kieContainer = KieHelper.getKieContainer(ks.newReleaseId("org.kie", "dmn-test-" + UUID.randomUUID(), "1.0"),
ks.getResources().newClassPathResource("forTypeCheckTest.dmn", this.getClass()));
@@ -67,14 +67,18 @@ public class DMNRuntimeTypeCheckTest extends BaseInterpretedVsCompiledTest {
assertNoTypeCheck(runtime);
}
- @Test
- public void testAskTypeCheckInKModule() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void askTypeCheckInKModule(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = getRuntimeWithTypeCheckOption("true", ks.getResources().newClassPathResource("forTypeCheckTest.dmn", this.getClass()));
assertPerformTypeCheck(runtime);
}
- @Test
- public void testAskTypeCheckWithGlobalEnvVariable() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void askTypeCheckWithGlobalEnvVariable(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
System.setProperty(RuntimeTypeCheckOption.PROPERTY_NAME, "true");
// do NOT use the DMNRuntimeUtil as that enables typeSafe check override for runtime.
final KieContainer kieContainer = KieHelper.getKieContainer(ks.newReleaseId("org.kie", "dmn-test-" + UUID.randomUUID(), "1.0"),
@@ -84,26 +88,34 @@ public class DMNRuntimeTypeCheckTest extends BaseInterpretedVsCompiledTest {
System.clearProperty(RuntimeTypeCheckOption.PROPERTY_NAME);
}
- @Test
- public void testExplicitDisableTypeCheckInKModule() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void explicitDisableTypeCheckInKModule(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = getRuntimeWithTypeCheckOption("false", ks.getResources().newClassPathResource("forTypeCheckTest.dmn", this.getClass()));
assertNoTypeCheck(runtime);
}
- @Test
- public void testUnreckonOptionTypeCheckInKModuleDefaultsToNoTypeCheck() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void unreckonOptionTypeCheckInKModuleDefaultsToNoTypeCheck(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = getRuntimeWithTypeCheckOption("boh", ks.getResources().newClassPathResource("forTypeCheckTest.dmn", this.getClass()));
assertNoTypeCheck(runtime);
}
- @Test
- public void testEmptyOptionTypeCheckInKModuleDefaultsToNoTypeCheck() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void emptyOptionTypeCheckInKModuleDefaultsToNoTypeCheck(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = getRuntimeWithTypeCheckOption("", ks.getResources().newClassPathResource("forTypeCheckTest.dmn", this.getClass()));
assertNoTypeCheck(runtime);
}
- @Test
- public void testDefaultNoTypeCheckButOverrideRuntime() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void defaultNoTypeCheckButOverrideRuntime(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// do NOT use the DMNRuntimeUtil as that enables typeSafe check override for runtime.
final KieContainer kieContainer = KieHelper.getKieContainer(ks.newReleaseId("org.kie", "dmn-test-" + UUID.randomUUID(), "1.0"),
ks.getResources().newClassPathResource("forTypeCheckTest.dmn", this.getClass()));
@@ -112,15 +124,19 @@ public class DMNRuntimeTypeCheckTest extends BaseInterpretedVsCompiledTest {
assertPerformTypeCheck(runtime);
}
- @Test
- public void testExplicitDisableTypeCheckInKModuleButOverrideRuntime() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void explicitDisableTypeCheckInKModuleButOverrideRuntime(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = getRuntimeWithTypeCheckOption("false", ks.getResources().newClassPathResource("forTypeCheckTest.dmn", this.getClass()));
((DMNRuntimeImpl) runtime).setOption(new RuntimeTypeCheckOption(true));
assertPerformTypeCheck(runtime);
}
- @Test
- public void testAskTypeCheckInKModuleButOverrideRuntime() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void askTypeCheckInKModuleButOverrideRuntime(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = getRuntimeWithTypeCheckOption("true", ks.getResources().newClassPathResource("forTypeCheckTest.dmn", this.getClass()));
((DMNRuntimeImpl) runtime).setOption(new RuntimeTypeCheckOption(false));
assertPerformTypeCheck(runtime);
@@ -190,8 +206,10 @@ public class DMNRuntimeTypeCheckTest extends BaseInterpretedVsCompiledTest {
assertThat(hundredMinusNumber.getEvaluationStatus()).isEqualTo(DecisionEvaluationStatus.SKIPPED); // dependency failed type check
}
- @Test
- public void testMisleadingNPEbyAPIusage() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void misleadingNPEbyAPIusage(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// do NOT use the DMNRuntimeUtil as that enables typeSafe check override for runtime.
final KieContainer kieContainer = KieHelper.getKieContainer(ks.newReleaseId("org.kie", "dmn-test-" + UUID.randomUUID(), "1.0"),
ks.getResources().newClassPathResource("simple-item-def.dmn", this.getClass()));
@@ -215,8 +233,10 @@ public class DMNRuntimeTypeCheckTest extends BaseInterpretedVsCompiledTest {
}
}
- @Test
- public void testSqrtString() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void sqrtString(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// do NOT use the DMNRuntimeUtil as that enables typeSafe check override for runtime.
final KieContainer kieContainer = KieHelper.getKieContainer(ks.newReleaseId("org.kie", "dmn-test-" + UUID.randomUUID(), "1.0"),
ks.getResources().newClassPathResource("notypecheck/sqrtstring.dmn", this.getClass()));
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNStronglyTypedSupportTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNStronglyTypedSupportTest.java
index bb9ab591bd..8023226166 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNStronglyTypedSupportTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNStronglyTypedSupportTest.java
@@ -29,10 +29,12 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.TimeUnit;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Timeout;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -56,17 +58,14 @@ import static org.kie.dmn.core.util.DynamicTypeUtils.prototype;
/* These are duplicated test that are run against the Typesafe DMN, see https://issues.redhat.com/browse/DROOLS-5061 */
public class DMNStronglyTypedSupportTest extends BaseVariantTest {
- public DMNStronglyTypedSupportTest(VariantTestConf testConfig) {
- super(testConfig);
- }
-
- @Parameterized.Parameters(name = "{0}")
public static Object[] params() {
return new Object[]{KIE_API_TYPECHECK, BUILDER_DEFAULT_NOCL_TYPECHECK, BUILDER_DEFAULT_NOCL_TYPECHECK_TYPESAFE, KIE_API_TYPECHECK_TYPESAFE};
}
- @Test
- public void testDMNInputDataNodeTypeTest() {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void dmnInputDataNodeTypeTest(VariantTestConf conf) {
+ testConfig = conf;
// DROOLS-1569
final DMNRuntime runtime = createRuntime("DMNInputDataNodeTypeTest.dmn", this.getClass());
final String MODEL_NAMESPACE = "http://www.trisotech.com/definitions/_17396034-163a-48aa-9a7f-c6eb17f9cc6c";
@@ -106,8 +105,10 @@ public class DMNStronglyTypedSupportTest extends BaseVariantTest {
assertThat(idnCarDamageResponsibility.getType().isComposite()).isTrue();
}
- @Test
- public void testDateAndTime() {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void dateAndTime(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("0007-date-time.dmn", getClass());
runtime.addListener(DMNRuntimeUtil.createListener());
@@ -190,8 +191,10 @@ public class DMNStronglyTypedSupportTest extends BaseVariantTest {
}
}
- @Test
- public void testTimeFunction() {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void timeFunction(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("TimeFromDate.dmn", getClass());
runtime.addListener(DMNRuntimeUtil.createListener());
@@ -211,8 +214,10 @@ public class DMNStronglyTypedSupportTest extends BaseVariantTest {
}
}
- @Test
- public void testSO58507157() {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void so58507157(VariantTestConf conf) {
+ testConfig = conf;
// DROOLS-4679 DMN FEEL list contains() invocation from DMN layer fixes
final DMNRuntime runtime = createRuntime("so58507157.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://sample.dmn", "DecisionNumberInList");
@@ -243,8 +248,10 @@ public class DMNStronglyTypedSupportTest extends BaseVariantTest {
}
}
- @Test
- public void testDTinputExprCollectionWithAllowedValuesA() {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void dTinputExprCollectionWithAllowedValuesA(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("DROOLS-4379.dmn", this.getClass());
// DROOLS-4379 DMN decision table input expr collection with allowedValues
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_95436b7a-7268-4713-bf84-58bff10407b4", "Dessin 1");
@@ -268,9 +275,12 @@ public class DMNStronglyTypedSupportTest extends BaseVariantTest {
}
}
- @Test(timeout = 30_000L)
- @Ignore("This shouldn't be supported by Typesafe DMN")
- public void testAccessorCache() {
+ @ParameterizedTest(name = "{0}")
+ @Timeout(value = 30_000L, unit = TimeUnit.MILLISECONDS)
+ @Disabled("This shouldn't be supported by Typesafe DMN")
+ @MethodSource("params")
+ public void accessorCache(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("20180731-pr1997.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_7a39d775-bce9-45e3-aa3b-147d6f0028c7", "20180731-pr1997");
assertThat(dmnModel).isNotNull();
@@ -288,9 +298,11 @@ public class DMNStronglyTypedSupportTest extends BaseVariantTest {
}
}
- @Test
- @Ignore("This test has a different assertion as the output is typesafe")
- public void testNotWithPredicates20180601b() {
+ @ParameterizedTest(name = "{0}")
+ @Disabled("This test has a different assertion as the output is typesafe")
+ @MethodSource("params")
+ public void notWithPredicates20180601b(VariantTestConf conf) {
+ testConfig = conf;
// DROOLS-2605
final DMNRuntime runtime = createRuntime("BruceTask20180601.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_3802fcb2-5b93-4502-aff4-0f5c61244eab", "Bruce Task");
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNTwoValueLogicTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNTwoValueLogicTest.java
index 6069727f5f..77527ec840 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNTwoValueLogicTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNTwoValueLogicTest.java
@@ -18,19 +18,22 @@
*/
package org.kie.dmn.core;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.kie.dmn.api.core.*;
+import java.math.BigDecimal;
+import java.math.MathContext;
+import java.util.List;
+
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.kie.dmn.api.core.DMNContext;
+import org.kie.dmn.api.core.DMNModel;
+import org.kie.dmn.api.core.DMNResult;
+import org.kie.dmn.api.core.DMNRuntime;
import org.kie.dmn.core.api.DMNFactory;
import org.kie.dmn.core.util.DMNRuntimeUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.math.BigDecimal;
-import java.math.MathContext;
-import java.util.Arrays;
-import java.util.List;
-
import static org.assertj.core.api.Assertions.assertThat;
/**
@@ -46,14 +49,10 @@ public class DMNTwoValueLogicTest extends BaseInterpretedVsCompiledTest {
private static DMNContext context;
private static DMNModel dmnModel;
- public DMNTwoValueLogicTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
-
public static final Logger LOG = LoggerFactory.getLogger(DMNTwoValueLogicTest.class);
- @BeforeClass
- public static void setup() {
+ @BeforeAll
+ static void setup() {
runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Two-Value Logic Tests.dmn",
DMNTwoValueLogicTest.class,
"/libs/Two-Value Logic.dmn");
@@ -74,53 +73,73 @@ public class DMNTwoValueLogicTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get(decisionName)).isEqualTo(expected);
}
- @Test
- public void testFunctionAll() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void functionAll(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
runTest("Test all", Boolean.TRUE);
}
- @Test
- public void testFunctionAny() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void functionAny(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
runTest("Test any", Boolean.TRUE);
}
- @Test
- public void testFunctionSum() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void functionSum(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
runTest("Test sum", new BigDecimal(6, MathContext.DECIMAL128 ));
}
- @Test
- public void testFunctionMean() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void functionMean(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
runTest("Test mean", new BigDecimal(20, MathContext.DECIMAL128 ));
}
- @Test
- public void testFunctionCount() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void functionCount(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
runTest("Test count", new BigDecimal(3, MathContext.DECIMAL128 ));
}
- @Test
- public void testFunctionMax() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void functionMax(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
runTest("Test max", new BigDecimal(30, MathContext.DECIMAL128 ));
}
- @Test
- public void testFunctionMin() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void functionMin(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
runTest("Test min", new BigDecimal(10, MathContext.DECIMAL128 ));
}
- @Test
- public void testFunctionMedian() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void functionMedian(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
runTest("Test median", new BigDecimal(20, MathContext.DECIMAL128 ));
}
- @Test
- public void testFunctionMode() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void functionMode(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
runTest("Test mode", List.of(new BigDecimal(20, MathContext.DECIMAL128)));
}
- @Test
- public void testFunctionStddev() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void functionStddev(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
runTest("Test stddev", new BigDecimal("8.164965809277260327324280249019638", MathContext.DECIMAL128 ) );
}
}
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNTypeTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNTypeTest.java
index 47d0c68b0f..6e6ec5b8ba 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNTypeTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNTypeTest.java
@@ -18,7 +18,12 @@
*/
package org.kie.dmn.core;
-import org.junit.Test;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.jupiter.api.Test;
import org.kie.dmn.api.core.DMNType;
import org.kie.dmn.core.compiler.DMNTypeRegistry;
import org.kie.dmn.core.compiler.DMNTypeRegistryV15;
@@ -29,23 +34,18 @@ import org.kie.dmn.feel.FEEL;
import org.kie.dmn.feel.lang.types.BuiltInType;
import org.kie.dmn.model.v1_5.KieDMNModelInstrumentedBase;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
import static org.assertj.core.api.Assertions.assertThat;
import static org.kie.dmn.core.util.DynamicTypeUtils.entry;
import static org.kie.dmn.core.util.DynamicTypeUtils.prototype;
-public class DMNTypeTest {
+class DMNTypeTest {
private static final DMNTypeRegistry typeRegistry = new DMNTypeRegistryV15(Collections.emptyMap());
private static final DMNType FEEL_STRING = typeRegistry.resolveType(KieDMNModelInstrumentedBase.URI_FEEL, "string");
private static final DMNType FEEL_NUMBER = typeRegistry.resolveType(KieDMNModelInstrumentedBase.URI_FEEL, "number");
@Test
- public void testDROOLS2147() {
+ void drools2147() {
// DROOLS-2147
final String testNS = "testDROOLS2147";
@@ -89,7 +89,7 @@ public class DMNTypeTest {
}
@Test
- public void testAllowedValuesForASimpleTypeCollection() {
+ void allowedValuesForASimpleTypeCollection() {
// DROOLS-2357
final String testNS = "testDROOLS2357";
@@ -107,7 +107,7 @@ public class DMNTypeTest {
}
@Test
- public void testTypeConstraintForASimpleTypeCollection() {
+ void typeConstraintForASimpleTypeCollection() {
// incubator-kie-issues#926
final String testNS = "testINCUBATORKIEISSUES926";
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNUpdateTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNUpdateTest.java
index 78bc32e714..ebcb2f114a 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNUpdateTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNUpdateTest.java
@@ -25,7 +25,8 @@ import org.drools.compiler.kie.builder.impl.InternalKieModule;
import org.drools.compiler.kie.builder.impl.KieContainerImpl;
import org.drools.compiler.kie.builder.impl.KieModuleKieProject;
import org.drools.compiler.kie.builder.impl.KieProject;
-import org.junit.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.api.KieBase;
import org.kie.api.KieServices;
import org.kie.api.builder.KieModule;
@@ -51,13 +52,11 @@ import static org.assertj.core.api.Assertions.assertThat;
public class DMNUpdateTest extends BaseInterpretedVsCompiledTest {
public static final Logger LOG = LoggerFactory.getLogger(DMNUpdateTest.class);
-
- public DMNUpdateTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
-
- @Test
- public void testRemoveAndAddSomething() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void removeAndAddSomething(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final KieServices ks = KieServices.Factory.get();
ReleaseId releaseId = ks.newReleaseId("org.kie", "dmn-test", "1.0.0");
@@ -89,8 +88,10 @@ public class DMNUpdateTest extends BaseInterpretedVsCompiledTest {
assertThat(evaluateAll2.getDecisionResultByName("Greeting Message").getResult()).isEqualTo("Salve John Doe");
}
- @Test
- public void testReplace() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void replace(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final KieServices ks = KieServices.Factory.get();
ReleaseId releaseId = ks.newReleaseId("org.kie", "dmn-test", "1.0.0");
@@ -124,8 +125,10 @@ public class DMNUpdateTest extends BaseInterpretedVsCompiledTest {
assertThat(evaluateAll2.getDecisionResultByName("Greeting Message").getResult()).isEqualTo("Salve John Doe");
}
- @Test
- public void testReplaceDisposeCreateReplace() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void replaceDisposeCreateReplace(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final KieServices ks = KieServices.Factory.get();
final ReleaseId v100 = ks.newReleaseId("org.kie", "dmn-test", "1.0.0");
@@ -181,8 +184,10 @@ public class DMNUpdateTest extends BaseInterpretedVsCompiledTest {
assertThat(evaluateAll4.getDecisionResultByName("Greeting Message").getResult()).isEqualTo("Salve John Doe");
}
- @Test
- public void testFromClonedKiePackage() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void fromClonedKiePackage(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final KieServices ks = KieServices.Factory.get();
final ReleaseId v100 = ks.newReleaseId("org.kie", "dmn-test", "1.0.0");
@@ -205,8 +210,10 @@ public class DMNUpdateTest extends BaseInterpretedVsCompiledTest {
assertThat(runtime.getModels()).hasSize(1);
}
- @Test
- public void testFromClonedKiePackageThenUpgrade() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void fromClonedKiePackageThenUpgrade(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final KieServices ks = KieServices.Factory.get();
final ReleaseId v100 = ks.newReleaseId("org.kie", "dmn-test", "1.0.0");
@@ -243,8 +250,9 @@ public class DMNUpdateTest extends BaseInterpretedVsCompiledTest {
assertThat(runtime.getModels()).hasSize(1);
}
- @Test
- public void testKieMarshaller() throws Exception {
+ @ParameterizedTest
+ @MethodSource("params")
+ void kieMarshaller() throws Exception {
final KieServices ks = KieServices.Factory.get();
final ReleaseId v100 = ks.newReleaseId("org.kie", "dmn-test", "1.0.0");
@@ -277,8 +285,9 @@ public class DMNUpdateTest extends BaseInterpretedVsCompiledTest {
check0001_input_data_string(runtime);
}
- @Test
- public void test_as_kie_wb_common_services_backend_Builder() throws Exception {
+ @ParameterizedTest
+ @MethodSource("params")
+ void as_kie_wb_common_services_backend_builder() throws Exception {
final KieServices ks = KieServices.Factory.get();
final ReleaseId v100 = ks.newReleaseId("org.kie", "dmn-test", "1.0.0");
@@ -313,8 +322,9 @@ public class DMNUpdateTest extends BaseInterpretedVsCompiledTest {
assertThat(evaluateAll.getDecisionResultByName("Greeting Message").getResult()).isEqualTo("Hello John Doe");
}
- @Test
- public void test_as_kie_wb_common_services_backend_Builder2() throws Exception {
+ @ParameterizedTest
+ @MethodSource("params")
+ void as_kie_wb_common_services_backend_builder2() throws Exception {
final KieServices ks = KieServices.Factory.get();
final ReleaseId v100 = ks.newReleaseId("org.kie", "dmn-test", "1.0.0");
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/FlightRebookingTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/FlightRebookingTest.java
index 2b3d8ac51b..f68c35f8d1 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/FlightRebookingTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/FlightRebookingTest.java
@@ -25,7 +25,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNDecisionResult;
import org.kie.dmn.api.core.DMNModel;
@@ -37,13 +39,11 @@ import org.kie.dmn.core.util.DMNRuntimeUtil;
import static org.assertj.core.api.Assertions.assertThat;
public class FlightRebookingTest extends BaseInterpretedVsCompiledTest {
-
- public FlightRebookingTest(final boolean useExecModelCompiler ) {
- super( useExecModelCompiler );
- }
-
- @Test
- public void testSolution1() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void solution1(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0019-flight-rebooking.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("https://www.drools.org/kie-dmn", "0019-flight-rebooking" );
assertThat(dmnModel).isNotNull();
@@ -64,8 +64,10 @@ public class FlightRebookingTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get( "Rebooked Passengers")).isEqualTo(loadExpectedResult());
}
- @Test
- public void testSolutionAlternate() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void solutionAlternate(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0019-flight-rebooking-alternative.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("https://www.drools.org/kie-dmn", "0019-flight-rebooking" );
assertThat(dmnModel).isNotNull();
@@ -86,8 +88,10 @@ public class FlightRebookingTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get( "Rebooked Passengers")).isEqualTo(loadExpectedResult());
}
- @Test
- public void testSolutionSingletonLists() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void solutionSingletonLists(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0019-flight-rebooking-singleton-lists.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("https://www.drools.org/kie-dmn", "0019-flight-rebooking" );
assertThat(dmnModel).isNotNull();
@@ -108,8 +112,10 @@ public class FlightRebookingTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("Rebooked Passengers")).isEqualTo(loadExpectedResult());
}
- @Test
- public void testSolutionBadExample() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void solutionBadExample(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0019-flight-rebooking-bad-example.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("https://www.drools.org/kie-dmn", "0019-flight-rebooking" );
assertThat(dmnModel).isNotNull();
@@ -130,8 +136,10 @@ public class FlightRebookingTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get( "Rebooked Passengers")).isEqualTo(loadExpectedResult());
}
- @Test
- public void testUninterpreted() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void uninterpreted(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0019-flight-rebooking-uninterpreted.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_188d6caf-a355-49b5-a692-bd6ce713da08", "0019-flight-rebooking" );
runtime.addListener( DMNRuntimeUtil.createListener() );
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/OnlineDatingTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/OnlineDatingTest.java
index 476ef924ee..1d1424f7d7 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/OnlineDatingTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/OnlineDatingTest.java
@@ -25,7 +25,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -34,12 +35,10 @@ import org.kie.dmn.core.util.DMNRuntimeUtil;
public class OnlineDatingTest extends BaseInterpretedVsCompiledTest {
- public OnlineDatingTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
-
- @Test
- public void testDMChallengeMarch2017() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dMChallengeMarch2017(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("dmcommunity_challenge_2017_03.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"http://www.trisotech.com/definitions/_1b5a3a8f-ccf0-459b-8783-38601977e828",
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/VacationDaysTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/VacationDaysTest.java
index a00637c17e..9b1569c6de 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/VacationDaysTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/VacationDaysTest.java
@@ -20,7 +20,9 @@ package org.kie.dmn.core;
import java.math.BigDecimal;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -31,43 +33,53 @@ import org.kie.dmn.core.util.DMNRuntimeUtil;
import static org.assertj.core.api.Assertions.assertThat;
public class VacationDaysTest extends BaseInterpretedVsCompiledTest {
-
- public VacationDaysTest(final boolean useExecModelCompiler ) {
- super( useExecModelCompiler );
- }
-
- @Test
- public void testSolutionCase1() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void solutionCase1(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
executeTest( 16, 1, 27 );
}
- @Test
- public void testSolutionCase2() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void solutionCase2(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
executeTest( 25, 5, 22 );
}
- @Test
- public void testSolutionCase3() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void solutionCase3(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
executeTest( 44, 20, 24 );
}
- @Test
- public void testSolutionCase4() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void solutionCase4(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
executeTest( 44, 30, 30 );
}
- @Test
- public void testSolutionCase5() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void solutionCase5(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
executeTest( 50, 20, 24 );
}
- @Test
- public void testSolutionCase6() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void solutionCase6(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
executeTest( 50, 30, 30 );
}
- @Test
- public void testSolutionCase7() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void solutionCase7(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
executeTest( 60, 20, 30 );
}
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/WBCommonServicesBackendTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/WBCommonServicesBackendTest.java
index 5f04bca3e7..22694fb61c 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/WBCommonServicesBackendTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/WBCommonServicesBackendTest.java
@@ -25,7 +25,9 @@ import org.drools.compiler.kie.builder.impl.InternalKieModule;
import org.drools.compiler.kie.builder.impl.KieContainerImpl;
import org.drools.compiler.kie.builder.impl.KieModuleKieProject;
import org.drools.compiler.kie.builder.impl.KieProject;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.api.KieServices;
import org.kie.api.builder.KieModule;
import org.kie.api.builder.ReleaseId;
@@ -49,12 +51,10 @@ public class WBCommonServicesBackendTest extends BaseInterpretedVsCompiledTest {
public static final Logger LOG = LoggerFactory.getLogger(WBCommonServicesBackendTest.class);
- public WBCommonServicesBackendTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
-
- @Test
- public void testAsKieWbCommonServicesBackendBuilder() throws Exception {
+ @ParameterizedTest
+ @MethodSource("params")
+ void asKieWbCommonServicesBackendBuilder(boolean useExecModelCompiler) throws Exception {
+ init(useExecModelCompiler);
final KieServices ks = KieServices.Factory.get();
final ReleaseId v100 = ks.newReleaseId("org.kie", "dmn-test", "1.0.0");
@@ -95,9 +95,11 @@ public class WBCommonServicesBackendTest extends BaseInterpretedVsCompiledTest {
final DMNContext result = dmnResult.getContext();
assertThat(result.get("the shortest distance")).isEqualTo(new BigDecimal("5"));
}
-
- @Test
- public void testProfileWithKieWbCommonServicesBackendBuilder() throws Exception {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void profileWithKieWbCommonServicesBackendBuilder(boolean useExecModelCompiler) throws Exception {
+ init(useExecModelCompiler);
final KieServices ks = KieServices.Factory.get();
final ReleaseId v100 = ks.newReleaseId("org.kie", "dmn-test-"+UUID.randomUUID(), "1.0.0");
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/alphanetwork/AlphaNetworkSupportInLargeDecisionTableTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/alphanetwork/AlphaNetworkSupportInLargeDecisionTableTest.java
index 258c7b04e5..7514d335e7 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/alphanetwork/AlphaNetworkSupportInLargeDecisionTableTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/alphanetwork/AlphaNetworkSupportInLargeDecisionTableTest.java
@@ -22,9 +22,8 @@ import java.io.StringReader;
import java.math.BigDecimal;
import java.util.UUID;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.api.KieServices;
import org.kie.api.builder.KieBuilder;
import org.kie.api.builder.KieFileSystem;
@@ -42,22 +41,22 @@ import org.kie.dmn.core.compiler.AlphaNetworkOption;
import static org.assertj.core.api.Assertions.assertThat;
import static org.kie.dmn.core.classloader.DMNClassloaderTest.getPom;
-@RunWith(Parameterized.class)
public class AlphaNetworkSupportInLargeDecisionTableTest {
- @Parameterized.Parameters(name = "{0}")
public static Object[] params() {
return new Object[]{true, false};
}
- private final boolean useAlphaNetwork;
+ private boolean useAlphaNetwork;
- public AlphaNetworkSupportInLargeDecisionTableTest(final boolean useAlphaNetwork) {
+ public void initAlphaNetworkSupportInLargeDecisionTableTest(final boolean useAlphaNetwork) {
this.useAlphaNetwork = useAlphaNetwork;
}
- @Test
- public void evaluateDecisionTable() {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void evaluateDecisionTable(final boolean useAlphaNetwork) {
+ initAlphaNetworkSupportInLargeDecisionTableTest(useAlphaNetwork);
System.setProperty(AlphaNetworkOption.PROPERTY_NAME, Boolean.toString(useAlphaNetwork));
KieServices kieServices = KieServices.get();
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/alphanetwork/DMNDecisionTableAlphaSupportingTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/alphanetwork/DMNDecisionTableAlphaSupportingTest.java
index 9e26402a70..0f97add554 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/alphanetwork/DMNDecisionTableAlphaSupportingTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/alphanetwork/DMNDecisionTableAlphaSupportingTest.java
@@ -19,8 +19,13 @@
package org.kie.dmn.core.alphanetwork;
import java.math.BigDecimal;
+import java.util.concurrent.TimeUnit;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -36,12 +41,10 @@ public class DMNDecisionTableAlphaSupportingTest extends BaseInterpretedVsAlphaN
private static final Logger LOG = org.slf4j.LoggerFactory.getLogger(DMNDecisionTableAlphaSupportingTest.class);
- public DMNDecisionTableAlphaSupportingTest(final boolean useAlphaNetwork ) {
- super( useAlphaNetwork );
- }
-
- @Test
- public void testSimpleDecision() {
+ @ParameterizedTest(name = "{0}")
+ @MethodSource("params")
+ void simpleDecision(boolean useAlphaNetwork) {
+ alphaNetwork = useAlphaNetwork;
DMNRuntime runtime = DMNRuntimeUtil.createRuntime("alphasupport.dmn", this.getClass());
DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_c0cf6e20-0b43-43ce-9def-c759a5f86df2", "DMN Specification Chapter 11 Example Reduced");
assertThat(dmnModel).isNotNull();
@@ -54,8 +57,10 @@ public class DMNDecisionTableAlphaSupportingTest extends BaseInterpretedVsAlphaN
assertThat(dmnResult.getContext().get("Pre-bureau risk category table")).isEqualTo("LOW");
}
- @Test
- public void testSimpleTableMultipleTests() {
+ @ParameterizedTest(name = "{0}")
+ @MethodSource("params")
+ void simpleTableMultipleTests(boolean useAlphaNetwork) {
+ alphaNetwork = useAlphaNetwork;
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("an-simpletable-multipletests.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "an-simpletable-multipletests");
assertThat(dmnModel).isNotNull();
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/ast/DMNContextEvaluatorTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/ast/DMNContextEvaluatorTest.java
index a7183d95c0..4b8ac9d25d 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/ast/DMNContextEvaluatorTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/ast/DMNContextEvaluatorTest.java
@@ -5,7 +5,7 @@ import java.math.BigDecimal;
import java.util.stream.Collectors;
import org.drools.util.FileUtils;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNRuntime;
@@ -19,15 +19,15 @@ import org.kie.dmn.core.impl.DMNResultImplFactory;
import org.kie.dmn.core.util.DMNRuntimeUtil;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
-public class DMNContextEvaluatorTest {
+class DMNContextEvaluatorTest {
private DMNResultImplFactory dmnResultFactory = new DMNResultImplFactory();
@Test
- public void dateToDateTime() {
+ void dateToDateTime() {
File file = FileUtils.getFile("0007-date-time.dmn");
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime(file);
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_69430b3e-17b8-430d-b760-c505bf6469f9", "dateTime Table 58");
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNClassloaderTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNClassloaderTest.java
index f9a88dc788..e2b599455c 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNClassloaderTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNClassloaderTest.java
@@ -22,7 +22,8 @@ import java.math.BigDecimal;
import java.util.Arrays;
import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.api.KieServices;
import org.kie.api.builder.KieBuilder;
import org.kie.api.builder.KieFileSystem;
@@ -43,12 +44,10 @@ import static org.assertj.core.api.Assertions.assertThat;
public class DMNClassloaderTest extends BaseInterpretedVsCompiledTest {
public static final Logger LOG = LoggerFactory.getLogger(DMNClassloaderTest.class);
- public DMNClassloaderTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
-
- @Test
- public void testClassloaderFunctionInvocation() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void classloaderFunctionInvocation(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final String javaSource = "package com.acme.functions;\n" +
"\n" +
"import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;\n" +
@@ -127,8 +126,10 @@ public class DMNClassloaderTest extends BaseInterpretedVsCompiledTest {
return pom.toString();
}
- @Test
- public void testInvokeJavaReturnArrayPrimitives() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void invokeJavaReturnArrayPrimitives(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final String javaSource = "package org.acme.functions;\n" +
"\n" +
"public class MyFunctions {\n" +
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNEvalHelperAccessorCacheTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNEvalHelperAccessorCacheTest.java
index b921146795..5a69d987ca 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNEvalHelperAccessorCacheTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNEvalHelperAccessorCacheTest.java
@@ -20,7 +20,8 @@ package org.kie.dmn.core.classloader;
import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.api.KieServices;
import org.kie.api.builder.KieBuilder;
import org.kie.api.builder.KieFileSystem;
@@ -42,12 +43,11 @@ import static org.assertj.core.api.Assertions.assertThat;
public class DMNEvalHelperAccessorCacheTest extends BaseInterpretedVsCompiledTest {
public static final Logger LOG = LoggerFactory.getLogger(DMNEvalHelperAccessorCacheTest.class);
- public DMNEvalHelperAccessorCacheTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
- @Test
- public void testClassloaderFunctionInvocation() throws Exception {
+ @ParameterizedTest
+ @MethodSource("params")
+ void classloaderFunctionInvocation(boolean useExecModelCompiler) throws Exception {
+ init(useExecModelCompiler);
final KieServices ks = KieServices.Factory.get();
final KieContainer container1 = createKieContainer1(ks);
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNRuntimeListenerBKMTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNRuntimeListenerBKMTest.java
index 80d113bd80..c7c02935b6 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNRuntimeListenerBKMTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNRuntimeListenerBKMTest.java
@@ -24,7 +24,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -70,7 +70,7 @@ public class DMNRuntimeListenerBKMTest {
}
@Test
- public void test() {
+ void test() {
final BKMListener listenerUT = new BKMListener();
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("sumWithBKM.dmn", this.getClass());
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNRuntimeListenerDSTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNRuntimeListenerDSTest.java
index f150112e90..4e75b2325a 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNRuntimeListenerDSTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNRuntimeListenerDSTest.java
@@ -23,7 +23,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -71,7 +71,7 @@ public class DMNRuntimeListenerDSTest {
}
@Test
- public void testWholeModel() {
+ void wholeModel() {
final DSListener listenerUT = new DSListener();
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("helloDS.dmn", this.getClass());
@@ -105,7 +105,7 @@ public class DMNRuntimeListenerDSTest {
}
@Test
- public void testDS() {
+ void ds() {
final DSListener listenerUT = new DSListener();
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("helloDS.dmn", this.getClass());
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNRuntimeListenerPropertyTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNRuntimeListenerPropertyTest.java
index a11d494c8f..dd024582a5 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNRuntimeListenerPropertyTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNRuntimeListenerPropertyTest.java
@@ -21,7 +21,7 @@ package org.kie.dmn.core.classloader;
import java.util.List;
import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.api.KieServices;
import org.kie.api.builder.KieBuilder;
import org.kie.api.builder.KieFileSystem;
@@ -78,7 +78,7 @@ public class DMNRuntimeListenerPropertyTest {
}
@Test
- public void test() {
+ void test() {
final String LISTENER_KEY = "org.kie.dmn.runtime.listeners.DMNRuntimeListenerPropertyTest";
final String LISTENER_VALUE = "com.acme.TestPropertyListener";
System.setProperty(LISTENER_KEY, LISTENER_VALUE);
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNRuntimeListenerTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNRuntimeListenerTest.java
index b19fc4a85c..e3e950ce32 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNRuntimeListenerTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DMNRuntimeListenerTest.java
@@ -25,7 +25,9 @@ import java.util.Map;
import java.util.UUID;
import org.drools.base.util.Drools;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.api.KieServices;
import org.kie.api.builder.KieBuilder;
import org.kie.api.builder.KieFileSystem;
@@ -57,10 +59,6 @@ import static org.assertj.core.api.Assertions.assertThat;
public class DMNRuntimeListenerTest extends BaseInterpretedVsCompiledTest {
- public DMNRuntimeListenerTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
-
public static final Logger LOG = LoggerFactory.getLogger(DMNRuntimeListenerTest.class);
public static final Map<String, Object> TEST_METADATA = new HashMap<String, Object>() {{
@@ -68,8 +66,10 @@ public class DMNRuntimeListenerTest extends BaseInterpretedVsCompiledTest {
put("fieldName", "fieldValue");
}};
- @Test
- public void testBasicListenerFromKModule() throws Exception {
+ @ParameterizedTest
+ @MethodSource("params")
+ void basicListenerFromKModule(boolean useExecModelCompiler) throws Exception {
+ init(useExecModelCompiler);
final String javaSource = "package com.acme;" +
"" +
"public class TestListener implements org.kie.dmn.api.core.event.DMNRuntimeEventListener {\n" +
@@ -85,7 +85,7 @@ public class DMNRuntimeListenerTest extends BaseInterpretedVsCompiledTest {
" }\n" +
" }\n" +
"\n" +
- " public java.util.List<Object> getResults() {\n" +
+ " public java.util.List<Object> getResults() {;\n" +
" return java.util.Collections.unmodifiableList(decisionResults);\n" +
" }\n" +
"}";
@@ -132,8 +132,10 @@ public class DMNRuntimeListenerTest extends BaseInterpretedVsCompiledTest {
assertThat(results).contains("Hello John Doe");
}
- @Test
- public void testListenerWithBKM() throws Exception {
+ @ParameterizedTest
+ @MethodSource("params")
+ void listenerWithBKM(boolean useExecModelCompiler) throws Exception {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("org/kie/dmn/core/say_for_hello.dmn", this.getClass());
TestEventListener listener = new TestEventListener();
runtime.addListener(listener);
@@ -194,8 +196,10 @@ public class DMNRuntimeListenerTest extends BaseInterpretedVsCompiledTest {
assertThat(((AfterEvaluateDecisionEvent) eventList.get(11)).getDecision().getName()).isEqualTo("just say");
}
- @Test
- public void testListenerWithDecisionService() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void listenerWithDecisionService(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("org/kie/dmn/core/decisionservices/DecisionServiceABC.dmn", this.getClass());
TestEventListener listener = new TestEventListener();
runtime.addListener(listener);
@@ -241,8 +245,10 @@ public class DMNRuntimeListenerTest extends BaseInterpretedVsCompiledTest {
assertThat(((AfterEvaluateDecisionEvent) eventList.get(5)).getDecision().getName()).isEqualTo("Invoking Decision");
}
- @Test
- public void testBeforeAndAfterEvaluateAllEvents() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void beforeAndAfterEvaluateAllEvents(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final String modelResource = "org/kie/dmn/core/say_for_hello.dmn";
final String modelNamespace = "http://www.trisotech.com/dmn/definitions/_b6f2a9ca-a246-4f27-896a-e8ef04ea439c";
final String modelName = "say for hello";
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DTAnnotationListenerTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DTAnnotationListenerTest.java
index fb465a1a98..bdb69ca7a6 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DTAnnotationListenerTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/classloader/DTAnnotationListenerTest.java
@@ -18,15 +18,11 @@
*/
package org.kie.dmn.core.classloader;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.kie.dmn.core.util.DynamicTypeUtils.entry;
-import static org.kie.dmn.core.util.DynamicTypeUtils.mapOf;
-
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -42,6 +38,10 @@ import org.kie.dmn.model.api.RuleAnnotation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.kie.dmn.core.util.DynamicTypeUtils.entry;
+import static org.kie.dmn.core.util.DynamicTypeUtils.mapOf;
+
public class DTAnnotationListenerTest {
public static final Logger LOG = LoggerFactory.getLogger(DTAnnotationListenerTest.class);
@@ -82,7 +82,7 @@ public class DTAnnotationListenerTest {
}
@Test
- public void test() {
+ void test() {
final DTAnnotationListener listenerUT = new DTAnnotationListener();
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("license.dmn", this.getClass());
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/ImportDMNResolverUtilTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/ImportDMNResolverUtilTest.java
index dbaec33b32..87156dc70c 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/ImportDMNResolverUtilTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/ImportDMNResolverUtilTest.java
@@ -26,17 +26,17 @@ import java.util.function.Function;
import javax.xml.namespace.QName;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.feel.util.Either;
import org.kie.dmn.model.api.Import;
import org.kie.dmn.model.v1_1.TImport;
import static org.assertj.core.api.Assertions.assertThat;
-public class ImportDMNResolverUtilTest {
+class ImportDMNResolverUtilTest {
@Test
- public void testNSonly() {
+ void nSonly() {
final Import i = makeImport("ns1", null, null);
final List<QName> available = Arrays.asList(new QName("ns1", "m1"),
new QName("ns2", "m2"),
@@ -47,7 +47,7 @@ public class ImportDMNResolverUtilTest {
}
@Test
- public void testNSandModelName() {
+ void nSandModelName() {
final Import i = makeImport("ns1", null, "m1");
final List<QName> available = Arrays.asList(new QName("ns1", "m1"),
new QName("ns2", "m2"),
@@ -58,7 +58,7 @@ public class ImportDMNResolverUtilTest {
}
@Test
- public void testNSandModelNameWithAlias() {
+ void nSandModelNameWithAlias() {
final Import i = makeImport("ns1", "aliased", "m1");
final List<QName> available = Arrays.asList(new QName("ns1", "m1"),
new QName("ns2", "m2"),
@@ -69,7 +69,7 @@ public class ImportDMNResolverUtilTest {
}
@Test
- public void testNSnoModelNameWithAlias() {
+ void nSnoModelNameWithAlias() {
final Import i = makeImport("ns1", "mymodel", null);
final List<QName> available = Arrays.asList(new QName("ns1", "m1"),
new QName("ns2", "m2"),
@@ -80,7 +80,7 @@ public class ImportDMNResolverUtilTest {
}
@Test
- public void testNSandUnexistentModelName() {
+ void nSandUnexistentModelName() {
final Import i = makeImport("ns1", null, "boh");
final List<QName> available = Arrays.asList(new QName("ns1", "m1"),
new QName("ns2", "m2"),
@@ -90,7 +90,7 @@ public class ImportDMNResolverUtilTest {
}
@Test
- public void testNSnoModelNameDefaultWithAlias2() {
+ void nSnoModelNameDefaultWithAlias2() {
final Import i = makeImport("ns1", "boh", null);
final List<QName> available = Arrays.asList(new QName("ns1", "m1"),
new QName("ns2", "m2"),
@@ -101,7 +101,7 @@ public class ImportDMNResolverUtilTest {
}
@Test
- public void testLocateInNS() {
+ void locateInNS() {
final Import i = makeImport("nsA", null, "m1");
final List<QName> available = Arrays.asList(new QName("nsA", "m1"),
new QName("nsA", "m2"),
@@ -112,7 +112,7 @@ public class ImportDMNResolverUtilTest {
}
@Test
- public void testLocateInNSnoModelNameWithAlias() {
+ void locateInNSnoModelNameWithAlias() {
final Import i = makeImport("nsA", "m1", null);
final List<QName> available = Arrays.asList(new QName("nsA", "m1"),
new QName("nsA", "m2"),
@@ -122,7 +122,7 @@ public class ImportDMNResolverUtilTest {
}
@Test
- public void testLocateInNSAliased() {
+ void locateInNSAliased() {
final Import i = makeImport("nsA", "aliased", "m1");
final List<QName> available = Arrays.asList(new QName("nsA", "m1"),
new QName("nsA", "m2"),
@@ -133,7 +133,7 @@ public class ImportDMNResolverUtilTest {
}
@Test
- public void testLocateInNSunexistent() {
+ void locateInNSunexistent() {
final Import i = makeImport("nsA", null, "boh");
final List<QName> available = Arrays.asList(new QName("nsA", "m1"),
new QName("nsA", "m2"),
@@ -143,7 +143,7 @@ public class ImportDMNResolverUtilTest {
}
@Test
- public void testLocateInNSnoModelNameWithAlias2() {
+ void locateInNSnoModelNameWithAlias2() {
final Import i = makeImport("nsA", "boh", null);
final List<QName> available = Arrays.asList(new QName("nsA", "m1"),
new QName("nsA", "m2"),
@@ -153,7 +153,7 @@ public class ImportDMNResolverUtilTest {
}
@Test
- public void testLocateInNSAliasedBadScenario() {
+ void locateInNSAliasedBadScenario() {
// this is a BAD scenario are in namespace `nsA` there are 2 models with the same name.
final Import i = makeImport("nsA", "aliased", "mA");
final List<QName> available = Arrays.asList(new QName("nsA", "mA"),
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/ItemDefinitionDependenciesGeneratedTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/ItemDefinitionDependenciesGeneratedTest.java
index ebc8f93cc5..2d3d258fa6 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/ItemDefinitionDependenciesGeneratedTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/ItemDefinitionDependenciesGeneratedTest.java
@@ -27,9 +27,8 @@ import java.util.stream.Collectors;
import javax.xml.namespace.QName;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.model.api.ItemDefinition;
import org.kie.dmn.model.v1_1.TItemDefinition;
import org.slf4j.Logger;
@@ -37,7 +36,6 @@ import org.slf4j.LoggerFactory;
import static org.assertj.core.api.Assertions.assertThat;
-@RunWith(Parameterized.class)
public class ItemDefinitionDependenciesGeneratedTest {
private final Logger logger = LoggerFactory.getLogger(ItemDefinitionDependenciesGeneratedTest.class);
@@ -46,11 +44,8 @@ public class ItemDefinitionDependenciesGeneratedTest {
private static final int LEVELS_OF_DEPENDENCIES = 3;
private static final String ITEM_DEFINITION_NAME_BASE = "ItemDefinition";
private static final String TEST_NS = "https://www.drools.org/";
-
- @Parameterized.Parameter
public static List<ItemDefinition> itemDefinitions;
- @Parameterized.Parameters
public static Collection<List<ItemDefinition>> generateParameters() {
final List<ItemDefinition> baseItemDefinitions = getBaseListOfItemDefinitions(1);
@@ -181,8 +176,10 @@ public class ItemDefinitionDependenciesGeneratedTest {
return new ItemDefinitionDependenciesSorter(TEST_NS).sort(ins);
}
- @Test
- public void testOrdering() {
+ @MethodSource("generateParameters")
+ @ParameterizedTest
+ public void ordering(List<ItemDefinition> itemDefinitions) {
+ initItemDefinitionDependenciesGeneratedTest(itemDefinitions);
logger.trace("Item definitions:");
itemDefinitions.forEach(itemDefinition -> {
logger.trace(itemDefinition.getName());
@@ -217,4 +214,8 @@ public class ItemDefinitionDependenciesGeneratedTest {
}
return -1;
}
+
+ public void initItemDefinitionDependenciesGeneratedTest(List<ItemDefinition> itemDefinitions) {
+ this.itemDefinitions = itemDefinitions;
+ }
}
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/ItemDefinitionDependenciesTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/ItemDefinitionDependenciesTest.java
index 4123beab6c..a7a63efc43 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/ItemDefinitionDependenciesTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/ItemDefinitionDependenciesTest.java
@@ -23,14 +23,14 @@ import java.util.List;
import javax.xml.namespace.QName;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.model.api.ItemDefinition;
import org.kie.dmn.model.v1_1.TItemDefinition;
import static org.assertj.core.api.Assertions.assertThat;
-public class ItemDefinitionDependenciesTest {
+class ItemDefinitionDependenciesTest {
private static final String TEST_NS = "https://www.drools.org/";
@@ -53,9 +53,9 @@ public class ItemDefinitionDependenciesTest {
private List<ItemDefinition> orderingStrategy(final List<ItemDefinition> ins) {
return new ItemDefinitionDependenciesSorter(TEST_NS).sort(ins);
}
-
+
@Test
- public void testGeneric() {
+ void generic() {
final ItemDefinition a = build("a");
final ItemDefinition b = build("b");
@@ -71,9 +71,9 @@ public class ItemDefinitionDependenciesTest {
assertThat(orderedList.subList(0, 2)).contains(a,b);
assertThat(orderedList.subList(2, 4)).contains(c,d);
}
-
+
@Test
- public void testGeneric2() {
+ void generic2() {
final ItemDefinition z = build("z");
final ItemDefinition b = build("b");
@@ -86,9 +86,9 @@ public class ItemDefinitionDependenciesTest {
assertThat(orderedList.indexOf(z) < orderedList.indexOf(a)).as("Index of z < a").isTrue();
}
-
+
@Test
- public void testOrdering1() {
+ void ordering1() {
final ItemDefinition tCollateralRiskCategory = build("tCollateralRiskCategory");
final ItemDefinition tCreditRiskCategory = build("tCreditRiskCategory");
final ItemDefinition tAffordabilityCategory = build("tAffordabilityCategory");
@@ -120,9 +120,9 @@ public class ItemDefinitionDependenciesTest {
assertThat(orderedList.indexOf(tAge) < orderedList.indexOf(tBorrowe)).as("Index of tAge < tBorrowe").isTrue();
assertThat(orderedList.indexOf(temploementStatus) < orderedList.indexOf(tBorrowe)).as("Index of temploementStatus < tBorrowe").isTrue();
}
-
+
@Test
- public void testOrdering2() {
+ void ordering2() {
final ItemDefinition tMortgageType = build("tMortgageType");
final ItemDefinition tObjective = build("tObjective");
final ItemDefinition tRequested = build("tRequested", tMortgageType, tObjective);
@@ -149,9 +149,9 @@ public class ItemDefinitionDependenciesTest {
assertThat(orderedList.indexOf(tMortgageType) < orderedList.indexOf(tLoanTypes)).as("Index of tMortgageType < tLoanTypes").isTrue();
assertThat(orderedList.indexOf(tConformanceType) < orderedList.indexOf(tLoanTypes)).as("Index of tConformanceType < tLoanTypes").isTrue();
}
-
+
@Test
- public void testOrdering3() {
+ void ordering3() {
final ItemDefinition tNumberList = build("tNumberList");
final ItemDefinition tTax = build("tTax");
final ItemDefinition tStateModel = build("tStateModel");
@@ -180,7 +180,7 @@ public class ItemDefinitionDependenciesTest {
}
@Test
- public void testOrdering4() {
+ void ordering4() {
final ItemDefinition _TypeDecisionA1 = build("TypeDecisionA1");
final ItemDefinition _TypeDecisionA2_x = build("TypeDecisionA2.x", _TypeDecisionA1);
final ItemDefinition _TypeDecisionA3 = build("TypeDecisionA3", _TypeDecisionA2_x);
@@ -212,7 +212,7 @@ public class ItemDefinitionDependenciesTest {
}
@Test
- public void testCircular3() {
+ void circular3() {
final ItemDefinition fhirAge = build("fhirAge");
addComponent(fhirAge, "fhirExtension");
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/UnnamedImportUtilsTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/UnnamedImportUtilsTest.java
index 2f317557a5..a0cf025888 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/UnnamedImportUtilsTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/UnnamedImportUtilsTest.java
@@ -7,7 +7,7 @@ import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collection;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNRuntime;
import org.kie.dmn.backend.marshalling.v1x.DMNMarshallerFactory;
@@ -17,28 +17,28 @@ import org.kie.dmn.model.api.Definitions;
import org.kie.dmn.model.api.NamedElement;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.kie.dmn.core.compiler.UnnamedImportUtils.addIfNotPresent;
import static org.kie.dmn.core.compiler.UnnamedImportUtils.isInUnnamedImport;
-public class UnnamedImportUtilsTest {
+class UnnamedImportUtilsTest {
@Test
- public void isInUnnamedImportTrueWithHrefNamespace() {
+ void isInUnnamedImportTrueWithHrefNamespace() {
commonIsInUnnamedImportTrue("valid_models/DMNv1_5/Importing_EmptyNamed_Model_With_Href_Namespace.dmn",
"valid_models/DMNv1_5/Imported_Model_Unamed.dmn");
}
@Test
- public void isInUnnamedImportTrueWithoutHrefNamespace() {
+ void isInUnnamedImportTrueWithoutHrefNamespace() {
commonIsInUnnamedImportTrue("valid_models/DMNv1_5/Importing_EmptyNamed_Model_Without_Href_Namespace.dmn",
"valid_models/DMNv1_5/Imported_Model_Unamed.dmn");
}
@Test
- public void isInUnnamedImportFalse() {
+ void isInUnnamedImportFalse() {
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("valid_models/DMNv1_5/Importing_Named_Model.dmn",
this.getClass(),
"valid_models/DMNv1_5/Imported_Model_Unamed.dmn");
@@ -57,7 +57,7 @@ public class UnnamedImportUtilsTest {
}
@Test
- public void addIfNotPresentTrue() throws IOException {
+ void addIfNotPresentTrue() throws IOException {
URL importedModelFileResource = Thread.currentThread().getContextClassLoader().getResource(
"valid_models/DMNv1_5/Imported_Model_Unamed.dmn");
assertNotNull(importedModelFileResource);
@@ -73,13 +73,13 @@ public class UnnamedImportUtilsTest {
}
@Test
- public void addIfNotPresentFalseWithHrefNamespace() throws IOException {
+ void addIfNotPresentFalseWithHrefNamespace() throws IOException {
commonAddIfNotPresentFalse("valid_models/DMNv1_5/Importing_EmptyNamed_Model_With_Href_Namespace.dmn",
"valid_models/DMNv1_5/Imported_Model_Unamed.dmn");
}
@Test
- public void addIfNotPresentFalseWithoutHrefNamespace() throws IOException {
+ void addIfNotPresentFalseWithoutHrefNamespace() throws IOException {
commonAddIfNotPresentFalse("valid_models/DMNv1_5/Importing_EmptyNamed_Model_Without_Href_Namespace.dmn",
"valid_models/DMNv1_5/Imported_Model_Unamed.dmn");
}
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/extensions/DMNExtensionRegisterTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/extensions/DMNExtensionRegisterTest.java
index c25ab09234..05e7e65b2b 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/extensions/DMNExtensionRegisterTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/extensions/DMNExtensionRegisterTest.java
@@ -21,7 +21,7 @@ package org.kie.dmn.core.compiler.extensions;
import java.util.List;
import java.util.stream.Collectors;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.api.KieServices;
import org.kie.api.builder.KieBuilder;
import org.kie.api.builder.KieFileSystem;
@@ -40,11 +40,11 @@ import org.slf4j.LoggerFactory;
import static org.assertj.core.api.Assertions.assertThat;
-public class DMNExtensionRegisterTest {
+class DMNExtensionRegisterTest {
private static final Logger LOG = LoggerFactory.getLogger(DMNExtensionRegisterTest.class);
@Test
- public void testUsingSystemProperty() {
+ void usingSystemProperty() {
try {
System.setProperty("org.kie.dmn.profiles.FirstNameLastNameProfile", FirstNameLastNameProfile.class.getCanonicalName());
assertThat(System.getProperty("org.kie.dmn.profiles.FirstNameLastNameProfile")).isEqualTo(FirstNameLastNameProfile.class.getCanonicalName());
@@ -81,7 +81,7 @@ public class DMNExtensionRegisterTest {
}
@Test
- public void testUsingKModuleProperty() {
+ void usingKModuleProperty() {
final KieServices ks = KieServices.Factory.get();
final KieFileSystem kfs = ks.newKieFileSystem();
@@ -126,7 +126,7 @@ public class DMNExtensionRegisterTest {
}
@Test
- public void testUsingKModuleProperty_WrongClasses() {
+ void usingKModulePropertyWrongClasses() {
final KieServices ks = KieServices.Factory.get();
final KieFileSystem kfs = ks.newKieFileSystem();
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/profiles/DMNProfilesTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/profiles/DMNProfilesTest.java
index 63717eb85e..cf4d25cec5 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/profiles/DMNProfilesTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/profiles/DMNProfilesTest.java
@@ -20,7 +20,8 @@ package org.kie.dmn.core.compiler.profiles;
import java.math.BigDecimal;
-import org.junit.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.api.KieServices;
import org.kie.api.builder.KieBuilder;
import org.kie.api.builder.KieFileSystem;
@@ -43,12 +44,10 @@ public class DMNProfilesTest extends BaseInterpretedVsCompiledTest {
public static final Logger LOG = LoggerFactory.getLogger(DMNProfilesTest.class);
- public DMNProfilesTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
-
- @Test
- public void testJust47() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void just47(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final KieServices ks = KieServices.Factory.get();
final KieFileSystem kfs = ks.newKieFileSystem();
@@ -79,8 +78,10 @@ public class DMNProfilesTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("decision result")).isEqualTo(new BigDecimal(47));
}
- @Test
- public void testCustomModelCount() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void customModelCount(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final KieServices ks = KieServices.Factory.get();
final KieFileSystem kfs = ks.newKieFileSystem();
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/profiles/ExtendedDMNProfileTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/profiles/ExtendedDMNProfileTest.java
index 1002cf1bdd..62f84cfc62 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/profiles/ExtendedDMNProfileTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/profiles/ExtendedDMNProfileTest.java
@@ -26,7 +26,7 @@ import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.Collections;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.feel.runtime.functions.AbsFunction;
import org.kie.dmn.feel.runtime.functions.EvenFunction;
import org.kie.dmn.feel.runtime.functions.ExpFunction;
@@ -46,7 +46,7 @@ import org.kie.dmn.feel.runtime.functions.extended.TimeFunction;
import static java.math.BigDecimal.valueOf;
import static org.assertj.core.api.Assertions.assertThat;
-public class ExtendedDMNProfileTest {
+class ExtendedDMNProfileTest {
private final DateFunction dateFunction = DateFunction.INSTANCE;
private final TimeFunction timeFunction = TimeFunction.INSTANCE;
private final SplitFunction splitFunction = SplitFunction.INSTANCE;
@@ -63,101 +63,101 @@ public class ExtendedDMNProfileTest {
private final OddFunction oddFunction = OddFunction.INSTANCE;
@Test
- public void testDateFunction_invokeParamStringDateTime() {
+ void dateFunctionInvokeParamStringDateTime() {
assertResult(dateFunction.invoke("2017-09-07T10:20:30"), LocalDate.of(2017, 9, 7));
}
@Test
- public void testDateFunction_invokeExtended() {
+ void dateFunctionInvokeExtended() {
assertResult(dateFunction.invoke("2016-12-20T14:30:22"), DateTimeFormatter.ISO_DATE.parse( "2016-12-20", LocalDate::from ));
assertResult(dateFunction.invoke("2016-12-20T14:30:22-05:00"), DateTimeFormatter.ISO_DATE.parse( "2016-12-20", LocalDate::from ));
assertResult(dateFunction.invoke("2016-12-20T14:30:22z"), DateTimeFormatter.ISO_DATE.parse( "2016-12-20", LocalDate::from ));
}
@Test
- public void testTimeFunction_invokeStringParamDate() {
+ void timeFunctionInvokeStringParamDate() {
assertResult(timeFunction.invoke("2017-10-09"), LocalTime.of(0,0,0));
assertResult(timeFunction.invoke("2017-10-09T10:15:06"), LocalTime.of(10,15,6));
}
@Test
- public void testTimeFunction_invokeExtended() {
+ void timeFunctionInvokeExtended() {
assertResult(timeFunction.invoke("2016-12-20T14:30:22"), DateTimeFormatter.ISO_TIME.parse( "14:30:22", LocalTime::from ));
assertResult(timeFunction.invoke("2016-12-20T14:30:22-05:00"), DateTimeFormatter.ISO_TIME.parse( "14:30:22-05:00", OffsetTime::from ));
assertResult(timeFunction.invoke("2016-12-20T14:30:22z"), DateTimeFormatter.ISO_TIME.parse( "14:30:22z", OffsetTime::from ));
}
@Test
- public void testSplitFunction() {
+ void splitFunction() {
assertResult(splitFunction.invoke("John Doe", "\\s"), Arrays.asList("John", "Doe"));
assertResult(splitFunction.invoke("a;b;c;;", ";"), Arrays.asList("a", "b", "c", "", ""));
}
@Test
- public void testProductFunction() {
+ void productFunction() {
assertResult(productFunction.invoke(Arrays.asList(valueOf(2), valueOf(3), valueOf(4))), valueOf(24));
}
@Test
- public void testMedianFunction() {
+ void medianFunction() {
assertResult(medianFunction.invoke(new Object[]{valueOf(8), valueOf(2), valueOf(5), valueOf(3), valueOf(4)}), valueOf(4));
assertResult(medianFunction.invoke(Arrays.asList(valueOf(6), valueOf(1), valueOf(2), valueOf(3))), valueOf(2.5));
assertNull(medianFunction.invoke(new Object[]{}));
}
@Test
- public void testStddevFunction() {
+ void stddevFunction() {
assertResultDoublePrecision(stddevFunction.invoke(new Object[]{2, 4, 7, 5}), valueOf(2.0816659994661326));
}
@Test
- public void testModeFunction() {
+ void modeFunction() {
assertResult(modeFunction.invoke(new Object[]{6, 3, 9, 6, 6}), Collections.singletonList(valueOf(6)));
assertResult(modeFunction.invoke(Arrays.asList(6, 1, 9, 6, 1)), Arrays.asList(valueOf(1), valueOf(6)));
assertResult(modeFunction.invoke(Collections.emptyList()), Collections.emptyList());
}
@Test
- public void testModuloFunction() {
+ void moduloFunction() {
assertResult(moduloFunction.invoke(valueOf(12), valueOf(5)), valueOf(2));
}
@Test
- public void testSqrtFunction() {
+ void sqrtFunction() {
assertResultDoublePrecision(sqrtFunction.invoke(valueOf(16)), valueOf(4));
assertResultDoublePrecision(sqrtFunction.invoke(valueOf(2)), valueOf(1.4142135623730951));
}
@Test
- public void testLogFunction() {
+ void logFunction() {
assertResultDoublePrecision(logFunction.invoke(valueOf(10)), valueOf(2.302585092994046));
}
@Test
- public void testExpFunction() {
+ void expFunction() {
assertResultDoublePrecision(expFunction.invoke(valueOf(5)), valueOf(148.4131591025766));
}
@Test
- public void testOddFunction() {
+ void oddFunction() {
assertResult(oddFunction.invoke(valueOf(5)), Boolean.TRUE);
assertResult(oddFunction.invoke(valueOf(2)), Boolean.FALSE);
}
@Test
- public void testOddFunction_fractional() {
+ void oddFunctionFractional() {
assertNull(oddFunction.invoke(valueOf(5.5)));
assertResult(oddFunction.invoke(valueOf(5.0)), Boolean.TRUE);
}
@Test
- public void testEvenFunction() {
+ void evenFunction() {
assertResult(evenFunction.invoke(valueOf(5)), Boolean.FALSE);
assertResult(evenFunction.invoke(valueOf(2)), Boolean.TRUE);
}
@Test
- public void testEvenFunction_fractional() {
+ void evenFunctionFractional() {
assertNull(evenFunction.invoke(valueOf(5.5)));
assertResult(evenFunction.invoke(valueOf(2.0)), Boolean.TRUE);
}
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/decisionservices/DMNDecisionServicesTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/decisionservices/DMNDecisionServicesTest.java
index e4706403be..69be0798dd 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/decisionservices/DMNDecisionServicesTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/decisionservices/DMNDecisionServicesTest.java
@@ -21,7 +21,8 @@ package org.kie.dmn.core.decisionservices;
import java.math.BigDecimal;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.api.builder.Message.Level;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
@@ -42,12 +43,10 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
public static final Logger LOG = LoggerFactory.getLogger(DMNDecisionServicesTest.class);
- public DMNDecisionServicesTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
-
- @Test
- public void testBasic() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void basic(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0004-decision-services.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_686f58d4-4ec3-4c65-8c06-0e4fd8983def", "Decision Services");
assertThat(dmnModel).isNotNull();
@@ -103,8 +102,10 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("A")).isEqualTo("inBinC");
}
- @Test
- public void testDSInLiteralExpression() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dSInLiteralExpression(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DecisionServicesInLiteralExpression.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_686f58d4-4ec3-4c65-8c06-0e4fd8983def", "Decision Services");
assertThat(dmnModel).isNotNull();
@@ -123,8 +124,10 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("Decide based on A and DS")).isEqualTo("xyde");
}
- @Test
- public void testDSInLiteralExpressionWithBKM() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dSInLiteralExpressionWithBKM(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DecisionServicesInLiteralExpressionWithBKM.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_686f58d4-4ec3-4c65-8c06-0e4fd8983def", "Decision Services");
assertThat(dmnModel).isNotNull();
@@ -143,8 +146,10 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("Decide based on A and DS")).isEqualTo("xydemn");
}
- @Test
- public void testDSInLiteralExpressionWithBKMUsingInvocation() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dSInLiteralExpressionWithBKMUsingInvocation(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DecisionServicesInLiteralExpressionWithBKMUsingInvocation.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_686f58d4-4ec3-4c65-8c06-0e4fd8983def", "Decision Services");
assertThat(dmnModel).isNotNull();
@@ -163,8 +168,10 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("Decide based on A and DS")).isEqualTo("xydemn");
}
- @Test
- public void testDSInLiteralExpressionOnlyfromBKMUsingInvocation() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dSInLiteralExpressionOnlyfromBKMUsingInvocation(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DecisionServicesInLiteralExpressionOnlyFromBKMUsingInvocation.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_686f58d4-4ec3-4c65-8c06-0e4fd8983def", "Decision Services");
assertThat(dmnModel).isNotNull();
@@ -183,8 +190,10 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("Decide based on A and DS")).isEqualTo("demn");
}
- @Test
- public void testMixtypeDS() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void mixtypeDS(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("mixtype-DS.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_c9885563-aa54-4c7b-ae8a-738cfd29b544", "mixtype DS");
assertThat(dmnModel).isNotNull();
@@ -276,8 +285,10 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
assertThat(result.getAll()).doesNotContainKey("hardcoded now");
}
- @Test
- public void testDSForTypeCheck() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dSForTypeCheck(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DecisionService20180718.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_6eef3a7c-bb0d-40bb-858d-f9067789c18a", "Decision Service 20180718");
assertThat(dmnModel).isNotNull();
@@ -344,8 +355,10 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
.as(DMNRuntimeUtil.formatMessages(dmnResult.getMessages())).isTrue();
}
- @Test
- public void testDSSingletonOrMultipleOutputDecisions() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dSSingletonOrMultipleOutputDecisions(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Decision-Services-singleton-or-multiple-output-decisions.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_b4ebfbf2-8608-4297-9662-be70bab01974", "Decision Services singleton or multiple output decisions");
assertThat(dmnModel).isNotNull();
@@ -383,8 +396,10 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResultMultiple.getContext().getAll()).doesNotContainKey("a Value"); // Decision Service will not expose (nor encapsulate hence not execute) this decision.
}
- @Test
- public void testDSSingletonOrMultipleOutputDecisions_OVERRIDE() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dSSingletonOrMultipleOutputDecisionsOVERRIDE(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
try {
System.setProperty(CoerceDecisionServiceSingletonOutputOption.PROPERTY_NAME, "false");
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Decision-Services-singleton-or-multiple-output-decisions.dmn", this.getClass());
@@ -431,8 +446,10 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
}
}
- @Test
- public void testImportDS() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void importDS(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2768 DMN Decision Service encapsulate Decision which imports a Decision Service
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("DecisionService20180718.dmn", this.getClass(), "ImportDecisionService20180718.dmn");
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_0ff3708a-c861-4a96-b85c-7b882f18b7a1", "Import Decision Service 20180718");
@@ -473,8 +490,10 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("final Import L1 decision")).isEqualTo("Hello, L1 Import Evaluate DS NAME the result of invoking the imported DS is: Hello, L1 Import Evaluate DS NAME; you are allowed");
}
- @Test
- public void testTransitiveImportDS() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void transitiveImportDS(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2768 DMN Decision Service encapsulate Decision which imports a Decision Service
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("DecisionService20180718.dmn", this.getClass(),
"ImportDecisionService20180718.dmn",
@@ -515,8 +534,10 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("Final L2 Decision")).isEqualTo("The result of invoking the L1 DS was: Hello, L2 Bob DS the result of invoking the imported DS is: Hello, L2 Bob DS; you are allowed");
}
- @Test
- public void testDecisionServiceCompiler20180830() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionServiceCompiler20180830(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2943 DMN DecisionServiceCompiler not correctly wired for DMNv1.2 format
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DecisionServiceABC.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_2443d3f5-f178-47c6-a0c9-b1fd1c933f60", "Drawing 1");
@@ -554,8 +575,10 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("ABC")).isEqualTo("abc");
}
- @Test
- public void testDecisionService20180920() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionService20180920(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-3005 DMN DecisionService having an imported requiredInput
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("DSWithImportRequiredInput20180920.dmn",
this.getClass(),
@@ -596,8 +619,10 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("Decision B")).isEqualTo("input 1 value");
}
- @Test
- public void test20190520() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void test20190520(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DStypecheck.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_6e76b9ca-ce06-426a-91c0-99b70665321a", "Drawing 1");
assertThat(dmnModel).isNotNull();
@@ -611,9 +636,11 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.hasErrors()).as(DMNRuntimeUtil.formatMessages(dmnResult.getMessages())).isFalse();
assertThat((Map<String, Object>) dmnResult.getDecisionResultByName("my invoke DS1").getResult()).containsEntry("outDS1", true);
}
-
- @Test
- public void testImportingBasic() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void importingBasic(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("0004-decision-services.dmn", this.getClass(), "importing0004.dmn");
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_346B2E00-71E5-4CEA-ADE1-7A0872481F38", "importing0004");
assertThat(dmnModel).isNotNull();
@@ -634,9 +661,11 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
final DMNContext result = dmnResult.getContext();
assertThat(result.get("Decision1")).isEqualTo("inBinC");
}
-
- @Test
- public void testImportingBoxedInvocation() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void importingBoxedInvocation(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("0004-decision-services.dmn", this.getClass(), "importing0004boxedInvocation.dmn");
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_346B2E00-71E5-4CEA-ADE1-7A0872481F38", "importing0004");
assertThat(dmnModel).isNotNull();
@@ -644,9 +673,11 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
assertSupplyingBandC(runtime, dmnModel);
}
-
- @Test
- public void testImportingBkmBoxedInvocation() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void importingBkmBoxedInvocation(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("0004-decision-services.dmn", this.getClass(), "importing0004bkmBoxedInvocation.dmn");
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_0CA8CCDE-106B-4805-B0C1-8D8D740C80F7", "importing0004bkmBoxedInvocation");
assertThat(dmnModel).isNotNull();
@@ -654,9 +685,11 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
assertSupplyingBandC(runtime, dmnModel);
}
-
- @Test
- public void testImportingWithSameDSName() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void importingWithSameDSName(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("myHelloDS.dmn", this.getClass(), "importingMyHelloDS.dmn");
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_3295867F-C02D-4312-849B-844F74C51ADE", "importingMyHelloDS");
assertThat(dmnModel).isNotNull();
@@ -676,9 +709,11 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
final DMNContext result = dmnResult.getContext();
assertThat(result.get("Decision1")).isEqualTo("Hello, John Doe");
}
-
- @Test
- public void testImportingWithSameDSNameBoxedInvocation() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void importingWithSameDSNameBoxedInvocation(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("myHelloDS.dmn", this.getClass(), "importingMyHelloDSboxedInvocation.dmn");
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_3295867F-C02D-4312-849B-844F74C51ADE", "importingMyHelloDS");
assertThat(dmnModel).isNotNull();
@@ -686,9 +721,11 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
assertSupplyingPersonname(runtime, dmnModel);
}
-
- @Test
- public void testImportingWithSameDSNameBKMBoxedInvocation() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void importingWithSameDSNameBKMBoxedInvocation(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("myHelloDS.dmn", this.getClass(), "importingMyHelloDSbkmBoxedInvocation.dmn");
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_3295867F-C02D-4312-849B-844F74C51ADE", "importingMyHelloDS");
assertThat(dmnModel).isNotNull();
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/decisionservices/DMNDecisionServicesTypecheckDSxyTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/decisionservices/DMNDecisionServicesTypecheckDSxyTest.java
index 75359cea75..1d73b4e3de 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/decisionservices/DMNDecisionServicesTypecheckDSxyTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/decisionservices/DMNDecisionServicesTypecheckDSxyTest.java
@@ -20,10 +20,9 @@ package org.kie.dmn.core.decisionservices;
import java.math.BigDecimal;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNDecisionResult.DecisionEvaluationStatus;
import org.kie.dmn.api.core.DMNModel;
@@ -40,7 +39,6 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.kie.dmn.core.util.DynamicTypeUtils.entry;
import static org.kie.dmn.core.util.DynamicTypeUtils.mapOf;
-@RunWith(Parameterized.class)
public class DMNDecisionServicesTypecheckDSxyTest {
public static final Logger LOG = LoggerFactory.getLogger(DMNDecisionServicesTypecheckDSxyTest.class);
@@ -51,23 +49,22 @@ public class DMNDecisionServicesTypecheckDSxyTest {
DMNResult apply(DMNRuntime runtime, DMNModel dmnModel, DMNContext context);
}
- public DMNDecisionServicesTypecheckDSxyTest(final TestEitherModelOrDS variant) {
+ public void initDMNDecisionServicesTypecheckDSxyTest(final TestEitherModelOrDS variant) {
fn = variant;
}
- @Parameterized.Parameters()
public static Object[] params() {
return new TestEitherModelOrDS[]{(runtime, dmnModel, context) -> runtime.evaluateAll(dmnModel, context),
(runtime, dmnModel, context) -> runtime.evaluateDecisionService(dmnModel, context, "DecisionService-1")};
}
- private final TestEitherModelOrDS fn;
+ private TestEitherModelOrDS fn;
private DMNRuntime runtime;
private DMNModel dmnModel;
- @Before()
- public void init() {
+ @BeforeEach()
+ void init() {
runtime = DMNRuntimeUtil.createRuntime("DSxy.dmn", this.getClass());
dmnModel = runtime.getModel("https://kiegroup.org/dmn/_127520A0-364A-4ADA-A012-3AB6A7E3585E", "DSxy");
@@ -75,8 +72,10 @@ public class DMNDecisionServicesTypecheckDSxyTest {
assertThat(dmnModel.hasErrors()).as(DMNRuntimeUtil.formatMessages(dmnModel.getMessages())).isFalse();
}
- @Test
- public void testDSParamsTConOK() {
+ @MethodSource("params")
+ @ParameterizedTest()
+ public void dSParamsTConOK(final TestEitherModelOrDS variant) {
+ initDMNDecisionServicesTypecheckDSxyTest(variant);
final DMNContext context = DMNFactory.newContext();
context.set("x", mapOf(entry("x", new BigDecimal(1)),
entry("y", new BigDecimal(2))));
@@ -89,9 +88,11 @@ public class DMNDecisionServicesTypecheckDSxyTest {
assertThat(dmnResult.getDecisionResultByName("Decision-1").getEvaluationStatus()).isEqualTo(DecisionEvaluationStatus.SUCCEEDED);
assertThat(dmnResult.getDecisionResultByName("Decision-1").getResult()).isEqualTo(new BigDecimal(1));
}
-
- @Test
- public void testDSParamsTConFAIL() {
+
+ @MethodSource("params")
+ @ParameterizedTest()
+ public void dSParamsTConFAIL(final TestEitherModelOrDS variant) {
+ initDMNDecisionServicesTypecheckDSxyTest(variant);
final DMNContext context = DMNFactory.newContext();
context.set("x", mapOf(entry("x", new BigDecimal(1))));
@@ -103,8 +104,10 @@ public class DMNDecisionServicesTypecheckDSxyTest {
assertThat(dmnResult.getDecisionResultByName("Decision-1").getEvaluationStatus()).isNotEqualTo(DecisionEvaluationStatus.SUCCEEDED);
}
- @Test
- public void testDSParamsTCoff() {
+ @MethodSource("params")
+ @ParameterizedTest()
+ public void dSParamsTCoff(final TestEitherModelOrDS variant) {
+ initDMNDecisionServicesTypecheckDSxyTest(variant);
// IMPORTANT !!
((DMNRuntimeImpl) runtime).setOption(new RuntimeTypeCheckOption(false));
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/decisiontable/DTListenerTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/decisiontable/DTListenerTest.java
index a7ceecc85b..27eb139fb8 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/decisiontable/DTListenerTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/decisiontable/DTListenerTest.java
@@ -18,15 +18,15 @@
*/
package org.kie.dmn.core.decisiontable;
-import static org.assertj.core.api.Assertions.assertThat;
-
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.assertj.core.api.SoftAssertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -40,14 +40,12 @@ import org.kie.dmn.model.api.DecisionTable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class DTListenerTest extends BaseInterpretedVsAlphaNetworkTest {
private static final String E1 = "e1";
- public DTListenerTest(boolean useAlphaNetwork) {
- super(useAlphaNetwork);
- }
-
public static final Logger LOG = LoggerFactory.getLogger(DTListenerTest.class);
public static class ExampleDTListener extends DefaultDMNRuntimeEventListener {
@@ -63,8 +61,10 @@ public class DTListenerTest extends BaseInterpretedVsAlphaNetworkTest {
}
}
- @Test
- public void test() {
+ @ParameterizedTest(name = "{0}")
+ @MethodSource("params")
+ void test(boolean useAlphaNetwork) {
+ alphaNetwork = useAlphaNetwork;
final ExampleDTListener listenerUT = new ExampleDTListener();
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("dtevent.dmn", this.getClass());
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/extra/DMNRecursionTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/extra/DMNRecursionTest.java
index d29f0227ff..32340e21e8 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/extra/DMNRecursionTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/extra/DMNRecursionTest.java
@@ -20,7 +20,8 @@ package org.kie.dmn.core.extra;
import java.math.BigDecimal;
-import org.junit.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -36,16 +37,14 @@ import static org.assertj.core.api.Assertions.assertThat;
public class DMNRecursionTest extends BaseInterpretedVsCompiledTest {
- public DMNRecursionTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
-
public static final Logger LOG = LoggerFactory.getLogger(DMNRecursionTest.class);
- @Test
- public void testBasicRecursion() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void basicRecursion(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("basicRecursion.dmn", this.getClass());
- runtime.addListener(new DMNRuntimeEventListener() {});
+ runtime.addListener(new DMNRuntimeEventListener(){});
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_16EF6BF4-9B59-40E8-8C99-A3A3D58B88CC", "factorial");
assertThat(dmnModel).isNotNull();
assertThat(dmnModel.hasErrors()).as(DMNRuntimeUtil.formatMessages(dmnModel.getMessages())).isFalse();
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/extra/YCombinatorTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/extra/YCombinatorTest.java
index 883ca518ab..e91c6862c2 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/extra/YCombinatorTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/extra/YCombinatorTest.java
@@ -20,7 +20,8 @@ package org.kie.dmn.core.extra;
import java.math.BigDecimal;
-import org.junit.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -34,14 +35,12 @@ import static org.assertj.core.api.Assertions.assertThat;
public class YCombinatorTest extends BaseInterpretedVsCompiledTest {
- public YCombinatorTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
-
public static final Logger LOG = LoggerFactory.getLogger(YCombinatorTest.class);
- @Test
- public void testY() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void y(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Y.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_2E160C58-B13A-4C35-B161-BB4B31E049B4",
"new-file");
@@ -61,8 +60,10 @@ public class YCombinatorTest extends BaseInterpretedVsCompiledTest {
new BigDecimal(5));
}
- @Test
- public void testYboxed() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void yboxed(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("Yboxed.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_2E160C58-B13A-4C35-B161-BB4B31E049B4",
"new-file");
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/impl/DMNContextFEELCtxWrapperTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/impl/DMNContextFEELCtxWrapperTest.java
index 9bfef51788..a0dd83951c 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/impl/DMNContextFEELCtxWrapperTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/impl/DMNContextFEELCtxWrapperTest.java
@@ -24,49 +24,57 @@ import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.api.core.DMNRuntime;
import org.kie.dmn.api.feel.runtime.events.FEELEvent;
import org.kie.dmn.api.feel.runtime.events.FEELEventListener;
import org.kie.dmn.core.BaseDMNContextTest;
import org.kie.dmn.feel.lang.EvaluationContext;
-public class DMNContextFEELCtxWrapperTest extends BaseDMNContextTest {
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+class DMNContextFEELCtxWrapperTest extends BaseDMNContextTest {
@Test
- public void testEmptyContext() {
+ void emptyContext() {
DMNContextFEELCtxWrapper ctx = new DMNContextFEELCtxWrapper(new EvaluationContextMock(Collections.emptyMap()));
testCloneAndAlter(ctx, Collections.emptyMap(), Collections.emptyMap());
}
@Test
- public void testContextWithEntries() {
+ void contextWithEntries() {
DMNContextFEELCtxWrapper ctx = new DMNContextFEELCtxWrapper(new EvaluationContextMock(DEFAULT_ENTRIES));
testCloneAndAlter(ctx, DEFAULT_ENTRIES, Collections.emptyMap());
}
@Test
- public void testContextWithEntriesAndMetadata() {
+ void contextWithEntriesAndMetadata() {
DMNContextFEELCtxWrapper ctx = new DMNContextFEELCtxWrapper(new EvaluationContextMock(DEFAULT_ENTRIES), DEFAULT_METADATA);
testCloneAndAlter(ctx, DEFAULT_ENTRIES, DEFAULT_METADATA);
}
- @Test(expected = UnsupportedOperationException.class)
- public void testPushScopeException() {
- DMNContextFEELCtxWrapper ctx = new DMNContextFEELCtxWrapper(new EvaluationContextMock(Collections.emptyMap()));
- ctx.pushScope("scopeName", "scopeNamespace");
+ @Test
+ void pushScopeException() {
+ assertThrows(UnsupportedOperationException.class, () -> {
+ DMNContextFEELCtxWrapper ctx = new DMNContextFEELCtxWrapper(new EvaluationContextMock(Collections.emptyMap()));
+ ctx.pushScope("scopeName", "scopeNamespace");
+ });
}
- @Test(expected = UnsupportedOperationException.class)
- public void testPopScopeException() {
- DMNContextFEELCtxWrapper ctx = new DMNContextFEELCtxWrapper(new EvaluationContextMock(Collections.emptyMap()));
- ctx.popScope();
+ @Test
+ void popScopeException() {
+ assertThrows(UnsupportedOperationException.class, () -> {
+ DMNContextFEELCtxWrapper ctx = new DMNContextFEELCtxWrapper(new EvaluationContextMock(Collections.emptyMap()));
+ ctx.popScope();
+ });
}
- @Test(expected = UnsupportedOperationException.class)
- public void testScopeNamespaceException() {
- DMNContextFEELCtxWrapper ctx = new DMNContextFEELCtxWrapper(new EvaluationContextMock(Collections.emptyMap()));
- ctx.scopeNamespace();
+ @Test
+ void scopeNamespaceException() {
+ assertThrows(UnsupportedOperationException.class, () -> {
+ DMNContextFEELCtxWrapper ctx = new DMNContextFEELCtxWrapper(new EvaluationContextMock(Collections.emptyMap()));
+ ctx.scopeNamespace();
+ });
}
private static class EvaluationContextMock implements EvaluationContext {
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/impl/DMNContextImplTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/impl/DMNContextImplTest.java
index 92cc885fa8..700b37f813 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/impl/DMNContextImplTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/impl/DMNContextImplTest.java
@@ -20,13 +20,13 @@ package org.kie.dmn.core.impl;
import java.util.Collections;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.core.BaseDMNContextTest;
-public class DMNContextImplTest extends BaseDMNContextTest {
+class DMNContextImplTest extends BaseDMNContextTest {
@Test
- public void testEmptyContext() {
+ void emptyContext() {
DMNContextImpl ctx1 = new DMNContextImpl();
testCloneAndAlter(ctx1, Collections.emptyMap(), Collections.emptyMap());
@@ -35,7 +35,7 @@ public class DMNContextImplTest extends BaseDMNContextTest {
}
@Test
- public void testContextWithEntries() {
+ void contextWithEntries() {
DMNContextImpl ctx1 = new DMNContextImpl(DEFAULT_ENTRIES);
testCloneAndAlter(ctx1, DEFAULT_ENTRIES, Collections.emptyMap());
@@ -44,7 +44,7 @@ public class DMNContextImplTest extends BaseDMNContextTest {
}
@Test
- public void testContextWithEntriesAndMetadata() {
+ void contextWithEntriesAndMetadata() {
DMNContextImpl ctx1 = new DMNContextImpl(DEFAULT_ENTRIES, DEFAULT_METADATA);
testCloneAndAlter(ctx1, DEFAULT_ENTRIES, DEFAULT_METADATA);
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/imports/ImportsTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/imports/ImportsTest.java
index 002a77781f..dee99fa9db 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/imports/ImportsTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/imports/ImportsTest.java
@@ -23,7 +23,9 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.function.Function;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -41,14 +43,12 @@ import static org.kie.dmn.core.util.DynamicTypeUtils.mapOf;
public class ImportsTest extends BaseInterpretedVsCompiledTest {
- public ImportsTest(final boolean useExecModelCompiler ) {
- super( useExecModelCompiler );
- }
-
public static final Logger LOG = LoggerFactory.getLogger(ImportsTest.class);
- @Test
- public void testImportDependenciesForDTInAContext() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void importDependenciesForDTInAContext(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Imported_Model.dmn",
this.getClass(),
"Import_BKM_and_have_a_Decision_Ctx_with_DT.dmn");
@@ -72,9 +72,11 @@ public class ImportsTest extends BaseInterpretedVsCompiledTest {
LOG.debug("{}", evaluateAll);
assertThat(evaluateAll.getDecisionResultByName("A Decision Ctx with DT").getResult()).isEqualTo("Respectfully, Hello John!");
}
-
- @Test
- public void testImport2BKMs() {
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void import2BKMs(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Do_say_hello_with_2_bkms.dmn",
this.getClass(),
"Saying_hello_2_bkms.dmn");
@@ -100,8 +102,10 @@ public class ImportsTest extends BaseInterpretedVsCompiledTest {
assertThat(evaluateAll.getDecisionResultByName("what about hello").getResult()).isEqualTo("Hello");
}
- @Test
- public void testImport2BKMsInvoke() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void import2BKMsInvoke(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Do_invoke_hello_with_2_bkms.dmn",
this.getClass(),
"Saying_hello_2_bkms.dmn");
@@ -125,8 +129,10 @@ public class ImportsTest extends BaseInterpretedVsCompiledTest {
assertThat(evaluateAll.getDecisionResultByName("invocation of hello").getResult()).isEqualTo("Hello, John");
}
- @Test
- public void testImport2BKMsInvokeUsingInputData() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void import2BKMsInvokeUsingInputData(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2746 DMN Invocation parameters resolution with imported function
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Do_invoke_hello_with_2_bkms_using_inputdata.dmn",
this.getClass(),
@@ -152,8 +158,10 @@ public class ImportsTest extends BaseInterpretedVsCompiledTest {
assertThat(evaluateAll.getDecisionResultByName("what about hello").getResult()).isEqualTo("Hello, Bob");
}
- @Test
- public void testImport3Levels() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void import3Levels(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("L3_Do_say_hello.dmn",
this.getClass(),
"Do_say_hello_with_2_bkms.dmn",
@@ -191,8 +199,10 @@ public class ImportsTest extends BaseInterpretedVsCompiledTest {
assertThat(evaluateAll.getDecisionResultByName("L3 what about hello").getResult()).isEqualTo("Hello");
}
- @Test
- public void testImportHardcodedDecisions() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void importHardcodedDecisions(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Spell_Greeting.dmn",
this.getClass(),
"Import_Spell_Greeting.dmn");
@@ -217,8 +227,10 @@ public class ImportsTest extends BaseInterpretedVsCompiledTest {
assertThat(evaluateAll.getDecisionResultByName("Say the Greeting to Person").getResult()).isEqualTo("Hello, John");
}
- @Test
- public void testImportTransitiveBaseModel() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void importTransitiveBaseModel(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Sayhello1ID1D.dmn",
this.getClass(),
"ModelB.dmn",
@@ -227,8 +239,10 @@ public class ImportsTest extends BaseInterpretedVsCompiledTest {
getAndAssertModelNoErrors(runtime, "http://www.trisotech.com/dmn/definitions/_ae5b3c17-1ac3-4e1d-b4f9-2cf861aec6d9", "Say hello 1ID1D");
}
- @Test
- public void testImportTransitiveEvaluate2Layers() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void importTransitiveEvaluate2Layers(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Sayhello1ID1D.dmn",
this.getClass(),
"ModelB.dmn",
@@ -246,8 +260,10 @@ public class ImportsTest extends BaseInterpretedVsCompiledTest {
assertThat(evaluateAll.getDecisionResultByName("Evaluating Say Hello").getResult()).isEqualTo("Evaluating Say Hello to: Hello, John");
}
- @Test
- public void testImportTransitiveEvaluate3Layers() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void importTransitiveEvaluate3Layers(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Sayhello1ID1D.dmn",
this.getClass(),
"ModelB.dmn",
@@ -266,8 +282,10 @@ public class ImportsTest extends BaseInterpretedVsCompiledTest {
assertThat(evaluateAll.getDecisionResultByName("Model C Decision based on Bs").getResult()).isEqualTo("B: Evaluating Say Hello to: Hello, B.A.John; B2:Evaluating Say Hello to: Hello, B2.A.John2");
}
- @Test
- public void testImportingID() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void importingID(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2944 DMN decision logic referencing DMN<import> InputData
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Sayhello1ID1D.dmn",
this.getClass(),
@@ -284,8 +302,10 @@ public class ImportsTest extends BaseInterpretedVsCompiledTest {
assertThat(evaluateAll.getDecisionResultByName("Hello decision using imported InputData").getResult()).isEqualTo("Hello, DROOLS-2944");
}
- @Test
- public void testAllowDMNAPItoEvaluateDirectDependencyImportedDecisions() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void allowDMNAPItoEvaluateDirectDependencyImportedDecisions(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-3012 Allow DMN API to evaluate direct-dependency imported Decisions
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Sayhello1ID1D.dmn",
this.getClass(),
@@ -317,8 +337,10 @@ public class ImportsTest extends BaseInterpretedVsCompiledTest {
assertThat(evaluateAll.getDecisionResultByName("modelA.Greet the Person").getResult()).isEqualTo("Hello, John");
}
- @Test
- public void testRetrieveDecisionByIDName() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void retrieveDecisionByIDName(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-3026
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Sayhello1ID1D.dmn",
this.getClass(),
@@ -340,8 +362,10 @@ public class ImportsTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnModel.getInputByName("modelA.Person name").getId()).isEqualTo("_4f6c136c-8512-4d71-8bbf-7c9eb6e74063"); // this is an imported InputData node.
}
- @Test
- public void testImportChain() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void importChain(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-3045 DMN model API to display namespace transitive import dependencies
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Sayhello1ID1D.dmn",
this.getClass(),
@@ -372,8 +396,10 @@ public class ImportsTest extends BaseInterpretedVsCompiledTest {
Arrays.asList("Model B", "modelA"));
}
- @Test
- public void testImportDependenciesBKMchain() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void importDependenciesBKMchain(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("base join.dmn",
this.getClass(),
"use join.dmn");
@@ -399,8 +425,10 @@ public class ImportsTest extends BaseInterpretedVsCompiledTest {
assertThat(evaluateAll.getDecisionResultByName("greet2").getResult()).isEqualTo("Hello, John Doe");
}
- @Test
- public void testImportInstanceOf() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void importInstanceOf(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("instanceof base model.dmn",
this.getClass(),
"instanceof checks.dmn");
@@ -433,8 +461,10 @@ public class ImportsTest extends BaseInterpretedVsCompiledTest {
assertThat(evaluateAll.getDecisionResultByName("is yes yes collection of ps?").getResult()).isEqualTo(Boolean.TRUE);
}
- @Test
- public void testImportCalculation() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void importCalculation(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("baseSum.dmn",
this.getClass(),
"importingSum.dmn");
@@ -460,8 +490,10 @@ public class ImportsTest extends BaseInterpretedVsCompiledTest {
assertThat(evaluateAll.getDecisionResultByName("importing Decision").getResult()).isEqualTo(new BigDecimal(3));
}
- @Test
- public void testImportAliasedWithDots() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void importAliasedWithDots(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("ComparatorModel.dmn",
this.getClass(),
"Import_ComparatorModel_and_alias_with_dots.dmn");
@@ -487,8 +519,10 @@ public class ImportsTest extends BaseInterpretedVsCompiledTest {
assertThat(evaluateAll.getDecisionResultByName("Is A Bigger?").getResult()).isEqualTo(Boolean.TRUE);
}
- @Test
- public void testImportContainingDotsAndAliasedWithDots() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void importContainingDotsAndAliasedWithDots(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("ComparatorModelNamedWithDots.dmn",
this.getClass(),
"Import_ComparatorModelNamedWithDots_and_alias_with_dots.dmn");
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/incrementalcompilation/DMNIncrementalCompilationTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/incrementalcompilation/DMNIncrementalCompilationTest.java
index 1a76c87c45..64e809bd5b 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/incrementalcompilation/DMNIncrementalCompilationTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/incrementalcompilation/DMNIncrementalCompilationTest.java
@@ -20,7 +20,9 @@ package org.kie.dmn.core.incrementalcompilation;
import java.lang.reflect.Method;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.api.KieServices;
import org.kie.api.builder.ReleaseId;
import org.kie.api.runtime.KieContainer;
@@ -30,6 +32,7 @@ import org.kie.dmn.api.core.DMNResult;
import org.kie.dmn.api.core.DMNRuntime;
import org.kie.dmn.core.BaseInterpretedVsCompiledTest;
import org.kie.dmn.core.api.DMNFactory;
+import org.kie.dmn.core.compiler.ExecModelCompilerOption;
import org.kie.dmn.core.util.DMNRuntimeUtil;
import org.kie.dmn.core.util.KieHelper;
import org.slf4j.Logger;
@@ -41,12 +44,10 @@ public class DMNIncrementalCompilationTest extends BaseInterpretedVsCompiledTest
public static final Logger LOG = LoggerFactory.getLogger(DMNIncrementalCompilationTest.class);
- public DMNIncrementalCompilationTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
-
- @Test
- public void testUpgrade() throws Exception {
+ @ParameterizedTest
+ @MethodSource("params")
+ void upgrade(boolean useExecModelCompiler) throws Exception {
+ init(useExecModelCompiler);
final KieServices ks = KieServices.Factory.get();
final ReleaseId releaseId_v10 = ks.newReleaseId("org.kie", "dmn-test-PR1997", "1.0");
@@ -101,8 +102,10 @@ public class DMNIncrementalCompilationTest extends BaseInterpretedVsCompiledTest
assertThat(result.get("Say hello and age")).isEqualTo(sayHelloAndAgeDecisionResultValue);// change v1.0 -> v1.1
}
- @Test
- public void testUpgradeWithImport() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void upgradeWithImport(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final KieServices ks = KieServices.Factory.get();
final ReleaseId releaseId_v10 = ks.newReleaseId("org.kie", "dmn-test-RHDM-965", "1.0");
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/incrementalcompilation/WBCompilationTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/incrementalcompilation/WBCompilationTest.java
index 91a77f011b..8172522b89 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/incrementalcompilation/WBCompilationTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/incrementalcompilation/WBCompilationTest.java
@@ -19,7 +19,7 @@
package org.kie.dmn.core.incrementalcompilation;
import org.drools.compiler.kie.builder.impl.DrlProject;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.api.KieServices;
import org.kie.api.builder.KieBuilder;
import org.kie.api.builder.KieFileSystem;
@@ -31,7 +31,7 @@ import org.kie.internal.builder.InternalKieBuilder;
import static org.assertj.core.api.Assertions.assertThat;
-public class WBCompilationTest {
+class WBCompilationTest {
static final String DMN_1 = "<?xml version=\"1.0\" ?>\n" +
"<dmn:definitions xmlns:dmn=\"https://www.omg.org/spec/DMN/20230324/MODEL/\" xmlns=\"https://github.com/kiegroup/drools/kie-dmn/_E084990F-18BF-4D46-8617-56CF6D8B86B6\" xmlns:di=\"http://www.omg.org/spec/DMN/20180521/DI/\" xmlns:kie=\"http://www.drools.org/kie/dmn/1.5\" xmlns:feel=\"http://www.omg.org/spec/DMN/20180521/FEEL/\" xmlns:dmndi=\"http://www.omg.org/spec/DMN/20180521/DMNDI/\" xmlns:dc=\"http://www.omg.org/spec/DMN/20180521/DC/\" id=\"_F325E2BC-256 [...]
@@ -78,7 +78,7 @@ public class WBCompilationTest {
"</dmn:definitions>";
@Test
- public void testSteppedCompilation() {
+ void steppedCompilation() {
KieServices ks = KieServices.Factory.get();
ReleaseId id = ks.newReleaseId("org.test", "foo", "1.0-SNAPSHOT");
@@ -100,7 +100,7 @@ public class WBCompilationTest {
}
@Test
- public void testSteppedCompilationFromEmptyKbuilder() {
+ void steppedCompilationFromEmptyKbuilder() {
// DROOLS-5584
KieServices ks = KieServices.Factory.get();
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/DMNRuntimeBuilderTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/DMNRuntimeBuilderTest.java
index e5e7141226..f10cec99ed 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/DMNRuntimeBuilderTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/DMNRuntimeBuilderTest.java
@@ -20,24 +20,24 @@ package org.kie.dmn.core.internal.utils;
import java.util.Collections;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.core.impl.DMNRuntimeImpl;
import static org.assertj.core.api.Assertions.assertThat;
-public class DMNRuntimeBuilderTest {
+class DMNRuntimeBuilderTest {
private DMNRuntimeBuilder dmnRuntimeBuilder;
- @Before
- public void setup() {
+ @BeforeEach
+ void setup() {
dmnRuntimeBuilder = DMNRuntimeBuilder.fromDefaults();
assertThat(dmnRuntimeBuilder).isNotNull();
}
@Test
- public void buildFromConfiguration() {
+ void buildFromConfiguration() {
final DMNRuntimeImpl retrieved = (DMNRuntimeImpl) dmnRuntimeBuilder
.buildConfiguration()
.fromResources(Collections.emptyList()).getOrElseThrow(RuntimeException::new);
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/DRGAnalysisUtilsTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/DRGAnalysisUtilsTest.java
index 9687c9ad47..8dab011a8c 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/DRGAnalysisUtilsTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/DRGAnalysisUtilsTest.java
@@ -21,7 +21,7 @@ package org.kie.dmn.core.internal.utils;
import java.util.Collection;
import java.util.stream.Collectors;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNRuntime;
import org.kie.dmn.core.BaseVariantTest;
@@ -47,7 +47,7 @@ public class DRGAnalysisUtilsTest {
}
@Test
- public void testCH11usingDMN13() throws Exception {
+ void ch11usingDMN13() throws Exception {
final DMNRuntime runtime = createRuntimeWithAdditionalResources("Chapter 11 Example.dmn", DMN13specificTest.class, "Financial.dmn");
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_9d01a0c4-f529-4ad8-ad8e-ec5fb5d96ad4", "Chapter 11 Example");
assertThat(dmnModel).isNotNull();
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/DynamicDMNContextBuilderTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/DynamicDMNContextBuilderTest.java
index 2eb2b21f77..8e80538019 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/DynamicDMNContextBuilderTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/DynamicDMNContextBuilderTest.java
@@ -28,7 +28,7 @@ import java.util.Map;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.json.JsonMapper;
import org.assertj.core.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -63,7 +63,7 @@ public class DynamicDMNContextBuilderTest {
}
@Test
- public void testOneOfEachType() throws Exception {
+ void oneOfEachType() throws Exception {
DMNRuntime runtime = createRuntime("OneOfEachType.dmn", DMNRuntimeTypesTest.class);
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_4f5608e9-4d74-4c22-a47e-ab657257fc9c", "OneOfEachType");
assertThat(dmnModel).isNotNull();
@@ -96,7 +96,7 @@ public class DynamicDMNContextBuilderTest {
}
@Test
- public void testNextDays() throws Exception {
+ void nextDays() throws Exception {
final DMNRuntime runtime = createRuntime("nextDays.dmn", DMNRuntimeTypesTest.class);
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_8A1F9719-02AA-4517-97D4-5C4F5D22FE82", "nextDays");
assertThat(dmnModel).isNotNull();
@@ -115,7 +115,7 @@ public class DynamicDMNContextBuilderTest {
}
@Test
- public void testTrafficViolationAll() throws Exception {
+ void trafficViolationAll() throws Exception {
final DMNRuntime runtime = createRuntimeWithAdditionalResources("Traffic Violation.dmn", DMNRuntimeTypesTest.class);
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF", "Traffic Violation");
assertThat(dmnModel).isNotNull();
@@ -145,7 +145,7 @@ public class DynamicDMNContextBuilderTest {
}
@Test
- public void testTrafficViolationMin() throws Exception {
+ void trafficViolationMin() throws Exception {
final DMNRuntime runtime = createRuntimeWithAdditionalResources("Traffic Violation.dmn", DMNRuntimeTypesTest.class);
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF", "Traffic Violation");
assertThat(dmnModel).isNotNull();
@@ -169,7 +169,7 @@ public class DynamicDMNContextBuilderTest {
}
@Test
- public void testTrafficViolationArbitraryFine() throws Exception {
+ void trafficViolationArbitraryFine() throws Exception {
final DMNRuntime runtime = createRuntimeWithAdditionalResources("Traffic Violation.dmn", DMNRuntimeTypesTest.class);
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF", "Traffic Violation");
assertThat(dmnModel).isNotNull();
@@ -206,7 +206,7 @@ public class DynamicDMNContextBuilderTest {
}
@Test
- public void testDSBasicDS1() throws Exception {
+ void dSBasicDS1() throws Exception {
final DMNRuntime runtime = createRuntime("0004-decision-services.dmn", DMNDecisionServicesTest.class);
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_686f58d4-4ec3-4c65-8c06-0e4fd8983def", "Decision Services");
assertThat(dmnModel).isNotNull();
@@ -223,7 +223,7 @@ public class DynamicDMNContextBuilderTest {
}
@Test
- public void testDSBasicDS2() throws Exception {
+ void dSBasicDS2() throws Exception {
final DMNRuntime runtime = createRuntime("0004-decision-services.dmn", DMNDecisionServicesTest.class);
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_686f58d4-4ec3-4c65-8c06-0e4fd8983def", "Decision Services");
assertThat(dmnModel).isNotNull();
@@ -238,9 +238,9 @@ public class DynamicDMNContextBuilderTest {
assertThat(dmnResult.hasErrors()).as(DMNRuntimeUtil.formatMessages(dmnResult.getMessages())).isFalse();
assertThat(dmnResult.getDecisionResultByName("A").getResult()).isEqualTo("inBinC");
}
-
+
@Test
- public void testFloatFromREST() throws Exception {
+ void floatFromREST() throws Exception {
final DMNRuntime runtime = createRuntime("numberRESTinLIST.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_91CAD4BC-859F-465A-9294-300EABF4EC8A", "numberRESTinLIST");
Assertions.assertThat(dmnModel).isNotNull();
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/MapBackedDMNContextTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/MapBackedDMNContextTest.java
index 0511554ccb..984d593f9e 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/MapBackedDMNContextTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/MapBackedDMNContextTest.java
@@ -21,13 +21,13 @@ package org.kie.dmn.core.internal.utils;
import java.util.Collections;
import java.util.HashMap;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.core.BaseDMNContextTest;
-public class MapBackedDMNContextTest extends BaseDMNContextTest {
+class MapBackedDMNContextTest extends BaseDMNContextTest {
@Test
- public void testEmptyContext() {
+ void emptyContext() {
MapBackedDMNContext ctx1 = MapBackedDMNContext.of(new HashMap<>(Collections.emptyMap()));
testCloneAndAlter(ctx1, Collections.emptyMap(), Collections.emptyMap());
@@ -36,7 +36,7 @@ public class MapBackedDMNContextTest extends BaseDMNContextTest {
}
@Test
- public void testContextWithEntries() {
+ void contextWithEntries() {
MapBackedDMNContext ctx1 = MapBackedDMNContext.of(new HashMap<>(DEFAULT_ENTRIES));
testCloneAndAlter(ctx1, DEFAULT_ENTRIES, Collections.emptyMap());
@@ -45,7 +45,7 @@ public class MapBackedDMNContextTest extends BaseDMNContextTest {
}
@Test
- public void testContextWithEntriesAndMetadata() {
+ void contextWithEntriesAndMetadata() {
MapBackedDMNContext ctx1 = MapBackedDMNContext.of(new HashMap<>(DEFAULT_ENTRIES), new HashMap<>(DEFAULT_METADATA));
testCloneAndAlter(ctx1, DEFAULT_ENTRIES, DEFAULT_METADATA);
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/MarshallingStubUtilsTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/MarshallingStubUtilsTest.java
index d05098f746..6cb7c18006 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/MarshallingStubUtilsTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/internal/utils/MarshallingStubUtilsTest.java
@@ -20,7 +20,9 @@ package org.kie.dmn.core.internal.utils;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -37,12 +39,10 @@ public class MarshallingStubUtilsTest extends BaseVariantTest {
public static final Logger LOG = LoggerFactory.getLogger(MarshallingStubUtilsTest.class);
- public MarshallingStubUtilsTest(VariantTestConf testConfig) {
- super(testConfig);
- }
-
- @Test
- public void testComparablePeriod() {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ void comparablePeriod(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("comparablePeriod.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_CB283B9C-8581-447E-8625-4D1186F0B3A6", "A1B0FA02-D1C4-4386-AF36-0280AA45A7B7");
assertThat(dmnModel).isNotNull();
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/pmml/DMNKiePMMLTrustyInvocationEvaluatorTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/pmml/DMNKiePMMLTrustyInvocationEvaluatorTest.java
index 4105cc1a41..d87c0e5bdb 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/pmml/DMNKiePMMLTrustyInvocationEvaluatorTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/pmml/DMNKiePMMLTrustyInvocationEvaluatorTest.java
@@ -30,8 +30,8 @@ import java.util.Random;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.kie.api.io.Resource;
import org.kie.api.pmml.PMML4Result;
import org.kie.api.pmml.PMMLRequestData;
@@ -50,7 +50,7 @@ import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-public class DMNKiePMMLTrustyInvocationEvaluatorTest {
+class DMNKiePMMLTrustyInvocationEvaluatorTest {
private static DMNKiePMMLTrustyInvocationEvaluator dmnKiePMMLTrustyInvocationEvaluator;
@@ -58,8 +58,8 @@ public class DMNKiePMMLTrustyInvocationEvaluatorTest {
private static final String pmmlFileName = pmmlFileNameNoSuffix + ".pmml";
private static final String model = "LogisticRegression";
- @Before
- public void setup() throws IOException {
+ @BeforeEach
+ void setup() throws IOException {
URL pmmlUrl = DMNKiePMMLTrustyInvocationEvaluatorTest.class.getResource(pmmlFileName);
assertThat(pmmlUrl).isNotNull();
String pmmlFilePath = pmmlUrl.getPath();
@@ -88,7 +88,7 @@ public class DMNKiePMMLTrustyInvocationEvaluatorTest {
}
@Test
- public void getPMML4Result() {
+ void getPMML4Result() {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
DMNRuntime dmnRuntimeMock = mock(DMNRuntime.class);
when(dmnRuntimeMock.getRootClassLoader()).thenReturn(classLoader);
@@ -101,7 +101,7 @@ public class DMNKiePMMLTrustyInvocationEvaluatorTest {
}
@Test
- public void getOutputFieldValues() {
+ void getOutputFieldValues() {
List<Object> values = getValues();
Map<String, Object> resultVariables = new HashMap<>();
for (int i = 0; i < values.size(); i++) {
@@ -118,7 +118,7 @@ public class DMNKiePMMLTrustyInvocationEvaluatorTest {
}
@Test
- public void getPredictedValues() {
+ void getPredictedValues() {
List<Object> values = getValues();
values.forEach(value -> {
PMML4Result result = getPMML4Result(value);
@@ -131,7 +131,7 @@ public class DMNKiePMMLTrustyInvocationEvaluatorTest {
}
@Test
- public void evaluate() {
+ void evaluate() {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
DMNRuntime dmnRuntimeMock = mock(DMNRuntime.class);
when(dmnRuntimeMock.getRootClassLoader()).thenReturn(classLoader);
@@ -143,7 +143,7 @@ public class DMNKiePMMLTrustyInvocationEvaluatorTest {
}
@Test
- public void compileFile() {
+ void compileFile() {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
Map<String, GeneratedResources> retrieved = dmnKiePMMLTrustyInvocationEvaluator.compileFile(pmmlFileName, classLoader);
assertThat(retrieved).isNotNull().isNotEmpty().containsKey("pmml");
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/stronglytyped/AnnotationsTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/stronglytyped/AnnotationsTest.java
index 240ea7fa1b..9dfab41fb9 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/stronglytyped/AnnotationsTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/stronglytyped/AnnotationsTest.java
@@ -28,7 +28,9 @@ import java.util.Arrays;
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -48,13 +50,11 @@ public class AnnotationsTest extends BaseVariantTest {
public static final Logger LOG = LoggerFactory.getLogger(AnnotationsTest.class);
private boolean strongly;
- public AnnotationsTest(VariantTestConf testConfig) {
- super(testConfig);
+ @ParameterizedTest
+ @MethodSource("params")
+ void nswe(VariantTestConf conf) throws Exception {
+ testConfig = conf;
strongly = testConfig.isTypeSafe();
- }
-
- @Test
- public void testNSWE() throws Exception {
final DMNRuntime runtime = createRuntime("NSEW.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_FBA17BF4-BC04-4C16-9305-40E8B4B2FECB", "NSEW");
assertThat(dmnModel).isNotNull();
@@ -85,8 +85,11 @@ public class AnnotationsTest extends BaseVariantTest {
}
}
- @Test
- public void testOneOfEachType() throws Exception {
+ @ParameterizedTest
+ @MethodSource("params")
+ void oneOfEachType(VariantTestConf conf) throws Exception {
+ testConfig = conf;
+ strongly = testConfig.isTypeSafe();
final DMNRuntime runtime = createRuntime("OneOfEachType.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_4f5608e9-4d74-4c22-a47e-ab657257fc9c", "OneOfEachType");
assertThat(dmnModel).isNotNull();
@@ -122,8 +125,11 @@ public class AnnotationsTest extends BaseVariantTest {
}
}
- @Test
- public void testNextDays() throws Exception {
+ @ParameterizedTest
+ @MethodSource("params")
+ void nextDays(VariantTestConf conf) throws Exception {
+ testConfig = conf;
+ strongly = testConfig.isTypeSafe();
final DMNRuntime runtime = createRuntime("nextDays.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_8A1F9719-02AA-4517-97D4-5C4F5D22FE82", "nextDays");
assertThat(dmnModel).isNotNull();
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/stronglytyped/DMNRuntimeTypesTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/stronglytyped/DMNRuntimeTypesTest.java
index ae3c16546f..452c6cd270 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/stronglytyped/DMNRuntimeTypesTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/stronglytyped/DMNRuntimeTypesTest.java
@@ -33,8 +33,9 @@ import java.util.stream.Collectors;
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
-
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNDecisionResult.DecisionEvaluationStatus;
import org.kie.dmn.api.core.DMNModel;
@@ -63,12 +64,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
public static final Logger LOG = LoggerFactory.getLogger(DMNRuntimeTypesTest.class);
- public DMNRuntimeTypesTest(VariantTestConf testConfig) {
- super(testConfig);
- }
-
- @Test
- public void testOneOfEachType() throws Exception {
+ @ParameterizedTest
+ @MethodSource("params")
+ void oneOfEachType(VariantTestConf conf) throws Exception {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("OneOfEachType.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_4f5608e9-4d74-4c22-a47e-ab657257fc9c", "OneOfEachType");
assertThat(dmnModel).isNotNull();
@@ -129,8 +128,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testJavaKeywords() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void javaKeywords(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("javaKeywords.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_C41C1676-0DA9-47EA-90AD-F9BAA257129F", "A1B1A8AD-B0DC-453D-86A7-C9475450C982");
assertThat(dmnModel).isNotNull();
@@ -154,8 +155,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testInnerComposite() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void innerComposite(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("innerComposite.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_641BCEBF-8D10-4E08-B47F-A9181C737A82", "new-file");
assertThat(dmnModel).isNotNull();
@@ -187,8 +190,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testFixInnerComposite() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void fixInnerComposite(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("fixInnerComposite.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_E82058C1-27D3-44F3-B1B3-4C02D17B7A05", "new-file");
assertThat(dmnModel).isNotNull();
@@ -211,8 +216,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testInnerCompositeCollection() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void innerCompositeCollection(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("innerCompositeCollection.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_D8AE5AF4-1F9E-4423-873A-B8F3C3BE5FE5", "new-file");
assertThat(dmnModel).isNotNull();
@@ -238,8 +245,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testInputAny() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void inputAny(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("inputAny.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_7D9140EF-DC52-4DC1-8983-9C2EC5B89BAE", "new-file");
assertThat(dmnModel).isNotNull();
@@ -260,8 +269,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testRecursiveEmployee() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void recursiveEmployee(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("recursiveEmployee.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_d1e3d83e-230d-42fb-bc58-313463f7f40b", "Drawing 1");
@@ -300,8 +311,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testListBasic() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void listBasic(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("listBasic.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_B84B17F3-3E84-4DED-996E-AA630A6BF9C4", "new-file");
assertThat(dmnModel).isNotNull();
@@ -334,8 +347,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testListBasic_LOVerror() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void listBasicLOVerror(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("listBasic.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_B84B17F3-3E84-4DED-996E-AA630A6BF9C4", "new-file");
assertThat(dmnModel).isNotNull();
@@ -368,8 +383,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testSameTypeNameMultiple() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void sameTypeNameMultiple(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntimeWithAdditionalResources("class_imported.dmn", this.getClass(), "class_importing.dmn");
final DMNModel dmnModel0 = runtime.getModel("http://www.trisotech.com/definitions/_b3deed2b-245f-4cc4-a4bf-1e95cd240664", "imported");
assertThat(dmnModel0).isNotNull();
@@ -398,8 +415,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testFieldCapitalization() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void fieldCapitalization(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntimeWithAdditionalResources("Traffic Violation.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF", "Traffic Violation");
assertThat(dmnModel).isNotNull();
@@ -457,8 +476,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testDecisionService() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionService(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("DecisionServiceABC_DMN12.dmn", DMNDecisionServicesTest.class);
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_2443d3f5-f178-47c6-a0c9-b1fd1c933f60", "Drawing 1");
assertThat(dmnModel).isNotNull();
@@ -512,8 +533,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testBKM() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void bkm(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("0009-invocation-arithmetic.dmn", DMNRuntimeTest.class);
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_cb28c255-91cd-4c01-ac7b-1a9cb1ecdb11", "literal invocation1");
assertThat(dmnModel).isNotNull();
@@ -552,8 +575,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testCapitalLetterConflict() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void capitalLetterConflict(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("capitalLetterConflict.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_B321C9B1-856E-45DE-B05D-5B4D4D301D37", "capitalLetterConflict");
assertThat(dmnModel).isNotNull();
@@ -593,8 +618,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testCapitalLetterConflictWithInputAndDecision() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void capitalLetterConflictWithInputAndDecision(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("capitalLetterConflictWithInputAndDecision.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_EE9DAFC0-D50D-4D23-8676-FF8A40E02919", "capitalLetterConflictWithInputAndDecision");
assertThat(dmnModel).isNotNull();
@@ -623,8 +650,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testCapitalLetterConflictItemDef() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void capitalLetterConflictItemDef(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("capitalLetterConflictItemDef.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_DA986720-823F-4334-8AB5-5CBA76FD1B9E", "capitalLetterConflictItemDef");
assertThat(dmnModel).isNotNull();
@@ -654,8 +683,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testShareTypeForInputAndOutput() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void shareTypeForInputAndOutput(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("shareTypeForInputAndOutput.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_DBEFBA7B-C568-4631-A89E-AA31F7C6564B", "shareTypeForInputAndOutput");
assertThat(dmnModel).isNotNull();
@@ -688,8 +719,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testTopLevelTypeCollection() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void topLevelTypeCollection(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("PersonListHelloBKM2.dmn", DMNRuntimeTest.class);
final DMNModel dmnModel = runtime.getModel(
"http://www.trisotech.com/definitions/_7e41a76e-2df6-4899-bf81-ae098757a3b6", "PersonListHelloBKM2");
@@ -723,8 +756,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testTopLevelCompositeCollection() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void topLevelCompositeCollection(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("topLevelCompositeCollection.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel(
"https://kiegroup.org/dmn/_3ED2F714-24F0-4764-88FA-04217901C05A", "topLevelCompositeCollection");
@@ -759,8 +794,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testComponentCollection() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void componentCollection(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("collections.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_2A93F258-EF3B-4150-A202-1D02A893DF2B", "collections");
assertThat(dmnModel).isNotNull();
@@ -805,8 +842,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testComponentCollectionPassTypedObject() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void componentCollectionPassTypedObject(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("collectionsPassTypedObject.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_10C4DB2B-1DCA-4B4F-A994-FA046AE5C7B0", "collectionsPassTypedObject");
assertThat(dmnModel).isNotNull();
@@ -852,8 +891,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- @Test
- public void testEvaluateByIdAndName() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void evaluateByIdAndName(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntimeWithAdditionalResources("2decisions.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_6453A539-85B5-4A4E-800E-6721C50B6B55", "2decisions");
assertThat(dmnModel).isNotNull();
@@ -905,7 +946,8 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
}
}
- public void testCollectionOfCollection() {
+ public void testCollectionOfCollection(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("topLevelColOfCol.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_74636626-ACB0-4A1F-9AD3-D4E0AFA1A24A", "topLevelColOfCol");
assertThat(dmnModel).isNotNull();
@@ -958,8 +1000,10 @@ public class DMNRuntimeTypesTest extends BaseVariantTest {
assertThat(personMap.get("age")).isIn(coerceNumber(21), coerceNumber(22), coerceNumber(23), coerceNumber(24));
}
- @Test
- public void testCollectionOfCollectionOfCollection() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void collectionOfCollectionOfCollection(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("topLevelColOfColOfCol.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_74636626-ACB0-4A1F-9AD3-D4E0AFA1A24A", "topLevelColOfColOfCol");
assertThat(dmnModel).isNotNull();
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/stronglytyped/DMNTypeSafeTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/stronglytyped/DMNTypeSafeTest.java
index 85585bd56e..363fbf0371 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/stronglytyped/DMNTypeSafeTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/stronglytyped/DMNTypeSafeTest.java
@@ -23,9 +23,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -41,15 +41,14 @@ import org.kie.memorycompiler.KieMemoryCompiler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import static org.assertj.core.api.Assertions.assertThat;
import static java.util.Arrays.asList;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.kie.dmn.core.BaseVariantTest.VariantTestConf.KIE_API_TYPECHECK_TYPESAFE;
import static org.kie.dmn.core.util.DynamicTypeUtils.entry;
import static org.kie.dmn.core.util.DynamicTypeUtils.mapOf;
public class DMNTypeSafeTest extends BaseVariantTest {
- @Parameterized.Parameters(name = "{0}")
public static Object[] params() {
return new Object[]{KIE_API_TYPECHECK_TYPESAFE};
}
@@ -62,12 +61,8 @@ public class DMNTypeSafeTest extends BaseVariantTest {
private DMNTypeSafePackageName.ModelFactory modelFactory;
- public DMNTypeSafeTest(VariantTestConf testConfig) {
- super(testConfig);
- }
-
- @Before
- public void setUp() {
+ @BeforeEach
+ void setUp() {
runtime = DMNRuntimeUtil.createRuntime("a.dmn", this.getClass());
String namespace = "http://www.trisotech.com/definitions/_2ceee5b6-0f0d-41ef-890e-2cd6fb1adb10";
String modelName = "Drawing 1";
@@ -77,8 +72,10 @@ public class DMNTypeSafeTest extends BaseVariantTest {
packageName = modelFactory.create(dmnModel);
}
- @Test
- public void test() throws Exception {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void test(VariantTestConf conf) throws Exception {
+ testConfig = conf;
assertValidDmnModel(dmnModel);
@@ -135,8 +132,10 @@ public class DMNTypeSafeTest extends BaseVariantTest {
return feelPropertyAccessible;
}
- @Test
- public void testDynamic() throws Exception {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void dynamic(VariantTestConf conf) throws Exception {
+ testConfig = conf;
assertValidDmnModel(dmnModel);
@@ -174,8 +173,10 @@ public class DMNTypeSafeTest extends BaseVariantTest {
assertThat(dContext.get("the person")).isEqualTo(context.getFEELProperty("p").toOptional().get());
}
- @Test
- public void testMetadata() throws Exception {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void metadata(VariantTestConf conf) throws Exception {
+ testConfig = conf;
assertValidDmnModel(dmnModel);
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/stronglytyped/JavadocTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/stronglytyped/JavadocTest.java
index e6c0af2648..13270a3e73 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/stronglytyped/JavadocTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/stronglytyped/JavadocTest.java
@@ -27,8 +27,8 @@ import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.ast.body.FieldDeclaration;
import com.github.javaparser.ast.comments.JavadocComment;
import org.drools.util.StringUtils;
-import org.junit.Test;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNRuntime;
import org.kie.dmn.core.BaseVariantTest;
@@ -45,17 +45,14 @@ public class JavadocTest extends BaseVariantTest {
public static final Logger LOG = LoggerFactory.getLogger(JavadocTest.class);
- public JavadocTest(VariantTestConf testConfig) {
- super(testConfig);
- }
-
- @Parameterized.Parameters(name = "{0}")
public static Object[] params() {
return new Object[]{BUILDER_DEFAULT_NOCL_TYPECHECK_TYPESAFE, KIE_API_TYPECHECK_TYPESAFE};
}
- @Test
- public void testDateAndTime() throws Exception {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void dateAndTime(VariantTestConf conf) throws Exception {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("0007-date-time.dmn", DMNRuntimeTest.class);
runtime.addListener(DMNRuntimeUtil.createListener());
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/typeref/DMNTyperefTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/typeref/DMNTyperefTest.java
index 2050c2a993..98d7182403 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/typeref/DMNTyperefTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/typeref/DMNTyperefTest.java
@@ -21,7 +21,9 @@ package org.kie.dmn.core.typeref;
import java.math.BigDecimal;
import java.util.List;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNMessage;
import org.kie.dmn.api.core.DMNMessageType;
@@ -40,14 +42,12 @@ import static org.kie.dmn.core.util.DynamicTypeUtils.mapOf;
public class DMNTyperefTest extends BaseInterpretedVsCompiledTest {
- public DMNTyperefTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
-
public static final Logger LOG = LoggerFactory.getLogger(DMNTyperefTest.class);
- @Test
- public void testCircular3() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void circular3(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("circular3.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_EEE7FA5B-AF9C-4937-8870-D612D4D8D860", "new-file");
assertThat(dmnModel).isNotNull();
@@ -64,8 +64,10 @@ public class DMNTyperefTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("Decision-1")).isEqualTo("named John Doe age 40 ext age 41");
}
- @Test
- public void testGenFn1() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void genFn1(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("wireGenFnType1.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_10795E58-CD3F-4203-B4D7-C80D9D8BE7BD", "wireGenFnType1");
assertThat(dmnModel).isNotNull();
@@ -83,36 +85,46 @@ public class DMNTyperefTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("Decision-1")).isEqualTo("Hello, World!");
}
- @Test
- public void test_bkmWrongFnType() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void bkm_wrong_fn_type(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("bkmWrongFnType.dmn", this.getClass());
assertThat(messages).isNotNull().isNotEmpty();
assertThat(messages.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.TYPEREF_MISMATCH))).isTrue();
}
- @Test
- public void test_bkmWrongFnType2() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void bkm_wrong_fn_type2(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("bkmWrongFnType2.dmn", this.getClass());
assertThat(messages).isNotNull().isNotEmpty();
assertThat(messages.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.PARAMETER_MISMATCH))).isTrue();
}
- @Test
- public void test_bkmWrongFnType3() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void bkm_wrong_fn_type3(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("bkmWrongFnType3.dmn", this.getClass());
assertThat(messages).isNotNull().isNotEmpty();
assertThat(messages.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.PARAMETER_MISMATCH))).isTrue();
}
- @Test
- public void test_bkmWrongFnType4() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void bkm_wrong_fn_type4(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("bkmWrongFnType4.dmn", this.getClass());
assertThat(messages).isNotNull().isNotEmpty();
assertThat(messages.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.PARAMETER_MISMATCH))).isTrue();
}
- @Test
- public void testGenFn2() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void genFn2(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("wireGenFnType2.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_10795E58-CD3F-4203-B4D7-C80D9D8BE7BD", "wireGenFnType2");
assertThat(dmnModel).isNotNull();
@@ -130,8 +142,10 @@ public class DMNTyperefTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("Decision-1")).isEqualTo("Hello, World!");
}
- @Test
- public void test_dsWrongFnType() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void ds_wrong_fn_type(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("dsWrongFnType.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_10795E58-CD3F-4203-B4D7-C80D9D8BE7BD", "dsWrongFnType");
assertThat(dmnModel).isNotNull();
@@ -145,50 +159,64 @@ public class DMNTyperefTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getMessages()).as(DMNRuntimeUtil.formatMessages(dmnResult.getMessages())).isNotEmpty();
}
- @Test
- public void test_dsWrongFnType2() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void ds_wrong_fn_type2(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("dsWrongFnType2.dmn", this.getClass());
assertThat(messages).isNotNull().isNotEmpty();
assertThat(messages.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.PARAMETER_MISMATCH))).isTrue();
}
- @Test
- public void test_dsWrongFnType3() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void ds_wrong_fn_type3(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("dsWrongFnType3.dmn", this.getClass());
assertThat(messages).isNotNull().isNotEmpty();
assertThat(messages.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.PARAMETER_MISMATCH))).isTrue();
}
- @Test
- public void test_dsWrongFnType4() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void ds_wrong_fn_type4(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("dsWrongFnType4.dmn", this.getClass());
assertThat(messages).isNotNull().isNotEmpty();
assertThat(messages.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.PARAMETER_MISMATCH))).isTrue();
}
- @Test
- public void test_dsWrongFnType5() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void ds_wrong_fn_type5(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("dsWrongFnType5.dmn", this.getClass());
assertThat(messages).isNotNull().isNotEmpty();
assertThat(messages.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.TYPEREF_MISMATCH))).isTrue();
}
- @Test
- public void test_dsWrongFnType6() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void ds_wrong_fn_type6(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("dsWrongFnType6.dmn", this.getClass());
assertThat(messages).isNotNull().isNotEmpty();
assertThat(messages.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.TYPEREF_MISMATCH))).isTrue();
}
- @Test
- public void test_dsWrongFnType7() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void ds_wrong_fn_type7(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("dsWrongFnType7.dmn", this.getClass());
assertThat(messages).isNotNull().isNotEmpty();
assertThat(messages.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.TYPEREF_MISMATCH))).isTrue();
}
- @Test
- public void testGenFn3() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void genFn3(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("wireGenFnType3.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_10795E58-CD3F-4203-B4D7-C80D9D8BE7BD", "wireGenFnType3");
assertThat(dmnModel).isNotNull();
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/util/CoerceUtilTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/util/CoerceUtilTest.java
index c2d829b9b0..51998a82d5 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/util/CoerceUtilTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/util/CoerceUtilTest.java
@@ -6,17 +6,19 @@ import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.util.Collections;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.api.core.DMNType;
import org.kie.dmn.core.impl.SimpleTypeImpl;
import org.kie.dmn.feel.lang.types.BuiltInType;
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
-public class CoerceUtilTest {
+class CoerceUtilTest {
@Test
- public void coerceValueCollectionToArrayConverted() {
+ void coerceValueCollectionToArrayConverted() {
Object item = "TESTED_OBJECT";
Object value = Collections.singleton(item);
DMNType requiredType = new SimpleTypeImpl("http://www.omg.org/spec/DMN/20180521/FEEL/",
@@ -33,7 +35,7 @@ public class CoerceUtilTest {
}
@Test
- public void coerceValueCollectionToArrayNotConverted() {
+ void coerceValueCollectionToArrayNotConverted() {
Object item = "TESTED_OBJECT";
Object value = Collections.singleton(item);
DMNType requiredType = new SimpleTypeImpl("http://www.omg.org/spec/DMN/20180521/FEEL/",
@@ -80,7 +82,7 @@ public class CoerceUtilTest {
}
@Test
- public void coerceValueDateToDateTimeConverted() {
+ void coerceValueDateToDateTimeConverted() {
Object value = LocalDate.now();
DMNType requiredType = new SimpleTypeImpl("http://www.omg.org/spec/DMN/20180521/FEEL/",
"date and time",
@@ -102,7 +104,7 @@ public class CoerceUtilTest {
}
@Test
- public void coerceValueDateToDateTimeNotConverted() {
+ void coerceValueDateToDateTimeNotConverted() {
Object value = "TEST_OBJECT";
DMNType requiredType = new SimpleTypeImpl("http://www.omg.org/spec/DMN/20180521/FEEL/",
"date and time",
@@ -130,7 +132,7 @@ public class CoerceUtilTest {
}
@Test
- public void actualCoerceValueCollectionToArray() {
+ void actualCoerceValueCollectionToArray() {
Object item = "TESTED_OBJECT";
Object value = Collections.singleton(item);
DMNType requiredType = new SimpleTypeImpl("http://www.omg.org/spec/DMN/20180521/FEEL/",
@@ -147,7 +149,7 @@ public class CoerceUtilTest {
}
@Test
- public void actualCoerceValueDateToDateTime() {
+ void actualCoerceValueDateToDateTime() {
Object value = LocalDate.now();
DMNType requiredType = new SimpleTypeImpl("http://www.omg.org/spec/DMN/20180521/FEEL/",
"date and time",
@@ -169,7 +171,7 @@ public class CoerceUtilTest {
}
@Test
- public void actualCoerceValueNotConverted() {
+ void actualCoerceValueNotConverted() {
Object value = BigDecimal.valueOf(1L);
DMNType requiredType = new SimpleTypeImpl("http://www.omg.org/spec/DMN/20180521/FEEL/",
"number",
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_2/DMN12specificTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_2/DMN12specificTest.java
index 72f196e0a0..f778389282 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_2/DMN12specificTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_2/DMN12specificTest.java
@@ -25,7 +25,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -44,12 +45,10 @@ public class DMN12specificTest extends BaseInterpretedVsCompiledTest {
public static final Logger LOG = LoggerFactory.getLogger(DMN12specificTest.class);
- public DMN12specificTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
-
- @Test
- public void testDMN12typeAliases() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dmn12typeAliases(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("typeAliases.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_9f6be450-17c0-49d9-a67f-960ad04b046f", "Drawing 1");
@@ -67,8 +66,10 @@ public class DMN12specificTest extends BaseInterpretedVsCompiledTest {
assertThat(result.get("a decision")).isEqualTo(LocalDateTime.of(2018, 9, 28, 16, 7).plusDays(1));
}
- @Test
- public void testItemDefCollection() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void itemDefCollection(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0001-filter.dmn", getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_f52ca843-504b-4c3b-a6bc-4d377bffef7a", "filter01");
assertThat(dmnModel).isNotNull();
@@ -96,14 +97,18 @@ public class DMN12specificTest extends BaseInterpretedVsCompiledTest {
assertThat(dmnResult.getContext().get("filter01")).asList().containsExactly("Adams", "Ford");
}
- @Test
- public void testDMN12typeRefInformationItem() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dmn12typeRefInformationItem(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-3544
check_testDMN12typeRefInformationItem("typeRefInformationItem_original.dmn");
}
- @Test
- public void testDMN12typeRefInformationItem_modified() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dmn12typeRefInformationItemModified(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-3544
check_testDMN12typeRefInformationItem("typeRefInformationItem_modified.dmn");
}
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_2/DMNDecisionServicesTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_2/DMNDecisionServicesTest.java
index 3303c49537..7bee8b40e7 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_2/DMNDecisionServicesTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_2/DMNDecisionServicesTest.java
@@ -18,7 +18,8 @@
*/
package org.kie.dmn.core.v1_2;
-import org.junit.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNRuntime;
import org.kie.dmn.core.BaseInterpretedVsCompiledTest;
@@ -32,12 +33,10 @@ public class DMNDecisionServicesTest extends BaseInterpretedVsCompiledTest {
public static final Logger LOG = LoggerFactory.getLogger(DMNDecisionServicesTest.class);
- public DMNDecisionServicesTest(final boolean useExecModelCompiler) {
- super(useExecModelCompiler);
- }
-
- @Test
- public void testDecisionServiceCompiler20180830_DMN12() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void decisionServiceCompiler20180830DMN12(boolean useExecModelCompiler) {
+ init(useExecModelCompiler);
// DROOLS-2943 DMN DecisionServiceCompiler not correctly wired for DMNv1.2 format
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("DecisionServiceABC_DMN12.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_2443d3f5-f178-47c6-a0c9-b1fd1c933f60", "Drawing 1");
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_3/DMN13specificTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_3/DMN13specificTest.java
index 3d3f4a227f..d2b4194c3f 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_3/DMN13specificTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_3/DMN13specificTest.java
@@ -21,7 +21,8 @@ package org.kie.dmn.core.v1_3;
import java.math.BigDecimal;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNMessage.Severity;
import org.kie.dmn.api.core.DMNModel;
@@ -43,12 +44,10 @@ public class DMN13specificTest extends BaseVariantTest {
public static final Logger LOG = LoggerFactory.getLogger(DMN13specificTest.class);
- public DMN13specificTest(final BaseVariantTest.VariantTestConf conf) {
- super(conf);
- }
-
- @Test
- public void testDMNv1_3_simple() {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ void dMNv13Simple(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("simple.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_9d01a0c4-f529-4ad8-ad8e-ec5fb5d96ad4", "Chapter 11 Example");
assertThat(dmnModel).isNotNull();
@@ -71,8 +70,10 @@ public class DMN13specificTest extends BaseVariantTest {
}
}
- @Test
- public void testDMNv1_3_ch11() {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ void dMNv13Ch11(VariantTestConf conf) {
+ testConfig = conf;
testName = "testDMNv1_3_ch11";
final DMNRuntime runtime = createRuntimeWithAdditionalResources("Chapter 11 Example.dmn", this.getClass(), "Financial.dmn");
@@ -111,8 +112,10 @@ public class DMN13specificTest extends BaseVariantTest {
}
}
- @Test
- public void testDMNv1_3_ch11_asSpecInputDataValues() {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ void dMNv13Ch11AsSpecInputDataValues(VariantTestConf conf) {
+ testConfig = conf;
testName = "testDMNv1_3_ch11_asSpecInputDataValues";
final DMNRuntime runtime = createRuntimeWithAdditionalResources("Chapter 11 Example.dmn", this.getClass(), "Financial.dmn");
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_9d01a0c4-f529-4ad8-ad8e-ec5fb5d96ad4", "Chapter 11 Example");
@@ -150,8 +153,10 @@ public class DMN13specificTest extends BaseVariantTest {
}
}
- @Test
- public void testBKMencapsulatedlogictyperef() {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ void bKMencapsulatedlogictyperef(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("bkmELTyperef.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_a49df6fc-c936-467a-9762-9aa3c9a93c06", "Drawing 1");
assertThat(dmnModel).isNotNull();
@@ -172,9 +177,11 @@ public class DMN13specificTest extends BaseVariantTest {
assertThat(allProperties.get("Decision1")).isEqualTo(new BigDecimal("3"));
}
}
-
- @Test
- public void testBKMFnTypeVirtuous() {
+
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ void bkmFnTypeVirtuous(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("bkmFnTypeVirtuous.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_563323ba-325e-4a3f-938f-369854010eaf", "Drawing 1");
assertThat(dmnModel).isNotNull();
@@ -190,9 +197,11 @@ public class DMN13specificTest extends BaseVariantTest {
final DMNContext result = dmnResult.getContext();
assertThat(result.get("do greet the name")).isEqualTo("Hello, John");
}
-
- @Test
- public void testBKMFnTypeWrongEL() {
+
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ void bkmFnTypeWrongEL(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("bkmFnTypeWrongEL.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_563323ba-325e-4a3f-938f-369854010eaf", "Drawing 1");
assertThat(dmnModel).isNotNull();
@@ -208,9 +217,11 @@ public class DMN13specificTest extends BaseVariantTest {
final DMNContext result = dmnResult.getContext();
assertThat(result.get("do greet the name")).isEqualTo("Hello, John");
}
-
- @Test
- public void testBKMWrongELExpr() {
+
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ void bkmWrongELExpr(VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("bkmWrongELExprType.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_563323ba-325e-4a3f-938f-369854010eaf", "Drawing 1");
assertThat(dmnModel).isNotNull();
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_3/DMN13specificTestNonTypesafe.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_3/DMN13specificTestNonTypesafe.java
index 83da10019b..4e4fbe544c 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_3/DMN13specificTestNonTypesafe.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_3/DMN13specificTestNonTypesafe.java
@@ -21,7 +21,8 @@ package org.kie.dmn.core.v1_3;
import java.math.BigDecimal;
import java.util.Arrays;
-import org.junit.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -40,12 +41,10 @@ public class DMN13specificTestNonTypesafe extends BaseVariantNonTypeSafeTest {
public static final Logger LOG = LoggerFactory.getLogger(DMN13specificTestNonTypesafe.class);
- public DMN13specificTestNonTypesafe(final VariantTestConf conf) {
- super(conf);
- }
-
- @Test
- public void testDMNv1_3_ch11_Example2() {
+ @ParameterizedTest
+ @MethodSource("params")
+ void dMNv13Ch11Example2(VariantTestConf conf) {
+ testConfig = conf;
testName = "testDMNv1_3_ch11_Example2";
final DMNRuntime runtime = createRuntimeWithAdditionalResources("Recommended Loan Products.dmn", this.getClass(), "Loan info.dmn");
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_4/DMN14ExpressionsTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_4/DMN14ExpressionsTest.java
index f5566dd6e4..b684c947a0 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_4/DMN14ExpressionsTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_4/DMN14ExpressionsTest.java
@@ -24,9 +24,9 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNMessageType;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -47,26 +47,22 @@ public class DMN14ExpressionsTest extends BaseVariantTest {
private DMNRuntime runtime;
private DMNModel model;
- public DMN14ExpressionsTest(final BaseVariantTest.VariantTestConf conf) {
- super(conf);
- }
-
- @Parameterized.Parameters(name = "{0}")
public static Object[] params() {
return new Object[]{KIE_API_TYPECHECK, BUILDER_DEFAULT_NOCL_TYPECHECK}; // only variants needed until DMNv1.4 is actually published
}
-
-
- @Before
- public void setup() {
+
+ void setup() {
runtime = createRuntime("dmn14expressions.dmn", DMN14ExpressionsTest.class);
assertThat(runtime).isNotNull();
model = runtime.getModel("http://www.trisotech.com/definitions/_3404349f-5046-4ad3-ad15-7f1e27291ab5", "DMN 1.4 expressions");
assertThat(model).isNotNull();
}
- @Test
- public void testConditionalWithInput() throws Throwable {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void conditionalWithInput(final BaseVariantTest.VariantTestConf conf) throws Throwable {
+ testConfig = conf;
+ setup();
DMNResult results = runtime.evaluateByName(model, new DMNContextImpl(Collections.singletonMap("Boolean Input", true)), "Conditional");
assertThat(results.getDecisionResultByName("Conditional").getResult()).isEqualTo("Conditional evaluated to TRUE");
@@ -78,16 +74,22 @@ public class DMN14ExpressionsTest extends BaseVariantTest {
}
- @Test
- public void testConditionalNonBooleanIf() throws Throwable {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void conditionalNonBooleanIf(final BaseVariantTest.VariantTestConf conf) throws Throwable {
+ testConfig = conf;
+ setup();
DMNResult results = runtime.evaluateByName(model, new DMNContextImpl(), "Non boolean");
assertThat(results.getMessages()).hasSize(1);
assertThat(results.getMessages().iterator().next().getMessageType()).isEqualTo(DMNMessageType.ERROR_EVAL_NODE);
}
- @Test
- public void testIteratorFor() throws Throwable {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void iteratorFor(final BaseVariantTest.VariantTestConf conf) throws Throwable {
+ testConfig = conf;
+ setup();
DMNResult results = runtime.evaluateByName(model, new DMNContextImpl(Collections.singletonMap("Number Input", 1)), "Addition");
assertThat(results.getDecisionResultByName("Addition").getResult().toString()).isEqualTo(Arrays.asList(2, 3, 4, 5).toString());
@@ -95,36 +97,48 @@ public class DMN14ExpressionsTest extends BaseVariantTest {
assertThat(results.getDecisionResultByName("Addition").getResult().toString()).isEqualTo(Arrays.asList(3, 4, 5, 6).toString());
}
- @Test
- public void testIteratorForPartial() throws Throwable {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void iteratorForPartial(final BaseVariantTest.VariantTestConf conf) throws Throwable {
+ testConfig = conf;
+ setup();
DMNResult results = runtime.evaluateByName(model, new DMNContextImpl(Collections.singletonMap("Number Input", 0)), "Addition Partial");
assertThat(results.getDecisionResultByName("Addition Partial").getResult().toString()).isEqualTo(Arrays.asList(1, 3, 6, 10).toString());
results = runtime.evaluateByName(model, new DMNContextImpl(Collections.singletonMap("Number Input", 5)), "Addition Partial");
assertThat(results.getDecisionResultByName("Addition Partial").getResult().toString()).isEqualTo(Arrays.asList(1, 8, 16, 25).toString());
}
-
- @Test
- public void testIteratorForInRangeClose() throws Throwable {
+
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void iteratorForInRangeClose(final BaseVariantTest.VariantTestConf conf) throws Throwable {
+ testConfig = conf;
+ setup();
DMNResult results = runtime.evaluateByName(model, new DMNContextImpl(Collections.singletonMap("Number Input", 1)), "Addition Range Close");
assertThat(results.getDecisionResultByName("Addition Range Close").getResult().toString()).isEqualTo(Arrays.asList(3, 4).toString());
results = runtime.evaluateByName(model, new DMNContextImpl(Collections.singletonMap("Number Input", 2)), "Addition Range Close");
assertThat(results.getDecisionResultByName("Addition Range Close").getResult().toString()).isEqualTo(Arrays.asList(4, 5).toString());
- }
+ }
- @Test
- public void testIteratorForInRangeOpen() throws Throwable {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void iteratorForInRangeOpen(final BaseVariantTest.VariantTestConf conf) throws Throwable {
+ testConfig = conf;
+ setup();
DMNResult results = runtime.evaluateByName(model, new DMNContextImpl(Collections.singletonMap("Number Input", 1)), "Addition Range Open");
assertThat(results.getDecisionResultByName("Addition Range Open").getResult().toString()).isEqualTo(Arrays.asList(2, 3, 4, 5).toString());
results = runtime.evaluateByName(model, new DMNContextImpl(Collections.singletonMap("Number Input", 2)), "Addition Range Open");
assertThat(results.getDecisionResultByName("Addition Range Open").getResult().toString()).isEqualTo(Arrays.asList(3, 4, 5, 6).toString());
- }
+ }
-
- @Test
- public void testIteratorSome() throws Throwable {
+
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void iteratorSome(final BaseVariantTest.VariantTestConf conf) throws Throwable {
+ testConfig = conf;
+ setup();
DMNResult results = runtime.evaluateByName(model, new DMNContextImpl(Collections.singletonMap("Number Input", 5)), "Number Greater Exists");
assertThat(((Boolean) results.getDecisionResultByName("Number Greater Exists").getResult()).booleanValue()).isTrue();
@@ -135,8 +149,11 @@ public class DMN14ExpressionsTest extends BaseVariantTest {
assertThat(((Boolean) results.getDecisionResultByName("Number Greater Exists").getResult()).booleanValue()).isFalse();
}
- @Test
- public void testIteratorEvery() throws Throwable {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void iteratorEvery(final BaseVariantTest.VariantTestConf conf) throws Throwable {
+ testConfig = conf;
+ setup();
DMNResult results = runtime.evaluateByName(model, new DMNContextImpl(Collections.singletonMap("Number Input", 5)), "All Greater");
assertThat(((Boolean) results.getDecisionResultByName("All Greater").getResult()).booleanValue()).isFalse();
@@ -147,8 +164,11 @@ public class DMN14ExpressionsTest extends BaseVariantTest {
assertThat(((Boolean) results.getDecisionResultByName("All Greater").getResult()).booleanValue()).isFalse();
}
- @Test
- public void testFilterIndex() throws Throwable {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void filterIndex(final BaseVariantTest.VariantTestConf conf) throws Throwable {
+ testConfig = conf;
+ setup();
DMNResult results = runtime.evaluateByName(model, new DMNContextImpl(Collections.singletonMap("Number Input", 5)), "Match by index");
assertThat(results.getDecisionResultByName("Match by index").getResult()).isEqualTo(new BigDecimal(5));
@@ -160,8 +180,11 @@ public class DMN14ExpressionsTest extends BaseVariantTest {
}
- @Test
- public void testFilterExpression() throws Throwable {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void filterExpression(final BaseVariantTest.VariantTestConf conf) throws Throwable {
+ testConfig = conf;
+ setup();
DMNResult results = runtime.evaluateByName(model, new DMNContextImpl(Collections.singletonMap("Number Input", 5)), "Match by Fnct");
assertThat(results.getDecisionResultByName("Match by Fnct").getResult().toString()).isEqualTo(Arrays.asList(6, 7, 8, 9, 10).toString());
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_4/DMN14GenericSynthTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_4/DMN14GenericSynthTest.java
index beacc0e039..a9134471fa 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_4/DMN14GenericSynthTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_4/DMN14GenericSynthTest.java
@@ -23,8 +23,8 @@ import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Map;
-import org.junit.Test;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -43,17 +43,14 @@ public class DMN14GenericSynthTest extends BaseVariantTest {
public static final Logger LOG = LoggerFactory.getLogger(DMN14GenericSynthTest.class);
- public DMN14GenericSynthTest(final BaseVariantTest.VariantTestConf conf) {
- super(conf);
- }
-
- @Parameterized.Parameters(name = "{0}")
public static Object[] params() {
return new Object[]{KIE_API_TYPECHECK, BUILDER_DEFAULT_NOCL_TYPECHECK}; // only variants needed until DMNv1.4 is actually published
}
- @Test
- public void testFilterDatatype() throws Throwable {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void filterDatatype(final BaseVariantTest.VariantTestConf conf) throws Throwable {
+ testConfig = conf;
DMNRuntime runtime = createRuntime("filter-datatype.dmn", this.getClass());
assertThat(runtime).isNotNull();
DMNModel model = runtime.getModel("http://www.trisotech.com/definitions/_caa02430-93c6-4ba7-a646-81bbcef32978", "Drawing 1");
@@ -72,8 +69,10 @@ public class DMN14GenericSynthTest extends BaseVariantTest {
assertThat(results.getDecisionResultByName("Decision").getResult()).isEqualTo(Arrays.asList(tc1, tc3));
}
- @Test
- public void testFilterDatatype2() throws Throwable {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void filterDatatype2(final BaseVariantTest.VariantTestConf conf) throws Throwable {
+ testConfig = conf;
DMNRuntime runtime = createRuntime("filter-datatype2.dmn", this.getClass());
assertThat(runtime).isNotNull();
DMNModel model = runtime.getModel("http://www.trisotech.com/definitions/_caa02430-93c6-4ba7-a646-81bbcef32978", "Drawing 1");
@@ -82,8 +81,10 @@ public class DMN14GenericSynthTest extends BaseVariantTest {
checkFilterDatatype(runtime, model);
}
- @Test
- public void testIteratorDatatype() throws Throwable {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void iteratorDatatype(final BaseVariantTest.VariantTestConf conf) throws Throwable {
+ testConfig = conf;
DMNRuntime runtime = createRuntime("iterator-datatype.dmn", this.getClass());
assertThat(runtime).isNotNull();
DMNModel model = runtime.getModel("http://www.trisotech.com/definitions/_caa02430-93c6-4ba7-a646-81bbcef32978", "Drawing 1");
@@ -102,8 +103,10 @@ public class DMN14GenericSynthTest extends BaseVariantTest {
assertThat(results.getDecisionResultByName("Decision").getResult()).isEqualTo(Arrays.asList("x", "y", "z"));
}
- @Test
- public void testIteratorDatatype2() throws Throwable {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void iteratorDatatype2(final BaseVariantTest.VariantTestConf conf) throws Throwable {
+ testConfig = conf;
DMNRuntime runtime = createRuntime("iterator-datatype2.dmn", this.getClass());
assertThat(runtime).isNotNull();
DMNModel model = runtime.getModel("http://www.trisotech.com/definitions/_caa02430-93c6-4ba7-a646-81bbcef32978", "Drawing 1");
diff --git a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_4/DMN14specificTest.java b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_4/DMN14specificTest.java
index 6cc366635f..dfa36efbdf 100644
--- a/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_4/DMN14specificTest.java
+++ b/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/v1_4/DMN14specificTest.java
@@ -21,8 +21,8 @@ package org.kie.dmn.core.v1_4;
import java.math.BigDecimal;
import java.util.Arrays;
-import org.junit.Test;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.kie.dmn.api.core.DMNContext;
import org.kie.dmn.api.core.DMNModel;
import org.kie.dmn.api.core.DMNResult;
@@ -49,17 +49,14 @@ public class DMN14specificTest extends BaseVariantTest {
public static final Logger LOG = LoggerFactory.getLogger(DMN14specificTest.class);
- public DMN14specificTest(final BaseVariantTest.VariantTestConf conf) {
- super(conf);
- }
-
- @Parameterized.Parameters(name = "{0}")
public static Object[] params() {
return new Object[]{KIE_API_TYPECHECK, BUILDER_DEFAULT_NOCL_TYPECHECK}; // only variants needed until DMNv1.4 is actually published
}
- @Test
- public void testDMNv1_4_put() {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void dMNv14Put(final BaseVariantTest.VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("exampleContextPut.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("ns1", "examplePut");
assertThat(dmnModel).isNotNull();
@@ -75,8 +72,10 @@ public class DMN14specificTest extends BaseVariantTest {
assertThat(dmnResult.getDecisionResultByName("Processed Request").getResult()).hasFieldOrPropertyWithValue("priority", "Medium");
}
- @Test
- public void testDMNv1_4_putAll() {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void dMNv14PutAll(final BaseVariantTest.VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("exampleContextMerge.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("https://kiegroup.org/dmn/_864E9A62-12E5-41DC-A7A6-7F028822A067", "examplePutAll");
assertThat(dmnModel).isNotNull();
@@ -91,9 +90,11 @@ public class DMN14specificTest extends BaseVariantTest {
assertThat(dmnResult.getDecisionResultByName("Complete Person").getResult()).hasFieldOrPropertyWithValue("last name", "Doe")
.hasFieldOrPropertyWithValue("age", new BigDecimal(47));
}
-
- @Test
- public void test_simple() {
+
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void simple(final BaseVariantTest.VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("simple.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_d9232146-7aaa-49a9-8668-261a01844ace", "Drawing 1");
assertThat(dmnModel).isNotNull();
@@ -109,9 +110,11 @@ public class DMN14specificTest extends BaseVariantTest {
final DMNContext result = dmnResult.getContext();
assertThat(result.get("greet")).isEqualTo("Hello, John");
}
-
- @Test
- public void testDMNv1_4_ch11() {
+
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void dMNv14Ch11(final BaseVariantTest.VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntimeWithAdditionalResources("Chapter 11 Example.dmn", this.getClass(), "Financial.dmn");
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_9d01a0c4-f529-4ad8-ad8e-ec5fb5d96ad4", "Chapter 11 Example");
assertThat(dmnModel).isNotNull();
@@ -140,9 +143,11 @@ public class DMN14specificTest extends BaseVariantTest {
assertThat(result.get("Strategy")).isEqualTo("THROUGH");
assertThat(result.get("Routing")).isEqualTo("ACCEPT");
}
-
- @Test
- public void testDMNv1_4_ch11_Example2() {
+
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void dMNv14Ch11Example2(final BaseVariantTest.VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntimeWithAdditionalResources("Recommended Loan Products.dmn", this.getClass(), "Loan info.dmn");
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_736fa164-03d8-429f-8318-4913a548c3a6", "Recommended Loan Products");
assertThat(dmnModel).isNotNull();
@@ -253,8 +258,10 @@ public class DMN14specificTest extends BaseVariantTest {
entry("Recommendation", "Best")));
}
- @Test
- public void test_sampleFor() {
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void sample_for(final BaseVariantTest.VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("sampleFor.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_5d7731f1-525d-4e75-a24a-39066f52ccdf", "Drawing 1");
assertThat(dmnModel).isNotNull();
@@ -268,9 +275,11 @@ public class DMN14specificTest extends BaseVariantTest {
final DMNContext result = dmnResult.getContext();
assertThat(result.get("sampleFor")).asList().containsExactly(new BigDecimal(2), new BigDecimal(3), new BigDecimal(4));
}
-
- @Test
- public void test_sampleQuantified() {
+
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void sample_quantified(final BaseVariantTest.VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("sampleQuantified.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_480411d5-e8b4-422f-9a76-1e8929930ead", "Drawing 1");
assertThat(dmnModel).isNotNull();
@@ -285,9 +294,11 @@ public class DMN14specificTest extends BaseVariantTest {
assertThat(result.get("sampleEvery")).isEqualTo(Boolean.TRUE);
assertThat(result.get("sampleSome")).isEqualTo(Boolean.TRUE);
}
-
- @Test
- public void test_sampleConditional() {
+
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void sample_conditional(final BaseVariantTest.VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("sampleConditional.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_da2ac43a-133b-483d-9c08-958d10024584", "Drawing 1");
assertThat(dmnModel).isNotNull();
@@ -301,9 +312,11 @@ public class DMN14specificTest extends BaseVariantTest {
final DMNContext result = dmnResult.getContext();
assertThat(result.get("sampleConditional")).isEqualTo("Hello World");
}
-
- @Test
- public void test_sampleFilter() {
+
+ @MethodSource("params")
+ @ParameterizedTest(name = "{0}")
+ public void sample_filter(final BaseVariantTest.VariantTestConf conf) {
+ testConfig = conf;
final DMNRuntime runtime = createRuntime("sampleFilter.dmn", this.getClass());
final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_e1291f4e-e828-4a47-86e8-474899d50185", "Drawing 1");
assertThat(dmnModel).isNotNull();
diff --git a/kie-dmn/kie-dmn-feel/pom.xml b/kie-dmn/kie-dmn-feel/pom.xml
index 19e72a32d2..c0c9b9ecb9 100644
--- a/kie-dmn/kie-dmn-feel/pom.xml
+++ b/kie-dmn/kie-dmn-feel/pom.xml
@@ -97,13 +97,13 @@
<!-- Tests -->
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
+ <artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@@ -121,6 +121,11 @@
<artifactId>yasson</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj</artifactId>
@@ -135,11 +140,11 @@
<directory>${project.basedir}/src/test/resources</directory>
</testResource>
<testResource>
- <directory>${project.basedir}/../</directory>
- <includes>
- <include>ref-dmn-feel-builtin-functions.adoc</include>
- </includes>
- <filtering>false</filtering>
+ <directory>${project.basedir}/../</directory>
+ <includes>
+ <include>ref-dmn-feel-builtin-functions.adoc</include>
+ </includes>
+ <filtering>false</filtering>
</testResource>
</testResources>
<plugins>
diff --git a/kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/codegen/feel11/DirectCompilerTest.java b/kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/codegen/feel11/DirectCompilerTest.java
index edf20396a0..137a3c50db 100644
--- a/kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/codegen/feel11/DirectCompilerTest.java
+++ b/kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/codegen/feel11/DirectCompilerTest.java
@@ -22,7 +22,7 @@ import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Collections;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.kie.dmn.feel.lang.EvaluationContext;
import org.kie.dmn.feel.lang.FEELProperty;
import org.kie.dmn.feel.lang.Type;
@@ -47,17 +47,17 @@ public class DirectCompilerTest {
@Test
- public void test_FEEL_number() {
+ void feel_number() {
assertThat(parseCompileEvaluate("10")).isEqualTo(BigDecimal.valueOf(10));
}
-
+
@Test
- public void test_FEEL_negative_number() {
+ void feel_negative_number() {
assertThat(parseCompileEvaluate("-10")).isEqualTo(BigDecimal.valueOf(-10));
}
-
+
@Test
- public void test_FEEL_DROOLS_2143() {
+ void feel_drools_2143() {
// DROOLS-2143: Allow ''--1' expression as per FEEL grammar rule 26
assertThat(parseCompileEvaluate("--10")).isEqualTo(BigDecimal.valueOf(10));
assertThat(parseCompileEvaluate("---10")).isEqualTo(BigDecimal.valueOf(-10));
@@ -65,24 +65,24 @@ public class DirectCompilerTest {
}
@Test
- public void test_FEEL_boolean() {
+ void feel_boolean() {
assertThat(parseCompileEvaluate("false")).isEqualTo(Boolean.FALSE);
assertThat(parseCompileEvaluate("true")).isEqualTo(Boolean.TRUE);
assertThat(parseCompileEvaluate("null")).isNull();
}
-
+
@Test
- public void test_FEEL_null() {
+ void feel_null() {
assertThat(parseCompileEvaluate("null")).isNull();
}
-
+
@Test
- public void test_FEEL_string() {
+ void feel_string() {
assertThat(parseCompileEvaluate("\"some string\"")).isEqualTo("some string" );
}
-
+
@Test
- public void test_primary_parens() {
+ void primary_parens() {
assertThat(parseCompileEvaluate("(\"some string\")")).isEqualTo("some string" );
assertThat(parseCompileEvaluate("(123)")).isEqualTo(BigDecimal.valueOf(123));
assertThat(parseCompileEvaluate("(-123)")).isEqualTo(BigDecimal.valueOf(-123));
@@ -90,12 +90,12 @@ public class DirectCompilerTest {
assertThat(parseCompileEvaluate("(false)")).isEqualTo(Boolean.FALSE);
assertThat(parseCompileEvaluate("(true)")).isEqualTo(Boolean.TRUE);
}
-
+
/**
* See {@link FEELTernaryLogicTest}
*/
@Test
- public void test_ternary_logic() {
+ void ternary_logic() {
assertThat(parseCompileEvaluate( "true and true")).isEqualTo(Boolean.TRUE);
assertThat(parseCompileEvaluate( "true and false")).isEqualTo(Boolean.FALSE);
assertThat(parseCompileEvaluate( "true and null")).isNull();
@@ -120,29 +120,29 @@ public class DirectCompilerTest {
assertThat(parseCompileEvaluate( "true or false and false")).isEqualTo(Boolean.TRUE);
assertThat(parseCompileEvaluate( "(true or false) and false")).isEqualTo(Boolean.FALSE);
}
-
+
/**
* Partially from {@link FEELConditionsAndLoopsTest}
*/
@Test
- public void test_if() {
+ void test_if() {
assertThat(parseCompileEvaluate( "if true then 15 else 5")).isEqualTo(BigDecimal.valueOf( 15 ));
assertThat(parseCompileEvaluate( "if false then 15 else 5")).isEqualTo(BigDecimal.valueOf( 5 ));
assertThat(parseCompileEvaluate("if null then 15 else 5")).isEqualTo(BigDecimal.valueOf(5));
assertThat(parseCompileEvaluate("if \"hello\" then 15 else 5")).isEqualTo(BigDecimal.valueOf(5));
}
-
+
@Test
- public void test_additiveExpression() {
+ void additive_expression() {
assertThat(parseCompileEvaluate( "1 + 2")).isEqualTo(BigDecimal.valueOf( 3 ));
assertThat(parseCompileEvaluate( "1 + null")).isNull();
assertThat(parseCompileEvaluate( "1 - 2")).isEqualTo(BigDecimal.valueOf( -1 ));
assertThat(parseCompileEvaluate( "1 - null")).isNull();
assertThat(parseCompileEvaluate( "\"Hello, \" + \"World\"")).isEqualTo("Hello, World");
}
-
+
@Test
- public void test_multiplicativeExpression() {
+ void multiplicative_expression() {
assertThat(parseCompileEvaluate("3 * 5")).isEqualTo(BigDecimal.valueOf(15));
assertThat(parseCompileEvaluate("3 * null")).isNull();
assertThat(parseCompileEvaluate("10 / 2")).isEqualTo(BigDecimal.valueOf(5));
@@ -150,13 +150,13 @@ public class DirectCompilerTest {
}
@Test
- public void test_exponentiationExpression() {
+ void exponentiation_expression() {
assertThat(parseCompileEvaluate("3 ** 3")).isEqualTo(BigDecimal.valueOf(27));
assertThat(parseCompileEvaluate("3 ** null")).isNull();
}
@Test
- public void test_logicalNegationExpression() {
+ void logical_negation_expression() {
// this is all invalid syntax
assertThat(parseCompileEvaluate("not true")).isNull();
assertThat(parseCompileEvaluate("not false")).isNull();
@@ -165,7 +165,7 @@ public class DirectCompilerTest {
}
@Test
... 21622 lines suppressed ...
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org