├── .gitignore ├── .travis.yml ├── BPMNspector ├── BPMNspector.bat ├── LICENSE ├── README.md ├── build.gradle ├── config └── pmd.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── lib └── phloc-schematron-2.6.4.jar └── src ├── main ├── java │ ├── api │ │ ├── Location.java │ │ ├── LocationCoordinate.java │ │ ├── Resource.java │ │ ├── SimpleValidationResult.java │ │ ├── UnsortedValidationResult.java │ │ ├── ValidationException.java │ │ ├── ValidationResult.java │ │ ├── Validator.java │ │ ├── Violation.java │ │ └── Warning.java │ └── de │ │ └── uniba │ │ └── dsg │ │ └── bpmnspector │ │ ├── BPMNspector.java │ │ ├── BPMNspectorMain.java │ │ ├── BpmnProcessValidator.java │ │ ├── FixOption.java │ │ ├── MojoValidator.java │ │ ├── ReportOption.java │ │ ├── ValidationOption.java │ │ ├── autofix │ │ ├── BpmnXPathHelper.java │ │ ├── ConstraintFixer.java │ │ ├── EXT012FirstOptionNotExecutableFixer.java │ │ ├── EXT012SecondOptionMarkFormalExpFixer.java │ │ ├── EXT097AutoFixer.java │ │ ├── EXT098RemoveInvalidTypeFixer.java │ │ ├── EXT105AutoFixer.java │ │ ├── EXT106RemoveInvalidTypeFixer.java │ │ ├── EXT128AutoFixer.java │ │ ├── EXT150AutoFixer.java │ │ ├── EXT151AutoFixer.java │ │ ├── FixReport.java │ │ ├── FixerIdentifier.java │ │ ├── FixerRepository.java │ │ ├── FixingStrategy.java │ │ ├── SingleViolationFixerInterface.java │ │ └── ViolationFixer.java │ │ ├── cli │ │ ├── AutoFixController.java │ │ ├── BPMNspectorCli.java │ │ ├── CliException.java │ │ ├── CliParameter.java │ │ └── FixStrategySelectorUI.java │ │ ├── common │ │ ├── importer │ │ │ ├── BPMNProcess.java │ │ │ └── ProcessImporter.java │ │ ├── util │ │ │ ├── ConstantHelper.java │ │ │ ├── FileUtils.java │ │ │ ├── HtmlReportGenerator.java │ │ │ ├── ResourceUtils.java │ │ │ └── XmlWriterApi.java │ │ └── xsdvalidation │ │ │ ├── AbstractXsdValidator.java │ │ │ ├── BpmnXsdValidator.java │ │ │ ├── Input.java │ │ │ ├── ResourceResolver.java │ │ │ ├── WsdlValidator.java │ │ │ └── XsdValidationErrorHandler.java │ │ ├── refcheck │ │ ├── BPMNElement.java │ │ ├── BPMNReferenceValidator.java │ │ ├── Reference.java │ │ ├── ReferenceChecker.java │ │ ├── ReferenceLoader.java │ │ └── utils │ │ │ ├── JDOMUtils.java │ │ │ └── ViolationMessageCreator.java │ │ └── schematron │ │ ├── Ext002Checker.java │ │ ├── SchematronBPMNValidator.java │ │ └── preprocessing │ │ └── PreProcessor.java └── resources │ ├── BPMN20.xsd │ ├── BPMNDI.xsd │ ├── DC.xsd │ ├── DI.xsd │ ├── EXT_analytic.sch │ ├── EXT_commonExec.sch │ ├── EXT_descriptive.sch │ ├── EXT_full.sch │ ├── Semantic.xsd │ ├── logback.xml │ ├── references.xml │ ├── references.xsd │ ├── reporting │ ├── ValidationResult.vm │ ├── ValidationSummary.vm │ └── res │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── logo-h100.png │ └── wsdl20.xsd └── test ├── java └── de │ └── uniba │ └── dsg │ └── bpmnspector │ ├── MojoTestProcesses.java │ ├── SystemTest.java │ ├── api │ └── tests │ │ ├── ValidationResultTests.java │ │ ├── ValidatorTests.java │ │ └── ViolationTests.java │ ├── autofix │ ├── ConstraintFixerTests.java │ ├── DocHandlingHelper.java │ ├── EXT012FirstOptionNotExecutableFixerTests.java │ ├── EXT012SecondOptionMarkFormalExpFixerTests.java │ ├── EXT097AutoFixerTests.java │ ├── EXT098RemoveInvalidTypeFixerTests.java │ ├── EXT105AutoFixerTests.java │ ├── EXT106RemoveInvalidTypeFixerTests.java │ ├── EXT128AutoFixerTests.java │ ├── EXT150AutoFixerTests.java │ └── EXT151AutoFixerTests.java │ ├── common │ ├── cli │ │ └── TestBPMNspectorCli.java │ └── importer │ │ └── BPMNProcessTest.java │ ├── refcheck │ └── tests │ │ ├── ReferenceLoaderTests.java │ │ └── TestBPMNFiles.java │ ├── schematron │ ├── Path.java │ ├── PreProcessing.java │ ├── TestCase.java │ ├── Wsdl.java │ ├── Xsd.java │ ├── analytic │ │ ├── Ext057.java │ │ ├── Ext058.java │ │ ├── Ext059.java │ │ ├── Ext061.java │ │ ├── Ext062.java │ │ ├── Ext091.java │ │ ├── Ext092.java │ │ ├── Ext110.java │ │ ├── Ext111.java │ │ ├── Ext112.java │ │ ├── Ext113.java │ │ ├── Ext114.java │ │ ├── Ext115.java │ │ ├── Ext116.java │ │ ├── Ext117.java │ │ ├── Ext118.java │ │ ├── Ext119.java │ │ ├── Ext122.java │ │ ├── Ext123.java │ │ ├── Ext124.java │ │ ├── Ext125.java │ │ ├── Ext126.java │ │ ├── Ext136.java │ │ ├── Ext137.java │ │ ├── Ext138.java │ │ ├── Ext139.java │ │ ├── Ext140.java │ │ ├── Ext141.java │ │ ├── Ext142.java │ │ ├── Ext143.java │ │ ├── Ext144.java │ │ ├── Ext148.java │ │ └── Ext149.java │ ├── artifacts │ │ ├── AbstractArtifactTest.java │ │ ├── Ext008.java │ │ ├── Ext009.java │ │ └── sequenzflow │ │ │ ├── AbstractArtifactSequenceFlowTest.java │ │ │ ├── Ext006.java │ │ │ └── Ext007.java │ ├── commonExec │ │ ├── Ext011.java │ │ ├── Ext012.java │ │ ├── Ext013.java │ │ ├── Ext017.java │ │ ├── Ext018.java │ │ ├── Ext019.java │ │ ├── Ext020.java │ │ ├── Ext024.java │ │ ├── Ext035.java │ │ ├── Ext042.java │ │ ├── Ext043.java │ │ ├── Ext044.java │ │ ├── Ext045.java │ │ ├── Ext046.java │ │ ├── Ext047.java │ │ ├── Ext048.java │ │ ├── Ext049.java │ │ ├── Ext050.java │ │ ├── Ext051.java │ │ ├── Ext052.java │ │ ├── Ext053.java │ │ ├── Ext063.java │ │ ├── Ext064.java │ │ ├── Ext065.java │ │ ├── Ext067.java │ │ ├── Ext068.java │ │ ├── Ext069.java │ │ ├── Ext070.java │ │ ├── Ext085.java │ │ ├── Ext086.java │ │ ├── Ext087.java │ │ ├── Ext089.java │ │ ├── Ext090.java │ │ ├── Ext093.java │ │ ├── Ext094.java │ │ ├── Ext127.java │ │ └── Ext128.java │ ├── descriptive │ │ ├── Ext001.java │ │ ├── Ext002.java │ │ ├── Ext021.java │ │ ├── Ext022.java │ │ ├── Ext023.java │ │ ├── Ext025.java │ │ ├── Ext026.java │ │ ├── Ext028.java │ │ ├── Ext031.java │ │ ├── Ext036.java │ │ ├── Ext056.java │ │ ├── Ext076.java │ │ ├── Ext079.java │ │ ├── Ext084.java │ │ ├── Ext088.java │ │ ├── Ext095.java │ │ ├── Ext096.java │ │ ├── Ext097.java │ │ ├── Ext098.java │ │ ├── Ext099.java │ │ ├── Ext100.java │ │ ├── Ext101.java │ │ ├── Ext102.java │ │ ├── Ext103.java │ │ ├── Ext104.java │ │ ├── Ext105.java │ │ ├── Ext106.java │ │ ├── Ext107.java │ │ ├── Ext108.java │ │ ├── Ext109.java │ │ ├── Ext135.java │ │ ├── Ext146.java │ │ ├── Ext150.java │ │ ├── Ext151.java │ │ └── Ext152.java │ └── full │ │ ├── Ext027.java │ │ ├── Ext029.java │ │ ├── Ext030.java │ │ ├── Ext032.java │ │ ├── Ext033.java │ │ ├── Ext037.java │ │ └── Ext038.java │ └── xsdvalidation │ └── tests │ └── NonWellformedXmlTests.java └── resources ├── 100 ├── fail_event.bpmn ├── fail_event_ref.bpmn ├── fail_event_transaction.bpmn ├── success.bpmn └── success_event_sub.bpmn ├── 101 ├── fail.bpmn └── success.bpmn ├── 102 └── Fail.bpmn ├── 103 ├── Fail.bpmn ├── Success.bpmn └── Success_ref.bpmn ├── 104 ├── fail.bpmn └── success.bpmn ├── 105 ├── fail_end_without_sub-events.bpmn ├── fail_with_sub-startevent.bpmn ├── success_with_sub-events.bpmn └── success_without_sub-events.bpmn ├── 106 ├── fail_cancel_end_event.bpmn ├── fail_cancel_end_event_manualFix.bpmn ├── fail_sub_process.bpmn ├── fail_sub_process_manualFix.bpmn ├── success_cancel_boundary_event.bpmn └── success_cancel_event.bpmn ├── 107 ├── fail.bpmn └── success.bpmn ├── 108 └── Fail.bpmn ├── 109 ├── Fail.bpmn ├── Success.bpmn └── Success_ref.bpmn ├── 110 ├── EXT110_failure_cancel_link.bpmn ├── EXT110_failure_cancel_none.bpmn ├── EXT110_failure_cancel_terminate.bpmn ├── EXT110_failure_noCancel_cancel.bpmn ├── EXT110_failure_noCancel_compensate.bpmn ├── EXT110_failure_noCancel_error.bpmn ├── EXT110_failure_noCancel_none.bpmn ├── EXT110_failure_noCancel_terminate.bpmn └── EXT110_success_cancel_message.bpmn ├── 111 ├── EXT111_failure_cancel_subprocess.bpmn ├── EXT111_failure_cancel_task.bpmn └── EXT111_success.bpmn ├── 112 └── EXT112_failure_incomingSeqFlow.bpmn ├── 113 └── EXT113_failure_noSeqFlow.bpmn ├── 114 ├── EXT114_failure_compensateSeqFlow.bpmn └── EXT114_success_association.bpmn ├── 115 ├── EXT115_failure_noIncoming.bpmn ├── EXT115_failure_noIncomingCatch.bpmn ├── EXT115_success_StartEnd.bpmn └── EXT115_success_noStartEnd.bpmn ├── 116 ├── EXT116_failure_noOutgoing.bpmn └── EXT116_failure_noOutgoingCatch.bpmn ├── 117 ├── EXT117_failure_catchIncoming.bpmn ├── EXT117_failure_throwOutgoing.bpmn └── EXT117_success.bpmn ├── 118 ├── EXT118_failure_wrongTarget.bpmn ├── EXT118_success.bpmn └── EXT118_success_multipleSources.bpmn ├── 119 ├── EXT119_failure_catchInOut.bpmn ├── EXT119_failure_catchOutgoing.bpmn ├── EXT119_failure_throwInOut.bpmn ├── EXT119_failure_throwIncoming.bpmn ├── EXT119_success_catchIncoming.bpmn └── EXT119_success_throwOutgoing.bpmn ├── 122 ├── EXT122_failure.bpmn └── EXT122_success.bpmn ├── 123 ├── EXT123_failure_emptyCondition.bpmn ├── EXT123_failure_noFormalCondition.bpmn ├── EXT123_success_formalCondition.bpmn └── EXT123_success_notExecutable.bpmn ├── 124 └── EXT124_failure_noSource.bpmn ├── 125 └── EXT125_failure_noTarget.bpmn ├── 126 ├── EXT126_failure.bpmn └── EXT126_success_inSubProcess.bpmn ├── 127 ├── EXT127_failure_boundary.bpmn ├── EXT127_failure_endEvent.bpmn ├── EXT127_failure_intCatch.bpmn ├── EXT127_failure_intThrow.bpmn ├── EXT127_failure_startEvent.bpmn ├── EXT127_success_boundary.bpmn ├── EXT127_success_endEvent.bpmn ├── EXT127_success_intCatch.bpmn ├── EXT127_success_intThrow.bpmn ├── EXT127_success_notExecutable.bpmn └── EXT127_success_startEvent.bpmn ├── 128 ├── EXT128_failure_boundary.bpmn ├── EXT128_failure_endEvent.bpmn ├── EXT128_failure_endEvent_manualFix.bpmn ├── EXT128_failure_intCatch.bpmn ├── EXT128_failure_intThrow.bpmn ├── EXT128_failure_startEvent.bpmn └── EXT128_success_notExecutable.bpmn ├── 135 ├── fail.bpmn ├── fail_ex_no_connection.bpmn ├── fail_no_connection.bpmn ├── success_multiple_in_and_out.bpmn └── success_multiple_out.bpmn ├── 136 ├── EXT136_failure.bpmn └── EXT136_success.bpmn ├── 137 └── EXT137_failure.bpmn ├── 138 ├── EXT138_failure_invalidEventType.bpmn ├── EXT138_failure_invalidTaskType.bpmn ├── EXT138_failure_invalidThrowEvent.bpmn └── EXT138_success_receiveTask.bpmn ├── 139 └── EXT139_failure.bpmn ├── 140 └── EXT140_failure.bpmn ├── 141 └── EXT141_failure.bpmn ├── 142 ├── EXT142_failure.bpmn └── EXT142_success.bpmn ├── 143 ├── EXT143_failure.bpmn └── EXT143_success.bpmn ├── 144 └── EXT144_failure.bpmn ├── 146 ├── fail_conditional.bpmn ├── fail_link.bpmn ├── fail_multiple.bpmn ├── fail_timer.bpmn ├── fail_timer_ref.bpmn ├── success.bpmn └── success_multiple.bpmn ├── 148 ├── EXT148_failure_cancelCatch.bpmn ├── EXT148_failure_compensateCatch.bpmn ├── EXT148_failure_errorCatch.bpmn ├── EXT148_failure_escalationCatch.bpmn ├── EXT148_failure_noneCatch.bpmn └── EXT148_failure_terminateCatch.bpmn ├── 149 ├── EXT149_failure_cancelThrow.bpmn ├── EXT149_failure_conditionalThrow.bpmn ├── EXT149_failure_errorThrow.bpmn ├── EXT149_failure_terminateThrow.bpmn └── EXT149_failure_timerThrow.bpmn ├── 150 ├── fail_normal_sequence_flow_missing_1.bpmn ├── fail_normal_sequence_flow_missing_2.bpmn ├── fail_sequence_flow_in_sub_process_missing_1.bpmn ├── success.bpmn ├── success_2.bpmn └── success_linkevent.bpmn ├── 151 ├── fail_normal_sequence_flow_missing_1.bpmn ├── fail_normal_sequence_flow_missing_2.bpmn ├── fail_sequence_flow_in_sub_process_missing_1.bpmn ├── success.bpmn ├── success_2.bpmn └── success_linkevent.bpmn ├── 152 ├── fail_1.bpmn ├── fail_2.bpmn └── success.bpmn ├── 001 ├── Fail.bpmn ├── Fail2.bpmn ├── File.bpmn └── Success.bpmn ├── 002 ├── fail_import.bpmn ├── fail_import2.bpmn ├── fail_import3.bpmn ├── fail_import_URL.bpmn ├── import.bpmn ├── import2.bpmn ├── success_import.bpmn └── success_import_URL.bpmn ├── 006 ├── Fail_association.bpmn ├── Fail_group.bpmn └── Fail_text_annotation.bpmn ├── 007 ├── Fail_association.bpmn ├── Fail_group.bpmn └── Fail_text_annotation.bpmn ├── 008 ├── Fail_association.bpmn ├── Fail_group.bpmn └── Fail_text_annotation.bpmn ├── 009 ├── Fail_association.bpmn ├── Fail_group.bpmn └── Fail_text_annotation.bpmn ├── 010 └── Success.bpmn ├── 011 ├── EXT011_failure_endEventNoEscCode.bpmn ├── EXT011_failure_endEventNoRef.bpmn ├── EXT011_failure_intermediateThrowNoEscCode.bpmn ├── EXT011_success_boundaryNoEscCode.bpmn ├── EXT011_success_endEvent.bpmn ├── EXT011_success_intermediateThrow.bpmn └── EXT011_success_notExecutable.bpmn ├── 012 ├── EXT012_failure_adHocSubProcess.bpmn ├── EXT012_failure_assignment.bpmn ├── EXT012_failure_complexGateway.bpmn ├── EXT012_failure_multiInstanceLoopCharacteristics_invalidCardinality.bpmn ├── EXT012_failure_multiInstanceLoopCharacteristics_invalidCompletionCondition.bpmn ├── EXT012_failure_sequenceFlow.bpmn ├── EXT012_failure_sequenceFlow_manualFix.bpmn ├── EXT012_failure_standardLoopCharacteristics.bpmn ├── EXT012_failure_timerEvent_timeCycle.bpmn ├── EXT012_failure_timerEvent_timeDate.bpmn ├── EXT012_failure_timerEvent_timeDuration.bpmn ├── EXT012_success_adHocSubProcess.bpmn ├── EXT012_success_adHocSubProcessNamespacePrefix.bpmn ├── EXT012_success_assignment.bpmn ├── EXT012_success_complexGateway.bpmn ├── EXT012_success_multiInstanceLoopCharacteristics.bpmn ├── EXT012_success_sequenceFlow.bpmn ├── EXT012_success_standardLoopCharacteristics.bpmn ├── EXT012_success_timerEvent_timeCycle.bpmn ├── EXT012_success_timerEvent_timeDate.bpmn └── EXT012_success_timerEvent_timeDuration.bpmn ├── 013 ├── EXT013_failure_complexBehaviorDefinition.bpmn ├── EXT013_failure_correlation.bpmn ├── EXT013_failure_timerEvent_timeDate_noBody.bpmn ├── EXT013_failure_transformation.bpmn ├── EXT013_success_complexBehaviorDefinition.bpmn ├── EXT013_success_correlation.bpmn └── EXT013_success_transformation.bpmn ├── 017 ├── EXT017_failure_exclusiveGateway.bpmn ├── EXT017_success_complexGateway.bpmn ├── EXT017_success_exclusiveGateway.bpmn ├── EXT017_success_inclusiveGateway.bpmn └── EXT017_success_parallelGateway.bpmn ├── 018 ├── EXT018_failure_exclusiveGateway.bpmn └── EXT018_failure_parallelGateway.bpmn ├── 019 ├── EXT019_failure_exclusiveDiverging.bpmn ├── EXT019_failure_parallelConverging.bpmn └── EXT019_success_parallel.bpmn ├── 020 ├── EXT020_failure_dataInput.bpmn ├── EXT020_failure_dataInput_defaultValue.bpmn ├── EXT020_failure_dataObject.bpmn ├── EXT020_failure_dataOutput.bpmn ├── EXT020_success.bpmn ├── EXT020_success_noCollection.bpmn └── EXT020_success_noCollection_defaultValues.bpmn ├── 021 ├── fail_event_sub_process.bpmn ├── success_events.bpmn ├── success_gateways.bpmn └── success_tasks.bpmn ├── 022 ├── fail_event_sub_process.bpmn ├── success_event_in_normal_subprocess.bpmn ├── success_events.bpmn ├── success_gateways.bpmn └── success_tasks.bpmn ├── 023 ├── fail_no_incoming.bpmn ├── fail_no_outgoing.bpmn └── success.bpmn ├── 024 ├── EXT024_failure.bpmn └── EXT024_success.bpmn ├── 025 ├── fail.bpmn ├── fail_2.bpmn ├── success.bpmn ├── success_2.bpmn └── success_no_condition.bpmn ├── 026 ├── fail_activity.bpmn ├── fail_gateway.bpmn └── success.bpmn ├── 027 ├── EXT027_failure_choreography.bpmn ├── EXT027_failure_globalConversation.bpmn ├── EXT027_success_chorNoRef.bpmn └── EXT027_success_globalConversation.bpmn ├── 028 ├── Fail.bpmn └── Success.bpmn ├── 029 ├── EXT029_failure.bpmn └── EXT029_success.bpmn ├── 030 ├── EXT030_failure.bpmn └── EXT030_success.bpmn ├── 031 ├── Fail_circle.bpmn ├── Fail_message_flow_from_pool.bpmn ├── Fail_message_flow_in_same_pool.bpmn ├── Fail_message_flow_to_pool.bpmn └── Success.bpmn ├── 032 ├── EXT032_failure.bpmn └── EXT032_success.bpmn ├── 033 ├── EXT033_failure.bpmn └── EXT033_success.bpmn ├── 035 ├── EXT035_failure.bpmn └── EXT035_success.bpmn ├── 036 ├── fail_call_choreography.bpmn ├── fail_choreography_task.bpmn └── fail_sub_choreography.bpmn ├── 037 ├── EXT037_failure.bpmn └── EXT037_success.bpmn ├── 038 ├── EXT038_failure.bpmn └── EXT038_success.bpmn ├── 042 ├── EXT042_failure.bpmn └── EXT042_success.bpmn ├── 043 └── EXT043_failure.bpmn ├── 044 ├── EXT044_failure_differentItemDef_noStructureRef.bpmn ├── EXT044_failure_differentItemDef_unequalStructureRef.bpmn └── EXT044_success_differentItemDef_equalStructureRef.bpmn ├── 045 ├── EXT045_failure_differentItemDef_noStructureRef.bpmn ├── EXT045_failure_differentItemDef_unequalStructureRef.bpmn ├── EXT045_success_differentItemDef_equalStructureRef.bpmn └── EXT045_success_operationNoOutMessage.bpmn ├── 046 ├── EXT046_failure.bpmn └── EXT046_success.bpmn ├── 047 ├── EXT047_failure.bpmn └── EXT047_success.bpmn ├── 048 ├── EXT048_failure.bpmn ├── EXT048_failure_differentItemDef_unequalStructureRef.bpmn └── EXT048_success_differentItemDef_equalStructureRef.bpmn ├── 049 ├── EXT049_failure.bpmn ├── EXT049_success.bpmn └── EXT049_success_instantiateFalse.bpmn ├── 050 ├── EXT050_failure.bpmn └── EXT050_success.bpmn ├── 051 └── EXT051_failure.bpmn ├── 052 ├── EXT052_failure.bpmn ├── EXT052_failure_differentItemDef_unequalStructureRef.bpmn └── EXT052_success_differentItemDef_equalStructureRef.bpmn ├── 053 ├── EXT053_failure.bpmn └── EXT053_success.bpmn ├── 056 ├── fail_call_choreography.bpmn ├── fail_choreography_task.bpmn ├── fail_choreography_task_transaction.bpmn └── fail_sub_choreography.bpmn ├── 057 ├── EXT057_fail_incoming_seqFlow.bpmn ├── EXT057_fail_outgoing_seqFlow.bpmn ├── EXT057_success_no_eventSubProcess.bpmn └── EXT057_success_no_seqFlow.bpmn ├── 058 ├── EXT058_fail_noStartEvent.bpmn └── EXT058_fail_twoStartEvents.bpmn ├── 059 ├── EXT059_fail_illegal_cancelEventDef.bpmn ├── EXT059_fail_illegal_linkEventDef.bpmn ├── EXT059_fail_illegal_terminateEventDef.bpmn ├── EXT059_fail_no_eventDef.bpmn ├── EXT059_fail_nonInterrupting_illegal_compensateEventDef.bpmn ├── EXT059_fail_nonInterrupting_illegal_errorEventDef.bpmn ├── EXT059_success_interrupting_compensateEventDef.bpmn └── EXT059_success_interrupting_errorEventDef.bpmn ├── 061 ├── EXT061_fail_empty_AdHoc.bpmn └── EXT061_success.bpmn ├── 062 ├── EXT062_failure_EndEvent.bpmn ├── EXT062_failure_StartEvent.bpmn ├── EXT062_failure_chorActivity.bpmn └── EXT062_success_DataSeqFlow.bpmn ├── 063 ├── EXT063_failure_calledGlobalTask_additionalOutput.bpmn ├── EXT063_failure_calledProcess_additionalInput.bpmn ├── EXT063_failure_calledProcess_inputMissing.bpmn ├── EXT063_failure_calledProcess_itemsNotMatching.bpmn ├── EXT063_failure_calledProcess_outputMissing.bpmn ├── EXT063_success_calledGlobalTask.bpmn ├── EXT063_success_calledProcess.bpmn └── EXT063_success_calledProcess_differentItemsMatchingStructure.bpmn ├── 064 ├── EXT064_failure_calledGlobalTask.bpmn ├── EXT064_failure_calledProcess.bpmn ├── EXT064_success_calledGlobalTask.bpmn └── EXT064_success_calledProcess.bpmn ├── 065 ├── EXT065_failure_calledGlobalTask_wrongOutputData.bpmn └── EXT065_failure_calledProcess_wrongInputData.bpmn ├── 067 ├── EXT067_failure.bpmn ├── EXT067_success_loopCardinality.bpmn └── EXT067_success_loopDataInputRef.bpmn ├── 068 └── EXT068_failure.bpmn ├── 069 ├── EXT069_failure_isCollection.bpmn ├── EXT069_failure_unequalStructureRef.bpmn └── EXT069_success.bpmn ├── 070 ├── EXT070_failure_isCollection.bpmn ├── EXT070_failure_unequalStructureRef.bpmn └── EXT070_success.bpmn ├── 076 ├── Fail_1.bpmn ├── Fail_2.bpmn ├── Fail_3.bpmn └── Success.bpmn ├── 079 ├── fail.bpmn └── success.bpmn ├── 084 ├── Fail.bpmn └── success.bpmn ├── 085 ├── EXT085_failure.bpmn └── EXT085_success.bpmn ├── 086 ├── EXT086_failure.bpmn └── EXT086_success.bpmn ├── 087 ├── EXT087_failure_invalidReferencing.bpmn ├── EXT087_failure_missingInputSetRef.bpmn ├── EXT087_failure_missingOutputSetRef.bpmn └── EXT087_success.bpmn ├── 088 ├── fail.bpmn └── success.bpmn ├── 089 ├── EXT089_failure.bpmn └── EXT089_success.bpmn ├── 090 ├── EXT090_failure.bpmn └── EXT090_success.bpmn ├── 091 ├── EXT091_failure_differentStructureRef.bpmn ├── EXT091_success_equalItemDef.bpmn ├── EXT091_success_identicalItemDef.bpmn └── EXT091_success_withTransformation.bpmn ├── 092 ├── EXT092_failure_twoSourceRefs.bpmn └── EXT092_success_withTransformation.bpmn ├── 093 ├── EXT093_failure_boundaryEvent_missingDataOutput.bpmn ├── EXT093_failure_endEvent_missingDataInput.bpmn ├── EXT093_failure_intCatch_missingDataOutput.bpmn ├── EXT093_failure_intThrow_missingDataInput.bpmn ├── EXT093_failure_startEvent_missingDataOutput.bpmn ├── EXT093_success_boundaryEvent.bpmn ├── EXT093_success_endEvent.bpmn ├── EXT093_success_intCatch.bpmn ├── EXT093_success_intThrow.bpmn └── EXT093_success_startEvent.bpmn ├── 094 ├── EXT094_failure_multiple.bpmn ├── EXT094_failure_singleErrorEvent.bpmn ├── EXT094_failure_singleEscalationEvent.bpmn ├── EXT094_failure_singleMessageEvent.bpmn ├── EXT094_failure_singleSignalEvent.bpmn ├── EXT094_success_singleErrorEvent.bpmn ├── EXT094_success_singleEscalationEvent.bpmn ├── EXT094_success_singleMessageEvent.bpmn └── EXT094_success_singleSignalEvent.bpmn ├── 095 ├── Fail.bpmn ├── Success.bpmn └── fail_end.bpmn ├── 096 └── Fail.bpmn ├── 097 ├── fail_end_without_sub-events.bpmn ├── fail_with_sub-endevent.bpmn ├── multiple_tasks_with_no_start.bpmn ├── single_task_with_no_start.bpmn ├── success_with_sub-events.bpmn └── success_without_sub-events.bpmn ├── 098 ├── fail_cancel.bpmn ├── fail_compensate.bpmn ├── fail_error.bpmn ├── fail_escalation.bpmn ├── fail_escalation_ref.bpmn ├── fail_link.bpmn ├── fail_multiple.bpmn ├── fail_multiple_manualFix.bpmn ├── fail_terminate.bpmn ├── success_conditional.bpmn ├── success_message.bpmn ├── success_multiple.bpmn ├── success_none.bpmn ├── success_signal.bpmn └── success_timer.bpmn ├── 099 ├── fail_call_ref_process.bpmn ├── fail_event.bpmn ├── fail_eventref.bpmn ├── ref_process.bpmn ├── success.bpmn └── success_global.bpmn ├── mojo ├── failure_collaboration_deadlock.bpmn ├── failure_no-detection-deadlock-in-subprocess.bpmn ├── invalid_IOR-Split_Par-Merge.bpmn ├── invalid_LoopWithParallelSplit.bpmn ├── invalid_moreComplexLoopParSplit.bpmn ├── invalid_multipleParallelXorMixed.bpmn ├── valid_eventbased-split_XOR-merge.bpmn ├── valid_multipleParSplitCrossMerge.bpmn ├── valid_multipleParallel.bpmn ├── valid_multipleParallelXorCrossSplitMerge.bpmn ├── valid_parSplitIORMerge.bpmn ├── valid_simpleXorSplit2Ends.bpmn ├── warning_boundaryEvent.bpmn ├── warning_conditionalSeqFlow.bpmn ├── warning_intermediateEvents.bpmn ├── warning_mojo-cross-send-receive.bpmn └── warning_subprocess.bpmn ├── non-wellformed ├── import_non_wellformed.bpmn ├── import_wsdl_non_wellformed.bpmn ├── import_xsd_non_wellformed.bpmn ├── simple_corrupt.xsd ├── single_process.bpmn └── wsdl2primer_corrupt.wsdl ├── path ├── folder │ ├── import.bpmn │ └── success_import.bpmn ├── import.bpmn ├── import_URL.bpmn └── success_import.bpmn ├── preprocessing ├── fail_call_participant_process.bpmn ├── fail_call_ref_process.bpmn ├── fail_call_ref_process_call.bpmn ├── fail_call_ref_process_call_call.bpmn ├── ref_participant_process.bpmn ├── ref_process.bpmn └── testTnsIdReplacement.bpmn ├── refCheck_existenceViolation_MsgEventDef_messageRef.bpmn ├── subfolder └── test-18-referenz-6-teil-1.bpmn ├── test-1-gruppe-c.bpmn ├── test-10-gruppe-n.bpmn ├── test-11-gruppe-o.bpmn ├── test-12-gruppe-p.bpmn ├── test-13-gruppe-q.bpmn ├── test-14-gruppe-r.bpmn ├── test-15-gruppe-s.bpmn ├── test-16-gruppe-t.bpmn ├── test-17-gruppe-u.bpmn ├── test-18-referenz-6-teil-1.bpmn ├── test-18-referenz-6-teil-2-absolute.bpmn ├── test-18-referenz-6-teil-2-subfolder.bpmn ├── test-18-referenz-6-teil-2.bpmn ├── test-19-referenz-6-korrekt.bpmn ├── test-2-gruppe-d.bpmn ├── test-3-gruppe-e.bpmn ├── test-4-gruppe-f.bpmn ├── test-5-gruppe-g.bpmn ├── test-6-gruppe-h.bpmn ├── test-7-gruppe-i1.bpmn ├── test-8-gruppe-l.bpmn ├── test-9-gruppe-m.bpmn ├── test-import-2steps-step1.bpmn ├── test-import-2steps-step2.bpmn ├── test-import-2steps.bpmn ├── wsdl ├── wsdl-fail.bpmn ├── wsdl-success.bpmn ├── wsdl2primer-fail.wsdl └── wsdl2primer.wsdl └── xsd └── xsdfail.bpmn /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | bin/ 3 | build/ 4 | out/ 5 | .classpath 6 | .project 7 | .settings/* 8 | .gradle/ 9 | validator.log 10 | *.iml 11 | *.ipr 12 | *.iws 13 | .idea/* 14 | reports/ -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: true 2 | 3 | language: java 4 | jdk: 5 | - oraclejdk8 6 | 7 | script: 8 | - ./gradlew check --info 9 | 10 | after_success: 11 | - ./gradlew jacocoTestReport coveralls 12 | -------------------------------------------------------------------------------- /BPMNspector: -------------------------------------------------------------------------------- 1 | ./gradlew run -Pargs="$*" -------------------------------------------------------------------------------- /BPMNspector.bat: -------------------------------------------------------------------------------- 1 | gradlew run -Pargs="%*" -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uniba-dsg/BPMNspector/55f1ce8d7c46fc247f2c55df51f80d297615128e/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Aug 02 21:51:30 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-all.zip 7 | -------------------------------------------------------------------------------- /lib/phloc-schematron-2.6.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uniba-dsg/BPMNspector/55f1ce8d7c46fc247f2c55df51f80d297615128e/lib/phloc-schematron-2.6.4.jar -------------------------------------------------------------------------------- /src/main/java/api/LocationCoordinate.java: -------------------------------------------------------------------------------- 1 | package api; 2 | 3 | public final class LocationCoordinate { 4 | 5 | public static final LocationCoordinate EMPTY = new LocationCoordinate(-1, -1); 6 | 7 | private final int row; 8 | private final int column; 9 | 10 | public LocationCoordinate(int row, int column) { 11 | this.row = row; 12 | this.column = column; 13 | } 14 | 15 | public int getRow() { 16 | return row; 17 | } 18 | 19 | public int getColumn() { 20 | return column; 21 | } 22 | 23 | public String getId() { 24 | return String.format("%d,%d", row, column); 25 | } 26 | 27 | @Override 28 | public boolean equals(Object o) { 29 | if (this == o) return true; 30 | if (o == null || getClass() != o.getClass()) return false; 31 | 32 | LocationCoordinate location = (LocationCoordinate) o; 33 | 34 | if (column != location.column) return false; 35 | if (row != location.row) return false; 36 | 37 | return true; 38 | } 39 | 40 | @Override 41 | public int hashCode() { 42 | int result = row; 43 | result = 31 * result + column; 44 | return result; 45 | } 46 | 47 | @Override 48 | public String toString() { 49 | return "Location{" + 50 | "row=" + row + 51 | ", column=" + column + 52 | '}'; 53 | } 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/api/UnsortedValidationResult.java: -------------------------------------------------------------------------------- 1 | package api; 2 | 3 | import java.nio.file.Path; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import java.util.Objects; 7 | 8 | public class UnsortedValidationResult implements ValidationResult { 9 | 10 | private final List violations = new ArrayList<>(); 11 | private final List warnings = new ArrayList<>(); 12 | private final List resources = new ArrayList<>(); 13 | 14 | @Override public void addWarning(Warning warning) { 15 | warnings.add(warning); 16 | } 17 | 18 | @Override public void addViolation(Violation violation) { 19 | violations.add(violation); 20 | } 21 | 22 | @Override public void addFile(Path s) { 23 | resources.add(new Resource(s)); 24 | } 25 | 26 | @Override public void addResource(Resource resource) { 27 | resources.add(resource); 28 | } 29 | 30 | @Override public List getViolations() { 31 | return new ArrayList<>(violations); 32 | } 33 | 34 | @Override public List getWarnings() { 35 | return new ArrayList<>(warnings); 36 | } 37 | 38 | @Override public List getResources() { 39 | return new ArrayList<>(resources); 40 | } 41 | 42 | @Override 43 | public boolean equals(Object o) { 44 | if (this == o) { 45 | return true; 46 | } 47 | if (o == null || getClass() != o.getClass()) { 48 | return false; 49 | } 50 | UnsortedValidationResult that = (UnsortedValidationResult) o; 51 | return Objects.equals(violations, that.violations) && Objects.equals(warnings, that.warnings) && Objects 52 | .equals(resources, that.resources); 53 | } 54 | 55 | @Override 56 | public int hashCode() { 57 | return Objects.hash(violations, warnings, resources); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/api/ValidationException.java: -------------------------------------------------------------------------------- 1 | package api; 2 | 3 | public class ValidationException extends Exception { 4 | 5 | private static final long serialVersionUID = 5647199707160120246L; 6 | 7 | public ValidationException() { 8 | super(); 9 | } 10 | 11 | public ValidationException(String message) { 12 | super(message); 13 | } 14 | 15 | public ValidationException(String message, Throwable throwable) { 16 | super(message, throwable); 17 | } 18 | 19 | public ValidationException(Throwable throwable) { 20 | super(throwable); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/api/ValidationResult.java: -------------------------------------------------------------------------------- 1 | package api; 2 | 3 | import java.nio.file.Path; 4 | import java.util.List; 5 | import java.util.stream.Collectors; 6 | 7 | public interface ValidationResult { 8 | 9 | List getViolations(); 10 | 11 | List getWarnings(); 12 | 13 | List getResources(); 14 | 15 | void addWarning(Warning warning); 16 | 17 | void addViolation(Violation violation); 18 | 19 | void addFile(Path s); 20 | 21 | void addResource(Resource resource); 22 | 23 | default List getFoundFiles() { 24 | return getResources().stream().filter(r -> (r.getType() == Resource.ResourceType.FILE) && r.getPath().isPresent()) 25 | .map(r -> r.getPath().get()).collect(Collectors.toList()); 26 | } 27 | 28 | default List getViolatedConstraints() { 29 | return getViolations().stream().map(Violation::getConstraint).distinct().sorted().collect(Collectors.toList()); 30 | } 31 | 32 | default List getFilesWithViolations() { 33 | return getViolations().stream().map(v -> v.getLocation().getResource()) 34 | .filter(r -> (r.getType() == Resource.ResourceType.FILE && r.getPath().isPresent())) 35 | .map(r -> r.getPath().get()).distinct().sorted().collect(Collectors.toList()); 36 | } 37 | 38 | default List getResourcesWithViolations() { 39 | return getViolations().stream().map(v -> v.getLocation().getResource()).distinct().sorted().collect( 40 | Collectors.toList()); 41 | } 42 | 43 | default boolean isValid() { 44 | return getViolations().isEmpty(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/api/Validator.java: -------------------------------------------------------------------------------- 1 | package api; 2 | 3 | import java.nio.file.Path; 4 | import java.nio.file.Paths; 5 | 6 | public interface Validator { 7 | 8 | ValidationResult validate(Path file) throws ValidationException; 9 | 10 | default ValidationResult validate(String file) throws ValidationException { 11 | return validate(Paths.get(file)); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/api/Violation.java: -------------------------------------------------------------------------------- 1 | package api; 2 | 3 | import java.util.Objects; 4 | 5 | public final class Violation implements Comparable { 6 | 7 | // what 8 | private final String constraint; 9 | private final String message; 10 | 11 | // where 12 | private final Location location; 13 | 14 | public Violation(Location location, String message, String constraint) { 15 | this.location = Objects.requireNonNull(location); 16 | this.message = Objects.requireNonNull(message); 17 | this.constraint = Objects.requireNonNull(constraint); 18 | } 19 | 20 | public String getConstraint() { 21 | return constraint; 22 | } 23 | 24 | public String getMessage() { 25 | return message; 26 | } 27 | 28 | public Location getLocation() { 29 | return location; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "Violation{" + 35 | "constraint='" + constraint + '\'' + 36 | ", message='" + message + '\'' + 37 | ", indicator=" + location + 38 | '}'; 39 | } 40 | 41 | @Override 42 | public int compareTo(Violation o) { 43 | Objects.requireNonNull(o); 44 | 45 | if(getConstraint().equals(o.getConstraint())){ 46 | if(getMessage().equals(o.getMessage())) { 47 | return getLocation().compareTo(o.getLocation()); 48 | } else { 49 | return getMessage().compareTo(o.getMessage()); 50 | } 51 | } else { 52 | return getConstraint().compareTo(o.getConstraint()); 53 | } 54 | } 55 | 56 | @Override 57 | public boolean equals(Object o) { 58 | if (this == o) { 59 | return true; 60 | } 61 | if (o == null || getClass() != o.getClass()) { 62 | return false; 63 | } 64 | Violation violation = (Violation) o; 65 | return Objects.equals(constraint, violation.constraint) && Objects.equals(message, violation.message) && Objects 66 | .equals(location, violation.location); 67 | } 68 | 69 | @Override 70 | public int hashCode() { 71 | return Objects.hash(constraint, message, location); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/api/Warning.java: -------------------------------------------------------------------------------- 1 | package api; 2 | 3 | import java.util.Objects; 4 | 5 | public final class Warning implements Comparable { 6 | 7 | private final String message; 8 | private final Location location; 9 | 10 | public Warning(String message, Location location) { 11 | this.message = Objects.requireNonNull(message); 12 | this.location = Objects.requireNonNull(location); 13 | } 14 | 15 | public String getMessage() { 16 | return message; 17 | } 18 | 19 | public Location getLocation() { 20 | return location; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | return "Warning{" + 26 | "message='" + message + '\'' + 27 | ", indicator=" + location + 28 | '}'; 29 | } 30 | 31 | @Override 32 | public int compareTo(Warning o) { 33 | Objects.requireNonNull(o); 34 | 35 | if (getMessage().equals(o.getMessage())) { 36 | return getLocation().compareTo(o.getLocation()); 37 | } else { 38 | return getMessage().compareTo(o.getMessage()); 39 | } 40 | } 41 | 42 | @Override 43 | public boolean equals(Object o) { 44 | if (this == o) { 45 | return true; 46 | } 47 | if (o == null || getClass() != o.getClass()) { 48 | return false; 49 | } 50 | Warning warning = (Warning) o; 51 | return Objects.equals(message, warning.message) && Objects.equals(location, warning.location); 52 | } 53 | 54 | @Override 55 | public int hashCode() { 56 | return Objects.hash(message, location); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/de/uniba/dsg/bpmnspector/BpmnProcessValidator.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.common.importer.BPMNProcess; 6 | 7 | public interface BpmnProcessValidator { 8 | 9 | void validate(BPMNProcess process, ValidationResult validationResult) throws ValidationException; 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/de/uniba/dsg/bpmnspector/FixOption.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector; 2 | 3 | public enum FixOption { 4 | NONE("No fixes should be performed (default)"), 5 | AUTO("all fixable violations will be fixed automatically"), 6 | INTERACTIVE("ask for each violation"); 7 | 8 | private final String description; 9 | 10 | FixOption(String description) { 11 | this.description = description; 12 | } 13 | 14 | public String getDescription() { 15 | return description; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/de/uniba/dsg/bpmnspector/ReportOption.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector; 2 | 3 | public enum ReportOption { 4 | 5 | NONE("No report files should be created"), 6 | XML("create XML reports"), 7 | HTML("create HTML reports (default)"), 8 | ALL("create all report types"); 9 | 10 | 11 | private final String description; 12 | 13 | ReportOption(String description) { 14 | this.description = description; 15 | } 16 | 17 | public String getDescription() { 18 | return description; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/de/uniba/dsg/bpmnspector/ValidationOption.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector; 2 | 3 | public enum ValidationOption { 4 | 5 | XSD("performs an XML schema validation"), 6 | REF("checks the correctness of references"), 7 | EXT("checks conformance to EXT rules"), 8 | MOJO("checks soundness using mojo"); 9 | 10 | 11 | private final String description; 12 | 13 | ValidationOption(String description) { 14 | this.description = description; 15 | } 16 | 17 | public String getDescription() { 18 | return description; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/de/uniba/dsg/bpmnspector/autofix/EXT106RemoveInvalidTypeFixer.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.autofix; 2 | 3 | import de.uniba.dsg.bpmnspector.common.util.ConstantHelper; 4 | import org.jdom2.Document; 5 | import org.jdom2.Element; 6 | import org.jdom2.Namespace; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | 10 | import java.util.Optional; 11 | 12 | public class EXT106RemoveInvalidTypeFixer implements ViolationFixer { 13 | 14 | private static final Logger LOGGER = LoggerFactory.getLogger(EXT106RemoveInvalidTypeFixer.class.getSimpleName()); 15 | private static final String CONSTRAINT_ID = "EXT.106"; 16 | private static final FixingStrategy SUPPORTED_STRATEGY = FixingStrategy.REMOVE; 17 | 18 | private final BpmnXPathHelper bpmnXPathHelper = new BpmnXPathHelper(); 19 | 20 | @Override 21 | public String getConstraintId() { 22 | return CONSTRAINT_ID; 23 | } 24 | 25 | @Override 26 | public FixingStrategy getSupportedStrategy() { 27 | return SUPPORTED_STRATEGY; 28 | } 29 | 30 | @Override 31 | public String getDescription() { 32 | return "Removes the invalid cancel event definition - resulting in a 'None EndEvent'"; 33 | } 34 | 35 | @Override 36 | public Logger getLogger() { 37 | return LOGGER; 38 | } 39 | 40 | @Override 41 | public boolean fixSingleViolation(Document processAsDoc, String xPath) { 42 | Optional elementOptional = bpmnXPathHelper.findSingleElementForXPath(processAsDoc, xPath); 43 | 44 | if (!elementOptional.isPresent()) { 45 | return false; 46 | } 47 | elementOptional.get().removeChild("cancelEventDefinition", Namespace.getNamespace(ConstantHelper.BPMN_NAMESPACE_STRING)); 48 | 49 | return true; 50 | } 51 | 52 | public static FixerIdentifier getFixerIdentifier() { 53 | return new FixerIdentifier(CONSTRAINT_ID, SUPPORTED_STRATEGY); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/de/uniba/dsg/bpmnspector/autofix/FixReport.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.autofix; 2 | 3 | import api.Violation; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | public class FixReport { 9 | 10 | private final List fixedViolations; 11 | 12 | public FixReport() { 13 | this.fixedViolations = new ArrayList<>(); 14 | } 15 | 16 | public boolean violationsHaveBeenFixed() { 17 | return !fixedViolations.isEmpty(); 18 | } 19 | 20 | public void addFixedViolation(Violation violation) { 21 | this.fixedViolations.add(violation); 22 | } 23 | 24 | public List getFixedViolations() { 25 | return fixedViolations; 26 | } 27 | 28 | public static FixReport createUnchangedFixReport() { 29 | return new FixReport(); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/de/uniba/dsg/bpmnspector/autofix/FixerIdentifier.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.autofix; 2 | 3 | import java.util.Objects; 4 | 5 | public class FixerIdentifier { 6 | public final String constraintId; 7 | public final FixingStrategy fixingStrategy; 8 | 9 | public FixerIdentifier(String constraintId, FixingStrategy fixingStrategy) { 10 | this.constraintId = constraintId; 11 | this.fixingStrategy = fixingStrategy; 12 | } 13 | 14 | @Override 15 | public boolean equals(Object o) { 16 | if (this == o) return true; 17 | if (o == null || getClass() != o.getClass()) return false; 18 | FixerIdentifier that = (FixerIdentifier) o; 19 | return Objects.equals(constraintId, that.constraintId) && 20 | fixingStrategy == that.fixingStrategy; 21 | } 22 | 23 | @Override 24 | public int hashCode() { 25 | return Objects.hash(constraintId, fixingStrategy); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/de/uniba/dsg/bpmnspector/autofix/FixingStrategy.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.autofix; 2 | 3 | public enum FixingStrategy { 4 | IGNORE, 5 | AUTO_FIX, 6 | FIRST_OPTION, 7 | SECOND_OPTION, 8 | REMOVE 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/de/uniba/dsg/bpmnspector/autofix/SingleViolationFixerInterface.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.autofix; 2 | 3 | import org.jdom2.Document; 4 | 5 | public interface SingleViolationFixerInterface { 6 | 7 | boolean fixSingleIssue(Document processAsDoc, String xPath); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/de/uniba/dsg/bpmnspector/autofix/ViolationFixer.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.autofix; 2 | 3 | import api.Violation; 4 | import org.jdom2.Document; 5 | import org.slf4j.Logger; 6 | 7 | import java.util.List; 8 | 9 | public interface ViolationFixer { 10 | 11 | String getConstraintId(); 12 | 13 | FixingStrategy getSupportedStrategy(); 14 | 15 | String getDescription(); 16 | 17 | Logger getLogger(); 18 | 19 | boolean fixSingleViolation(Document processAsDoc, String xPath); 20 | 21 | default FixReport fixIssues(Document docToFix, List violationList) { 22 | if (violationList.isEmpty()) { 23 | return FixReport.createUnchangedFixReport(); 24 | } 25 | 26 | FixReport report = new FixReport(); 27 | for (Violation singleViolation : violationList) { 28 | if(!getConstraintId().equals(singleViolation.getConstraint())) { 29 | getLogger().warn("Invalid violation for "+getConstraintId()+" fixer, constraint ID is: "+singleViolation.getConstraint()); 30 | } 31 | if(!singleViolation.getLocation().getXpath().isPresent()) { 32 | getLogger().warn("Could not fix "+getConstraintId()+" violation "+singleViolation+": no XPath present."); 33 | continue; 34 | } 35 | if(fixSingleViolation(docToFix, singleViolation.getLocation().getXpath().get())) { 36 | report.addFixedViolation(singleViolation); 37 | } 38 | } 39 | return report; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/de/uniba/dsg/bpmnspector/cli/CliException.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.cli; 2 | 3 | /** 4 | * @author Matthias Geiger 5 | */ 6 | public class CliException extends Exception { 7 | 8 | public CliException(String message) { 9 | super(message); 10 | } 11 | 12 | public CliException(String message, Throwable cause) { 13 | super(message, cause); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/de/uniba/dsg/bpmnspector/cli/CliParameter.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.cli; 2 | 3 | import de.uniba.dsg.bpmnspector.FixOption; 4 | import de.uniba.dsg.bpmnspector.ReportOption; 5 | import de.uniba.dsg.bpmnspector.ValidationOption; 6 | 7 | import java.util.Collections; 8 | import java.util.List; 9 | 10 | public interface CliParameter { 11 | 12 | 13 | 14 | default boolean isDebug() { 15 | return false; 16 | } 17 | 18 | default List getValidationOptions() { 19 | return Collections.emptyList(); 20 | } 21 | 22 | default String getPath() { 23 | return ""; 24 | } 25 | 26 | default ReportOption getReportOption() { 27 | return ReportOption.NONE; 28 | } 29 | 30 | default boolean isOpenReport() { 31 | return false; 32 | } 33 | 34 | default boolean showHelpOnly() { return true; } 35 | 36 | default FixOption getFixOption() { 37 | return FixOption.NONE; 38 | } 39 | } -------------------------------------------------------------------------------- /src/main/java/de/uniba/dsg/bpmnspector/common/util/ConstantHelper.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.common.util; 2 | 3 | import org.jdom2.Namespace; 4 | 5 | /** 6 | * This class provides the constants used in the whole project 7 | * 8 | * @author Philipp Neugebauer 9 | * @version 1.0 10 | * 11 | */ 12 | public class ConstantHelper { 13 | 14 | public final static String PI_NAMESPACE = "http://www.uniba.de/pi/bpmn-cons/validation"; 15 | public final static String BPMN_NAMESPACE_STRING = "http://www.omg.org/spec/BPMN/20100524/MODEL"; 16 | public final static String BPMNDI_NAMESPACE = "http://www.omg.org/spec/BPMN/20100524/DI"; 17 | public final static String WSDL2_NAMESPACE = "http://www.w3.org/TR/wsdl20/"; 18 | public final static String XSD_NAMESPACE = "http://www.w3.org/2001/XMLSchema"; 19 | public final static String XSI_NAMESPACE = "http://www.w3.org/2001/XMLSchema-instance"; 20 | 21 | public static final Namespace BPMN_NAMESPACE = Namespace.getNamespace("bpmn", BPMN_NAMESPACE_STRING); 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/de/uniba/dsg/bpmnspector/common/util/ResourceUtils.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.common.util; 2 | 3 | import api.Resource; 4 | import api.ValidationException; 5 | 6 | import java.io.UnsupportedEncodingException; 7 | import java.net.*; 8 | import java.nio.file.Files; 9 | import java.nio.file.InvalidPathException; 10 | import java.nio.file.Path; 11 | import java.nio.file.Paths; 12 | 13 | public class ResourceUtils { 14 | 15 | public static Resource determineAndCreateResourceFromString(String location, String baseLocation) 16 | throws ValidationException { 17 | try { 18 | Resource resource; 19 | URI importUri = new URI(location); 20 | 21 | if(importUri.isAbsolute() && importUri.getScheme().toLowerCase().startsWith("http")) { 22 | // process as URL 23 | URL asURL = importUri.toURL(); 24 | resource = new Resource(asURL); 25 | } else { 26 | // process as file 27 | Path importPath = Paths.get(importUri); 28 | if (!importPath.isAbsolute() && baseLocation != null) { 29 | // resolve relative path based on the baseLocation 30 | importPath = Paths.get(baseLocation).getParent().resolve(importPath).normalize().toAbsolutePath(); 31 | } 32 | 33 | if (Files.notExists(importPath) || !Files.isRegularFile(importPath)) { 34 | throw new ValidationException("File does not exist."); 35 | } else { 36 | resource = new Resource(importPath); 37 | } 38 | } 39 | return resource; 40 | } catch (URISyntaxException | MalformedURLException | InvalidPathException e ) { 41 | throw new ValidationException("Path " + location + " is invalid.", e); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/de/uniba/dsg/bpmnspector/common/xsdvalidation/ResourceResolver.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.common.xsdvalidation; 2 | 3 | import java.io.InputStream; 4 | 5 | import org.w3c.dom.ls.LSInput; 6 | import org.w3c.dom.ls.LSResourceResolver; 7 | 8 | /** 9 | * Class for representing a custom LSResourceResolver in order to enable 10 | * resource resolution for BPMN XSD Validation. 11 | * 12 | * Needed for <xs:include>-resolution when generating a 13 | * {@link javax.xml.validation.Schema} when using 14 | * getClass().getResourceAsStream("path/to/file.xsd") 15 | * 16 | * @author Matthias Geiger 17 | * @version 1.0 18 | * @see LSResourceResolver 19 | */ 20 | public class ResourceResolver implements LSResourceResolver { 21 | 22 | /* 23 | * (non-Javadoc) 24 | * 25 | * @see org.w3c.dom.ls.LSResourceResolver#resolveResource(java.lang.String, 26 | * java.lang.String, java.lang.String, java.lang.String, java.lang.String) 27 | */ 28 | @Override 29 | public LSInput resolveResource(String type, String namespaceURI, 30 | String publicId, String systemId, String baseURI) { 31 | 32 | InputStream resourceAsStream = this.getClass().getResourceAsStream( 33 | "/" + systemId); 34 | 35 | return new Input(publicId, systemId, resourceAsStream); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/de/uniba/dsg/bpmnspector/common/xsdvalidation/XsdValidationErrorHandler.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.common.xsdvalidation; 2 | 3 | import java.util.List; 4 | 5 | import org.xml.sax.ErrorHandler; 6 | import org.xml.sax.SAXException; 7 | import org.xml.sax.SAXParseException; 8 | 9 | /** 10 | * customized error handler for simple processing of sax errors 11 | * 12 | * @author Andreas Vorndran, Philipp Neugebauer 13 | * @version 1.0 14 | * 15 | */ 16 | public class XsdValidationErrorHandler implements ErrorHandler { 17 | 18 | private final List xsdErrorList; 19 | 20 | public XsdValidationErrorHandler(List xsdErrorList) { 21 | this.xsdErrorList = xsdErrorList; 22 | } 23 | 24 | @Override 25 | public void error(SAXParseException e) throws SAXException { 26 | xsdErrorList.add(e); 27 | } 28 | 29 | @Override 30 | public void fatalError(SAXParseException e) throws SAXException { 31 | xsdErrorList.add(e); 32 | } 33 | 34 | @Override 35 | public void warning(SAXParseException e) throws SAXException { 36 | xsdErrorList.add(e); 37 | } 38 | 39 | public List getXsdErrors() { 40 | return xsdErrorList; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/de/uniba/dsg/bpmnspector/refcheck/BPMNElement.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.refcheck; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * This class represents a BPMN element, which has one or more checkable 7 | * references. It is also embedded in the BPMN element hierarchy. For that it 8 | * has maybe a parent element (represented here by its name) and maybe children 9 | * (also represented by their names). The information structure is consistent 10 | * with the 'references.xsd', so that the elements of the 'references.xml' can 11 | * be represented. 12 | * 13 | * @author Andreas Vorndran 14 | * @version 1.0 15 | * 16 | */ 17 | public class BPMNElement { 18 | 19 | private final String name; 20 | private final String parent; 21 | private final List children; 22 | private final List references; 23 | 24 | /** 25 | * Constructor 26 | * 27 | * @param name 28 | * the name of this element 29 | * @param parent 30 | * the name of a parent element or null 31 | * @param children 32 | * the children element names of this element or null 33 | * @param references 34 | * the references of this element 35 | */ 36 | public BPMNElement(String name, String parent, List children, 37 | List references) { 38 | this.name = name; 39 | this.parent = parent; 40 | this.children = children; 41 | this.references = references; 42 | } 43 | 44 | /** 45 | * @return the name 46 | */ 47 | public String getName() { 48 | return name; 49 | } 50 | 51 | /** 52 | * @return the parent 53 | */ 54 | public String getParent() { 55 | return parent; 56 | } 57 | 58 | /** 59 | * @return the children 60 | */ 61 | public List getChildren() { 62 | return children; 63 | } 64 | 65 | /** 66 | * @return the references 67 | */ 68 | public List getReferences() { 69 | return references; 70 | } 71 | 72 | @Override 73 | public String toString() { 74 | return String.format("<%s ; Possible referencing attribs/elems: %s >", name, references); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/main/resources/BPMN20.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/main/resources/DC.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | [%-5level] %logger{36} - %msg%n 8 | 9 | 10 | 11 | 12 | validator.log 13 | true 14 | 15 | [%d{HH:mm:ss.SSS}] [%-5level] %logger{35} - %msg%n 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/main/resources/references.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/main/resources/reporting/res/logo-h100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uniba-dsg/BPMNspector/55f1ce8d7c46fc247f2c55df51f80d297615128e/src/main/resources/reporting/res/logo-h100.png -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/SystemTest.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector; 2 | 3 | import api.ValidationException; 4 | import org.junit.Test; 5 | 6 | import java.io.File; 7 | import java.io.FileInputStream; 8 | import java.io.FileNotFoundException; 9 | 10 | /** 11 | * @author Matthias Geiger 12 | */ 13 | public class SystemTest { 14 | @Test 15 | public void runMainDefaultOptions() { 16 | String[] args = {"src/test/resources/test-1-gruppe-c.bpmn"}; 17 | BPMNspectorMain.main(args); 18 | } 19 | 20 | @Test 21 | public void runMainXmlReport() { 22 | String[] args = {"src/test/resources/test-1-gruppe-c.bpmn", "-rXML"}; 23 | BPMNspectorMain.main(args); 24 | } 25 | 26 | @Test 27 | public void runMainAllReport() { 28 | String[] args = {"src/test/resources/test-1-gruppe-c.bpmn", "-rALL"}; 29 | BPMNspectorMain.main(args); 30 | } 31 | 32 | @Test 33 | public void runMainCheckingFolderInDebugMode() { 34 | String[] args = {"src/test/resources/001", "-d"}; 35 | BPMNspectorMain.main(args); 36 | } 37 | 38 | @Test 39 | public void runMainCheckingFolderCreateXMLReports() { 40 | String[] args = {"src/test/resources/001", "-rXML"}; 41 | BPMNspectorMain.main(args); 42 | } 43 | 44 | @Test 45 | public void runMainCheckingFolderCreateAllReports() { 46 | String[] args = {"src/test/resources/001", "-rALL"}; 47 | BPMNspectorMain.main(args); 48 | } 49 | 50 | @Test 51 | public void runMainCheckInvalidFile() { 52 | String[] args = {"NON_EXISTING"}; 53 | BPMNspectorMain.main(args); 54 | } 55 | 56 | @Test 57 | public void testStreamValidation() throws ValidationException, FileNotFoundException { 58 | BPMNspector bpmnSpector = new BPMNspector(); 59 | bpmnSpector.validate(new FileInputStream(new File("src/test/resources/test-1-gruppe-c.bpmn")), "test-1-gruppe-c.bpmn"); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/api/tests/ValidatorTests.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.api.tests; 2 | 3 | import api.ValidationException; 4 | import api.Validator; 5 | import de.uniba.dsg.bpmnspector.BPMNspector; 6 | import org.junit.Test; 7 | 8 | import java.nio.file.Path; 9 | import java.nio.file.Paths; 10 | 11 | /** 12 | * @author Matthias Geiger 13 | */ 14 | public class ValidatorTests { 15 | 16 | private final Path path = Paths.get(System.getProperty("user.dir")).resolve("src").resolve("test").resolve("resources").resolve("test-1-gruppe-c.bpmn"); 17 | private final Validator validator; 18 | 19 | public ValidatorTests() throws ValidationException { 20 | validator = new BPMNspector(); 21 | } 22 | 23 | @Test 24 | public void testValidateMethodPath() throws ValidationException { 25 | validator.validate(path); 26 | } 27 | 28 | @Test 29 | public void testValidateMethodString() throws ValidationException { 30 | validator.validate(path.toString()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/Path.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import api.Warning; 6 | import org.junit.Test; 7 | 8 | import java.io.File; 9 | 10 | import static org.junit.Assert.assertEquals; 11 | import static org.junit.Assert.assertTrue; 12 | 13 | /** 14 | * Test class for testing the right resolvement of pathes 15 | * 16 | * @author Philipp Neugebauer 17 | * @version 1.0 18 | * 19 | */ 20 | public class Path extends TestCase { 21 | 22 | @Test 23 | public void testConstraintSuccess1() throws ValidationException { 24 | File f = new File(getTestFilePath() + File.separator + "path" 25 | + File.separator + "folder" + File.separator 26 | + "success_import.bpmn"); 27 | verifyValidResult(f); 28 | } 29 | 30 | @Test 31 | public void testConstraintSuccess2() throws ValidationException { 32 | verifyValidResult(createFile("success_import.bpmn")); 33 | } 34 | 35 | @Test 36 | public void testInvalidUrlImports() throws ValidationException { 37 | ValidationResult result = validate(createFile("import_URL.bpmn")); 38 | assertEquals(2, result.getViolations().size()); 39 | } 40 | 41 | @Override 42 | protected String getExtNumber() { 43 | return "path"; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/Xsd.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron; 2 | 3 | import api.ValidationResult; 4 | import api.ValidationException; 5 | import api.Violation; 6 | import org.junit.Test; 7 | 8 | import static org.junit.Assert.assertEquals; 9 | import static org.junit.Assert.assertTrue; 10 | 11 | /** 12 | * Test class for testing the XSD validation 13 | * 14 | * @author Philipp Neugebauer 15 | * @version 1.0 16 | * 17 | */ 18 | public class Xsd extends TestCase { 19 | 20 | @Test 21 | public void testXsdFail() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult( 23 | createFile("xsdfail.bpmn"), 1); 24 | Violation v = result.getViolations().get(0); 25 | assertEquals("xsdfail.bpmn", v.getLocation().getResource().getPath().get().getFileName().toString()); 26 | assertEquals(6, v.getLocation().getLocation().getRow()); 27 | assertTrue(v.getMessage().contains("cvc-complex-type.2.4.a:")); 28 | assertTrue(v.getMessage().contains("outgoing")); 29 | assertEquals("", v.getLocation().getXpath().orElse("")); 30 | assertEquals("XSD-Check", v.getConstraint()); 31 | } 32 | 33 | @Override 34 | protected String getExtNumber() { 35 | return "xsd"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext057.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.057 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext057 extends TestCase { 16 | 17 | private static final String ERR_MSG = "An Event Sub-Process MUST NOT have any incoming or outgoing Sequence Flows."; 18 | 19 | @Test 20 | public void testConstraintFailInvalidIncoming() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT057_fail_incoming_seqFlow.bpmn"), 22 | 2); 23 | assertViolation(result.getViolations().get(1), 24 | ERR_MSG, 25 | "(//bpmn:subProcess[@triggeredByEvent='true'])[1]", 30); 26 | } 27 | 28 | @Test 29 | public void testConstraintFailInvalidOutgoing() throws ValidationException { 30 | ValidationResult result = verifyInvalidResult(createFile("EXT057_fail_outgoing_seqFlow.bpmn"), 31 | 2); 32 | assertViolation(result.getViolations().get(1), 33 | ERR_MSG, 34 | "(//bpmn:subProcess[@triggeredByEvent='true'])[1]", 30); 35 | } 36 | 37 | @Test 38 | public void testConstraintSuccessNoSeqFlow() throws ValidationException { 39 | verifyValidResult(createFile("EXT057_success_no_seqFlow.bpmn")); 40 | } 41 | 42 | @Test 43 | public void testConstraintSuccessNoEventSubProcess() throws ValidationException { 44 | verifyValidResult(createFile("EXT057_success_no_eventSubProcess.bpmn")); 45 | } 46 | 47 | @Override 48 | protected String getExtNumber() { 49 | return "057"; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext058.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.058 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext058 extends TestCase { 16 | 17 | private static final String ERR_MSG = "An Event Sub-Process MUST have exactly one Start Event."; 18 | 19 | @Test 20 | public void testConstraintFailTwoStartEvents() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT058_fail_twoStartEvents.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), ERR_MSG, 23 | "(//bpmn:subProcess[@triggeredByEvent='true'])[1]", 27); 24 | } 25 | 26 | @Test 27 | public void testConstraintFailNoStartEvent() throws ValidationException { 28 | ValidationResult result = verifyInvalidResult(createFile("EXT058_fail_noStartEvent.bpmn"), 1); 29 | assertViolation(result.getViolations().get(0), ERR_MSG, 30 | "(//bpmn:subProcess[@triggeredByEvent='true'])[1]", 27); 31 | } 32 | 33 | @Override 34 | protected String getExtNumber() { 35 | return "058"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext061.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.061 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext061 extends TestCase { 16 | 17 | private static final String ERR_MSG = "At least one Activity must be contained in an AdHocSubProcess."; 18 | 19 | 20 | @Test 21 | public void testConstraintFailEmptyAdHoc() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT061_fail_empty_AdHoc.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:adHocSubProcess)[1]", 7); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccess() throws ValidationException { 29 | verifyValidResult(createFile("EXT061_success.bpmn")); 30 | } 31 | 32 | @Override 33 | protected String getExtNumber() { 34 | return "061"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext062.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.062 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext062 extends TestCase { 16 | 17 | private static final String ERR_MSG = "Start Event, End Event, Conversations, Conversation Links and Choreography " + 18 | "Activities MUST NOT be used in an AdHocSubProcess."; 19 | 20 | 21 | @Test 22 | public void testConstraintFailStartEvent() throws ValidationException { 23 | ValidationResult result = verifyInvalidResult(createFile("EXT062_failure_StartEvent.bpmn"), 2); 24 | assertViolation(result.getViolations().get(1), ERR_MSG, 25 | "(//bpmn:adHocSubProcess)[1]", 7); 26 | } 27 | 28 | @Test 29 | public void testConstraintFailEndEvent() throws ValidationException { 30 | ValidationResult result = verifyInvalidResult(createFile("EXT062_failure_StartEvent.bpmn"), 2); 31 | assertViolation(result.getViolations().get(1), ERR_MSG, 32 | "(//bpmn:adHocSubProcess)[1]", 7); 33 | } 34 | 35 | @Test 36 | public void testConstraintFailChorActivity() throws ValidationException { 37 | ValidationResult result = verifyInvalidResult(createFile("EXT062_failure_StartEvent.bpmn"), 2); 38 | assertViolation(result.getViolations().get(1), ERR_MSG, 39 | "(//bpmn:adHocSubProcess)[1]", 7); 40 | } 41 | @Test 42 | public void testConstraintSuccess() throws ValidationException { 43 | verifyValidResult(createFile("EXT062_success_DataSeqFlow.bpmn")); 44 | } 45 | 46 | @Override 47 | protected String getExtNumber() { 48 | return "062"; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext091.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.091 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext091 extends TestCase { 16 | 17 | private static final String ERR_MSG = "sourceRef and targetRef of a DataAssociation must have the same ItemDefinition or a transformation must be present."; 18 | 19 | 20 | @Test 21 | public void testConstraintFailDifferentStructureRef() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT091_failure_differentStructureRef.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:dataInputAssociation[not(./bpmn:transformation)])[1]", 14); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccessEqualItemDef() throws ValidationException { 29 | verifyValidResult(createFile("EXT091_success_equalItemDef.bpmn")); 30 | } 31 | 32 | @Test 33 | public void testConstraintSuccessIdenticalItemDef() throws ValidationException { 34 | verifyValidResult(createFile("EXT091_success_identicalItemDef.bpmn")); 35 | } 36 | 37 | @Test 38 | public void testConstraintSuccessWithTransformation() throws ValidationException { 39 | verifyValidResult(createFile("EXT091_success_withTransformation.bpmn")); 40 | } 41 | 42 | @Override 43 | protected String getExtNumber() { 44 | return "091"; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext092.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.092 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext092 extends TestCase { 16 | 17 | private static final String ERR_MSG = "If a DataAssociation does not define a Transformation, only a single sourceRef is allowed."; 18 | 19 | 20 | @Test 21 | public void testConstraintFailDifferentStructureRef() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT092_failure_twoSourceRefs.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:dataInputAssociation[not(./bpmn:transformation)])[1]", 13); 25 | } 26 | 27 | 28 | @Test 29 | public void testConstraintSuccessWithTransformation() throws ValidationException { 30 | verifyValidResult(createFile("EXT092_success_withTransformation.bpmn")); 31 | } 32 | 33 | @Override 34 | protected String getExtNumber() { 35 | return "092"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext111.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.111 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext111 extends TestCase { 16 | 17 | private static final String ERR_MSG = "A cancel boundary event must be attached to a Transaction."; 18 | 19 | 20 | @Test 21 | public void testConstraintFailCancelSubProcess() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT111_failure_cancel_subprocess.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:boundaryEvent[bpmn:cancelEventDefinition])[1]", 16); 25 | } 26 | 27 | @Test 28 | public void testConstraintFailCancelTask() throws ValidationException { 29 | ValidationResult result = verifyInvalidResult(createFile("EXT111_failure_cancel_task.bpmn"), 1); 30 | assertViolation(result.getViolations().get(0), ERR_MSG, 31 | "(//bpmn:boundaryEvent[bpmn:cancelEventDefinition])[1]", 16); 32 | } 33 | 34 | 35 | @Test 36 | public void testConstraintSuccess() throws ValidationException { 37 | verifyValidResult(createFile("EXT111_success.bpmn")); 38 | } 39 | 40 | @Override 41 | protected String getExtNumber() { 42 | return "111"; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext112.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.112 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext112 extends TestCase { 16 | 17 | private static final String ERR_MSG = "A boundary event must not be target of a Sequence Flow."; 18 | 19 | 20 | @Test 21 | public void testConstraintFailIncomingSeqFlow() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT112_failure_incomingSeqFlow.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:boundaryEvent[bpmn:incoming])[1]", 23); 25 | } 26 | 27 | 28 | @Override 29 | protected String getExtNumber() { 30 | return "112"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext113.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.113 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext113 extends TestCase { 16 | 17 | private static final String ERR_MSG = "A boundary event must be a source of at least a SequenceFlow."; 18 | 19 | 20 | @Test 21 | public void testConstraintFailNoSeqFlow() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT113_failure_noSeqFlow.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:boundaryEvent[not(bpmn:outgoing)])[1]", 16); 25 | } 26 | 27 | 28 | @Override 29 | protected String getExtNumber() { 30 | return "113"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext114.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.114 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext114 extends TestCase { 16 | 17 | private static final String ERR_MSG = "A compensation boundary event MUST NOT have an outgoing Sequence Flow."; 18 | 19 | 20 | @Test 21 | public void testConstraintFailCompensateSeqFlow() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT114_failure_compensateSeqFlow.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:boundaryEvent[bpmn:compensateEventDefinition])[1]", 16); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccess() throws ValidationException { 29 | verifyValidResult(createFile("EXT114_success_association.bpmn")); 30 | } 31 | 32 | @Override 33 | protected String getExtNumber() { 34 | return "114"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext115.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.115 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext115 extends TestCase { 16 | 17 | private static final String ERR_MSG = "Intermediate Events MUST be a target of at least a Sequence Flow."; 18 | 19 | 20 | @Test 21 | public void testConstraintFailNoIncoming() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT115_failure_noIncoming.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:intermediateThrowEvent[not(bpmn:incoming)])[1]", 11); 25 | } 26 | 27 | @Test 28 | public void testConstraintFailNoIncomingCatch() throws ValidationException { 29 | ValidationResult result = verifyInvalidResult(createFile("EXT115_failure_noIncomingCatch.bpmn"), 1); 30 | assertViolation(result.getViolations().get(0), ERR_MSG, 31 | "(//bpmn:intermediateCatchEvent[not(bpmn:linkEventDefinition) and not(bpmn:incoming)])[1]", 11); 32 | } 33 | 34 | @Test 35 | public void testConstraintSuccess_noStartEnd() throws ValidationException { 36 | verifyValidResult(createFile("EXT115_success_noStartEnd.bpmn")); 37 | } 38 | 39 | @Test 40 | public void testConstraintSuccess_StartEnd() throws ValidationException { 41 | verifyValidResult(createFile("EXT115_success_StartEnd.bpmn")); 42 | } 43 | 44 | @Override 45 | protected String getExtNumber() { 46 | return "115"; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext116.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.116 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext116 extends TestCase { 16 | 17 | private static final String ERR_MSG = "Intermediate Events MUST be a source of at least a Sequence Flow."; 18 | 19 | 20 | @Test 21 | public void testConstraintFailNoOutgoing() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT116_failure_noOutgoing.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:intermediateThrowEvent[not(bpmn:linkEventDefinition) and not(bpmn:outgoing)])[1]", 11); 25 | } 26 | 27 | @Test 28 | public void testConstraintFailNoOutgoingCatch() throws ValidationException { 29 | ValidationResult result = verifyInvalidResult(createFile("EXT116_failure_noOutgoingCatch.bpmn"), 1); 30 | assertViolation(result.getViolations().get(0), ERR_MSG, 31 | "(//bpmn:intermediateCatchEvent[not(bpmn:outgoing)])[1]", 11); 32 | } 33 | 34 | 35 | @Override 36 | protected String getExtNumber() { 37 | return "116"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext117.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.117 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext117 extends TestCase { 16 | 17 | private static final String ERR_MSG = "A Link Intermediate Event MUST NOT be both a target and a source of a Sequence Flow."; 18 | 19 | 20 | @Test 21 | public void testConstraintFailThrowOutgoing() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT117_failure_throwOutgoing.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:intermediateThrowEvent[bpmn:linkEventDefinition and bpmn:outgoing])[1]", 11); 25 | } 26 | 27 | @Test 28 | public void testConstraintFailCatchIncoming() throws ValidationException { 29 | ValidationResult result = verifyInvalidResult(createFile("EXT117_failure_catchIncoming.bpmn"), 1); 30 | assertViolation(result.getViolations().get(0), ERR_MSG, 31 | "(//bpmn:intermediateCatchEvent[bpmn:linkEventDefinition and bpmn:incoming])[1]", 19); 32 | } 33 | 34 | @Test 35 | public void testConstraintSuccess() throws ValidationException { 36 | verifyValidResult(createFile("EXT117_success.bpmn")); 37 | } 38 | 39 | 40 | @Override 41 | protected String getExtNumber() { 42 | return "117"; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext118.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.118 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext118 extends TestCase { 16 | 17 | private static final String ERR_MSG = "For each source Link there must exist a corresponding target. There may be multiple sources for one target."; 18 | 19 | 20 | @Test 21 | public void testConstraintFailNoTarget() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT118_failure_wrongTarget.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:linkEventDefinition[bpmn:target])[2]", 19); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccessMultipleSources() throws ValidationException { 29 | verifyValidResult(createFile("EXT118_success_multipleSources.bpmn")); 30 | } 31 | 32 | @Test 33 | public void testConstraintSuccess() throws ValidationException { 34 | verifyValidResult(createFile("EXT118_success.bpmn")); 35 | } 36 | 37 | 38 | @Override 39 | protected String getExtNumber() { 40 | return "118"; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext122.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.122 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext122 extends TestCase { 16 | 17 | private static final String ERR_MSG = "A intermediateCatchEvent in normal flow must not contain a compensateEventDefinition."; 18 | 19 | 20 | @Test 21 | public void testConstraintFail() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT122_failure.bpmn"), 2); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:intermediateCatchEvent[bpmn:compensateEventDefinition])[1]", 7); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccess() throws ValidationException { 29 | verifyValidResult(createFile("EXT122_success.bpmn")); 30 | } 31 | 32 | 33 | @Override 34 | protected String getExtNumber() { 35 | return "122"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext123.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.123 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext123 extends TestCase { 16 | 17 | private static final String ERR_MSG = "For executable Processes (isExecutable = true), if the trigger is " + 18 | "Conditional, then a FormalExpression MUST be entered."; 19 | 20 | 21 | @Test 22 | public void testConstraintFailEmptyCondition() throws ValidationException { 23 | ValidationResult result = verifyInvalidResult(createFile("EXT123_failure_emptyCondition.bpmn"), 1); 24 | assertViolation(result.getViolations().get(0), ERR_MSG, 25 | "(//bpmn:conditionalEventDefinition[ancestor::bpmn:process[@isExecutable='true']])[1]", 7); 26 | } 27 | 28 | @Test 29 | public void testConstraintFailNoFormalCondition() throws ValidationException { 30 | ValidationResult result = verifyInvalidResult(createFile("EXT123_failure_noFormalCondition.bpmn"), 1); 31 | assertViolation(result.getViolations().get(0), ERR_MSG, 32 | "(//bpmn:conditionalEventDefinition[ancestor::bpmn:process[@isExecutable='true']])[1]", 7); 33 | } 34 | 35 | @Test 36 | public void testConstraintSuccessFormalCondition() throws ValidationException { 37 | verifyValidResult(createFile("EXT123_success_formalCondition.bpmn")); 38 | } 39 | 40 | @Test 41 | public void testConstraintSuccessNotExecutable() throws ValidationException { 42 | verifyValidResult(createFile("EXT123_success_notExecutable.bpmn")); 43 | } 44 | 45 | @Override 46 | protected String getExtNumber() { 47 | return "123"; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext124.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.124 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext124 extends TestCase { 16 | 17 | private static final String ERR_MSG = "A LinkEventDefinition in a Catch Event must have at least one source Element."; 18 | 19 | 20 | @Test 21 | public void testConstraintFailNoSource() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT124_failure_noSource.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:linkEventDefinition[parent::bpmn:intermediateCatchEvent])[1]", 9); 25 | } 26 | 27 | 28 | @Override 29 | protected String getExtNumber() { 30 | return "124"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext125.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.125 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext125 extends TestCase { 16 | 17 | private static final String ERR_MSG = "A LinkEventDefinition in a Throw Event must have exactly one target Element."; 18 | 19 | 20 | @Test 21 | public void testConstraintFailNoTarget() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT125_failure_noTarget.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:linkEventDefinition[parent::bpmn:intermediateThrowEvent])[1]", 19); 25 | } 26 | 27 | @Override 28 | protected String getExtNumber() { 29 | return "125"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext126.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.126 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext126 extends TestCase { 16 | 17 | private static final String ERR_MSG = "Links are only allowed to a target in the same process and process level."; 18 | 19 | 20 | @Test 21 | public void testConstraintFail() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT126_failure.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:linkEventDefinition[parent::bpmn:intermediateThrowEvent and bpmn:target])[1]", 19); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccessInSubProcess() throws ValidationException { 29 | verifyValidResult(createFile("EXT126_success_inSubProcess.bpmn")); 30 | } 31 | 32 | @Override 33 | protected String getExtNumber() { 34 | return "126"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext136.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.136 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext136 extends TestCase { 16 | 17 | private static final String ERR_MSG = "An Event Gateway MUST have two or more outgoing Sequence Flows."; 18 | 19 | 20 | @Test 21 | public void testConstraintFail() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT136_failure.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:eventBasedGateway)[1]", 4); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccess() throws ValidationException { 29 | verifyValidResult(createFile("EXT136_success.bpmn")); 30 | } 31 | 32 | @Override 33 | protected String getExtNumber() { 34 | return "136"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext137.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.137 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext137 extends TestCase { 16 | 17 | private static final String ERR_MSG = "The outgoing Sequence Flows of the Event Gateway MUST NOT have a conditionExpression."; 18 | 19 | 20 | @Test 21 | public void testConstraintFail() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT137_failure.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:sequenceFlow[@id=//bpmn:eventBasedGateway/bpmn:outgoing])[1]", 18); 25 | } 26 | 27 | @Override 28 | protected String getExtNumber() { 29 | return "137"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext139.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.139 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext139 extends TestCase { 16 | 17 | private static final String ERR_MSG = "If Message Intermediate Events are used in the configuration, then Receive " + 18 | "Tasks MUST NOT be used in that configuration and vice versa."; 19 | 20 | 21 | @Test 22 | public void testConstraintFail() throws ValidationException { 23 | ValidationResult result = verifyInvalidResult(createFile("EXT139_failure.bpmn"), 1); 24 | assertViolation(result.getViolations().get(0), ERR_MSG, 25 | "(//bpmn:eventBasedGateway[bpmn:outgoing=//bpmn:sequenceFlow[@targetRef=//bpmn:receiveTask/@id]/@id])[1]", 4); 26 | } 27 | 28 | @Override 29 | protected String getExtNumber() { 30 | return "139"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext140.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.140 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext140 extends TestCase { 16 | 17 | private static final String ERR_MSG = "Receive Tasks used in an Event Gateway configuration MUST NOT have any " + 18 | "attached Intermediate Events."; 19 | 20 | 21 | @Test 22 | public void testConstraintFail() throws ValidationException { 23 | ValidationResult result = verifyInvalidResult(createFile("EXT140_failure.bpmn"), 1); 24 | assertViolation(result.getViolations().get(0), ERR_MSG, 25 | "(//bpmn:receiveTask[@id=//bpmn:sequenceFlow[@id=//bpmn:eventBasedGateway/bpmn:outgoing]/@targetRef])[1]", 19); 26 | } 27 | 28 | @Override 29 | protected String getExtNumber() { 30 | return "140"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext141.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.141 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext141 extends TestCase { 16 | 17 | private static final String ERR_MSG = "Targets of an EventBasedGateway must not have any other incoming SequenceFlow."; 18 | 19 | 20 | @Test 21 | public void testConstraintFail() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT141_failure.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:*[@id=//bpmn:sequenceFlow[@id=//bpmn:eventBasedGateway/bpmn:outgoing]/@targetRef])[2]", 25); 25 | } 26 | 27 | @Override 28 | protected String getExtNumber() { 29 | return "141"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext142.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.142 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext142 extends TestCase { 16 | 17 | private static final String ERR_MSG = "When an EventBasedGateway is used to instantiate a process instance no " + 18 | "Incoming Sequence Flow is allowed."; 19 | 20 | 21 | @Test 22 | public void testConstraintFail() throws ValidationException { 23 | ValidationResult result = verifyInvalidResult(createFile("EXT142_failure.bpmn"), 1); 24 | assertViolation(result.getViolations().get(0), ERR_MSG, 25 | "(//bpmn:eventBasedGateway[@instantiate='true'])[1]", 4); 26 | } 27 | 28 | @Test 29 | public void testConstraintSuccess() throws ValidationException { 30 | verifyValidResult(createFile("EXT142_success.bpmn")); 31 | } 32 | 33 | @Override 34 | protected String getExtNumber() { 35 | return "142"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext143.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.143 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext143 extends TestCase { 16 | 17 | private static final String ERR_MSG = "A compensateBoundaryEvent must be connected with an Association to a Compensation Activity."; 18 | 19 | 20 | @Test 21 | public void testConstraintFail() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT143_failure.bpmn"), 2); 23 | assertViolation(result.getViolations().get(0), ERR_MSG, 24 | "(//bpmn:boundaryEvent[bpmn:compensateEventDefinition])[1]", 5); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccess() throws ValidationException { 29 | verifyValidResult(createFile("EXT143_success.bpmn")); 30 | } 31 | 32 | @Override 33 | protected String getExtNumber() { 34 | return "143"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/analytic/Ext144.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.analytic; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.144 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext144 extends TestCase { 16 | 17 | private static final String ERR_MSG = "The associated Activity must be a Task or a Sub-Process which is marked for " + 18 | "compensation (i.e., isForCompensation=true)"; 19 | 20 | 21 | @Test 22 | public void testConstraintFail() throws ValidationException { 23 | ValidationResult result = verifyInvalidResult(createFile("EXT144_failure.bpmn"), 1); 24 | assertViolation(result.getViolations().get(0), ERR_MSG, 25 | "(//bpmn:boundaryEvent[bpmn:compensateEventDefinition])[1]", 5); 26 | } 27 | 28 | @Override 29 | protected String getExtNumber() { 30 | return "144"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/artifacts/AbstractArtifactTest.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.artifacts; 2 | 3 | import api.ValidationResult; 4 | import api.ValidationException; 5 | import api.Violation; 6 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 7 | import org.junit.Test; 8 | 9 | /** 10 | * Abstract test class for simplifying the testing of the Constraints EXT.008 11 | * and EXT.009 12 | * 13 | * @author Philipp Neugebauer 14 | * @version 1.0 15 | * 16 | */ 17 | abstract public class AbstractArtifactTest extends TestCase { 18 | 19 | @Test 20 | public void testConstraintAssociationFail() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult( 22 | createFile("Fail_association.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0)); 24 | } 25 | 26 | @Test 27 | public void testConstraintGroupFail() throws ValidationException { 28 | ValidationResult result = verifyInvalidResult( 29 | createFile("Fail_group.bpmn"), 1); 30 | assertViolation(result.getViolations().get(0)); 31 | } 32 | 33 | @Test 34 | public void testConstraintTextAnnotationFail() 35 | throws ValidationException { 36 | ValidationResult result = verifyInvalidResult( 37 | createFile("Fail_text_annotation.bpmn"), 1); 38 | assertViolation(result.getViolations().get(0)); 39 | } 40 | 41 | protected void assertViolation(Violation v) { 42 | throw new UnsupportedOperationException( 43 | "must be overriden by every child class!"); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/artifacts/Ext008.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.artifacts; 2 | 3 | import api.Violation; 4 | 5 | /** 6 | * Test class for testing Constraint EXT.008 7 | * 8 | * @author Philipp Neugebauer 9 | * @version 1.0 10 | * 11 | */ 12 | public class Ext008 extends AbstractArtifactTest { 13 | 14 | @Override 15 | protected void assertViolation(Violation v) { 16 | assertViolation(v, "(//bpmn:messageFlow[@targetRef])[1]", 7); 17 | } 18 | 19 | @Override 20 | protected String getErrorMessage() { 21 | return "An Artifact MUST NOT be a target for a Message Flow"; 22 | } 23 | 24 | @Override 25 | protected String getExtNumber() { 26 | return "008"; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/artifacts/Ext009.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.artifacts; 2 | 3 | import api.Violation; 4 | 5 | /** 6 | * Test class for testing Constraint EXT.009 7 | * 8 | * @author Philipp Neugebauer 9 | * @version 1.0 10 | * 11 | */ 12 | public class Ext009 extends AbstractArtifactTest { 13 | 14 | @Override 15 | protected void assertViolation(Violation v) { 16 | assertViolation(v, "(//bpmn:messageFlow[@sourceRef])[1]", 7); 17 | } 18 | 19 | @Override 20 | protected String getErrorMessage() { 21 | return "An Artifact MUST NOT be a source for a Message Flow"; 22 | } 23 | 24 | @Override 25 | protected String getExtNumber() { 26 | return "009"; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/artifacts/sequenzflow/Ext006.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.artifacts.sequenzflow; 2 | 3 | import api.Violation; 4 | 5 | /** 6 | * Test class for testing Constraint EXT.006 7 | * 8 | * @author Philipp Neugebauer 9 | * @version 1.0 10 | * 11 | */ 12 | public class Ext006 extends AbstractArtifactSequenceFlowTest { 13 | 14 | private final static String ERRORMESSAGEONE = "An Artifact MUST NOT be a target for a Sequence Flow"; 15 | private final static String ERRORMESSAGETWO = "For a Process: Of the types of FlowNode, only Activities, Gateways, and Events can be the target. However, Activities that are Event SubProcesses are not allowed to be a target"; 16 | private final static String ERRORMESSAGETHREE = "The target element of the sequence flow must reference the SequenceFlow definition using their incoming attribute."; 17 | private final static String XPATHSTRING = "(//bpmn:sequenceFlow[@targetRef])[1]"; 18 | 19 | @Override 20 | protected void assertFirstViolation(Violation v, String fileName) { 21 | assertViolation(v, ERRORMESSAGEONE, fileName, XPATHSTRING, 7); 22 | } 23 | 24 | @Override 25 | protected void assertSecondViolation(Violation v, String fileName, int line) { 26 | assertViolation(v, ERRORMESSAGETWO, fileName, 27 | "(//bpmn:*[./@id = //bpmn:sequenceFlow/@targetRef and ancestor::bpmn:process])[1]", line); 28 | } 29 | 30 | @Override 31 | protected void assertThirdViolation(Violation v, String fileName) { 32 | assertViolation(v, ERRORMESSAGETHREE, fileName, XPATHSTRING, 7); 33 | } 34 | 35 | @Override 36 | protected String getExtNumber() { 37 | return "006"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/artifacts/sequenzflow/Ext007.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.artifacts.sequenzflow; 2 | 3 | import api.Violation; 4 | 5 | /** 6 | * Test class for testing Constraint EXT.007 7 | * 8 | * @author Philipp Neugebauer 9 | * @version 1.0 10 | * 11 | */ 12 | public class Ext007 extends AbstractArtifactSequenceFlowTest { 13 | 14 | private final static String ERRORMESSAGEONE = "An Artifact MUST NOT be a source for a Sequence Flow"; 15 | private final static String ERRORMESSAGETWO = "For a Process: Of the types of FlowNode, only Activities, Gateways, and Events can be the source. However, Activities that are Event SubProcesses are not allowed to be a source"; 16 | private final static String ERRORMESSAGETHREE = "The source element of the sequence flow must reference the SequenceFlow definition using their outgoing attribute."; 17 | private final static String XPATHSTRING = "(//bpmn:sequenceFlow[@sourceRef])[1]"; 18 | 19 | @Override 20 | protected void assertFirstViolation(Violation v, String fileName) { 21 | assertViolation(v, ERRORMESSAGEONE, fileName, XPATHSTRING, 7); 22 | } 23 | 24 | @Override 25 | protected void assertSecondViolation(Violation v, String fileName, int line) { 26 | assertViolation(v, ERRORMESSAGETWO, fileName, 27 | "(//bpmn:*[./@id = //bpmn:sequenceFlow/@sourceRef and ancestor::bpmn:process])[1]", line); 28 | } 29 | 30 | @Override 31 | protected void assertThirdViolation(Violation v, String fileName) { 32 | assertViolation(v, ERRORMESSAGETHREE, fileName, XPATHSTRING, 7); 33 | } 34 | 35 | @Override 36 | protected String getExtNumber() { 37 | return "007"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext017.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.017 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext017 extends TestCase { 16 | 17 | private static final String ERR_MSG = "A converging Gateway must not have more than one outgoing Sequence Flow."; 18 | 19 | @Test 20 | public void testConstraintFailExclusiveGateway() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT017_failure_exclusiveGateway.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 23 | ERR_MSG, 24 | "(//bpmn:*[@gatewayDirection='Converging'])[1]", 7); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccessComplexGateway() throws ValidationException { 29 | verifyValidResult(createFile("EXT017_success_complexGateway.bpmn")); 30 | } 31 | 32 | @Test 33 | public void testConstraintSuccessExclusiveGateway() throws ValidationException { 34 | verifyValidResult(createFile("EXT017_success_exclusiveGateway.bpmn")); 35 | } 36 | 37 | @Test 38 | public void testConstraintSuccessInclusiveGateway() throws ValidationException { 39 | verifyValidResult(createFile("EXT017_success_inclusiveGateway.bpmn")); 40 | } 41 | 42 | @Test 43 | public void testConstraintSuccessParallelGateway() throws ValidationException { 44 | verifyValidResult(createFile("EXT017_success_parallelGateway.bpmn")); 45 | } 46 | 47 | 48 | @Override 49 | protected String getExtNumber() { 50 | return "017"; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext018.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.018 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext018 extends TestCase { 16 | 17 | private static final String ERR_MSG = "A diverging Gateway must not have more than one incoming Sequence Flow."; 18 | 19 | @Test 20 | public void testConstraintFailExclusiveGateway() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT018_failure_exclusiveGateway.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 23 | ERR_MSG, 24 | "(//bpmn:*[@gatewayDirection='Diverging'])[2]", 13); 25 | } 26 | 27 | @Test 28 | public void testConstraintFailParallelGateway() throws ValidationException { 29 | ValidationResult result = verifyInvalidResult(createFile("EXT018_failure_parallelGateway.bpmn"), 1); 30 | assertViolation(result.getViolations().get(0), 31 | ERR_MSG, 32 | "(//bpmn:*[@gatewayDirection='Diverging'])[2]", 13); 33 | } 34 | 35 | 36 | @Override 37 | protected String getExtNumber() { 38 | return "018"; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext019.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.019 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext019 extends TestCase { 16 | 17 | private static final String ERR_MSG = "A mixed Gateway must have more than one incoming and more than one outgoing Sequence Flow."; 18 | 19 | @Test 20 | public void testConstraintFailExclusiveDiverging() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT019_failure_exclusiveDiverging.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 23 | ERR_MSG, 24 | "(//bpmn:*[@gatewayDirection='Mixed'])[1]", 12); 25 | } 26 | 27 | @Test 28 | public void testConstraintFailParallelConverging() throws ValidationException { 29 | ValidationResult result = verifyInvalidResult(createFile("EXT019_failure_parallelConverging.bpmn"), 1); 30 | assertViolation(result.getViolations().get(0), 31 | ERR_MSG, 32 | "(//bpmn:*[@gatewayDirection='Mixed'])[1]", 18); 33 | } 34 | 35 | @Test 36 | public void testConstraintSuccessParallel() throws ValidationException { 37 | verifyValidResult(createFile("EXT019_success_parallel.bpmn")); 38 | } 39 | 40 | 41 | @Override 42 | protected String getExtNumber() { 43 | return "019"; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext024.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.024 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext024 extends TestCase { 16 | 17 | private static final String ERR_MSG = "The optional attribute isImmediate must not be 'false' for executable processes."; 18 | 19 | @Test 20 | public void testConstraintFail() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT024_failure.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 23 | ERR_MSG, 24 | "(//bpmn:sequenceFlow[@isImmediate='false'])[1]", 10); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccess() throws ValidationException { 29 | verifyValidResult(createFile("EXT024_success.bpmn")); 30 | } 31 | 32 | @Override 33 | protected String getExtNumber() { 34 | return "024"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext035.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.035 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext035 extends TestCase { 16 | 17 | private static final String ERR_MSG = "A Public process may not be marked as executable."; 18 | 19 | @Test 20 | public void testConstraintFail() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT035_failure.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 23 | ERR_MSG, 24 | "(//bpmn:process[@processType='Public'])[1]", 3); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccess() throws ValidationException { 29 | verifyValidResult(createFile("EXT035_success.bpmn")); 30 | } 31 | 32 | @Override 33 | protected String getExtNumber() { 34 | return "035"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext042.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.042 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext042 extends TestCase { 16 | 17 | private static final String ERR_MSG = "If a ServiceTask references an operation, exactly one InputSet must be " + 18 | "defined in the ioSpecification."; 19 | 20 | @Test 21 | public void testConstraintFail() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT042_failure.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), 24 | ERR_MSG, 25 | "(//bpmn:serviceTask[@operationRef])[1]", 14); 26 | } 27 | 28 | @Test 29 | public void testConstraintSuccess() throws ValidationException { 30 | verifyValidResult(createFile("EXT042_success.bpmn")); 31 | } 32 | 33 | @Override 34 | protected String getExtNumber() { 35 | return "042"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext043.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.043 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext043 extends TestCase { 16 | 17 | private static final String ERR_MSG = "If a ServiceTask references an operation, at most one OutputSet can be " + 18 | "defined in the ioSpecification."; 19 | 20 | @Test 21 | public void testConstraintFail() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT043_failure.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), 24 | ERR_MSG, 25 | "(//bpmn:serviceTask[@operationRef])[1]", 16); 26 | } 27 | 28 | @Override 29 | protected String getExtNumber() { 30 | return "043"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext044.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.044 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext044 extends TestCase { 16 | 17 | private static final String ERR_MSG = "The ItemDefinition of the DataInput of the ServiceTask and the inMessage " 18 | + "itemDefinition of the referenced Operation must be equal."; 19 | 20 | @Test 21 | public void testConstraintFailDifferentItemDefNoStructureRef() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT044_failure_differentItemDef_noStructureRef.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), 24 | ERR_MSG, 25 | "(//bpmn:serviceTask[@operationRef and bpmn:ioSpecification/bpmn:dataInput])[1]", 17); 26 | } 27 | 28 | @Test 29 | public void testConstraintFailDifferentItemDefUnequalStructureRef() throws ValidationException { 30 | ValidationResult result = verifyInvalidResult(createFile("EXT044_failure_differentItemDef_unequalStructureRef.bpmn"), 1); 31 | assertViolation(result.getViolations().get(0), 32 | ERR_MSG, 33 | "(//bpmn:serviceTask[@operationRef and bpmn:ioSpecification/bpmn:dataInput])[1]", 17); 34 | } 35 | 36 | @Test 37 | public void testConstraintSuccessDifferentItemDefEqualStructureRef() throws ValidationException { 38 | verifyValidResult(createFile("EXT044_success_differentItemDef_equalStructureRef.bpmn")); 39 | } 40 | 41 | @Override 42 | protected String getExtNumber() { 43 | return "044"; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext045.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.045 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext045 extends TestCase { 16 | 17 | private static final String ERR_MSG = "If the operation defines a outMessage, the ItemDefinition of the DataOutput " + 18 | "of the ServiceTask and the outMessage of the operation must be equal."; 19 | 20 | @Test 21 | public void testConstraintFailDifferentItemDefNoStructureRef() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT045_failure_differentItemDef_noStructureRef.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), 24 | ERR_MSG, 25 | "(//bpmn:serviceTask[@operationRef])[1]", 17); 26 | } 27 | 28 | @Test 29 | public void testConstraintFailDifferentItemDefUnequalStructureRef() throws ValidationException { 30 | ValidationResult result = verifyInvalidResult(createFile("EXT045_failure_differentItemDef_unequalStructureRef.bpmn"), 1); 31 | assertViolation(result.getViolations().get(0), 32 | ERR_MSG, 33 | "(//bpmn:serviceTask[@operationRef])[1]", 17); 34 | } 35 | 36 | @Test 37 | public void testConstraintSuccessDifferentItemDefEqualStructureRef() throws ValidationException { 38 | verifyValidResult(createFile("EXT045_success_differentItemDef_equalStructureRef.bpmn")); 39 | } 40 | 41 | @Test 42 | public void testConstraintSuccessOperationNoOutMessage() throws ValidationException { 43 | verifyValidResult(createFile("EXT045_success_operationNoOutMessage.bpmn")); 44 | } 45 | 46 | @Override 47 | protected String getExtNumber() { 48 | return "045"; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext046.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.046 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext046 extends TestCase { 16 | 17 | private static final String ERR_MSG = "If a SendTask references a message, at most one InputSet must be defined in " + 18 | "the ioSpecification."; 19 | 20 | @Test 21 | public void testConstraintFail() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT046_failure.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), 24 | ERR_MSG, 25 | "(//bpmn:sendTask[@messageRef])[1]", 14); 26 | } 27 | 28 | @Test 29 | public void testConstraintSuccess() throws ValidationException { 30 | verifyValidResult(createFile("EXT046_success.bpmn")); 31 | } 32 | 33 | @Override 34 | protected String getExtNumber() { 35 | return "046"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext047.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.047 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext047 extends TestCase { 16 | 17 | private static final String ERR_MSG = "If a SendTask references a message, at most one DataInput must be defined in " + 18 | "the ioSpecification."; 19 | 20 | @Test 21 | public void testConstraintFail() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT047_failure.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), 24 | ERR_MSG, 25 | "(//bpmn:sendTask[@messageRef])[1]", 14); 26 | } 27 | 28 | @Test 29 | public void testConstraintSuccess() throws ValidationException { 30 | verifyValidResult(createFile("EXT047_success.bpmn")); 31 | } 32 | 33 | @Override 34 | protected String getExtNumber() { 35 | return "047"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext048.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.048 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext048 extends TestCase { 16 | 17 | private static final String ERR_MSG = "An Item must be referenced which must be declared in referenced Message definition."; 18 | 19 | @Test 20 | public void testConstraintFail() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT048_failure.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 23 | ERR_MSG, 24 | "(//bpmn:sendTask[bpmn:ioSpecification/bpmn:dataInput])[1]", 14); 25 | } 26 | 27 | @Test 28 | public void testConstraintFailDifferentItemDefUnequalStructureRef() throws ValidationException { 29 | ValidationResult result = verifyInvalidResult(createFile("EXT048_failure_differentItemDef_unequalStructureRef.bpmn"), 1); 30 | assertViolation(result.getViolations().get(0), 31 | ERR_MSG, 32 | "(//bpmn:sendTask[bpmn:ioSpecification/bpmn:dataInput])[1]", 15); 33 | } 34 | 35 | @Test 36 | public void testConstraintSuccessDifferentItemDefEqualStructureRef() throws ValidationException { 37 | verifyValidResult(createFile("EXT048_success_differentItemDef_equalStructureRef.bpmn")); 38 | } 39 | 40 | @Override 41 | protected String getExtNumber() { 42 | return "048"; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext049.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.049 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext049 extends TestCase { 16 | 17 | private static final String ERR_MSG = "A ReceiveTask with attribute instantiate set to true must not have any incoming sequence flow."; 18 | 19 | @Test 20 | public void testConstraintFail() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT049_failure.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 23 | ERR_MSG, 24 | "(//bpmn:receiveTask[@instantiate='true'])[1]", 4); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccess() throws ValidationException { 29 | verifyValidResult(createFile("EXT049_success.bpmn")); 30 | } 31 | 32 | @Test 33 | public void testConstraintSuccessInstantiateFalse() throws ValidationException { 34 | verifyValidResult(createFile("EXT049_success_instantiateFalse.bpmn")); 35 | } 36 | 37 | @Override 38 | protected String getExtNumber() { 39 | return "049"; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext050.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.046 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext050 extends TestCase { 16 | 17 | private static final String ERR_MSG = "If a ReceiveTask references a message, at most one OutputSet must be defined " + 18 | "in the ioSpecification."; 19 | 20 | @Test 21 | public void testConstraintFail() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT050_failure.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), 24 | ERR_MSG, 25 | "(//bpmn:receiveTask[@messageRef])[1]", 9); 26 | } 27 | 28 | @Test 29 | public void testConstraintSuccess() throws ValidationException { 30 | verifyValidResult(createFile("EXT050_success.bpmn")); 31 | } 32 | 33 | @Override 34 | protected String getExtNumber() { 35 | return "050"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext051.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.046 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext051 extends TestCase { 16 | 17 | private static final String ERR_MSG = "If a ReceiveTask references a message, at most one DataOutput must be defined " + 18 | "in the ioSpecification."; 19 | 20 | @Test 21 | public void testConstraintFail() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT051_failure.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), 24 | ERR_MSG, 25 | "(//bpmn:receiveTask[@messageRef])[1]", 9); 26 | } 27 | 28 | @Override 29 | protected String getExtNumber() { 30 | return "051"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext052.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.048 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext052 extends TestCase { 16 | 17 | private static final String ERR_MSG = "An Item must be referenced which must be declared in referenced Message definition."; 18 | 19 | @Test 20 | public void testConstraintFail() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT052_failure.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 23 | ERR_MSG, 24 | "(//bpmn:receiveTask[bpmn:ioSpecification/bpmn:dataOutput])[1]", 9); 25 | } 26 | 27 | @Test 28 | public void testConstraintFailDifferentItemDefUnequalStructureRef() throws ValidationException { 29 | ValidationResult result = verifyInvalidResult(createFile("EXT052_failure_differentItemDef_unequalStructureRef.bpmn"), 1); 30 | assertViolation(result.getViolations().get(0), 31 | ERR_MSG, 32 | "(//bpmn:receiveTask[bpmn:ioSpecification/bpmn:dataOutput])[1]", 10); 33 | } 34 | 35 | @Test 36 | public void testConstraintSuccessDifferentItemDefEqualStructureRef() throws ValidationException { 37 | verifyValidResult(createFile("EXT052_success_differentItemDef_equalStructureRef.bpmn")); 38 | } 39 | 40 | @Override 41 | protected String getExtNumber() { 42 | return "052"; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext053.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.053 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext053 extends TestCase { 16 | 17 | private static final String ERR_MSG = "If a script is present the script type must be defined."; 18 | 19 | @Test 20 | public void testConstraintFail() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT053_failure.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 23 | ERR_MSG, 24 | "(//bpmn:scriptTask[bpmn:script])[1]", 7); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccess() throws ValidationException { 29 | verifyValidResult(createFile("EXT053_success.bpmn")); 30 | } 31 | 32 | @Override 33 | protected String getExtNumber() { 34 | return "053"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext064.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.064 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext064 extends TestCase { 16 | 17 | private static final String ERR_MSG = "At least one InputOutputBinding must be defined as the Callable Element is exposed as a Service."; 18 | 19 | @Test 20 | public void testConstraintFailCalledProcess() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT064_failure_calledProcess.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 23 | ERR_MSG, 24 | "(//bpmn:*[bpmn:supportedInterfaceRef])[1]", 21); 25 | } 26 | 27 | @Test 28 | public void testConstraintFailCalledGlobalTask() throws ValidationException { 29 | ValidationResult result = verifyInvalidResult(createFile("EXT064_failure_calledGlobalTask.bpmn"), 1); 30 | assertViolation(result.getViolations().get(0), 31 | ERR_MSG, 32 | "(//bpmn:*[bpmn:supportedInterfaceRef])[1]", 54); 33 | } 34 | 35 | @Test 36 | public void testConstraintSuccessCalledProcess() throws ValidationException { 37 | verifyValidResult(createFile("EXT064_success_calledProcess.bpmn")); 38 | } 39 | 40 | @Test 41 | public void testConstraintSuccessCalledGlobalTask() throws ValidationException { 42 | verifyValidResult(createFile("EXT064_success_calledGlobalTask.bpmn")); 43 | } 44 | 45 | @Override 46 | protected String getExtNumber() { 47 | return "064"; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext065.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.065 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext065 extends TestCase { 16 | 17 | private static final String ERR_MSG = "An InputOutputBinding element must correctly bind one Input and one Output of" + 18 | " the InputOutputSpecification to an Operation of a Service Interface."; 19 | 20 | @Test 21 | public void testConstraintFailCalledProcess() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT065_failure_calledProcess_wrongInputData.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), 24 | ERR_MSG, 25 | "(//bpmn:*[bpmn:supportedInterfaceRef and bpmn:ioBinding])[1]", 19); 26 | } 27 | 28 | @Test 29 | public void testConstraintFailCalledGlobalTask() throws ValidationException { 30 | ValidationResult result = verifyInvalidResult(createFile("EXT065_failure_calledGlobalTask_wrongOutputData.bpmn"), 1); 31 | assertViolation(result.getViolations().get(0), 32 | ERR_MSG, 33 | "(//bpmn:*[bpmn:supportedInterfaceRef and bpmn:ioBinding])[1]", 14); 34 | } 35 | 36 | 37 | @Override 38 | protected String getExtNumber() { 39 | return "065"; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext067.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.053 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext067 extends TestCase { 16 | 17 | private static final String ERR_MSG = "If a multiInstance marker is used in an executable process either a " + 18 | "loopCardinality or a loopDataInputRef must be present."; 19 | 20 | @Test 21 | public void testConstraintFail() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT067_failure.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), 24 | ERR_MSG, 25 | "(//bpmn:multiInstanceLoopCharacteristics[ancestor::bpmn:process[@isExecutable='true']])[1]", 10); 26 | } 27 | 28 | @Test 29 | public void testConstraintSuccessLoopCardinality() throws ValidationException { 30 | verifyValidResult(createFile("EXT067_success_loopCardinality.bpmn")); 31 | } 32 | 33 | @Test 34 | public void testConstraintSuccessLoopDataInputRef() throws ValidationException { 35 | verifyValidResult(createFile("EXT067_success_loopDataInputRef.bpmn")); 36 | } 37 | 38 | @Override 39 | protected String getExtNumber() { 40 | return "067"; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext068.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.068 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext068 extends TestCase { 16 | 17 | private static final String ERR_MSG = "If a multiInstance task is used in an executable process " + 18 | "loopDataInputReference must be resolvable to a DataInput defined in the InputOutputSpecification of the Task."; 19 | 20 | @Test 21 | public void testConstraintFail() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT068_failure.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), 24 | ERR_MSG, 25 | "(//bpmn:multiInstanceLoopCharacteristics[bpmn:loopDataInputRef and not(parent::bpmn:subProcess) and ancestor::bpmn:process[@isExecutable='true']])[1]", 18); 26 | } 27 | 28 | @Override 29 | protected String getExtNumber() { 30 | return "068"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext069.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.069 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext069 extends TestCase { 16 | 17 | private static final String ERR_MSG = "Type of DataOutput must be the scalar of the loopDataOutput type."; 18 | 19 | @Test 20 | public void testConstraintFailIsCollection() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT069_failure_isCollection.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 23 | ERR_MSG, 24 | "(//bpmn:multiInstanceLoopCharacteristics[ancestor::bpmn:process[@isExecutable='true'] and bpmn:loopDataOutputRef and bpmn:outputDataItem])[1]", 19); 25 | } 26 | 27 | @Test 28 | public void testConstraintFailUnequalStructureRef() throws ValidationException { 29 | ValidationResult result = verifyInvalidResult(createFile("EXT069_failure_unequalStructureRef.bpmn"), 1); 30 | assertViolation(result.getViolations().get(0), 31 | ERR_MSG, 32 | "(//bpmn:multiInstanceLoopCharacteristics[ancestor::bpmn:process[@isExecutable='true'] and bpmn:loopDataOutputRef and bpmn:outputDataItem])[1]", 19); 33 | } 34 | 35 | @Test 36 | public void testConstraintSuccess() throws ValidationException { 37 | verifyValidResult(createFile("EXT069_success.bpmn")); 38 | } 39 | 40 | @Override 41 | protected String getExtNumber() { 42 | return "069"; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext070.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.070 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext070 extends TestCase { 16 | 17 | private static final String ERR_MSG = "Type of DataInput must be the scalar of the loopDataInput type."; 18 | 19 | @Test 20 | public void testConstraintFailIsCollection() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT070_failure_isCollection.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 23 | ERR_MSG, 24 | "(//bpmn:multiInstanceLoopCharacteristics[ancestor::bpmn:process[@isExecutable='true'] and bpmn:loopDataInputRef and bpmn:inputDataItem])[1]", 19); 25 | } 26 | 27 | @Test 28 | public void testConstraintFailUnequalStructureRef() throws ValidationException { 29 | ValidationResult result = verifyInvalidResult(createFile("EXT070_failure_unequalStructureRef.bpmn"), 1); 30 | assertViolation(result.getViolations().get(0), 31 | ERR_MSG, 32 | "(//bpmn:multiInstanceLoopCharacteristics[ancestor::bpmn:process[@isExecutable='true'] and bpmn:loopDataInputRef and bpmn:inputDataItem])[1]", 19); 33 | } 34 | 35 | @Test 36 | public void testConstraintSuccess() throws ValidationException { 37 | verifyValidResult(createFile("EXT070_success.bpmn")); 38 | } 39 | 40 | @Override 41 | protected String getExtNumber() { 42 | return "070"; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext085.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.084 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext085 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult(createFile("EXT085_failure.bpmn"), 20 | 1); 21 | assertViolation(result.getViolations().get(0), 22 | "An optionalInputRef must be listed as dataInputRef.", 23 | "(//bpmn:inputSet[bpmn:optionalInputRefs])[1]", 7); 24 | } 25 | 26 | @Test 27 | public void testConstraintSuccess() throws ValidationException { 28 | verifyValidResult(createFile("EXT085_success.bpmn")); 29 | } 30 | 31 | @Override 32 | protected String getExtNumber() { 33 | return "085"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext086.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.086 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext086 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult(createFile("EXT086_failure.bpmn"), 20 | 1); 21 | assertViolation(result.getViolations().get(0), 22 | "A whileExecutingInputRef must be listed as dataInputRef.", 23 | "(//bpmn:inputSet[bpmn:whileExecutingInputRefs])[1]", 7); 24 | } 25 | 26 | @Test 27 | public void testConstraintSuccess() throws ValidationException { 28 | verifyValidResult(createFile("EXT086_success.bpmn")); 29 | } 30 | 31 | @Override 32 | protected String getExtNumber() { 33 | return "086"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext087.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.087 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext087 extends TestCase { 16 | 17 | private static final String ERR_MSG = "If an inputSet references an outputSet using the outputSetRefs element it " + 18 | "must be referenced by the outputSet using the inputSetRefs element and vice versa."; 19 | 20 | @Test 21 | public void testConstraintFailInvalidReferencing() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT087_failure_invalidReferencing.bpmn"), 4); 23 | assertViolation(result.getViolations().get(0), 24 | ERR_MSG, 25 | "(//bpmn:inputSet[bpmn:outputSetRefs])[1]", 8); 26 | } 27 | 28 | @Test 29 | public void testConstraintFailMissingInputSetRef() throws ValidationException { 30 | ValidationResult result = verifyInvalidResult(createFile("EXT087_failure_missingInputSetRef.bpmn"), 1); 31 | assertViolation(result.getViolations().get(0), 32 | ERR_MSG, 33 | "(//bpmn:inputSet[bpmn:outputSetRefs])[1]", 7); 34 | } 35 | 36 | @Test 37 | public void testConstraintFailMissingOutputSetRef() throws ValidationException { 38 | ValidationResult result = verifyInvalidResult(createFile("EXT087_failure_missingOutputSetRef.bpmn"), 1); 39 | assertViolation(result.getViolations().get(0), 40 | ERR_MSG, 41 | "(//bpmn:outputSet[bpmn:inputSetRefs])[1]", 10); 42 | } 43 | 44 | @Test 45 | public void testConstraintSuccess() throws ValidationException { 46 | verifyValidResult(createFile("EXT087_success.bpmn")); 47 | } 48 | 49 | @Override 50 | protected String getExtNumber() { 51 | return "087"; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext089.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.089 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext089 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult(createFile("EXT089_failure.bpmn"), 20 | 1); 21 | assertViolation(result.getViolations().get(0), 22 | "An optionalOutputRef must be listed as dataOutputRef.", 23 | "(//bpmn:outputSet[bpmn:optionalOutputRefs])[1]", 11); 24 | } 25 | 26 | @Test 27 | public void testConstraintSuccess() throws ValidationException { 28 | verifyValidResult(createFile("EXT089_success.bpmn")); 29 | } 30 | 31 | @Override 32 | protected String getExtNumber() { 33 | return "089"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/commonExec/Ext090.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.commonExec; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.090 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext090 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult(createFile("EXT090_failure.bpmn"), 20 | 1); 21 | assertViolation(result.getViolations().get(0), 22 | "A whileExecutingOutputRef must be listed as dataOutputRef.", 23 | "(//bpmn:outputSet[bpmn:whileExecutingOutputRefs])[1]", 11); 24 | } 25 | 26 | @Test 27 | public void testConstraintSuccess() throws ValidationException { 28 | verifyValidResult(createFile("EXT090_success.bpmn")); 29 | } 30 | 31 | @Override 32 | protected String getExtNumber() { 33 | return "090"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext001.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationResult; 4 | import api.ValidationException; 5 | import api.Violation; 6 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 7 | import org.junit.Test; 8 | 9 | import static org.junit.Assert.assertEquals; 10 | import static org.junit.Assert.assertTrue; 11 | 12 | /** 13 | * Test class for testing Constraint EXT.001 14 | * 15 | * @author Philipp Neugebauer 16 | * @version 1.0 17 | * 18 | */ 19 | public class Ext001 extends TestCase { 20 | 21 | @Test 22 | public void testConstraintFail() throws ValidationException { 23 | ValidationResult result = verifyInvalidResult(createFile("Fail.bpmn"), 24 | 1); 25 | assertViolation(result.getViolations().get(0)); 26 | } 27 | 28 | @Test 29 | public void testConstraintFail2() throws ValidationException { 30 | ValidationResult result = verifyInvalidResult(createFile("Fail2.bpmn"), 31 | 1); 32 | assertViolation(result.getViolations().get(0)); 33 | } 34 | 35 | @Test 36 | public void testConstraintSuccess() throws ValidationException { 37 | verifyValidResult(createFile("Success.bpmn")); 38 | } 39 | 40 | @Override 41 | protected String getExtNumber() { 42 | return "001"; 43 | } 44 | 45 | private void assertViolation(Violation v) { 46 | assertTrue(v.getMessage().contains("Import could not be resolved: ")); 47 | assertTrue(v.getMessage().contains("nofile.bpmn")); 48 | assertEquals(3, v.getLocation().getLocation().getRow()); 49 | assertEquals("EXT.001", v.getConstraint()); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext021.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.021 10 | * 11 | * @author Philipp Neugebauer 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext021 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintEventSubProcessFail() 19 | throws ValidationException { 20 | ValidationResult result = verifyInvalidResult( 21 | createFile("fail_event_sub_process.bpmn"), 2); 22 | assertViolation( 23 | result.getViolations().get(0), 24 | "For a Process: Of the types of FlowNode, only Activities, Gateways, and Events can be the source. However, Activities that are Event SubProcesses are not allowed to be a source", 25 | "(//bpmn:*[./@id = //bpmn:sequenceFlow/@sourceRef and ancestor::bpmn:process])[1]", 7); 26 | } 27 | 28 | @Test 29 | public void testConstraintEventsSuccess() throws ValidationException { 30 | verifyValidResult(createFile("success_events.bpmn")); 31 | 32 | } 33 | 34 | @Test 35 | public void testConstraintGatewaysSuccess() throws ValidationException { 36 | verifyValidResult(createFile("success_gateways.bpmn")); 37 | } 38 | 39 | @Test 40 | public void testConstraintTasksSuccess() throws ValidationException { 41 | verifyValidResult(createFile("success_tasks.bpmn")); 42 | } 43 | 44 | @Override 45 | protected String getExtNumber() { 46 | return "021"; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext022.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.022 10 | * 11 | * @author Philipp Neugebauer 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext022 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintEventSubProcessFail() 19 | throws ValidationException { 20 | ValidationResult result = verifyInvalidResult( 21 | createFile("fail_event_sub_process.bpmn"), 2); 22 | assertViolation( 23 | result.getViolations().get(0), 24 | "For a Process: Of the types of FlowNode, only Activities, Gateways, and Events can be the target. However, Activities that are Event SubProcesses are not allowed to be a target", 25 | "(//bpmn:*[./@id = //bpmn:sequenceFlow/@targetRef and ancestor::bpmn:process])[1]", 7); 26 | } 27 | 28 | @Test 29 | public void testConstraintEventsSuccess() throws ValidationException { 30 | verifyValidResult(createFile("success_events.bpmn")); 31 | } 32 | 33 | @Test 34 | public void testConstraintGatewaysSuccess() throws ValidationException { 35 | verifyValidResult(createFile("success_gateways.bpmn")); 36 | } 37 | 38 | @Test 39 | public void testConstraintTasksSuccess() throws ValidationException { 40 | verifyValidResult(createFile("success_tasks.bpmn")); 41 | } 42 | 43 | @Test 44 | public void testConstraintTasksSuccessEventProcessInSubProcess() 45 | throws ValidationException { 46 | verifyValidResult(createFile("success_event_in_normal_subprocess.bpmn")); 47 | } 48 | 49 | @Override 50 | protected String getExtNumber() { 51 | return "022"; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext023.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.023 10 | * 11 | * @author Philipp Neugebauer 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext023 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintNoIncomingFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult( 20 | createFile("fail_no_incoming.bpmn"), 1); 21 | assertViolation( 22 | result.getViolations().get(0), 23 | "The target element of the sequence flow must reference the SequenceFlow definition using their incoming attribute.", 24 | "(//bpmn:sequenceFlow[@targetRef])[1]", 10); 25 | 26 | } 27 | 28 | @Test 29 | public void testConstraintNoOutgoingFail() throws ValidationException { 30 | ValidationResult result = verifyInvalidResult( 31 | createFile("fail_no_outgoing.bpmn"), 1); 32 | assertViolation( 33 | result.getViolations().get(0), 34 | "The source element of the sequence flow must reference the SequenceFlow definition using their outgoing attribute.", 35 | "(//bpmn:sequenceFlow[@sourceRef])[1]", 10); 36 | } 37 | 38 | @Test 39 | public void testConstraintSuccess() throws ValidationException { 40 | verifyValidResult(createFile("success.bpmn")); 41 | } 42 | 43 | @Override 44 | protected String getExtNumber() { 45 | return "023"; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext026.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import api.Violation; 6 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 7 | import org.junit.Test; 8 | 9 | /** 10 | * Test class for testing Constraint EXT.026 11 | * 12 | * @author Philipp Neugebauer 13 | * @version 1.0 14 | * 15 | */ 16 | public class Ext026 extends TestCase { 17 | 18 | @Test 19 | public void testConstraintActivityFail() throws ValidationException { 20 | ValidationResult result = verifyInvalidResult( 21 | createFile("fail_activity.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 23 | "(//bpmn:task[@default])[1]"); 24 | } 25 | 26 | @Test 27 | public void testConstraintGatewayFail() throws ValidationException { 28 | ValidationResult result = verifyInvalidResult( 29 | createFile("fail_gateway.bpmn"), 1); 30 | assertViolation(result.getViolations().get(0), 31 | "(//bpmn:exclusiveGateway[@default])[1]"); 32 | } 33 | 34 | @Test 35 | public void testConstraintSuccess() throws ValidationException { 36 | verifyValidResult(createFile("success.bpmn")); 37 | } 38 | 39 | private void assertViolation(Violation v, String xpath) { 40 | assertViolation(v, xpath, 11); 41 | } 42 | 43 | @Override 44 | protected String getErrorMessage() { 45 | return "If an activity or gateway references a sequenceFlow as default flow - the referenced sequence flow must reference the activity/the gateway as sourceRef"; 46 | } 47 | 48 | @Override 49 | protected String getExtNumber() { 50 | return "026"; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext028.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.028 10 | * 11 | * @author Philipp Neugebauer 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext028 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult(createFile("Fail.bpmn"), 20 | 1); 21 | assertViolation(result.getViolations().get(0), 22 | "A Sequence Flow must not cross the border of a Pool", 23 | "(//bpmn:sequenceFlow)[1]", 16); 24 | } 25 | 26 | @Test 27 | public void testConstraintSuccess() throws ValidationException { 28 | verifyValidResult(createFile("Success.bpmn")); 29 | } 30 | 31 | @Override 32 | protected String getExtNumber() { 33 | return "028"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext079.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.079 10 | * 11 | * @author Philipp Neugebauer 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext079 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult(createFile("fail.bpmn"), 20 | 1); 21 | assertViolation(result.getViolations().get(0), 22 | "InputOutputSpecifications are not allowed in SubProcesses", 23 | "(//bpmn:subProcess)[1]", 7); 24 | } 25 | 26 | @Test 27 | public void testConstraintSuccess() throws ValidationException { 28 | verifyValidResult(createFile("success.bpmn")); 29 | } 30 | 31 | @Override 32 | protected String getExtNumber() { 33 | return "079"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext084.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.084 10 | * 11 | * @author Philipp Neugebauer 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext084 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult(createFile("Fail.bpmn"), 20 | 1); 21 | assertViolation(result.getViolations().get(0), 22 | "A DataInput must be referenced by at least one InputSet", 23 | "(//bpmn:dataInput)[1]", 5); 24 | } 25 | 26 | @Test 27 | public void testConstraintSuccess() throws ValidationException { 28 | verifyValidResult(createFile("success.bpmn")); 29 | } 30 | 31 | @Override 32 | protected String getExtNumber() { 33 | return "084"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext088.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.088 10 | * 11 | * @author Philipp Neugebauer 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext088 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult(createFile("fail.bpmn"), 20 | 1); 21 | assertViolation(result.getViolations().get(0), 22 | "A DataOutput must be referenced by at least one OutputSet", 23 | "(//bpmn:dataOutput)[1]", 5); 24 | } 25 | 26 | @Test 27 | public void testConstraintSuccess() throws ValidationException { 28 | verifyValidResult(createFile("success.bpmn")); 29 | } 30 | 31 | @Override 32 | protected String getExtNumber() { 33 | return "088"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext095.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.095 10 | * 11 | * @author Philipp Neugebauer 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext095 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult(createFile("Fail.bpmn"), 20 | 1); 21 | assertViolation(result.getViolations().get(0), 22 | "(//bpmn:intermediateThrowEvent/bpmn:messageEventDefinition)[1]", 23 | 14); 24 | } 25 | 26 | @Test 27 | public void testConstraintEndFail() throws ValidationException { 28 | ValidationResult result = verifyInvalidResult( 29 | createFile("fail_end.bpmn"), 1); 30 | assertViolation(result.getViolations().get(0), 31 | "(//bpmn:endEvent/bpmn:messageEventDefinition)[1]", 10); 32 | } 33 | 34 | @Test 35 | public void testConstraintSuccess() throws ValidationException { 36 | verifyValidResult(createFile("Success.bpmn")); 37 | } 38 | 39 | @Override 40 | protected String getErrorMessage() { 41 | return "EventDefinitions defined in a throw event are not allowed to be used somewhere else"; 42 | } 43 | 44 | @Override 45 | protected String getExtNumber() { 46 | return "095"; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext096.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.096 10 | * 11 | * @author Philipp Neugebauer 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext096 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult(createFile("Fail.bpmn"), 20 | 1); 21 | assertViolation(result.getViolations().get(0), 22 | "A Start Event must not have an incoming sequence flow", 23 | "(//bpmn:startEvent)[1]", 4); 24 | } 25 | 26 | @Override 27 | protected String getExtNumber() { 28 | return "096"; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext097.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import api.Violation; 6 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 7 | import org.junit.Test; 8 | 9 | /** 10 | * Test class for testing Constraint EXT.097 11 | * 12 | * @author Philipp Neugebauer 13 | * @version 1.0 14 | * 15 | */ 16 | public class Ext097 extends TestCase { 17 | 18 | @Test 19 | public void testConstraintFail() throws ValidationException { 20 | ValidationResult result = verifyInvalidResult( 21 | createFile("fail_end_without_sub-events.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 8); 23 | } 24 | 25 | @Test 26 | public void testConstraintSubFail() throws ValidationException { 27 | ValidationResult result = verifyInvalidResult( 28 | createFile("fail_with_sub-endevent.bpmn"), 1); 29 | assertViolation(result.getViolations().get(0), 10); 30 | } 31 | 32 | @Test 33 | public void testConstraintSubSuccess() throws ValidationException { 34 | verifyValidResult(createFile("success_with_sub-events.bpmn")); 35 | } 36 | 37 | @Test 38 | public void testConstraintSuccess() throws ValidationException { 39 | verifyValidResult(createFile("success_without_sub-events.bpmn")); 40 | 41 | } 42 | 43 | private void assertViolation(Violation v, int line) { 44 | assertViolation(v, "(//bpmn:endEvent)[1]", line); 45 | } 46 | 47 | @Override 48 | protected String getErrorMessage() { 49 | return "A Start event (or an instantiating ReceiveTask) must be present when an End event is used in the same process level"; 50 | } 51 | 52 | @Override 53 | protected String getExtNumber() { 54 | return "097"; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext101.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.101 10 | * 11 | * @author Philipp Neugebauer 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext101 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult(createFile("fail.bpmn"), 20 | 2); 21 | assertViolation( 22 | result.getViolations().get(0), 23 | "The source element of the sequence flow must reference the SequenceFlow definition using their outgoing attribute.", 24 | "(//bpmn:sequenceFlow[@sourceRef])[1]", 9); 25 | assertViolation(result.getViolations().get(1), 26 | "A startEvent must have a outgoing subelement", 27 | "(//bpmn:startEvent)[1]", 4); 28 | } 29 | 30 | @Test 31 | public void testConstraintSuccess() throws ValidationException { 32 | verifyValidResult(createFile("success.bpmn")); 33 | } 34 | 35 | @Override 36 | protected String getExtNumber() { 37 | return "101"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext102.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.102 10 | * 11 | * @author Philipp Neugebauer 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext102 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult(createFile("Fail.bpmn"), 20 | 2); 21 | assertViolation( 22 | result.getViolations().get(0), 23 | "A message flow must connect 'InteractionNodes' from different Pools", 24 | "(//bpmn:messageFlow)[1]", 7); 25 | assertViolation(result.getViolations().get(1), 26 | "A Start Event MUST NOT be a source for a message flow", 27 | "(//bpmn:messageFlow[@sourceRef])[1]", 7); 28 | } 29 | 30 | @Override 31 | protected String getExtNumber() { 32 | return "102"; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext103.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.103 10 | * 11 | * @author Philipp Neugebauer 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext103 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult(createFile("Fail.bpmn"), 20 | 1); 21 | assertViolation( 22 | result.getViolations().get(0), 23 | "If a Start Event is target of a MessageFlow definition, at least one messageEventDefinition must be present", 24 | "(//bpmn:startEvent[@id = //bpmn:messageFlow/@targetRef])[1]", 13); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccess() throws ValidationException { 29 | verifyValidResult(createFile("Success.bpmn")); 30 | } 31 | 32 | @Test 33 | public void testConstraintRefSuccess() throws ValidationException { 34 | verifyValidResult(createFile("Success_ref.bpmn")); 35 | } 36 | 37 | @Override 38 | protected String getExtNumber() { 39 | return "103"; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext104.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.104 10 | * 11 | * @author Philipp Neugebauer 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext104 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult(createFile("fail.bpmn"), 20 | 1); 21 | assertViolation(result.getViolations().get(0), 22 | "An End Event must not have an outgoing sequence flow", 23 | "(//bpmn:endEvent)[1]", 7); 24 | } 25 | 26 | @Test 27 | public void testConstraintSuccess() throws ValidationException { 28 | verifyValidResult(createFile("success.bpmn")); 29 | } 30 | 31 | @Override 32 | protected String getExtNumber() { 33 | return "104"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext105.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.105 10 | * 11 | * @author Philipp Neugebauer 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext105 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult( 20 | createFile("fail_end_without_sub-events.bpmn"), 1); 21 | assertViolation(result.getViolations().get(0), "(//bpmn:startEvent)[1]", 22 | 4); 23 | } 24 | 25 | @Test 26 | public void testConstraintSubFail() throws ValidationException { 27 | ValidationResult result = verifyInvalidResult( 28 | createFile("fail_with_sub-startevent.bpmn"), 1); 29 | assertViolation(result.getViolations().get(0), "(//bpmn:startEvent)[2]", 30 | 10); 31 | } 32 | 33 | @Test 34 | public void testConstraintSubSuccess() throws ValidationException { 35 | verifyValidResult(createFile("success_with_sub-events.bpmn")); 36 | } 37 | 38 | @Test 39 | public void testConstraintSuccess() throws ValidationException { 40 | verifyValidResult(createFile("success_without_sub-events.bpmn")); 41 | } 42 | 43 | @Override 44 | protected String getErrorMessage() { 45 | return "An end event must be present when a start event is used in the same process level"; 46 | } 47 | 48 | @Override 49 | protected String getExtNumber() { 50 | return "105"; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext106.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import api.Violation; 6 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 7 | import org.junit.Test; 8 | 9 | /** 10 | * Test class for testing Constraint EXT.106 11 | * 12 | * @author Philipp Neugebauer 13 | * @version 1.0 14 | * 15 | */ 16 | public class Ext106 extends TestCase { 17 | 18 | @Test 19 | public void testConstraintEventFail() throws ValidationException { 20 | ValidationResult result = verifyInvalidResult( 21 | createFile("fail_cancel_end_event.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 7); 23 | } 24 | 25 | @Test 26 | public void testConstraintEventRefFail() throws ValidationException { 27 | ValidationResult result = verifyInvalidResult( 28 | createFile("fail_sub_process.bpmn"), 1); 29 | assertViolation(result.getViolations().get(0), 22); 30 | } 31 | 32 | @Test 33 | public void testConstraintCancelEventSuccess() 34 | throws ValidationException { 35 | verifyValidResult(createFile("success_cancel_event.bpmn")); 36 | 37 | } 38 | 39 | @Test 40 | public void testConstraintCancelBoundaryEventSuccess() 41 | throws ValidationException { 42 | verifyValidResult(createFile("success_cancel_boundary_event.bpmn")); 43 | } 44 | 45 | private void assertViolation(Violation v, int line) { 46 | assertViolation(v, "(//bpmn:endEvent[./bpmn:cancelEventDefinition])[1]", line); 47 | } 48 | 49 | @Override 50 | protected String getErrorMessage() { 51 | return "A cancel EndEvent is only allowed in a transaction sub-process"; 52 | } 53 | 54 | @Override 55 | protected String getExtNumber() { 56 | return "106"; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext107.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.107 10 | * 11 | * @author Philipp Neugebauer 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext107 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult(createFile("fail.bpmn"), 20 | 2); 21 | assertViolation( 22 | result.getViolations().get(0), 23 | "The target element of the sequence flow must reference the SequenceFlow definition using their incoming attribute.", 24 | "(//bpmn:sequenceFlow[@targetRef])[1]", 9); 25 | assertViolation(result.getViolations().get(1), 26 | "An End Event MUST have at least one incoming Sequence Flow", 27 | "(//bpmn:endEvent)[1]", 4); 28 | } 29 | 30 | @Test 31 | public void testConstraintSuccess() throws ValidationException { 32 | verifyValidResult(createFile("success.bpmn")); 33 | } 34 | 35 | @Override 36 | protected String getExtNumber() { 37 | return "107"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext108.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.108 10 | * 11 | * @author Philipp Neugebauer 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext108 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult(createFile("Fail.bpmn"), 20 | 2); 21 | assertViolation( 22 | result.getViolations().get(0), 23 | "A message flow must connect 'InteractionNodes' from different Pools", 24 | "(//bpmn:messageFlow)[1]", 7); 25 | assertViolation(result.getViolations().get(1), 26 | "An End Event MUST NOT be a target for a message flow", 27 | "(//bpmn:messageFlow[@targetRef])[1]", 7); 28 | } 29 | 30 | @Override 31 | protected String getExtNumber() { 32 | return "108"; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/descriptive/Ext109.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.descriptive; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.109 10 | * 11 | * @author Philipp Neugebauer 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext109 extends TestCase { 16 | 17 | @Test 18 | public void testConstraintFail() throws ValidationException { 19 | ValidationResult result = verifyInvalidResult(createFile("Fail.bpmn"), 20 | 1); 21 | assertViolation( 22 | result.getViolations().get(0), 23 | "If an end event is source of a MessageFlow definition, at least one messageEventDefinition must be present", 24 | "(//bpmn:endEvent[@id = //bpmn:messageFlow/@sourceRef])[1]", 16); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccess() throws ValidationException { 29 | verifyValidResult(createFile("Success.bpmn")); 30 | } 31 | 32 | @Test 33 | public void testConstraintRefSuccess() throws ValidationException { 34 | verifyValidResult(createFile("Success_ref.bpmn")); 35 | } 36 | 37 | @Override 38 | protected String getExtNumber() { 39 | return "109"; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/full/Ext027.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.full; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.027 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext027 extends TestCase { 16 | 17 | private static final String ERR_MSG = "A choreography or a GlobalConversation must not reference a choreography."; 18 | 19 | @Test 20 | public void testConstraintFailChoreography() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT027_failure_choreography.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 23 | ERR_MSG, 24 | "(//bpmn:choreography[bpmn:choreographyRef])[1]", 3); 25 | } 26 | 27 | @Test 28 | public void testConstraintFailGlobalConversation() throws ValidationException { 29 | ValidationResult result = verifyInvalidResult(createFile("EXT027_failure_globalConversation.bpmn"), 1); 30 | assertViolation(result.getViolations().get(0), 31 | ERR_MSG, 32 | "(//bpmn:globalConversation[bpmn:choreographyRef])[1]", 14); 33 | } 34 | 35 | @Test 36 | public void testConstraintSuccessChorNoRef() throws ValidationException { 37 | verifyValidResult(createFile("EXT027_success_chorNoRef.bpmn")); 38 | } 39 | 40 | @Test 41 | public void testConstraintSuccessGlobalConversation() throws ValidationException { 42 | verifyValidResult(createFile("EXT027_success_globalConversation.bpmn")); 43 | } 44 | 45 | @Override 46 | protected String getExtNumber() { 47 | return "027"; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/full/Ext029.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.full; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.029 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext029 extends TestCase { 16 | 17 | private static final String ERR_MSG = "The value of the minimum attribute of the participant multiplicity must not be negative."; 18 | 19 | @Test 20 | public void testConstraintFail() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT029_failure.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 23 | ERR_MSG, 24 | "(//bpmn:participantMultiplicity[@minimum])[2]", 8); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccess() throws ValidationException { 29 | verifyValidResult(createFile("EXT029_success.bpmn")); 30 | } 31 | 32 | @Override 33 | protected String getExtNumber() { 34 | return "029"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/full/Ext030.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.full; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.030 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext030 extends TestCase { 16 | 17 | private static final String ERR_MSG = "The value of maximum MUST be one or greater, AND MUST be equal or greater than the minimum value."; 18 | 19 | @Test 20 | public void testConstraintFail() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT030_failure.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 23 | ERR_MSG, 24 | "(//bpmn:participantMultiplicity)[2]", 8); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccess() throws ValidationException { 29 | verifyValidResult(createFile("EXT030_success.bpmn")); 30 | } 31 | 32 | @Override 33 | protected String getExtNumber() { 34 | return "030"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/full/Ext032.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.full; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.032 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext032 extends TestCase { 16 | 17 | private static final String ERR_MSG = "A globalConversation must not contain any ConversationNodes, " + 18 | "participantAssociations, messageFlowAssociations, conversationAssociations or artifacts."; 19 | 20 | @Test 21 | public void testConstraintFail() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT032_failure.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), 24 | ERR_MSG, 25 | "(//bpmn:globalConversation)[1]", 3); 26 | } 27 | 28 | @Test 29 | public void testConstraintSuccess() throws ValidationException { 30 | verifyValidResult(createFile("EXT032_success.bpmn")); 31 | } 32 | 33 | @Override 34 | protected String getExtNumber() { 35 | return "032"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/full/Ext033.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.full; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.033 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext033 extends TestCase { 16 | 17 | private static final String ERR_MSG = "If a collaboration references a Choreography the value of the attribute " + 18 | "isClosed must be equal for both elements."; 19 | 20 | @Test 21 | public void testConstraintFail() throws ValidationException { 22 | ValidationResult result = verifyInvalidResult(createFile("EXT033_failure.bpmn"), 1); 23 | assertViolation(result.getViolations().get(0), 24 | ERR_MSG, 25 | "(//bpmn:collaboration[bpmn:choreographyRef])[1]", 29); 26 | } 27 | 28 | @Test 29 | public void testConstraintSuccess() throws ValidationException { 30 | verifyValidResult(createFile("EXT033_success.bpmn")); 31 | } 32 | 33 | @Override 34 | protected String getExtNumber() { 35 | return "033"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/full/Ext037.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.full; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.037 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext037 extends TestCase { 16 | 17 | private static final String ERR_MSG = "The value of the startQuantity attribute of an activity MUST NOT be less than 1."; 18 | 19 | @Test 20 | public void testConstraintFail() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT037_failure.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 23 | ERR_MSG, 24 | "(//bpmn:*[@startQuantity])[1]", 7); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccess() throws ValidationException { 29 | verifyValidResult(createFile("EXT037_success.bpmn")); 30 | } 31 | 32 | @Override 33 | protected String getExtNumber() { 34 | return "037"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/de/uniba/dsg/bpmnspector/schematron/full/Ext038.java: -------------------------------------------------------------------------------- 1 | package de.uniba.dsg.bpmnspector.schematron.full; 2 | 3 | import api.ValidationException; 4 | import api.ValidationResult; 5 | import de.uniba.dsg.bpmnspector.schematron.TestCase; 6 | import org.junit.Test; 7 | 8 | /** 9 | * Test class for testing Constraint EXT.038 10 | * 11 | * @author Matthias Geiger 12 | * @version 1.0 13 | * 14 | */ 15 | public class Ext038 extends TestCase { 16 | 17 | private static final String ERR_MSG = "The value of the completionQuantity attribute of an activity MUST NOT be less than 1."; 18 | 19 | @Test 20 | public void testConstraintFail() throws ValidationException { 21 | ValidationResult result = verifyInvalidResult(createFile("EXT038_failure.bpmn"), 1); 22 | assertViolation(result.getViolations().get(0), 23 | ERR_MSG, 24 | "(//bpmn:*[@completionQuantity])[1]", 7); 25 | } 26 | 27 | @Test 28 | public void testConstraintSuccess() throws ValidationException { 29 | verifyValidResult(createFile("EXT038_success.bpmn")); 30 | } 31 | 32 | @Override 33 | protected String getExtNumber() { 34 | return "038"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/resources/001/Fail.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/001/Fail2.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/001/File.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/test/resources/001/Success.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/006/Fail_text_annotation.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _4 6 | 7 | 8 | 9 | Text Annotation 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/test/resources/007/Fail_text_annotation.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _4 6 | 7 | 8 | 9 | Text Annotation 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/test/resources/008/Fail_association.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Text Annotation 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/test/resources/008/Fail_group.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/test/resources/008/Fail_text_annotation.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Text Annotation 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/test/resources/009/Fail_association.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Text Annotation 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/test/resources/009/Fail_group.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/test/resources/009/Fail_text_annotation.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Text Annotation 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/test/resources/010/Success.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Text Annotation 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/test/resources/022/fail_event_sub_process.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _4 6 | 7 | 8 | _4 9 | 10 | _13 11 | 12 | 13 | 14 | 15 | _13 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/test/resources/076/Fail_1.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/076/Fail_2.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/076/Fail_3.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/076/Success.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/084/Fail.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/test/resources/084/success.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | _3 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/test/resources/088/fail.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/test/resources/088/success.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | _4 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/test/resources/096/Fail.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _8 6 | _6 7 | 8 | 9 | _7 10 | 11 | 12 | _6 13 | _7 14 | _8 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/test/resources/099/fail_call_ref_process.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/test/resources/099/success_global.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/test/resources/135/fail_ex_no_connection.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/test/resources/135/fail_no_connection.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/test/resources/146/fail_conditional.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _4 6 | 7 | 8 | _4 9 | 10 | dummyCondition 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/test/resources/146/fail_timer.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _4 6 | 7 | 8 | _4 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/test/resources/146/fail_timer_ref.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | _4 7 | 8 | 9 | _4 10 | _3_ED_1 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/test/resources/non-wellformed/import_non_wellformed.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /src/test/resources/non-wellformed/simple_corrupt.xsd: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/test/resources/preprocessing/fail_call_participant_process.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | --------------------------------------------------------------------------------