Skip to content

Commit

Permalink
reworked dependency showing and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed Jul 4, 2024
1 parent 3cec466 commit 72fc4d1
Show file tree
Hide file tree
Showing 22 changed files with 251 additions and 282 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ A BormActivityControllerTest is a test class for testing the behavior of BormAct
"
Class {
#name : 'OPBormActivityControllerTest',
#superclass : 'OPBormControllerTest',
#superclass : 'OPBormProcessNodeControllerTest',
#category : 'OpenPonk-BormEditor-Tests',
#package : 'OpenPonk-BormEditor',
#tag : 'Tests'
Expand All @@ -15,21 +15,21 @@ OPBormActivityControllerTest >> controllerClass [
]

{ #category : 'accessing' }
OPBormActivityControllerTest >> diagramElementClass [
^ BormActivityShape
OPBormActivityControllerTest >> creationTargetControllerClass [
^ OPBormParticipantController
]

{ #category : 'accessing' }
OPBormActivityControllerTest >> modelClass [
^ BormActivity
OPBormActivityControllerTest >> creationTargetModelClass [
^ BormParticipant
]

{ #category : 'accessing' }
OPBormActivityControllerTest >> targetControllerClass [
^ OPBormParticipantController
OPBormActivityControllerTest >> diagramElementClass [
^ BormActivityShape
]

{ #category : 'accessing' }
OPBormActivityControllerTest >> targetModelClass [
^ BormParticipant
OPBormActivityControllerTest >> modelClass [
^ BormActivity
]
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ Class {
#tag : 'Controllers'
}

{ #category : 'construction' }
OPBormAssociationEnhancementController >> dependingOnElements [

^ super dependingOnElements , (Set with:
(self model owner ifNil: [
self error: 'There is no owner of ' , self model asString ]))
]

{ #category : 'diagram elements' }
OPBormAssociationEnhancementController >> diagramElementOwner [

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
Class {
#name : 'OPBormAssociationEnhancementControllerTest',
#superclass : 'OPBormControllerTest',
#instVars : [
'relationshipsSourceController',
'relationshipsTargetController'
],
#superclass : 'OPBormElementControllerTest',
#category : 'OpenPonk-BormEditor-Tests',
#package : 'OpenPonk-BormEditor',
#tag : 'Tests'
Expand All @@ -16,36 +12,40 @@ OPBormAssociationEnhancementControllerTest class >> isAbstract [
^ self = OPBormAssociationEnhancementControllerTest
]

{ #category : 'initialization' }
OPBormAssociationEnhancementControllerTest >> setUpTarget [

relationshipsSourceController := self targetsSourceControllerClass
new.
relationshipsSourceController diagramController: diagramController.
relationshipsSourceController createModelIn: diagramController model.
relationshipsTargetController := OPBormActivityController new.
relationshipsTargetController diagramController: diagramController.
relationshipsTargetController createModelIn: diagramController model.
relationshipController := self targetControllerClass new.
relationshipController diagramController: diagramController.
relationshipController
source: relationshipsTargetController;
target: relationshipsSourceController.
relationshipController createModelIn:
relationshipsSourceController model
]

{ #category : 'running' }
OPBormAssociationEnhancementControllerTest >> targetsSourceControllerClass [
{ #category : 'accessing' }
OPBormAssociationEnhancementControllerTest >> creationTargetControllerClass [

^ self subclassResponsibility
^ OPBormCommunicationController
]

{ #category : 'tests' }
OPBormAssociationEnhancementControllerTest >> testCreateDiagramElement [
{ #category : 'accessing' }
OPBormAssociationEnhancementControllerTest >> creationTargetModelClass [

relationshipController model add: model.
diagramController addController: relationshipController.
^ BormCommunication
]

super testCreateDiagramElement
{ #category : 'accessing' }
OPBormAssociationEnhancementControllerTest >> setUpCreationTargetModel [

| sourceParticipant targetParticipant sourceActivity targetActivity creationTargetModel |
sourceParticipant := BormParticipant new.
diagramController model add: sourceParticipant.
targetParticipant := BormParticipant new.
diagramController model add: targetParticipant.

sourceActivity := BormActivity new.
sourceParticipant add: sourceActivity.

targetActivity := BormActivity new.
targetParticipant add: targetActivity.

creationTargetModel := self creationTargetModelClass new.
creationTargetController model: creationTargetModel.
creationTargetController
modelSource: sourceActivity
in: targetActivity.
creationTargetController
modelTarget: targetActivity
in: targetActivity.
^ creationTargetModel
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@ OPBormCommunicationController >> canBeTargetForDataFlow: aController [
^ true
]

{ #category : 'accessing' }
OPBormCommunicationController >> createModelIn: aParentModel [
self model: self modelClass new.
model source: self source model.
model target: self target model.
source model send: model.
target model receive: model.
^ model
]

{ #category : 'construction' }
OPBormCommunicationController >> diagramElementClass [

Expand All @@ -37,6 +27,22 @@ OPBormCommunicationController >> modelClass [
^ BormCommunication
]

{ #category : 'accessing' }
OPBormCommunicationController >> modelSource: aModel in: aParentModel [

(super modelSource: aModel in: aParentModel) ifFalse: [ ^ false ].
self modelSource send: model.
^ true
]

{ #category : 'accessing' }
OPBormCommunicationController >> modelTarget: aModel in: aParentModel [

(super modelTarget: aModel in: aParentModel) ifFalse: [ ^ false ].
self modelTarget receive: model.
^ true
]

{ #category : 'destruction' }
OPBormCommunicationController >> removeModel [
self model target removeCommunication: self model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ Class {
#tag : 'Tests'
}

{ #category : 'initialization' }
OPBormCommunicationControllerTest >> assignModelSource [

super assignModelSource.
model source send: model
]

{ #category : 'initialization' }
OPBormCommunicationControllerTest >> assignModelTarget [

super assignModelTarget.
model target receive: model
]

{ #category : 'accessing' }
OPBormCommunicationControllerTest >> controllerClass [
^ OPBormCommunicationController
Expand All @@ -26,6 +40,12 @@ OPBormCommunicationControllerTest >> modelClass [
]

{ #category : 'as yet unclassified' }
OPBormCommunicationControllerTest >> targetControllerClass [
OPBormCommunicationControllerTest >> sourceControllerClass [
^ OPBormActivityController
]

{ #category : 'as yet unclassified' }
OPBormCommunicationControllerTest >> sourceModelClass [

^ BormActivity
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ OPBormConstraintController >> canVisitTarget: aController [
^ aController canBeTargetForConstraint: self
]

{ #category : 'construction' }
OPBormConstraintController >> createModelIn: aParentModel [

self model: self modelClass new.
aParentModel constraint: model.
^ model
]

{ #category : 'construction' }
OPBormConstraintController >> diagramElementClass [

Expand All @@ -30,6 +22,12 @@ OPBormConstraintController >> modelClass [
^ BormConstraint
]

{ #category : 'construction' }
OPBormConstraintController >> registerModelInContainer: aParentModel [

aParentModel constraint: model
]

{ #category : 'private' }
OPBormConstraintController >> removeModel [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,3 @@ OPBormConstraintControllerTest >> diagramElementClass [
OPBormConstraintControllerTest >> modelClass [
^ BormConstraint
]

{ #category : 'accessing' }
OPBormConstraintControllerTest >> targetControllerClass [
^ OPBormTransitionController
]

{ #category : 'accessing' }
OPBormConstraintControllerTest >> targetModelClass [
^ BormTransition
]

{ #category : 'running' }
OPBormConstraintControllerTest >> targetsSourceControllerClass [

^ OPBormStateController
]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Class {
#name : 'OPBormContainerControllerTest',
#superclass : 'OPBormControllerTest',
#superclass : 'OPBormElementControllerTest',
#category : 'OpenPonk-BormEditor-Tests',
#package : 'OpenPonk-BormEditor',
#tag : 'Tests'
Expand Down
101 changes: 0 additions & 101 deletions repository/OpenPonk-BormEditor/OPBormControllerTest.class.st

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ OPBormDataFlowController >> canVisitTarget: aController [
^ aController canBeTargetForDataFlow: self
]

{ #category : 'construction' }
OPBormDataFlowController >> createModelIn: aParentModel [

self model: self modelClass new.
aParentModel add: model.
^ model
]

{ #category : 'construction' }
OPBormDataFlowController >> diagramElementClass [

Expand Down
Loading

0 comments on commit 72fc4d1

Please sign in to comment.