diff --git a/repository/OpenPonk-PetriNets/OPPetriNetArcControllerTest.class.st b/repository/OpenPonk-PetriNets/OPPetriNetArcControllerTest.class.st index f754aa4..9810975 100644 --- a/repository/OpenPonk-PetriNets/OPPetriNetArcControllerTest.class.st +++ b/repository/OpenPonk-PetriNets/OPPetriNetArcControllerTest.class.st @@ -3,11 +3,7 @@ A DCPetriNetArcControllerTest is a test class for testing the behavior of DCPetr " Class { #name : 'OPPetriNetArcControllerTest', - #superclass : 'OPPetriNetsControllerTest', - #instVars : [ - 'fromCtrl', - 'toCtrl' - ], + #superclass : 'OPAbstractDirectionalRelationshipControllerTest', #category : 'OpenPonk-PetriNets-Tests', #package : 'OpenPonk-PetriNets', #tag : 'Tests' @@ -26,95 +22,25 @@ OPPetriNetArcControllerTest >> amountOfLabels [ ^ 1 ] -{ #category : 'hooks' } -OPPetriNetArcControllerTest >> fromClass [ - ^ self subclassResponsibility -] - -{ #category : 'running' } -OPPetriNetArcControllerTest >> 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' } -OPPetriNetArcControllerTest >> testCreateDiagramElement [ - - controller model: model. - controller model source: fromCtrl model. - controller model target: toCtrl model. +{ #category : 'accessing' } +OPPetriNetArcControllerTest >> diagramControllerClass [ - super testCreateDiagramElement + ^ OPPetriNetController ] -{ #category : 'tests' } -OPPetriNetArcControllerTest >> 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' } -OPPetriNetArcControllerTest >> 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 +{ #category : 'accessing' } +OPPetriNetArcControllerTest >> diagramModelClass [ + ^ OPPetriNet ] { #category : 'tests' } OPPetriNetArcControllerTest >> testFigureRefresh [ | label | - controller - source: fromCtrl; - target: toCtrl. - diagramController addController: controller. - controller createModelIn: diagramController model. - controller - createDiagramElement; - renderDiagramElement. + 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' ] - -{ #category : 'hooks' } -OPPetriNetArcControllerTest >> toClass [ - ^ self subclassResponsibility -] diff --git a/repository/OpenPonk-PetriNets/OPPetriNetInputArcControllerTest.class.st b/repository/OpenPonk-PetriNets/OPPetriNetInputArcControllerTest.class.st index 030e1eb..89fa289 100644 --- a/repository/OpenPonk-PetriNets/OPPetriNetInputArcControllerTest.class.st +++ b/repository/OpenPonk-PetriNets/OPPetriNetInputArcControllerTest.class.st @@ -18,11 +18,25 @@ OPPetriNetInputArcControllerTest class >> isAbstract [ ] { #category : 'hooks' } -OPPetriNetInputArcControllerTest >> fromClass [ +OPPetriNetInputArcControllerTest >> sourceControllerClass [ + ^ OPPetriNetPTPlaceController ] { #category : 'hooks' } -OPPetriNetInputArcControllerTest >> toClass [ +OPPetriNetInputArcControllerTest >> sourceModelClass [ + + ^ OPPetriNetPTPlace +] + +{ #category : 'hooks' } +OPPetriNetInputArcControllerTest >> targetControllerClass [ + ^ OPPetriNetTransitionController ] + +{ #category : 'hooks' } +OPPetriNetInputArcControllerTest >> targetModelClass [ + + ^ OPPetriNetTransition +] diff --git a/repository/OpenPonk-PetriNets/OPPetriNetNodeController.class.st b/repository/OpenPonk-PetriNets/OPPetriNetNodeController.class.st index 66131f9..db165ee 100644 --- a/repository/OpenPonk-PetriNets/OPPetriNetNodeController.class.st +++ b/repository/OpenPonk-PetriNets/OPPetriNetNodeController.class.st @@ -63,11 +63,6 @@ OPPetriNetNodeController >> isHideable [ ^ true ] -{ #category : 'connecting' } -OPPetriNetNodeController >> modelAsParent [ - ^ self model owner -] - { #category : 'removing' } OPPetriNetNodeController >> removeModel [ self model announcer unsubscribe: self. diff --git a/repository/OpenPonk-PetriNets/OPPetriNetNodeControllerTest.class.st b/repository/OpenPonk-PetriNets/OPPetriNetNodeControllerTest.class.st index e0e5615..4e74ea3 100644 --- a/repository/OpenPonk-PetriNets/OPPetriNetNodeControllerTest.class.st +++ b/repository/OpenPonk-PetriNets/OPPetriNetNodeControllerTest.class.st @@ -3,7 +3,7 @@ A DCPetriNetNodeControllerTest is a test class for testing the behavior of DCPet " Class { #name : 'OPPetriNetNodeControllerTest', - #superclass : 'OPPetriNetsControllerTest', + #superclass : 'OPAbstractElementControllerTest', #category : 'OpenPonk-PetriNets-Tests', #package : 'OpenPonk-PetriNets', #tag : 'Tests' @@ -17,22 +17,15 @@ OPPetriNetNodeControllerTest class >> isAbstract [ ^ self name = #OPPetriNetNodeControllerTest ] -{ #category : 'tests' } -OPPetriNetNodeControllerTest >> testCreateFigure [ +{ #category : 'accessing' } +OPPetriNetNodeControllerTest >> diagramControllerClass [ - controller createModelIn: diagramController model. - diagramController addController: controller. - controller - createDiagramElement; - renderDiagramElement. - self assert: (controller roassalShape isKindOf: RSBoundingShape) + ^ OPPetriNetController ] -{ #category : 'tests' } -OPPetriNetNodeControllerTest >> testCreateModel [ - self - assert: (controller createModelIn: diagramController model) class - equals: self modelClass +{ #category : 'accessing' } +OPPetriNetNodeControllerTest >> diagramModelClass [ + ^ OPPetriNet ] { #category : 'tests' } diff --git a/repository/OpenPonk-PetriNets/OPPetriNetsControllerTest.class.st b/repository/OpenPonk-PetriNets/OPPetriNetsControllerTest.class.st deleted file mode 100644 index 0969fbe..0000000 --- a/repository/OpenPonk-PetriNets/OPPetriNetsControllerTest.class.st +++ /dev/null @@ -1,46 +0,0 @@ -Class { - #name : 'OPPetriNetsControllerTest', - #superclass : 'OPElementControllerTest', - #category : 'OpenPonk-PetriNets-Tests', - #package : 'OpenPonk-PetriNets', - #tag : 'Tests' -} - -{ #category : 'testing' } -OPPetriNetsControllerTest class >> isAbstract [ - "Override to true if a TestCase subclass is Abstract and should not have - TestCase instances built from it" - - ^ self = OPPetriNetsControllerTest -] - -{ #category : 'hooks' } -OPPetriNetsControllerTest >> controllerClass [ - ^ self subclassResponsibility -] - -{ #category : 'accessing' } -OPPetriNetsControllerTest >> diagramControllerClass [ - - ^ OPPetriNetController -] - -{ #category : 'accessing' } -OPPetriNetsControllerTest >> diagramModelClass [ - ^ OPPetriNet -] - -{ #category : 'hooks' } -OPPetriNetsControllerTest >> modelClass [ - ^ self subclassResponsibility -] - -{ #category : 'tests' } -OPPetriNetsControllerTest >> testCreateController [ - self assert: controller class equals: self controllerClass -] - -{ #category : 'tests' } -OPPetriNetsControllerTest >> testModelClass [ - self assert: controller modelClass equals: self modelClass -]