yesamer commented on code in PR #2207: URL: https://github.com/apache/incubator-kie-tools/pull/2207#discussion_r1574783758
########## packages/dmn-marshaller/tests/dmnSemanticComparison.test.ts: ########## @@ -0,0 +1,159 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import * as fs from "fs"; +import * as path from "path"; +import { getMarshaller } from "@kie-tools/dmn-marshaller"; +import { fail } from "assert"; +import { + checkDmnSemanticComparison, + checkDmnSemanticComparisonWithImports, +} from "@kie-tools/dmn-marshaller-backend-compatibility-tester"; + +/** + * This test suite compares the xml generated (parsed and built) by the dmn-parser with the original xml. + * The original xml and the generated one are passed and compered to the KIE DMN Core backend API. + * A JBang script is used to actually call the KIE DMN Core backend API. + */ + +const dmnTestingModelsPath = path.dirname(require.resolve("@kie-tools/dmn-testing-models/package.json")); + +const dmnTestingModels = [ + "dist/valid_models/DMNv1_5/AllowedValuesChecksInsideCollection.dmn", + "dist/valid_models/DMNv1_5/DateToDateTimeFunction.dmn", + "dist/valid_models/DMNv1_5/ForLoopDatesEvaluate.dmn", + "dist/valid_models/DMNv1_5/Imported_Model_Unamed.dmn", + "dist/valid_models/DMNv1_5/ListReplaceEvaluate.dmn", + "dist/valid_models/DMNv1_5/NegationOfDurationEvaluate.dmn", + "dist/valid_models/DMNv1_5/TypeConstraintsChecks.dmn", + "dist/valid_models/DMNv1_x/multiple/Financial.dmn", + "dist/valid_models/DMNv1_x/multiple/Imported_Traffic_Violation.dmn", + "dist/valid_models/DMNv1_x/multiple/stdlib.dmn", + "dist/valid_models/DMNv1_x/allTypes.dmn", + "dist/valid_models/DMNv1_x/dtevent.dmn", + "dist/valid_models/DMNv1_x/habitability.dmn", + "dist/valid_models/DMNv1_x/loan.dmn", + "dist/valid_models/DMNv1_x/LoanEligibility.dmn", + "dist/valid_models/DMNv1_x/OneOfEachType.dmn", + "dist/valid_models/DMNv1_x/Prequalification.dmn", + "dist/valid_models/DMNv1_x/testWithExtensionElements.dmn", + "dist/valid_models/DMNv1_x/Traffic Violation Simple.dmn", + "dist/valid_models/DMNv1_x/Traffic Violation.dmn", Review Comment: @jomarko This is a good question. The reason for this behavior is intentional and it's because we need to discriminate between DMN models that import a DMN model and DMN models that don't. In the first case, if want to validate / or check for semantic comparison, you need to pass both models (the importer and the imported) together to the JBang script. So, the first array holds all the DMN files that don't have any imported DMN files. The second array holds the DMN files that import another DMN file (both are specified). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
