From c04247632d013f1c515e9f69a88f6e0aa2cfb6a2 Mon Sep 17 00:00:00 2001 From: Jan Bliznicenko Date: Sun, 30 Jun 2024 17:58:21 +0200 Subject: [PATCH] reworked dependency showing and tests --- .../OPBPMNActivityController.class.st | 5 - .../OPBPMNActivityControllerTest.class.st | 16 +-- .../OPBPMNBasicFlowControllerTest.class.st | 33 ----- .../OPBPMNBoundaryEventController.class.st | 6 - .../OPBPMNBoundaryEventTest.class.st | 16 +-- ...BPMNCollapsedSubProcessController.class.st | 5 - .../OPBPMNCollapsedSubProcessTest.class.st | 16 +-- .../OPBPMNControllerTest.class.st | 92 ------------- .../OPBPMNDataFlowControllerTest.class.st | 30 +---- .../OPBPMNDataObjectTest.class.st | 16 +-- .../OPBPMNEdgeController.class.st | 31 +++-- .../OPBPMNEdgeControllerTest.class.st | 69 ++++++++++ .../OpenPonk-BPMN/OPBPMNEdgeLabel.class.st | 5 +- .../OPBPMNEndEventControllerTest.class.st | 18 +-- .../OPBPMNFlowControllerTest.class.st | 125 ++---------------- .../OPBPMNGatewayControllerTest.class.st | 16 +-- ...MNIntermediateEventControllerTest.class.st | 16 +-- .../OPBPMNMessageFlowControllerTest.class.st | 6 +- .../OPBPMNNodeController.class.st | 17 +-- .../OPBPMNNodeControllerTest.class.st | 40 +----- .../OPBPMNPoolController.class.st | 6 - .../OPBPMNPoolControllerTest.class.st | 10 -- .../OPBPMNStartEventControllerTest.class.st | 16 +-- .../OPBPMNSubProcessController.class.st | 6 - .../OPBPMNSubProcessTest.class.st | 16 +-- 25 files changed, 189 insertions(+), 443 deletions(-) delete mode 100644 repository/OpenPonk-BPMN/OPBPMNBasicFlowControllerTest.class.st delete mode 100644 repository/OpenPonk-BPMN/OPBPMNControllerTest.class.st create mode 100644 repository/OpenPonk-BPMN/OPBPMNEdgeControllerTest.class.st diff --git a/repository/OpenPonk-BPMN/OPBPMNActivityController.class.st b/repository/OpenPonk-BPMN/OPBPMNActivityController.class.st index 2e48f32..05e2e3d 100644 --- a/repository/OpenPonk-BPMN/OPBPMNActivityController.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNActivityController.class.st @@ -61,11 +61,6 @@ OPBPMNActivityController >> canBeTargetFor: aController [ ] ] -{ #category : 'accessing' } -OPBPMNActivityController >> dependentElements [ - ^ (model incoming , model outgoing) asSet -] - { #category : 'connecting' } OPBPMNActivityController >> diagramElementClass [ diff --git a/repository/OpenPonk-BPMN/OPBPMNActivityControllerTest.class.st b/repository/OpenPonk-BPMN/OPBPMNActivityControllerTest.class.st index f1a3835..3a55be7 100644 --- a/repository/OpenPonk-BPMN/OPBPMNActivityControllerTest.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNActivityControllerTest.class.st @@ -12,21 +12,21 @@ OPBPMNActivityControllerTest >> controllerClass [ ] { #category : 'accessing' } -OPBPMNActivityControllerTest >> diagramElementClass [ - ^ OPBPMNActivityShape +OPBPMNActivityControllerTest >> creationTargetControllerClass [ + ^ OPBPMNPoolController ] { #category : 'accessing' } -OPBPMNActivityControllerTest >> modelClass [ - ^ OPBPMNActivityModel +OPBPMNActivityControllerTest >> creationTargetModelClass [ + ^ OPBPMNPoolModel ] { #category : 'accessing' } -OPBPMNActivityControllerTest >> targetControllerClass [ - ^ OPBPMNPoolController +OPBPMNActivityControllerTest >> diagramElementClass [ + ^ OPBPMNActivityShape ] { #category : 'accessing' } -OPBPMNActivityControllerTest >> targetModelClass [ - ^ OPBPMNPoolModel +OPBPMNActivityControllerTest >> modelClass [ + ^ OPBPMNActivityModel ] diff --git a/repository/OpenPonk-BPMN/OPBPMNBasicFlowControllerTest.class.st b/repository/OpenPonk-BPMN/OPBPMNBasicFlowControllerTest.class.st deleted file mode 100644 index f51f335..0000000 --- a/repository/OpenPonk-BPMN/OPBPMNBasicFlowControllerTest.class.st +++ /dev/null @@ -1,33 +0,0 @@ -Class { - #name : 'OPBPMNBasicFlowControllerTest', - #superclass : 'OPBPMNFlowControllerTest', - #category : 'OpenPonk-BPMN-Tests', - #package : 'OpenPonk-BPMN', - #tag : 'Tests' -} - -{ #category : 'accessing' } -OPBPMNBasicFlowControllerTest >> controllerClass [ - ^ OPBPMNFlowController -] - -{ #category : 'accessing' } -OPBPMNBasicFlowControllerTest >> diagramElementClass [ - - ^ OPBPMNFlowShape -] - -{ #category : 'accessing' } -OPBPMNBasicFlowControllerTest >> modelClass [ - ^ OPBPMNFlowModel -] - -{ #category : 'accessing' } -OPBPMNBasicFlowControllerTest >> targetControllerClass [ - ^ OPBPMNActivityController -] - -{ #category : 'accessing' } -OPBPMNBasicFlowControllerTest >> targetModelClass [ - ^ OPBPMNActivityModel -] diff --git a/repository/OpenPonk-BPMN/OPBPMNBoundaryEventController.class.st b/repository/OpenPonk-BPMN/OPBPMNBoundaryEventController.class.st index 7f937ca..da49151 100644 --- a/repository/OpenPonk-BPMN/OPBPMNBoundaryEventController.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNBoundaryEventController.class.st @@ -54,12 +54,6 @@ OPBPMNBoundaryEventController >> modelClass [ ^ OPBPMNBoundaryEventModel ] -{ #category : 'forms' } -OPBPMNBoundaryEventController >> removeModel [ - - self diagramController model remove: self model -] - { #category : 'forms' } OPBPMNBoundaryEventController >> subscribeDiagram: aDiagram [ diff --git a/repository/OpenPonk-BPMN/OPBPMNBoundaryEventTest.class.st b/repository/OpenPonk-BPMN/OPBPMNBoundaryEventTest.class.st index 89f43e2..8c3eae2 100644 --- a/repository/OpenPonk-BPMN/OPBPMNBoundaryEventTest.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNBoundaryEventTest.class.st @@ -12,23 +12,23 @@ OPBPMNBoundaryEventTest >> controllerClass [ ] { #category : 'accessing' } -OPBPMNBoundaryEventTest >> diagramElementClass [ - ^ OPBPMNBoundaryEventShape +OPBPMNBoundaryEventTest >> creationTargetControllerClass [ + ^ OPBPMNSubProcessController ] { #category : 'accessing' } -OPBPMNBoundaryEventTest >> modelClass [ - ^ OPBPMNBoundaryEventModel +OPBPMNBoundaryEventTest >> creationTargetModelClass [ + ^ OPBPMNSubProcessModel ] { #category : 'accessing' } -OPBPMNBoundaryEventTest >> targetControllerClass [ - ^ OPBPMNSubProcessController +OPBPMNBoundaryEventTest >> diagramElementClass [ + ^ OPBPMNBoundaryEventShape ] { #category : 'accessing' } -OPBPMNBoundaryEventTest >> targetModelClass [ - ^ OPBPMNSubProcessModel +OPBPMNBoundaryEventTest >> modelClass [ + ^ OPBPMNBoundaryEventModel ] { #category : 'accessing' } diff --git a/repository/OpenPonk-BPMN/OPBPMNCollapsedSubProcessController.class.st b/repository/OpenPonk-BPMN/OPBPMNCollapsedSubProcessController.class.st index 47548f1..0a93601 100644 --- a/repository/OpenPonk-BPMN/OPBPMNCollapsedSubProcessController.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNCollapsedSubProcessController.class.st @@ -69,11 +69,6 @@ OPBPMNCollapsedSubProcessController >> canBeTargetFor: aController [ ] ] -{ #category : 'testing' } -OPBPMNCollapsedSubProcessController >> dependentElements [ - ^ (model incoming , model outgoing) asSet -] - { #category : 'testing' } OPBPMNCollapsedSubProcessController >> diagramElementClass [ diff --git a/repository/OpenPonk-BPMN/OPBPMNCollapsedSubProcessTest.class.st b/repository/OpenPonk-BPMN/OPBPMNCollapsedSubProcessTest.class.st index 22bf557..9d1d560 100644 --- a/repository/OpenPonk-BPMN/OPBPMNCollapsedSubProcessTest.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNCollapsedSubProcessTest.class.st @@ -12,21 +12,21 @@ OPBPMNCollapsedSubProcessTest >> controllerClass [ ] { #category : 'accessing' } -OPBPMNCollapsedSubProcessTest >> diagramElementClass [ - ^ OPBPMNCollapsedSubProcessShape +OPBPMNCollapsedSubProcessTest >> creationTargetControllerClass [ + ^ OPBPMNPoolController ] { #category : 'accessing' } -OPBPMNCollapsedSubProcessTest >> modelClass [ - ^ OPBPMNCollapsedSubProcessModel +OPBPMNCollapsedSubProcessTest >> creationTargetModelClass [ + ^ OPBPMNPoolModel ] { #category : 'accessing' } -OPBPMNCollapsedSubProcessTest >> targetControllerClass [ - ^ OPBPMNPoolController +OPBPMNCollapsedSubProcessTest >> diagramElementClass [ + ^ OPBPMNCollapsedSubProcessShape ] { #category : 'accessing' } -OPBPMNCollapsedSubProcessTest >> targetModelClass [ - ^ OPBPMNPoolModel +OPBPMNCollapsedSubProcessTest >> modelClass [ + ^ OPBPMNCollapsedSubProcessModel ] diff --git a/repository/OpenPonk-BPMN/OPBPMNControllerTest.class.st b/repository/OpenPonk-BPMN/OPBPMNControllerTest.class.st deleted file mode 100644 index 591cc21..0000000 --- a/repository/OpenPonk-BPMN/OPBPMNControllerTest.class.st +++ /dev/null @@ -1,92 +0,0 @@ -Class { - #name : 'OPBPMNControllerTest', - #superclass : 'OPElementControllerTest', - #instVars : [ - 'relationshipController' - ], - #category : 'OpenPonk-BPMN-Tests', - #package : 'OpenPonk-BPMN', - #tag : 'Tests' -} - -{ #category : 'testing' } -OPBPMNControllerTest class >> isAbstract [ - - ^ self = OPBPMNControllerTest -] - -{ #category : 'accessing' } -OPBPMNControllerTest >> controllerClass [ - ^ self subclassResponsibility -] - -{ #category : 'accessing' } -OPBPMNControllerTest >> createTargetModel [ - ^ self targetModelClass new -] - -{ #category : 'accessing' } -OPBPMNControllerTest >> diagramControllerClass [ - - ^ OPBPMNDiagramController -] - -{ #category : 'accessing' } -OPBPMNControllerTest >> diagramElementClass [ - - ^ self subclassResponsibility -] - -{ #category : 'accessing' } -OPBPMNControllerTest >> diagramModelClass [ - ^ OPBPMNModel -] - -{ #category : 'accessing' } -OPBPMNControllerTest >> modelClass [ - ^ self subclassResponsibility -] - -{ #category : 'accessing' } -OPBPMNControllerTest >> modelOwner [ - ^ diagramController model -] - -{ #category : 'accessing' } -OPBPMNControllerTest >> setUp [ - super setUp. - self setUpTarget -] - -{ #category : 'accessing' } -OPBPMNControllerTest >> setUpTarget [ - relationshipController := self targetControllerClass new. - relationshipController diagramController: diagramController. - relationshipController createModelIn: diagramController model -] - -{ #category : 'accessing' } -OPBPMNControllerTest >> targetControllerClass [ - ^ self subclassResponsibility -] - -{ #category : 'accessing' } -OPBPMNControllerTest >> targetModelClass [ - ^ self subclassResponsibility -] - -{ #category : 'accessing' } -OPBPMNControllerTest >> testCreateController [ - self assert: controller class equals: self controllerClass -] - -{ #category : 'accessing' } -OPBPMNControllerTest >> testCreateModel [ - controller createModelIn: relationshipController model. - self assert: controller model class equals: self modelClass -] - -{ #category : 'accessing' } -OPBPMNControllerTest >> testModelClass [ - self assert: controller modelClass equals: self modelClass -] diff --git a/repository/OpenPonk-BPMN/OPBPMNDataFlowControllerTest.class.st b/repository/OpenPonk-BPMN/OPBPMNDataFlowControllerTest.class.st index d97098e..2607051 100644 --- a/repository/OpenPonk-BPMN/OPBPMNDataFlowControllerTest.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNDataFlowControllerTest.class.st @@ -1,6 +1,6 @@ Class { #name : 'OPBPMNDataFlowControllerTest', - #superclass : 'OPBPMNFlowControllerTest', + #superclass : 'OPBPMNEdgeControllerTest', #category : 'OpenPonk-BPMN-Tests', #package : 'OpenPonk-BPMN', #tag : 'Tests' @@ -23,35 +23,11 @@ OPBPMNDataFlowControllerTest >> modelClass [ ] { #category : 'accessing' } -OPBPMNDataFlowControllerTest >> targetControllerClass [ +OPBPMNDataFlowControllerTest >> sourceControllerClass [ ^ OPBPMNDataObjectController ] { #category : 'accessing' } -OPBPMNDataFlowControllerTest >> targetModelClass [ +OPBPMNDataFlowControllerTest >> sourceModelClass [ ^ OPBPMNDataObjectModel ] - -{ #category : 'accessing' } -OPBPMNDataFlowControllerTest >> testCreateFigure [ - - | figure previousElementsSize | - controller - source: fromCtrl; - target: toCtrl; - model: model. - diagramController addController: controller. - previousElementsSize := diagramController canvas nodes size. - figure := controller - createDiagramElement; - renderDiagramElement. - self assert: figure class equals: OPRSPolyline. - self assert: figure from equals: fromCtrl roassalShape. - self assert: figure to equals: toCtrl roassalShape. - self - assert: diagramController canvas nodes size - equals: previousElementsSize + self amountOfLabels. - self assert: figure shape color equals: Color black. - self assert: figure shape markerEnd isNil. - self assert: figure shape markerStart isNil. -] diff --git a/repository/OpenPonk-BPMN/OPBPMNDataObjectTest.class.st b/repository/OpenPonk-BPMN/OPBPMNDataObjectTest.class.st index 11c6075..361b8b3 100644 --- a/repository/OpenPonk-BPMN/OPBPMNDataObjectTest.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNDataObjectTest.class.st @@ -12,21 +12,21 @@ OPBPMNDataObjectTest >> controllerClass [ ] { #category : 'accessing' } -OPBPMNDataObjectTest >> diagramElementClass [ - ^ OPBPMNDataObjectShape +OPBPMNDataObjectTest >> creationTargetControllerClass [ + ^ OPBPMNPoolController ] { #category : 'accessing' } -OPBPMNDataObjectTest >> modelClass [ - ^ OPBPMNDataObjectModel +OPBPMNDataObjectTest >> creationTargetModelClass [ + ^ OPBPMNPoolModel ] { #category : 'accessing' } -OPBPMNDataObjectTest >> targetControllerClass [ - ^ OPBPMNPoolController +OPBPMNDataObjectTest >> diagramElementClass [ + ^ OPBPMNDataObjectShape ] { #category : 'accessing' } -OPBPMNDataObjectTest >> targetModelClass [ - ^ OPBPMNPoolModel +OPBPMNDataObjectTest >> modelClass [ + ^ OPBPMNDataObjectModel ] diff --git a/repository/OpenPonk-BPMN/OPBPMNEdgeController.class.st b/repository/OpenPonk-BPMN/OPBPMNEdgeController.class.st index b1278a0..66e935b 100644 --- a/repository/OpenPonk-BPMN/OPBPMNEdgeController.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNEdgeController.class.st @@ -11,19 +11,6 @@ OPBPMNEdgeController >> addLabels [ self constraintLabel: #name balance: 0.4 offset: 12 ] -{ #category : 'construction' } -OPBPMNEdgeController >> createModelIn: aParentModel [ - self model: self modelClass new. - model source: self source model. - model target: self target model. - source model addFlow: model. - target model addFlow: model. - "(aParentModel owner isKindOf: OPBPMNPoolModel) - ifTrue: [ (aParentModel owner) owner add: model ] - ifFalse: [ aParentModel owner add: model ]." - ^ model -] - { #category : 'construction' } OPBPMNEdgeController >> diagramElementClass [ ^ self subclassResponsibility @@ -56,9 +43,25 @@ OPBPMNEdgeController >> modelClass [ ^ self subclassResponsibility ] +{ #category : 'construction' } +OPBPMNEdgeController >> modelSource: aModel in: aParentModel [ + + (super modelSource: aModel in: aParentModel) ifFalse: [ ^ false ]. + self modelSource addFlow: model. + ^ true +] + +{ #category : 'construction' } +OPBPMNEdgeController >> modelTarget: aModel in: aParentModel [ + + (super modelTarget: aModel in: aParentModel) ifFalse: [ ^ false ]. + self modelTarget addFlow: model. + ^ true +] + { #category : 'private' } OPBPMNEdgeController >> removeModel [ - self diagramController model remove: self model. + self model owner remove: self model. self model target removeFlow: self model. self model source removeFlow: self model ] diff --git a/repository/OpenPonk-BPMN/OPBPMNEdgeControllerTest.class.st b/repository/OpenPonk-BPMN/OPBPMNEdgeControllerTest.class.st new file mode 100644 index 0000000..c81c0af --- /dev/null +++ b/repository/OpenPonk-BPMN/OPBPMNEdgeControllerTest.class.st @@ -0,0 +1,69 @@ +Class { + #name : 'OPBPMNEdgeControllerTest', + #superclass : 'OPAbstractDirectionalRelationshipControllerTest', + #category : 'OpenPonk-BPMN-Tests', + #package : 'OpenPonk-BPMN', + #tag : 'Tests' +} + +{ #category : 'testing' } +OPBPMNEdgeControllerTest class >> isAbstract [ + "Override to true if a TestCase subclass is Abstract and should not have + TestCase instances built from it" + + ^ self = OPBPMNEdgeControllerTest +] + +{ #category : 'tests' } +OPBPMNEdgeControllerTest >> amountOfLabels [ + ^ 1 +] + +{ #category : 'initialization' } +OPBPMNEdgeControllerTest >> assignModelSource [ + + super assignModelSource. + model source addFlow: model +] + +{ #category : 'initialization' } +OPBPMNEdgeControllerTest >> assignModelTarget [ + + super assignModelTarget. + model target addFlow: model +] + +{ #category : 'accessing' } +OPBPMNEdgeControllerTest >> diagramControllerClass [ + + ^ OPBPMNDiagramController +] + +{ #category : 'accessing' } +OPBPMNEdgeControllerTest >> diagramModelClass [ + ^ OPBPMNModel +] + +{ #category : 'tests' } +OPBPMNEdgeControllerTest >> testCreateUsingAddAsTarget [ + + | figure | + super testCreateUsingAddAsTarget. + figure := controller roassalShape. + self assert: figure class equals: OPRSPolyline. + self assert: figure from equals: self sourceController roassalShape. + self assert: figure to equals: self targetController roassalShape. + self assert: figure shape color equals: Color black +] + +{ #category : 'tests' } +OPBPMNEdgeControllerTest >> testFigureRefresh [ + + | label | + self showInDiagram. + label := controller diagramElement ownedElements first. + self assert: label roassalShape text equals: ''. + controller model name: 'new name'. + controller diagramElement modelChanged. + self assert: label roassalShape text equals: 'new name' +] diff --git a/repository/OpenPonk-BPMN/OPBPMNEdgeLabel.class.st b/repository/OpenPonk-BPMN/OPBPMNEdgeLabel.class.st index 64e308e..2d7bf9c 100644 --- a/repository/OpenPonk-BPMN/OPBPMNEdgeLabel.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNEdgeLabel.class.st @@ -26,11 +26,12 @@ OPBPMNEdgeLabel >> defaultMinDistance [ { #category : 'accessing' } OPBPMNEdgeLabel >> defaultText [ - self modelElement name ifNil: [ ^'' ]. - ^ self modelElement name + + ^ self modelElement name ifNil: [ ^ '' ] ifNotNil: [ :name | name ] ] { #category : 'as yet unclassified' } OPBPMNEdgeLabel >> text [ + ^ self modelElement name ] diff --git a/repository/OpenPonk-BPMN/OPBPMNEndEventControllerTest.class.st b/repository/OpenPonk-BPMN/OPBPMNEndEventControllerTest.class.st index c2912f8..8643feb 100644 --- a/repository/OpenPonk-BPMN/OPBPMNEndEventControllerTest.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNEndEventControllerTest.class.st @@ -12,22 +12,22 @@ OPBPMNEndEventControllerTest >> controllerClass [ ] { #category : 'accessing' } -OPBPMNEndEventControllerTest >> diagramElementClass [ - - ^ OPBPMNEndEventShape +OPBPMNEndEventControllerTest >> creationTargetControllerClass [ + ^ OPBPMNPoolController ] { #category : 'accessing' } -OPBPMNEndEventControllerTest >> modelClass [ - ^ OPBPMNEndEventModel +OPBPMNEndEventControllerTest >> creationTargetModelClass [ + ^ OPBPMNPoolModel ] { #category : 'accessing' } -OPBPMNEndEventControllerTest >> targetControllerClass [ - ^ OPBPMNPoolController +OPBPMNEndEventControllerTest >> diagramElementClass [ + + ^ OPBPMNEndEventShape ] { #category : 'accessing' } -OPBPMNEndEventControllerTest >> targetModelClass [ - ^ OPBPMNPoolModel +OPBPMNEndEventControllerTest >> modelClass [ + ^ OPBPMNEndEventModel ] diff --git a/repository/OpenPonk-BPMN/OPBPMNFlowControllerTest.class.st b/repository/OpenPonk-BPMN/OPBPMNFlowControllerTest.class.st index 24644cf..f10d1a1 100644 --- a/repository/OpenPonk-BPMN/OPBPMNFlowControllerTest.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNFlowControllerTest.class.st @@ -1,133 +1,34 @@ Class { #name : 'OPBPMNFlowControllerTest', - #superclass : 'OPBPMNControllerTest', - #instVars : [ - 'fromCtrl', - 'toCtrl' - ], + #superclass : 'OPBPMNEdgeControllerTest', #category : 'OpenPonk-BPMN-Tests', #package : 'OpenPonk-BPMN', #tag : 'Tests' } -{ #category : 'testing' } -OPBPMNFlowControllerTest class >> isAbstract [ - "Override to true if a TestCase subclass is Abstract and should not have - TestCase instances built from it" - - ^ self = OPBPMNFlowControllerTest | (self = OPBPMNControllerTest) -] - -{ #category : 'tests' } -OPBPMNFlowControllerTest >> amountOfLabels [ - ^ 1 -] - -{ #category : 'tests' } +{ #category : 'accessing' } OPBPMNFlowControllerTest >> controllerClass [ - ^ self subclassResponsibility + ^ OPBPMNFlowController ] -{ #category : 'tests' } +{ #category : 'accessing' } OPBPMNFlowControllerTest >> diagramElementClass [ - ^ self subclassResponsibility + ^ OPBPMNFlowShape ] -{ #category : 'tests' } -OPBPMNFlowControllerTest >> fromClass [ - ^ OPBPMNStartEventController -] - -{ #category : 'tests' } +{ #category : 'accessing' } OPBPMNFlowControllerTest >> modelClass [ - ^ self subclassResponsibility -] - -{ #category : 'tests' } -OPBPMNFlowControllerTest >> setUp [ - - super setUp. - fromCtrl := self fromClass new. - diagramController addController: fromCtrl. - fromCtrl createModelIn: diagramController model. - fromCtrl - createDiagramElement; - renderDiagramElement. - toCtrl := self toClass new. - diagramController addController: toCtrl. - toCtrl createModelIn: diagramController model. - toCtrl - createDiagramElement; - renderDiagramElement -] - -{ #category : 'tests' } -OPBPMNFlowControllerTest >> testCreateDiagramElement [ - - controller model: model. - controller model source: fromCtrl model. - controller model target: toCtrl model. - - super testCreateDiagramElement -] - -{ #category : 'tests' } -OPBPMNFlowControllerTest >> testCreateFigure [ - - | figure previousElementsSize | - controller - source: fromCtrl; - target: toCtrl; - model: model. - diagramController addController: controller. - previousElementsSize := diagramController canvas nodes size. - figure := controller - createDiagramElement; - renderDiagramElement. - self assert: figure class equals: OPRSPolyline. - self assert: figure from equals: fromCtrl roassalShape. - self assert: figure to equals: toCtrl roassalShape. - self - assert: diagramController canvas nodes size - equals: previousElementsSize + self amountOfLabels. - self assert: figure shape color equals: Color black. - self assert: figure shape markerEnd isNotNil -] - -{ #category : 'tests' } -OPBPMNFlowControllerTest >> testCreateModel [ - | createdModel | - controller source: fromCtrl. - controller target: toCtrl. - fromCtrl createModelIn: diagramController model. - toCtrl createModelIn: diagramController model. - createdModel := controller createModelIn: diagramController model. - self assert: createdModel class equals: self modelClass. - self assert: createdModel source equals: fromCtrl model. - self assert: createdModel target equals: toCtrl model + ^ OPBPMNFlowModel ] -{ #category : 'tests' } -OPBPMNFlowControllerTest >> testFigureRefresh [ +{ #category : 'accessing' } +OPBPMNFlowControllerTest >> sourceControllerClass [ - | label | - controller - source: fromCtrl; - target: toCtrl. - diagramController addController: controller. - controller createModelIn: diagramController model. - controller - createDiagramElement; - renderDiagramElement. - label := controller diagramElement ownedElements first. - self assert: label roassalShape text equals: ''. - controller model name: 'new name'. - controller diagramElement modelChanged. - self assert: label roassalShape text equals: 'new name' + ^ OPBPMNActivityController ] -{ #category : 'tests' } -OPBPMNFlowControllerTest >> toClass [ - ^ OPBPMNEndEventController +{ #category : 'accessing' } +OPBPMNFlowControllerTest >> sourceModelClass [ + ^ OPBPMNActivityModel ] diff --git a/repository/OpenPonk-BPMN/OPBPMNGatewayControllerTest.class.st b/repository/OpenPonk-BPMN/OPBPMNGatewayControllerTest.class.st index 321295e..e617121 100644 --- a/repository/OpenPonk-BPMN/OPBPMNGatewayControllerTest.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNGatewayControllerTest.class.st @@ -12,21 +12,21 @@ OPBPMNGatewayControllerTest >> controllerClass [ ] { #category : 'accessing' } -OPBPMNGatewayControllerTest >> diagramElementClass [ - ^ OPBPMNGatewayShape +OPBPMNGatewayControllerTest >> creationTargetControllerClass [ + ^ OPBPMNPoolController ] { #category : 'accessing' } -OPBPMNGatewayControllerTest >> modelClass [ - ^ OPBPMNGatewayModel +OPBPMNGatewayControllerTest >> creationTargetModelClass [ + ^ OPBPMNPoolModel ] { #category : 'accessing' } -OPBPMNGatewayControllerTest >> targetControllerClass [ - ^ OPBPMNPoolController +OPBPMNGatewayControllerTest >> diagramElementClass [ + ^ OPBPMNGatewayShape ] { #category : 'accessing' } -OPBPMNGatewayControllerTest >> targetModelClass [ - ^ OPBPMNPoolModel +OPBPMNGatewayControllerTest >> modelClass [ + ^ OPBPMNGatewayModel ] diff --git a/repository/OpenPonk-BPMN/OPBPMNIntermediateEventControllerTest.class.st b/repository/OpenPonk-BPMN/OPBPMNIntermediateEventControllerTest.class.st index c0456a1..a69c2b5 100644 --- a/repository/OpenPonk-BPMN/OPBPMNIntermediateEventControllerTest.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNIntermediateEventControllerTest.class.st @@ -12,21 +12,21 @@ OPBPMNIntermediateEventControllerTest >> controllerClass [ ] { #category : 'accessing' } -OPBPMNIntermediateEventControllerTest >> diagramElementClass [ - ^ OPBPMNIntermediateEventShape +OPBPMNIntermediateEventControllerTest >> creationTargetControllerClass [ + ^ OPBPMNPoolController ] { #category : 'accessing' } -OPBPMNIntermediateEventControllerTest >> modelClass [ - ^ OPBPMNIntermediateEventModel +OPBPMNIntermediateEventControllerTest >> creationTargetModelClass [ + ^ OPBPMNPoolModel ] { #category : 'accessing' } -OPBPMNIntermediateEventControllerTest >> targetControllerClass [ - ^ OPBPMNPoolController +OPBPMNIntermediateEventControllerTest >> diagramElementClass [ + ^ OPBPMNIntermediateEventShape ] { #category : 'accessing' } -OPBPMNIntermediateEventControllerTest >> targetModelClass [ - ^ OPBPMNPoolModel +OPBPMNIntermediateEventControllerTest >> modelClass [ + ^ OPBPMNIntermediateEventModel ] diff --git a/repository/OpenPonk-BPMN/OPBPMNMessageFlowControllerTest.class.st b/repository/OpenPonk-BPMN/OPBPMNMessageFlowControllerTest.class.st index 8921ea8..5973935 100644 --- a/repository/OpenPonk-BPMN/OPBPMNMessageFlowControllerTest.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNMessageFlowControllerTest.class.st @@ -1,6 +1,6 @@ Class { #name : 'OPBPMNMessageFlowControllerTest', - #superclass : 'OPBPMNFlowControllerTest', + #superclass : 'OPBPMNEdgeControllerTest', #category : 'OpenPonk-BPMN-Tests', #package : 'OpenPonk-BPMN', #tag : 'Tests' @@ -23,11 +23,11 @@ OPBPMNMessageFlowControllerTest >> modelClass [ ] { #category : 'accessing' } -OPBPMNMessageFlowControllerTest >> targetControllerClass [ +OPBPMNMessageFlowControllerTest >> sourceControllerClass [ ^ OPBPMNPoolController ] { #category : 'accessing' } -OPBPMNMessageFlowControllerTest >> targetModelClass [ +OPBPMNMessageFlowControllerTest >> sourceModelClass [ ^ OPBPMNPoolModel ] diff --git a/repository/OpenPonk-BPMN/OPBPMNNodeController.class.st b/repository/OpenPonk-BPMN/OPBPMNNodeController.class.st index 570012a..8d99455 100644 --- a/repository/OpenPonk-BPMN/OPBPMNNodeController.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNNodeController.class.st @@ -9,15 +9,6 @@ Class { #tag : 'Controllers' } -{ #category : 'connecting' } -OPBPMNNodeController >> addAsTargetFor: aController [ - self assert: (self canBeTargetFor: aController). - aController target: self. - aController - createModelIn: self model - andShowInDiagram: self diagramController -] - { #category : 'forms' } OPBPMNNodeController >> buildEditorForm: aForm [ (aForm addText: 'Name') @@ -42,13 +33,9 @@ OPBPMNNodeController >> isHideable [ ^ true ] -{ #category : 'connecting' } -OPBPMNNodeController >> modelAsParent [ - ^ self model owner -] - { #category : 'private' } OPBPMNNodeController >> removeModel [ + self model announcer unsubscribe: self. - self diagramController model remove: self model + self model owner remove: self model ] diff --git a/repository/OpenPonk-BPMN/OPBPMNNodeControllerTest.class.st b/repository/OpenPonk-BPMN/OPBPMNNodeControllerTest.class.st index 3c63631..91b93d7 100644 --- a/repository/OpenPonk-BPMN/OPBPMNNodeControllerTest.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNNodeControllerTest.class.st @@ -1,6 +1,6 @@ Class { #name : 'OPBPMNNodeControllerTest', - #superclass : 'OPBPMNControllerTest', + #superclass : 'OPAbstractElementControllerTest', #category : 'OpenPonk-BPMN-Tests', #package : 'OpenPonk-BPMN', #tag : 'Tests' @@ -11,46 +11,18 @@ OPBPMNNodeControllerTest class >> isAbstract [ "Override to true if a TestCase subclass is Abstract and should not have TestCase instances built from it" - ^ (self = OPBPMNNodeControllerTest) | (self = OPBPMNControllerTest) + ^ self = OPBPMNNodeControllerTest ] { #category : 'accessing' } -OPBPMNNodeControllerTest >> controllerClass [ - ^ self subclassResponsibility -] - -{ #category : 'accessing' } -OPBPMNNodeControllerTest >> diagramElementClass [ - - ^ self subclassResponsibility -] - -{ #category : 'accessing' } -OPBPMNNodeControllerTest >> modelClass [ - ^ self subclassResponsibility -] +OPBPMNNodeControllerTest >> diagramControllerClass [ -{ #category : 'accessing' } -OPBPMNNodeControllerTest >> testAssignmentToParent [ - controller createModelIn: relationshipController model. - self assert: (relationshipController model elements includes: controller model) -] - -{ #category : 'accessing' } -OPBPMNNodeControllerTest >> testClassSideModelClass [ - self assert: self controllerClass modelClass equals: self modelClass -] - -{ #category : 'accessing' } -OPBPMNNodeControllerTest >> testCreateController [ - self assert: controller class = self controllerClass + ^ OPBPMNDiagramController ] { #category : 'accessing' } -OPBPMNNodeControllerTest >> testCreateModel [ - self - assert: (controller createModelIn: diagramController model) class - equals: self modelClass +OPBPMNNodeControllerTest >> diagramModelClass [ + ^ OPBPMNModel ] { #category : 'accessing' } diff --git a/repository/OpenPonk-BPMN/OPBPMNPoolController.class.st b/repository/OpenPonk-BPMN/OPBPMNPoolController.class.st index 78c923b..b0ea70a 100644 --- a/repository/OpenPonk-BPMN/OPBPMNPoolController.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNPoolController.class.st @@ -68,12 +68,6 @@ OPBPMNPoolController >> modelClass [ ^ OPBPMNPoolModel ] -{ #category : 'connecting' } -OPBPMNPoolController >> removeModel [ - self diagramController model remove: self model. - -] - { #category : 'connecting' } OPBPMNPoolController >> showDenyFeedbackFor: aController [ ^ nil diff --git a/repository/OpenPonk-BPMN/OPBPMNPoolControllerTest.class.st b/repository/OpenPonk-BPMN/OPBPMNPoolControllerTest.class.st index 2a56bbb..c8993a6 100644 --- a/repository/OpenPonk-BPMN/OPBPMNPoolControllerTest.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNPoolControllerTest.class.st @@ -21,16 +21,6 @@ OPBPMNPoolControllerTest >> modelClass [ ^ OPBPMNPoolModel ] -{ #category : 'accessing' } -OPBPMNPoolControllerTest >> targetControllerClass [ - ^ OPBPMNPoolController -] - -{ #category : 'accessing' } -OPBPMNPoolControllerTest >> targetModelClass [ - ^ OPBPMNPoolModel -] - { #category : 'accessing' } OPBPMNPoolControllerTest >> testAssignmentToParent [ "not by pool" diff --git a/repository/OpenPonk-BPMN/OPBPMNStartEventControllerTest.class.st b/repository/OpenPonk-BPMN/OPBPMNStartEventControllerTest.class.st index 039523f..b194b52 100644 --- a/repository/OpenPonk-BPMN/OPBPMNStartEventControllerTest.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNStartEventControllerTest.class.st @@ -12,21 +12,21 @@ OPBPMNStartEventControllerTest >> controllerClass [ ] { #category : 'accessing' } -OPBPMNStartEventControllerTest >> diagramElementClass [ - ^ OPBPMNStartEventShape +OPBPMNStartEventControllerTest >> creationTargetControllerClass [ + ^ OPBPMNPoolController ] { #category : 'accessing' } -OPBPMNStartEventControllerTest >> modelClass [ - ^ OPBPMNStartEventModel +OPBPMNStartEventControllerTest >> creationTargetModelClass [ + ^ OPBPMNPoolModel ] { #category : 'accessing' } -OPBPMNStartEventControllerTest >> targetControllerClass [ - ^ OPBPMNPoolController +OPBPMNStartEventControllerTest >> diagramElementClass [ + ^ OPBPMNStartEventShape ] { #category : 'accessing' } -OPBPMNStartEventControllerTest >> targetModelClass [ - ^ OPBPMNPoolModel +OPBPMNStartEventControllerTest >> modelClass [ + ^ OPBPMNStartEventModel ] diff --git a/repository/OpenPonk-BPMN/OPBPMNSubProcessController.class.st b/repository/OpenPonk-BPMN/OPBPMNSubProcessController.class.st index 24fc333..2106c6c 100644 --- a/repository/OpenPonk-BPMN/OPBPMNSubProcessController.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNSubProcessController.class.st @@ -77,12 +77,6 @@ OPBPMNSubProcessController >> modelClass [ ^ OPBPMNSubProcessModel ] -{ #category : 'forms' } -OPBPMNSubProcessController >> removeModel [ - - self diagramController model remove: self model -] - { #category : 'forms' } OPBPMNSubProcessController >> showDenyFeedbackFor: aController [ diff --git a/repository/OpenPonk-BPMN/OPBPMNSubProcessTest.class.st b/repository/OpenPonk-BPMN/OPBPMNSubProcessTest.class.st index 2e99d00..c9cb257 100644 --- a/repository/OpenPonk-BPMN/OPBPMNSubProcessTest.class.st +++ b/repository/OpenPonk-BPMN/OPBPMNSubProcessTest.class.st @@ -12,21 +12,21 @@ OPBPMNSubProcessTest >> controllerClass [ ] { #category : 'accessing' } -OPBPMNSubProcessTest >> diagramElementClass [ - ^ OPBPMNSubProcessShape +OPBPMNSubProcessTest >> creationTargetControllerClass [ + ^ OPBPMNPoolController ] { #category : 'accessing' } -OPBPMNSubProcessTest >> modelClass [ - ^ OPBPMNSubProcessModel +OPBPMNSubProcessTest >> creationTargetModelClass [ + ^ OPBPMNPoolModel ] { #category : 'accessing' } -OPBPMNSubProcessTest >> targetControllerClass [ - ^ OPBPMNPoolController +OPBPMNSubProcessTest >> diagramElementClass [ + ^ OPBPMNSubProcessShape ] { #category : 'accessing' } -OPBPMNSubProcessTest >> targetModelClass [ - ^ OPBPMNPoolModel +OPBPMNSubProcessTest >> modelClass [ + ^ OPBPMNSubProcessModel ]