diff --git a/repository/OpenPonk-ClassEditor/OPUmlCompartmentableShapeTest.class.st b/repository/OpenPonk-ClassEditor/OPAbstractUmlCompartmentableShapeTest.class.st similarity index 75% rename from repository/OpenPonk-ClassEditor/OPUmlCompartmentableShapeTest.class.st rename to repository/OpenPonk-ClassEditor/OPAbstractUmlCompartmentableShapeTest.class.st index 62ce2a82..e496fab0 100644 --- a/repository/OpenPonk-ClassEditor/OPUmlCompartmentableShapeTest.class.st +++ b/repository/OpenPonk-ClassEditor/OPAbstractUmlCompartmentableShapeTest.class.st @@ -1,5 +1,5 @@ Class { - #name : 'OPUmlCompartmentableShapeTest', + #name : 'OPAbstractUmlCompartmentableShapeTest', #superclass : 'OPAbstractUmlShapeTest', #category : 'OpenPonk-ClassEditor-Tests - Shapes', #package : 'OpenPonk-ClassEditor', @@ -7,12 +7,12 @@ Class { } { #category : 'hooks' } -OPUmlCompartmentableShapeTest >> shapeClass [ +OPAbstractUmlCompartmentableShapeTest >> shapeClass [ ^ OPUmlCompartmentableShape ] { #category : 'tests' } -OPUmlCompartmentableShapeTest >> testEmptyRoassalShape [ +OPAbstractUmlCompartmentableShapeTest >> testEmptyRoassalShape [ | roassalShape | shape renderIn: RSCanvas new. @@ -21,7 +21,7 @@ OPUmlCompartmentableShapeTest >> testEmptyRoassalShape [ ] { #category : 'tests' } -OPUmlCompartmentableShapeTest >> testFigures [ +OPAbstractUmlCompartmentableShapeTest >> testFigures [ shape renderIn: RSCanvas new. @@ -29,7 +29,7 @@ OPUmlCompartmentableShapeTest >> testFigures [ ] { #category : 'tests' } -OPUmlCompartmentableShapeTest >> testFigures1 [ +OPAbstractUmlCompartmentableShapeTest >> testFigures1 [ | lbl | (lbl := OPUmlLabel new) owningElement: shape. @@ -38,7 +38,7 @@ OPUmlCompartmentableShapeTest >> testFigures1 [ ] { #category : 'tests' } -OPUmlCompartmentableShapeTest >> testFigures2 [ +OPAbstractUmlCompartmentableShapeTest >> testFigures2 [ | lbl comp1 | (lbl := OPUmlLabel new) owningElement: shape. @@ -52,7 +52,7 @@ OPUmlCompartmentableShapeTest >> testFigures2 [ ] { #category : 'tests' } -OPUmlCompartmentableShapeTest >> testFigures3 [ +OPAbstractUmlCompartmentableShapeTest >> testFigures3 [ | lbl comp compLbl | (lbl := OPUmlLabel new) owningElement: shape. @@ -65,10 +65,9 @@ OPUmlCompartmentableShapeTest >> testFigures3 [ ] { #category : 'tests' } -OPUmlCompartmentableShapeTest >> testRemoveExtentChanged [ +OPAbstractUmlCompartmentableShapeTest >> testRemoveExtentChanged [ - | compartment compLbl canvas fullExtent labelContainer | - shape modelElement: OPTestEntityModel new. + | compartment compLbl fullExtent labelContainer | labelContainer := OPUmlCompartmentableLabel in: shape. OPUmlNameLabel in: labelContainer. compartment := OPUmlCompartment in: shape. @@ -76,7 +75,6 @@ OPUmlCompartmentableShapeTest >> testRemoveExtentChanged [ compLbl := (OPUmlLabel in: compartment) text: 'testx'; yourself ]. - canvas := RSCanvas new. shape renderIn: canvas. fullExtent := shape extent. compLbl remove. @@ -85,7 +83,7 @@ OPUmlCompartmentableShapeTest >> testRemoveExtentChanged [ ] { #category : 'tests' } -OPUmlCompartmentableShapeTest >> testRemoveFromOwnership [ +OPAbstractUmlCompartmentableShapeTest >> testRemoveFromOwnership [ | lbl | (lbl := OPUmlLabel new) owningElement: shape. @@ -97,7 +95,7 @@ OPUmlCompartmentableShapeTest >> testRemoveFromOwnership [ ] { #category : 'tests' } -OPUmlCompartmentableShapeTest >> testRemoveFromViewEmpty [ +OPAbstractUmlCompartmentableShapeTest >> testRemoveFromViewEmpty [ | canvas | canvas := RSCanvas new. @@ -107,7 +105,7 @@ OPUmlCompartmentableShapeTest >> testRemoveFromViewEmpty [ ] { #category : 'tests' } -OPUmlCompartmentableShapeTest >> testRemoveOwnedElement [ +OPAbstractUmlCompartmentableShapeTest >> testRemoveOwnedElement [ | lbl | (lbl := OPUmlLabel new) owningElement: shape. diff --git a/repository/OpenPonk-ClassEditor/OPUmlEdgeTest.class.st b/repository/OpenPonk-ClassEditor/OPAbstractUmlEdgeTest.class.st similarity index 81% rename from repository/OpenPonk-ClassEditor/OPUmlEdgeTest.class.st rename to repository/OpenPonk-ClassEditor/OPAbstractUmlEdgeTest.class.st index 5e04a145..0903fa96 100644 --- a/repository/OpenPonk-ClassEditor/OPUmlEdgeTest.class.st +++ b/repository/OpenPonk-ClassEditor/OPAbstractUmlEdgeTest.class.st @@ -1,5 +1,5 @@ Class { - #name : 'OPUmlEdgeTest', + #name : 'OPAbstractUmlEdgeTest', #superclass : 'OPAbstractEdgeTest', #category : 'OpenPonk-ClassEditor-Tests - Shapes', #package : 'OpenPonk-ClassEditor', @@ -7,7 +7,7 @@ Class { } { #category : 'running' } -OPUmlEdgeTest >> setUp [ +OPAbstractUmlEdgeTest >> setUp [ | source target | super setUp. source := OPUmlLabel new. @@ -19,12 +19,12 @@ OPUmlEdgeTest >> setUp [ ] { #category : 'hooks' } -OPUmlEdgeTest >> shapeClass [ +OPAbstractUmlEdgeTest >> shapeClass [ ^ OPUmlEdge ] { #category : 'tests' } -OPUmlEdgeTest >> testRemove [ +OPAbstractUmlEdgeTest >> testRemove [ | lbl | (lbl := OPUmlLabel new) owningElement: shape. @@ -34,7 +34,7 @@ OPUmlEdgeTest >> testRemove [ ] { #category : 'tests' } -OPUmlEdgeTest >> testRemoveDetachFromEnds [ +OPAbstractUmlEdgeTest >> testRemoveDetachFromEnds [ | source target | source := OPUmlLabel new. @@ -47,9 +47,10 @@ OPUmlEdgeTest >> testRemoveDetachFromEnds [ ] { #category : 'tests' } -OPUmlEdgeTest >> testRemoveFromView [ +OPAbstractUmlEdgeTest >> testRemoveFromView [ | lbl | + shape modelElement: model. (lbl := OPUmlLabel new) text: 'x'; owningElement: shape. diff --git a/repository/OpenPonk-ClassEditor/OPAbstractUmlShapeTest.class.st b/repository/OpenPonk-ClassEditor/OPAbstractUmlShapeTest.class.st index 193cf532..545dfe46 100644 --- a/repository/OpenPonk-ClassEditor/OPAbstractUmlShapeTest.class.st +++ b/repository/OpenPonk-ClassEditor/OPAbstractUmlShapeTest.class.st @@ -1,6 +1,6 @@ Class { #name : 'OPAbstractUmlShapeTest', - #superclass : 'OPAbstractShapeTest', + #superclass : 'OPAbstractNodeTest', #category : 'OpenPonk-ClassEditor-Tests - Shapes', #package : 'OpenPonk-ClassEditor', #tag : 'Tests - Shapes' @@ -48,7 +48,7 @@ OPAbstractUmlShapeTest >> testAddSelfEdge [ { #category : 'tests' } OPAbstractUmlShapeTest >> testEmpty [ - self assert: shape modelElement isNil. + super testEmpty. self assert: shape owningElement doesNotExist. self assert: shape ownedElements isEmpty. self assert: shape sourceEdges isEmpty. diff --git a/repository/OpenPonk-ClassEditor/OPUmlAssociationShapeTest.class.st b/repository/OpenPonk-ClassEditor/OPUmlAssociationShapeTest.class.st index 098c8dce..ef0e9310 100644 --- a/repository/OpenPonk-ClassEditor/OPUmlAssociationShapeTest.class.st +++ b/repository/OpenPonk-ClassEditor/OPUmlAssociationShapeTest.class.st @@ -1,10 +1,9 @@ Class { #name : 'OPUmlAssociationShapeTest', - #superclass : 'OPUmlEdgeTest', + #superclass : 'OPAbstractUmlEdgeTest', #instVars : [ 'element', 'comment', - 'association', 'ownedComment', 'owningElement' ], @@ -13,17 +12,19 @@ Class { #tag : 'Tests - Shapes' } -{ #category : 'running' } -OPUmlAssociationShapeTest >> setUp [ - super setUp. - self setUpAssociation +{ #category : 'instance creation' } +OPUmlAssociationShapeTest >> modelClass [ + + ^ OPUMLAssociation ] { #category : 'running' } -OPUmlAssociationShapeTest >> setUpAssociation [ +OPUmlAssociationShapeTest >> newModelInstance [ + + | association | element := OPUMLClass new name: 'Element'. comment := OPUMLClass new name: 'Comment'. - association := OPUMLAssociation new. + association := self modelClass new. (ownedComment := OPUMLProperty new) name: 'ownedComment'; owningClass: element; @@ -32,10 +33,10 @@ OPUmlAssociationShapeTest >> setUpAssociation [ name: 'owningElement'; owningAssociation: association; type: element. - association - memberEnds: - {ownedComment. - owningElement} + association memberEnds: { + ownedComment. + owningElement }. + ^ association ] { #category : 'hooks' } diff --git a/repository/OpenPonk-ClassEditor/OPUmlClassShapeTest.class.st b/repository/OpenPonk-ClassEditor/OPUmlClassShapeTest.class.st index e3bcc93e..86094e6e 100644 --- a/repository/OpenPonk-ClassEditor/OPUmlClassShapeTest.class.st +++ b/repository/OpenPonk-ClassEditor/OPUmlClassShapeTest.class.st @@ -1,13 +1,20 @@ Class { #name : 'OPUmlClassShapeTest', - #superclass : 'OPUmlCompartmentableShapeTest', + #superclass : 'OPAbstractUmlCompartmentableShapeTest', #category : 'OpenPonk-ClassEditor-Tests - Shapes', #package : 'OpenPonk-ClassEditor', #tag : 'Tests - Shapes' } +{ #category : 'instance creation' } +OPUmlClassShapeTest >> modelClass [ + + ^ OPUMLClass +] + { #category : 'hooks' } OPUmlClassShapeTest >> shapeClass [ + ^ OPUmlClassShape ]