diff --git a/test/e2e/mxGraph.model.test.ts b/test/e2e/mxGraph.model.test.ts index c9d08c17cf..a6b387ef38 100644 --- a/test/e2e/mxGraph.model.test.ts +++ b/test/e2e/mxGraph.model.test.ts @@ -442,87 +442,7 @@ describe('mxGraph model', () => { }); it('lanes and bpmn element shapes should have coordinates relative to the pool or the lane', async () => { - const bpmn = ` - - - - - - - - - - - SequenceFlow_id - StartEvent_1 - EndEvent_1 - - - - - - - - - - StartEvent_2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`; - bpmnVisualization.load(bpmn); + bpmnVisualization.load(readFileSync('../fixtures/bpmn/model-coordinates-relative-to-pool-or-lane.bpmn')); expectModelContainsCellWithGeometry( 'Participant_1', diff --git a/test/fixtures/bpmn/model-coordinates-relative-to-pool-or-lane.bpmn b/test/fixtures/bpmn/model-coordinates-relative-to-pool-or-lane.bpmn new file mode 100644 index 0000000000..9bd4116992 --- /dev/null +++ b/test/fixtures/bpmn/model-coordinates-relative-to-pool-or-lane.bpmn @@ -0,0 +1,79 @@ + + + + + + + + + + + + SequenceFlow_id + StartEvent_1 + EndEvent_1 + + + + + + + + + + StartEvent_2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/fixtures/bpmn/xml-parsing/activiti-5_14_1-miwg-A.2.0.export.bpmn b/test/fixtures/bpmn/xml-parsing/activiti-5_14_1-miwg-A.2.0.export.bpmn new file mode 100644 index 0000000000..ed1cbf9438 --- /dev/null +++ b/test/fixtures/bpmn/xml-parsing/activiti-5_14_1-miwg-A.2.0.export.bpmn @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + 3. Gateways display the X symbol in all cases (no user control) but actually do not write it to the file. Always displaying it seems quite reasonable if the attribute is stored in the model. + 4. Gateway labels not displayed on diagram. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/fixtures/bpmn/xml-parsing/adonis-np-8_0-miwg-A.2.1-export.bpmn b/test/fixtures/bpmn/xml-parsing/adonis-np-8_0-miwg-A.2.1-export.bpmn new file mode 100644 index 0000000000..805628e9c4 --- /dev/null +++ b/test/fixtures/bpmn/xml-parsing/adonis-np-8_0-miwg-A.2.1-export.bpmn @@ -0,0 +1,2092 @@ + + + + + + + No entry + + + + No entry + + + + false + + + + No entry + + + + No entry + + + + None + + + + No entry + + + + No entry + + + + Draft + + + + No assessment data available to calculate as-is average + + + + No entry + + + + No entry + + + + No entry + + + + 0 + + + + 13920 + + + + false + + + + false + + + + No entry + + + + No entry + + + + No entry + + + + 0 + + + + 0 + + + + No entry + + + + false + + + + 7095 + + + + No entry + + + + 1569418046853 + + + + false + + + + + + + + + + + + + + + + + No change + + + + 0 + + + + 0 + + + + 0 + + + + true + + + + false + + + + true + + + + false + + + + false + + + + true + + + + 0 + + + + inside + + + + false + + + + true + + + + false + + + + 0 + + + + false + + + + No entry + + + + 0 + + + + false + + + + false + + + + + + + + _ab1dbc48-3851-440e-bee0-ef1af884a1a5 + _fd0f19bf-1482-46d5-a145-69a9e712623d + + + + + + No change + + + + below + + + + false + + + + 0 + + + + + + + _fd0f19bf-1482-46d5-a145-69a9e712623d + _107fb1c6-cf96-45a1-934e-e9a74f0ccb0c + _69f7f09a-ba49-454e-9b47-f1dcad1d1442 + _c30e5b1d-616b-4f25-a54a-6459fddef716 + + + + + + No change + + + + false + + + + false + + + + Per year + + + + false + + + + 0 + + + + 0 + + + + false + + + + No entry + + + + true + + + + + + + _ab1dbc48-3851-440e-bee0-ef1af884a1a5 + + + + + + No change + + + + 0 + + + + 0 + + + + 0 + + + + true + + + + false + + + + true + + + + false + + + + false + + + + true + + + + 0 + + + + inside + + + + false + + + + true + + + + false + + + + 0 + + + + false + + + + No entry + + + + 0 + + + + false + + + + false + + + + + + + + _c30e5b1d-616b-4f25-a54a-6459fddef716 + _5233d669-0e33-4456-a6c4-d863cf59adae + _eeddf2a4-a7f0-415b-b154-a98f64d411c2 + + + + + + No change + + + + below + + + + false + + + + 0 + + + + + + + _214a1bff-e526-492b-aed0-19497e999306 + _479c1a5b-945b-4914-aea8-315ece72d020 + _91a75c3f-7a0d-44a4-a1ba-ba6064187a9f + + + + + + No change + + + + 0 + + + + 0 + + + + 0 + + + + true + + + + false + + + + true + + + + false + + + + false + + + + true + + + + 0 + + + + inside + + + + false + + + + true + + + + false + + + + 0 + + + + false + + + + No entry + + + + 0 + + + + false + + + + false + + + + + + + + _434878e5-49bf-48e6-acb5-8dc4ff7fbb8f + _5233d669-0e33-4456-a6c4-d863cf59adae + _69f7f09a-ba49-454e-9b47-f1dcad1d1442 + _214a1bff-e526-492b-aed0-19497e999306 + + + + + + No change + + + + false + + + + false + + + + false + + + + 0 + + + + No entry + + + + false + + + + No entry + + + + true + + + + + + + _91a75c3f-7a0d-44a4-a1ba-ba6064187a9f + _eeddf2a4-a7f0-415b-b154-a98f64d411c2 + + + + + + No change + + + + 0 + + + + 0 + + + + 0 + + + + true + + + + false + + + + true + + + + false + + + + false + + + + true + + + + 0 + + + + inside + + + + false + + + + true + + + + false + + + + 0 + + + + false + + + + No entry + + + + 0 + + + + false + + + + false + + + + + + + + _107fb1c6-cf96-45a1-934e-e9a74f0ccb0c + _434878e5-49bf-48e6-acb5-8dc4ff7fbb8f + _479c1a5b-945b-4914-aea8-315ece72d020 + + + + + + Name and transition condition + + + + false + + + + 0 + + + + false + + + + automatic + + + + false + + + + + + + + + + + Name and transition condition + + + + false + + + + 0 + + + + false + + + + automatic + + + + false + + + + + + + + + + + Name and transition condition + + + + false + + + + 0 + + + + false + + + + automatic + + + + false + + + + + + + + + + + Name and transition condition + + + + false + + + + condition + \`0\`<x>\`12\`</x> + + + 0 + + + + false + + + + automatic + + + + false + + + + + + + + + + + + Name and transition condition + + + + false + + + + 0 + + + + false + + + + automatic + + + + false + + + + + + + + + + + Name and transition condition + + + + false + + + + 0 + + + + false + + + + automatic + + + + false + + + + + + + + + + + Name and transition condition + + + + false + + + + 0 + + + + false + + + + automatic + + + + false + + + + + + + + + + + Name and transition condition + + + + false + + + + 0 + + + + false + + + + automatic + + + + false + + + + + + + + + + + Name and transition condition + + + + false + + + + 0 + + + + false + + + + automatic + + + + Default + + + + false + + + + + + + + + + + Name and transition condition + + + + false + + + + Condition + \`0\`<x>\`12\`</x> + + + 0 + + + + false + + + + automatic + + + + false + + + + + + + + + + + + Name and transition condition + + + + false + + + + 0 + + + + false + + + + automatic + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/fixtures/bpmn/xml-parsing/bizagi-modeler-2_8_0_8-A.2.0-export.bpmn b/test/fixtures/bpmn/xml-parsing/bizagi-modeler-2_8_0_8-A.2.0-export.bpmn new file mode 100644 index 0000000000..5faada5cce --- /dev/null +++ b/test/fixtures/bpmn/xml-parsing/bizagi-modeler-2_8_0_8-A.2.0-export.bpmn @@ -0,0 +1,437 @@ + + + + + + + + + + + + + _b50f530c-3450-4e1a-b81f-ea346dc6e1cb + + + + + + + + + + + _b50f530c-3450-4e1a-b81f-ea346dc6e1cb + _fe74c141-8843-4b00-a704-5e5e13be53b0 + + + + + + + + + + + _a3d40a56-9b7f-417e-911e-d39e7f18b90c + _d4ce87c6-1373-45d6-a3b4-fbb2a04ee2e5 + + + + + + + + + + + _f1478fb7-98c4-4c01-8c15-68bd04c91535 + _a3d40a56-9b7f-417e-911e-d39e7f18b90c + + + + + + + + + + + _a1570a53-28d2-41b1-a3a2-3e50c00d747e + _e9ebc7c7-995d-46db-86ce-d823bc2b4687 + + + + + + + + + + + _fe74c141-8843-4b00-a704-5e5e13be53b0 + _f1478fb7-98c4-4c01-8c15-68bd04c91535 + _a1570a53-28d2-41b1-a3a2-3e50c00d747e + _20ebb3c1-5178-4c7c-a91d-23e58f2aa73b + + + + + + + + + + + _20ebb3c1-5178-4c7c-a91d-23e58f2aa73b + _698b593f-18eb-42ea-b8cd-bcd51e1514cc + + + + + + + + + + + _e9ebc7c7-995d-46db-86ce-d823bc2b4687 + _698b593f-18eb-42ea-b8cd-bcd51e1514cc + _d4ce87c6-1373-45d6-a3b4-fbb2a04ee2e5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/fixtures/bpmn/xml-parsing/camuda-eclipse-plugin-3_0_0-A.2.0-export.bpmn b/test/fixtures/bpmn/xml-parsing/camuda-eclipse-plugin-3_0_0-A.2.0-export.bpmn new file mode 100644 index 0000000000..aec508daa3 --- /dev/null +++ b/test/fixtures/bpmn/xml-parsing/camuda-eclipse-plugin-3_0_0-A.2.0-export.bpmn @@ -0,0 +1,145 @@ + + + + + SequenceFlow_1 + + + SequenceFlow_1 + SequenceFlow_2 + + + + SequenceFlow_2 + SequenceFlow_3 + SequenceFlow_4 + SequenceFlow_5 + + + + SequenceFlow_3 + SequenceFlow_6 + + + + SequenceFlow_4 + SequenceFlow_7 + + + + + SequenceFlow_5 + SequenceFlow_9 + + + + SequenceFlow_6 + SequenceFlow_7 + SequenceFlow_8 + + + + + SequenceFlow_8 + SequenceFlow_9 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/fixtures/bpmn/xml-parsing/miwg-A.1.0.bpmn b/test/fixtures/bpmn/xml-parsing/miwg-A.1.0.bpmn new file mode 100644 index 0000000000..be6e3e1128 --- /dev/null +++ b/test/fixtures/bpmn/xml-parsing/miwg-A.1.0.bpmn @@ -0,0 +1,86 @@ + + + + + _e16564d7-0c4c-413e-95f6-f668a3f851fb + + + _e16564d7-0c4c-413e-95f6-f668a3f851fb + _d77dd5ec-e4e7-420e-bbe7-8ac9cd1df599 + + + _d77dd5ec-e4e7-420e-bbe7-8ac9cd1df599 + _2aa47410-1b0e-4f8b-ad54-d6f798080cb4 + + + _2aa47410-1b0e-4f8b-ad54-d6f798080cb4 + _8e8fe679-eb3b-4c43-a4d6-891e7087ff80 + + + _8e8fe679-eb3b-4c43-a4d6-891e7087ff80 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/fixtures/bpmn/xml-parsing/miwg-A.1.0_french_special_characters.bpmn b/test/fixtures/bpmn/xml-parsing/miwg-A.1.0_french_special_characters.bpmn new file mode 100644 index 0000000000..65feb1e933 --- /dev/null +++ b/test/fixtures/bpmn/xml-parsing/miwg-A.1.0_french_special_characters.bpmn @@ -0,0 +1,86 @@ + + + + + _e16564d7-0c4c-413e-95f6-f668a3f851fb + + + _e16564d7-0c4c-413e-95f6-f668a3f851fb + _d77dd5ec-e4e7-420e-bbe7-8ac9cd1df599 + + + _d77dd5ec-e4e7-420e-bbe7-8ac9cd1df599 + _2aa47410-1b0e-4f8b-ad54-d6f798080cb4 + + + _2aa47410-1b0e-4f8b-ad54-d6f798080cb4 + _8e8fe679-eb3b-4c43-a4d6-891e7087ff80 + + + _8e8fe679-eb3b-4c43-a4d6-891e7087ff80 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/fixtures/bpmn/xml-parsing/miwg-A.1.0_html_special_characters.bpmn b/test/fixtures/bpmn/xml-parsing/miwg-A.1.0_html_special_characters.bpmn new file mode 100644 index 0000000000..d74863f50d --- /dev/null +++ b/test/fixtures/bpmn/xml-parsing/miwg-A.1.0_html_special_characters.bpmn @@ -0,0 +1,86 @@ + + + + + _e16564d7-0c4c-413e-95f6-f668a3f851fb + + + _e16564d7-0c4c-413e-95f6-f668a3f851fb + _d77dd5ec-e4e7-420e-bbe7-8ac9cd1df599 + + + _d77dd5ec-e4e7-420e-bbe7-8ac9cd1df599 + _2aa47410-1b0e-4f8b-ad54-d6f798080cb4 + + + _2aa47410-1b0e-4f8b-ad54-d6f798080cb4 + _8e8fe679-eb3b-4c43-a4d6-891e7087ff80 + + + _8e8fe679-eb3b-4c43-a4d6-891e7087ff80 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/fixtures/bpmn/xml-parsing/miwg-A.1.0_japanese_special_characters.bpmn b/test/fixtures/bpmn/xml-parsing/miwg-A.1.0_japanese_special_characters.bpmn new file mode 100644 index 0000000000..5c08af3a6b --- /dev/null +++ b/test/fixtures/bpmn/xml-parsing/miwg-A.1.0_japanese_special_characters.bpmn @@ -0,0 +1,86 @@ + + + + + _e16564d7-0c4c-413e-95f6-f668a3f851fb + + + _e16564d7-0c4c-413e-95f6-f668a3f851fb + _d77dd5ec-e4e7-420e-bbe7-8ac9cd1df599 + + + _d77dd5ec-e4e7-420e-bbe7-8ac9cd1df599 + _2aa47410-1b0e-4f8b-ad54-d6f798080cb4 + + + _2aa47410-1b0e-4f8b-ad54-d6f798080cb4 + _8e8fe679-eb3b-4c43-a4d6-891e7087ff80 + + + _8e8fe679-eb3b-4c43-a4d6-891e7087ff80 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/fixtures/bpmn/xml-parsing/miwg-A.2.1.bpmn b/test/fixtures/bpmn/xml-parsing/miwg-A.2.1.bpmn new file mode 100644 index 0000000000..eee8d2148c --- /dev/null +++ b/test/fixtures/bpmn/xml-parsing/miwg-A.2.1.bpmn @@ -0,0 +1,333 @@ + + + + + + + + + + + + + + + + + + + + + + + + _To9Z5DOCEeSknpIVFCxNIQ + + + + + + + + _To9Z5DOCEeSknpIVFCxNIQ + _To9Z5zOCEeSknpIVFCxNIQ + + + + + + + + _To9Z7TOCEeSknpIVFCxNIQ + _To9Z9jOCEeSknpIVFCxNIQ + + + + + + + + _To9Z6jOCEeSknpIVFCxNIQ + _To9Z7TOCEeSknpIVFCxNIQ + Bpmn_SequenceFlow_edepQQbbEealeL5I4Yl3Dw + + + + + + + + _To9Z-TOCEeSknpIVFCxNIQ + Bpmn_SequenceFlow_edepQQbbEealeL5I4Yl3Dw + Bpmn_SequenceFlow_f9nmUQbbEealeL5I4Yl3Dw + _To9Z8DOCEeSknpIVFCxNIQ + + + + + + + + _To9Z5zOCEeSknpIVFCxNIQ + _To9Z6jOCEeSknpIVFCxNIQ + _To9Z-TOCEeSknpIVFCxNIQ + _To9Z_DOCEeSknpIVFCxNIQ + + + + + + + + _To9Z_DOCEeSknpIVFCxNIQ + _To9Z8zOCEeSknpIVFCxNIQ + Bpmn_SequenceFlow_f9nmUQbbEealeL5I4Yl3Dw + + + + + + + + _To9Z8DOCEeSknpIVFCxNIQ + _To9Z8zOCEeSknpIVFCxNIQ + _To9Z9jOCEeSknpIVFCxNIQ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/helpers/file-helper.ts b/test/helpers/file-helper.ts index 8f75d1d792..3ece5bc484 100644 --- a/test/helpers/file-helper.ts +++ b/test/helpers/file-helper.ts @@ -16,6 +16,6 @@ import * as fs from 'fs'; import * as path from 'path'; -export function readFileSync(relPathToSourceFile: string): string { - return fs.readFileSync(path.join(__dirname, relPathToSourceFile), 'utf-8'); +export function readFileSync(relPathToSourceFile: string, encoding = 'utf8'): string { + return fs.readFileSync(path.join(__dirname, relPathToSourceFile), encoding); } diff --git a/test/unit/component/parser/xml/BpmnXmlParser.activiti-5_14_1.test.ts b/test/unit/component/parser/xml/BpmnXmlParser.activiti-5_14_1.test.ts index 48270fd23e..1d6c09e41c 100644 --- a/test/unit/component/parser/xml/BpmnXmlParser.activiti-5_14_1.test.ts +++ b/test/unit/component/parser/xml/BpmnXmlParser.activiti-5_14_1.test.ts @@ -18,110 +18,13 @@ import arrayContaining = jasmine.arrayContaining; import anything = jasmine.anything; import { TProcess } from '../../../../../src/component/parser/xml/bpmn-json-model/baseElement/rootElement/rootElement'; import { BPMNDiagram } from '../../../../../src/component/parser/xml/bpmn-json-model/BPMNDI'; +import { readFileSync } from '../../../../helpers/file-helper'; describe('parse bpmn as xml for Activiti Designer 5.14.1', () => { it('bpmn with process with extension, ensure elements are present', () => { - const a20Processe = ` - - - - - - - - - - - - - - - - - - - - - 3. Gateways display the X symbol in all cases (no user control) but actually do not write it to the file. Always displaying it seems quite reasonable if the attribute is stored in the model. -4. Gateway labels not displayed on diagram. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`; + const a20Process = readFileSync('../fixtures/bpmn/xml-parsing/activiti-5_14_1-miwg-A.2.0.export.bpmn'); - const json = new BpmnXmlParser().parse(a20Processe); + const json = new BpmnXmlParser().parse(a20Process); expect(json).toMatchObject({ definitions: { diff --git a/test/unit/component/parser/xml/BpmnXmlParser.adonis-np-8_0.test.ts b/test/unit/component/parser/xml/BpmnXmlParser.adonis-np-8_0.test.ts index 0f3b01d4c3..b03f42b946 100644 --- a/test/unit/component/parser/xml/BpmnXmlParser.adonis-np-8_0.test.ts +++ b/test/unit/component/parser/xml/BpmnXmlParser.adonis-np-8_0.test.ts @@ -18,2104 +18,13 @@ import arrayContaining = jasmine.arrayContaining; import anything = jasmine.anything; import { TProcess } from '../../../../../src/component/parser/xml/bpmn-json-model/baseElement/rootElement/rootElement'; import { BPMNDiagram } from '../../../../../src/component/parser/xml/bpmn-json-model/BPMNDI'; +import { readFileSync } from '../../../../helpers/file-helper'; describe('parse bpmn as xml for ADONIS NP 8.0', () => { it('bpmn with process with extension, ensure elements are present', () => { - const a21Processe = ` - - - - - - No entry - - - - No entry - - - - false - - - - No entry - - - - No entry - - - - None - - - - No entry - - - - No entry - - - - Draft - - - - No assessment data available to calculate as-is average - - - - No entry - - - - No entry - - - - No entry - - - - 0 - - - - 13920 - - - - false - - - - false - - - - No entry - - - - No entry - - - - No entry - - - - 0 - - - - 0 - - - - No entry - - - - false - - - - 7095 - - - - No entry - - - - 1569418046853 - - - - false - - - - - - - - - - - - - - - - - No change - - - - 0 - - - - 0 - - - - 0 - - - - true - - - - false - - - - true - - - - false - - - - false - - - - true - - - - 0 - - - - inside - - - - false - - - - true - - - - false - - - - 0 - - - - false - - - - No entry - - - - 0 - - - - false - - - - false - - - - - - - - _ab1dbc48-3851-440e-bee0-ef1af884a1a5 - _fd0f19bf-1482-46d5-a145-69a9e712623d - - - - - - No change - - - - below - - - - false - - - - 0 - - - - - - - _fd0f19bf-1482-46d5-a145-69a9e712623d - _107fb1c6-cf96-45a1-934e-e9a74f0ccb0c - _69f7f09a-ba49-454e-9b47-f1dcad1d1442 - _c30e5b1d-616b-4f25-a54a-6459fddef716 - - - - - - No change - - - - false - - - - false - - - - Per year - - - - false - - - - 0 - - - - 0 - - - - false - - - - No entry - - - - true - - - - - - - _ab1dbc48-3851-440e-bee0-ef1af884a1a5 - - - - - - No change - - - - 0 - - - - 0 - - - - 0 - - - - true - - - - false - - - - true - - - - false - - - - false - - - - true - - - - 0 - - - - inside - - - - false - - - - true - - - - false - - - - 0 - - - - false - - - - No entry - - - - 0 - - - - false - - - - false - - - - - - - - _c30e5b1d-616b-4f25-a54a-6459fddef716 - _5233d669-0e33-4456-a6c4-d863cf59adae - _eeddf2a4-a7f0-415b-b154-a98f64d411c2 - - - - - - No change - - - - below - - - - false - - - - 0 - - - - - - - _214a1bff-e526-492b-aed0-19497e999306 - _479c1a5b-945b-4914-aea8-315ece72d020 - _91a75c3f-7a0d-44a4-a1ba-ba6064187a9f - - - - - - No change - - - - 0 - - - - 0 - - - - 0 - - - - true - - - - false - - - - true - - - - false - - - - false - - - - true - - - - 0 - - - - inside - - - - false - - - - true - - - - false - - - - 0 - - - - false - - - - No entry - - - - 0 - - - - false - - - - false - - - - - - - - _434878e5-49bf-48e6-acb5-8dc4ff7fbb8f - _5233d669-0e33-4456-a6c4-d863cf59adae - _69f7f09a-ba49-454e-9b47-f1dcad1d1442 - _214a1bff-e526-492b-aed0-19497e999306 - - - - - - No change - - - - false - - - - false - - - - false - - - - 0 - - - - No entry - - - - false - - - - No entry - - - - true - - - - - - - _91a75c3f-7a0d-44a4-a1ba-ba6064187a9f - _eeddf2a4-a7f0-415b-b154-a98f64d411c2 - - - - - - No change - - - - 0 - - - - 0 - - - - 0 - - - - true - - - - false - - - - true - - - - false - - - - false - - - - true - - - - 0 - - - - inside - - - - false - - - - true - - - - false - - - - 0 - - - - false - - - - No entry - - - - 0 - - - - false - - - - false - - - - - - - - _107fb1c6-cf96-45a1-934e-e9a74f0ccb0c - _434878e5-49bf-48e6-acb5-8dc4ff7fbb8f - _479c1a5b-945b-4914-aea8-315ece72d020 - - - - - - Name and transition condition - - - - false - - - - 0 - - - - false - - - - automatic - - - - false - - - - - - - - - - - Name and transition condition - - - - false - - - - 0 - - - - false - - - - automatic - - - - false - - - - - - - - - - - Name and transition condition - - - - false - - - - 0 - - - - false - - - - automatic - - - - false - - - - - - - - - - - Name and transition condition - - - - false - - - - condition - \`0\`<x>\`12\`</x> - - - 0 - - - - false - - - - automatic - - - - false - - - - - - - - - - - - Name and transition condition - - - - false - - - - 0 - - - - false - - - - automatic - - - - false - - - - - - - - - - - Name and transition condition - - - - false - - - - 0 - - - - false - - - - automatic - - - - false - - - - - - - - - - - Name and transition condition - - - - false - - - - 0 - - - - false - - - - automatic - - - - false - - - - - - - - - - - Name and transition condition - - - - false - - - - 0 - - - - false - - - - automatic - - - - false - - - - - - - - - - - Name and transition condition - - - - false - - - - 0 - - - - false - - - - automatic - - - - Default - - - - false - - - - - - - - - - - Name and transition condition - - - - false - - - - Condition - \`0\`<x>\`12\`</x> - - - 0 - - - - false - - - - automatic - - - - false - - - - - - - - - - - - Name and transition condition - - - - false - - - - 0 - - - - false - - - - automatic - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`; + const a21Process = readFileSync('../fixtures/bpmn/xml-parsing/adonis-np-8_0-miwg-A.2.1-export.bpmn'); - const json = new BpmnXmlParser().parse(a21Processe); + const json = new BpmnXmlParser().parse(a21Process); expect(json).toMatchObject({ definitions: { diff --git a/test/unit/component/parser/xml/BpmnXmlParser.bizagi-modeler-2_8_0_8.test.ts b/test/unit/component/parser/xml/BpmnXmlParser.bizagi-modeler-2_8_0_8.test.ts index 4931375fad..414682b2af 100644 --- a/test/unit/component/parser/xml/BpmnXmlParser.bizagi-modeler-2_8_0_8.test.ts +++ b/test/unit/component/parser/xml/BpmnXmlParser.bizagi-modeler-2_8_0_8.test.ts @@ -18,448 +18,13 @@ import arrayContaining = jasmine.arrayContaining; import anything = jasmine.anything; import { TProcess } from '../../../../../src/component/parser/xml/bpmn-json-model/baseElement/rootElement/rootElement'; import { BPMNDiagram } from '../../../../../src/component/parser/xml/bpmn-json-model/BPMNDI'; +import { readFileSync } from '../../../../helpers/file-helper'; describe('parse bpmn as xml for Bizagi Modeler 2.8.0.8', () => { it('bpmn with process with extension, ensure elements are present', () => { - const a20Processe = ` - - - - - - - - - - - - _b50f530c-3450-4e1a-b81f-ea346dc6e1cb - - - - - - - - - - - _b50f530c-3450-4e1a-b81f-ea346dc6e1cb - _fe74c141-8843-4b00-a704-5e5e13be53b0 - - - - - - - - - - - _a3d40a56-9b7f-417e-911e-d39e7f18b90c - _d4ce87c6-1373-45d6-a3b4-fbb2a04ee2e5 - - - - - - - - - - - _f1478fb7-98c4-4c01-8c15-68bd04c91535 - _a3d40a56-9b7f-417e-911e-d39e7f18b90c - - - - - - - - - - - _a1570a53-28d2-41b1-a3a2-3e50c00d747e - _e9ebc7c7-995d-46db-86ce-d823bc2b4687 - - - - - - - - - - - _fe74c141-8843-4b00-a704-5e5e13be53b0 - _f1478fb7-98c4-4c01-8c15-68bd04c91535 - _a1570a53-28d2-41b1-a3a2-3e50c00d747e - _20ebb3c1-5178-4c7c-a91d-23e58f2aa73b - - - - - - - - - - - _20ebb3c1-5178-4c7c-a91d-23e58f2aa73b - _698b593f-18eb-42ea-b8cd-bcd51e1514cc - - - - - - - - - - - _e9ebc7c7-995d-46db-86ce-d823bc2b4687 - _698b593f-18eb-42ea-b8cd-bcd51e1514cc - _d4ce87c6-1373-45d6-a3b4-fbb2a04ee2e5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`; + const a20Process = readFileSync('../fixtures/bpmn/xml-parsing/bizagi-modeler-2_8_0_8-A.2.0-export.bpmn'); - const json = new BpmnXmlParser().parse(a20Processe); + const json = new BpmnXmlParser().parse(a20Process); expect(json).toMatchObject({ definitions: { diff --git a/test/unit/component/parser/xml/BpmnXmlParser.camuda-eclipse-plugin-3_0_0.test.ts b/test/unit/component/parser/xml/BpmnXmlParser.camuda-eclipse-plugin-3_0_0.test.ts index 66b62da843..5a2fa14021 100644 --- a/test/unit/component/parser/xml/BpmnXmlParser.camuda-eclipse-plugin-3_0_0.test.ts +++ b/test/unit/component/parser/xml/BpmnXmlParser.camuda-eclipse-plugin-3_0_0.test.ts @@ -18,156 +18,13 @@ import arrayContaining = jasmine.arrayContaining; import anything = jasmine.anything; import { TProcess } from '../../../../../src/component/parser/xml/bpmn-json-model/baseElement/rootElement/rootElement'; import { BPMNDiagram } from '../../../../../src/component/parser/xml/bpmn-json-model/BPMNDI'; +import { readFileSync } from '../../../../helpers/file-helper'; describe('parse bpmn as xml for Camunda Eclipse Plugin 3.0.0', () => { it('bpmn with process with extension, ensure elements are present', () => { - const a20Processe = ` - - - - SequenceFlow_1 - - - SequenceFlow_1 - SequenceFlow_2 - - - - SequenceFlow_2 - SequenceFlow_3 - SequenceFlow_4 - SequenceFlow_5 - - - - SequenceFlow_3 - SequenceFlow_6 - - - - SequenceFlow_4 - SequenceFlow_7 - - - - - SequenceFlow_5 - SequenceFlow_9 - - - - SequenceFlow_6 - SequenceFlow_7 - SequenceFlow_8 - - - - - SequenceFlow_8 - SequenceFlow_9 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`; + const a20Process = readFileSync('../fixtures/bpmn/xml-parsing/camuda-eclipse-plugin-3_0_0-A.2.0-export.bpmn'); - const json = new BpmnXmlParser().parse(a20Processe); + const json = new BpmnXmlParser().parse(a20Process); expect(json).toMatchObject({ definitions: { diff --git a/test/unit/component/parser/xml/BpmnXmlParser.miwg.test.ts b/test/unit/component/parser/xml/BpmnXmlParser.miwg.test.ts index 58cd1ec9aa..21e8b28cbb 100644 --- a/test/unit/component/parser/xml/BpmnXmlParser.miwg.test.ts +++ b/test/unit/component/parser/xml/BpmnXmlParser.miwg.test.ts @@ -19,345 +19,13 @@ import objectContaining = jasmine.objectContaining; import anything = jasmine.anything; import { BPMNDiagram } from '../../../../../src/component/parser/xml/bpmn-json-model/BPMNDI'; import { TProcess } from '../../../../../src/component/parser/xml/bpmn-json-model/baseElement/rootElement/rootElement'; +import { readFileSync } from '../../../../helpers/file-helper'; describe('parse bpmn as xml for MIWG', () => { it('bpmn with process with extension, ensure elements are present', () => { - const a21Processe = ` - - - - - - - - - - - - - - - - - - - - - - - _To9Z5DOCEeSknpIVFCxNIQ - - - - - - - - _To9Z5DOCEeSknpIVFCxNIQ - _To9Z5zOCEeSknpIVFCxNIQ - - - - - - - - _To9Z7TOCEeSknpIVFCxNIQ - _To9Z9jOCEeSknpIVFCxNIQ - - - - - - - - _To9Z6jOCEeSknpIVFCxNIQ - _To9Z7TOCEeSknpIVFCxNIQ - Bpmn_SequenceFlow_edepQQbbEealeL5I4Yl3Dw - - - - - - - - _To9Z-TOCEeSknpIVFCxNIQ - Bpmn_SequenceFlow_edepQQbbEealeL5I4Yl3Dw - Bpmn_SequenceFlow_f9nmUQbbEealeL5I4Yl3Dw - _To9Z8DOCEeSknpIVFCxNIQ - - - - - - - - _To9Z5zOCEeSknpIVFCxNIQ - _To9Z6jOCEeSknpIVFCxNIQ - _To9Z-TOCEeSknpIVFCxNIQ - _To9Z_DOCEeSknpIVFCxNIQ - - - - - - - - _To9Z_DOCEeSknpIVFCxNIQ - _To9Z8zOCEeSknpIVFCxNIQ - Bpmn_SequenceFlow_f9nmUQbbEealeL5I4Yl3Dw - - - - - - - - _To9Z8DOCEeSknpIVFCxNIQ - _To9Z8zOCEeSknpIVFCxNIQ - _To9Z9jOCEeSknpIVFCxNIQ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`; + const a21Process = readFileSync('../fixtures/bpmn/xml-parsing/miwg-A.2.1.bpmn'); - const json = new BpmnXmlParser().parse(a21Processe); + const json = new BpmnXmlParser().parse(a21Process); expect(json).toMatchObject({ definitions: { @@ -434,93 +102,7 @@ describe('parse bpmn as xml for MIWG', () => { }); it('bpmn with number attribute, ensure xml number are json number', () => { - const a10Process = ` - - - - _e16564d7-0c4c-413e-95f6-f668a3f851fb - - - _e16564d7-0c4c-413e-95f6-f668a3f851fb - _d77dd5ec-e4e7-420e-bbe7-8ac9cd1df599 - - - _d77dd5ec-e4e7-420e-bbe7-8ac9cd1df599 - _2aa47410-1b0e-4f8b-ad54-d6f798080cb4 - - - _2aa47410-1b0e-4f8b-ad54-d6f798080cb4 - _8e8fe679-eb3b-4c43-a4d6-891e7087ff80 - - - _8e8fe679-eb3b-4c43-a4d6-891e7087ff80 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`; + const a10Process = readFileSync('../fixtures/bpmn/xml-parsing/miwg-A.1.0.bpmn'); const json = new BpmnXmlParser().parse(a10Process); @@ -538,93 +120,7 @@ describe('parse bpmn as xml for MIWG', () => { }); it('bpmn with boolean attribute, ensure xml boolean are json boolean', () => { - const a10Process = ` - - - - _e16564d7-0c4c-413e-95f6-f668a3f851fb - - - _e16564d7-0c4c-413e-95f6-f668a3f851fb - _d77dd5ec-e4e7-420e-bbe7-8ac9cd1df599 - - - _d77dd5ec-e4e7-420e-bbe7-8ac9cd1df599 - _2aa47410-1b0e-4f8b-ad54-d6f798080cb4 - - - _2aa47410-1b0e-4f8b-ad54-d6f798080cb4 - _8e8fe679-eb3b-4c43-a4d6-891e7087ff80 - - - _8e8fe679-eb3b-4c43-a4d6-891e7087ff80 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`; + const a10Process = readFileSync('../fixtures/bpmn/xml-parsing/miwg-A.1.0.bpmn'); const json = new BpmnXmlParser().parse(a10Process); @@ -639,100 +135,14 @@ describe('parse bpmn as xml for MIWG', () => { }); it('bpmn with attribute with french special characters, ensure special characters are present', () => { - const a10Process = ` - - - - _e16564d7-0c4c-413e-95f6-f668a3f851fb - - - _e16564d7-0c4c-413e-95f6-f668a3f851fb - _d77dd5ec-e4e7-420e-bbe7-8ac9cd1df599 - - - _d77dd5ec-e4e7-420e-bbe7-8ac9cd1df599 - _2aa47410-1b0e-4f8b-ad54-d6f798080cb4 - - - _2aa47410-1b0e-4f8b-ad54-d6f798080cb4 - _8e8fe679-eb3b-4c43-a4d6-891e7087ff80 - - - _8e8fe679-eb3b-4c43-a4d6-891e7087ff80 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`; + const a10Process = readFileSync('../fixtures/bpmn/xml-parsing/miwg-A.1.0_french_special_characters.bpmn'); const json = new BpmnXmlParser().parse(a10Process); expect(json).toMatchObject({ definitions: { process: { - startEvent: { name: 'événement de début' }, + startEvent: { name: 'évènement de début' }, task: [{ id: 'à_ec59e164-68b4-4f94-98de-ffb1c58a84af' }, expect.anything(), expect.anything()], }, BPMNDiagram: expect.anything(), @@ -740,94 +150,8 @@ describe('parse bpmn as xml for MIWG', () => { }); }); - it('bpmn with attribute with japan special characters, ensure special characters are present', () => { - const a10Process = ` - - - - _e16564d7-0c4c-413e-95f6-f668a3f851fb - - - _e16564d7-0c4c-413e-95f6-f668a3f851fb - _d77dd5ec-e4e7-420e-bbe7-8ac9cd1df599 - - - _d77dd5ec-e4e7-420e-bbe7-8ac9cd1df599 - _2aa47410-1b0e-4f8b-ad54-d6f798080cb4 - - - _2aa47410-1b0e-4f8b-ad54-d6f798080cb4 - _8e8fe679-eb3b-4c43-a4d6-891e7087ff80 - - - _8e8fe679-eb3b-4c43-a4d6-891e7087ff80 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`; + it('bpmn with attribute with japanese special characters, ensure special characters are present', () => { + const a10Process = readFileSync('../fixtures/bpmn/xml-parsing/miwg-A.1.0_japanese_special_characters.bpmn'); const json = new BpmnXmlParser().parse(a10Process); @@ -843,93 +167,7 @@ describe('parse bpmn as xml for MIWG', () => { }); it('bpmn with attribute with html special characters, ensure special characters are present', () => { - const a10Process = ` - - - - _e16564d7-0c4c-413e-95f6-f668a3f851fb - - - _e16564d7-0c4c-413e-95f6-f668a3f851fb - _d77dd5ec-e4e7-420e-bbe7-8ac9cd1df599 - - - _d77dd5ec-e4e7-420e-bbe7-8ac9cd1df599 - _2aa47410-1b0e-4f8b-ad54-d6f798080cb4 - - - _2aa47410-1b0e-4f8b-ad54-d6f798080cb4 - _8e8fe679-eb3b-4c43-a4d6-891e7087ff80 - - - _8e8fe679-eb3b-4c43-a4d6-891e7087ff80 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`; + const a10Process = readFileSync('../fixtures/bpmn/xml-parsing/miwg-A.1.0_html_special_characters.bpmn'); const json = new BpmnXmlParser().parse(a10Process);