Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4e86a23
feat: simplified co-usage settings by removing less useful options
Nov 8, 2025
bd05d62
fix: adapted tests after changing settings
Nov 8, 2025
d466f9a
refactor: CoUsage settings, put sorting of shapes in the Model
Nov 8, 2025
57ea5e7
refactor: put all CoUsage settings in the same window
Nov 8, 2025
bc7bdec
refactor: Adapted tests to last changes
Nov 8, 2025
2b0262d
refactor: renamed MiCoUsageMapGeneralSettingsPresenter into MiCoUsage…
Nov 8, 2025
8d084a2
feat: Created classes to implement varous strategies for innerEntity …
Nov 9, 2025
7fc1dc3
Refactor: Removed MiCoFromSettingsMethodAttributeTester hierarchy and…
Nov 9, 2025
2b4772f
refactor: Removed settings in MiCoUsageMapVisualization menu
Nov 9, 2025
f953c9e
refactor: cleaned some unused methods
Nov 9, 2025
d82a604
refactor: In MiCoUsageMapSettings changed childrenBlockText for inner…
Nov 9, 2025
23203b8
Refactor: Update visualiation after changing the settings (#innerBoxE…
Nov 9, 2025
75ed5f9
refactor: adapted the test to all the changes
Nov 9, 2025
3ff9a21
refactor: Renamed classes MiCoChildrenBox... to MiCoInnerEntities... …
Nov 10, 2025
fb3f6ed
refactor: renamed class MiCoAttributeTest to MiCoInnerBoxTest
Nov 10, 2025
d356386
test: created tests for MiCoInnerEntitiesAttributeAccessExtractor
Nov 10, 2025
6fc7d89
refactor: renamed tests in MiCoUsageMapBrowserTest to match test name…
Nov 10, 2025
931ffd0
refactor: renamed variables/methods in MiCoUsageTestFamixModel ; chan…
Nov 10, 2025
e926366
refactor: Adapted tests to new names in MiCoUsageTestFamixModel
Nov 10, 2025
3911e8f
refactor: adapted MiCoUsageModelTest's tests to new names in MiCoUsag…
Nov 10, 2025
e16d5c1
chore: removed useless method
Nov 10, 2025
bbc0480
refactor: changed super-class of MiCoUsageAbstractTest to MiAbstractA…
Nov 10, 2025
3954f27
refactor: adapted MiCoUsageMapBrowserTest to all previous changes
Nov 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions src/MooseIDE-CoUsageMap-Tests/MiCoHighlightManagerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Class {
{ #category : 'tests' }
MiCoHighlightManagerTest >> testDeselectGoesToModel [
| mooseEntity attribute1 shape1 |
mooseEntity := self specModel currentMooseModel entityNamed: #var1.
attribute1 := self specModel getInnerBoxNamed: #var1.
mooseEntity := self specModel currentMooseModel entityNamed: #att1.
attribute1 := self specModel getInnerBoxNamed: #att1.
shape1 := builder canvas deepShapeFromModel: attribute1.

self specModel selectedEntity: mooseEntity.
Expand All @@ -27,7 +27,7 @@ MiCoHighlightManagerTest >> testDeselectInnerBox [
| attribute1 shape1 default selected |
self tagsWithPalette: { 'Frame'. 'Connection' }.

attribute1 := self specModel getInnerBoxNamed: #var1.
attribute1 := self specModel getInnerBoxNamed: #att1.
shape1 := builder canvas deepShapeFromModel: attribute1.

default := builder highlightManager defaultBoxBorder color.
Expand All @@ -46,7 +46,7 @@ MiCoHighlightManagerTest >> testHighlight [
| attribute1 shape1 default selected |
self tagsWithPalette: { 'Frame'. 'Connection' }.

attribute1 := self specModel getInnerBoxNamed: #var1.
attribute1 := self specModel getInnerBoxNamed: #att1.
shape1 := builder canvas deepShapeFromModel: attribute1.

default := builder highlightManager defaultBoxBorder color.
Expand All @@ -64,36 +64,36 @@ MiCoHighlightManagerTest >> testHighlight [

{ #category : 'tests' }
MiCoHighlightManagerTest >> testNoHighlightWhenSelectedInnerBox [
| attribute1 shape1 default selected attribute2 shape2 |
| attribute3 shape3 default selected attribute4 shape4 |
self tagsWithPalette: { 'Frame'. 'Connection' }.

attribute1 := self specModel getInnerBoxNamed: #var1.
attribute2 := self specModel getInnerBoxNamed: #var2.
shape1 := builder canvas deepShapeFromModel: attribute1.
shape2 := builder canvas deepShapeFromModel: attribute2.
attribute3 := self specModel getInnerBoxNamed: #att3.
attribute4 := self specModel getInnerBoxNamed: #att4.
shape3 := builder canvas deepShapeFromModel: attribute3.
shape4 := builder canvas deepShapeFromModel: attribute4.

default := builder highlightManager defaultBoxBorder color.
selected := builder highlightManager selectedBoxBorder color.

self assert: shape2 border color equals: default.
self assert: shape4 border color equals: default.

shape1 announce: (RSMouseLeftClick new shape: shape1).
shape2 announce: (RSMouseEnter new shape: shape2).
shape3 announce: (RSMouseLeftClick new shape: shape3).
shape4 announce: (RSMouseEnter new shape: shape4).

self assert: shape2 border color equals: default.
self assert: shape4 border color equals: default.

]

{ #category : 'tests' }
MiCoHighlightManagerTest >> testSelectGoesToModel [
| attribute1 shape1 |
attribute1 := self specModel getInnerBoxNamed: #var1.
attribute1 := self specModel getInnerBoxNamed: #att1.
shape1 := builder canvas deepShapeFromModel: attribute1.

shape1 announce: (RSMouseLeftClick new shape: shape1).
self
assert: self specModel selectedEntity
equals: (self specModel currentMooseModel entityNamed: #var1)
equals: (self specModel currentMooseModel entityNamed: #att1)

]

Expand All @@ -102,7 +102,7 @@ MiCoHighlightManagerTest >> testSelectInnerBox [
| attribute1 shape1 default selected |
self tagsWithPalette: { 'Frame'. 'Connection' }.

attribute1 := self specModel getInnerBoxNamed: #var1.
attribute1 := self specModel getInnerBoxNamed: #att1.
shape1 := builder canvas deepShapeFromModel: attribute1.

default := builder highlightManager defaultBoxBorder color.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
Class {
#name : 'MiCoAttributeTest',
#name : 'MiCoInnerBoxTest',
#superclass : 'TestCase',
#category : 'MooseIDE-CoUsageMap-Tests-Browser',
#category : 'MooseIDE-CoUsageMap-Tests-Model',
#package : 'MooseIDE-CoUsageMap-Tests',
#tag : 'Browser'
#tag : 'Model'
}

{ #category : 'tests' }
MiCoAttributeTest >> containerBoxOn: aName [
MiCoInnerBoxTest >> containerBoxOn: aName [
^MiCoContainerBox new mooseEntity: (FamixStMethod new name: aName)
]

{ #category : 'tests' }
MiCoAttributeTest >> innerBoxOn: aName [
MiCoInnerBoxTest >> innerBoxOn: aName [
^MiCoInnerBox new mooseEntity: (FamixStAttribute new name: aName)
]

{ #category : 'tests' }
MiCoAttributeTest >> test01ContainerBox [
MiCoInnerBoxTest >> test01ContainerBox [

| container |
container := self containerBoxOn: 'method1'.
self assert: container asString equals: 'method1'
]

{ #category : 'tests' }
MiCoAttributeTest >> test02InnerBox [
MiCoInnerBoxTest >> test02InnerBox [

| innerBox |
innerBox := self innerBoxOn: 'aVar'.
self assert: innerBox asString equals: 'aVar'
]

{ #category : 'tests' }
MiCoAttributeTest >> test03PopupMessage [
MiCoInnerBoxTest >> test03PopupMessage [

| innerBox containerBox |
containerBox := self containerBoxOn: 'method1'.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
Class {
#name : 'MiCoInnerEntitiesAttributeAccessExtractorTest',
#superclass : 'TestCase',
#instVars : [
'mooseModel',
'extractor'
],
#category : 'MooseIDE-CoUsageMap-Tests-Model',
#package : 'MooseIDE-CoUsageMap-Tests',
#tag : 'Model'
}

{ #category : 'running' }
MiCoInnerEntitiesAttributeAccessExtractorTest >> setUp [
super setUp.

mooseModel := MiCoUsageTestFamixModel new.
extractor := MiCoInnerEntitiesAttributeAccessExtractor new
]

{ #category : 'tests' }
MiCoInnerEntitiesAttributeAccessExtractorTest >> testAttributeAccessorInvocationsNone [

self assert: (extractor attributeAccessorInvocations: mooseModel method5) size equals: 0
]

{ #category : 'tests' }
MiCoInnerEntitiesAttributeAccessExtractorTest >> testAttributeAccessorInvocationsOne [

self assert: (extractor attributeAccessorInvocations: mooseModel method2) size equals: 1.

self
assertCollection: (extractor attributeAccessorInvocations: mooseModel method2)
hasSameElements: { mooseModel att6 }.
]

{ #category : 'tests' }
MiCoInnerEntitiesAttributeAccessExtractorTest >> testDirectAttributeAccessesMultipleAccesses [

self assert: (extractor directAttributeAccesses: mooseModel method1) size equals: 3.

self
assertCollection: (extractor directAttributeAccesses: mooseModel method1)
hasSameElements: { mooseModel att1 . mooseModel att1 . mooseModel att1 }.
]

{ #category : 'tests' }
MiCoInnerEntitiesAttributeAccessExtractorTest >> testDirectAttributeAccessesMultipleAttributes [

self assert: (extractor directAttributeAccesses: mooseModel method3) size equals: 3.

self
assertCollection: (extractor directAttributeAccesses: mooseModel method3)
hasSameElements: { mooseModel att3 . mooseModel att4 . mooseModel att5 }.
]

{ #category : 'tests' }
MiCoInnerEntitiesAttributeAccessExtractorTest >> testDirectAttributeAccessesNone [

self assert: (extractor directAttributeAccesses: mooseModel method2) size equals: 0
]

{ #category : 'tests' }
MiCoInnerEntitiesAttributeAccessExtractorTest >> testInnerEntitiesFor [

self
assertCollection: (extractor innerEntitiesFor: mooseModel method2)
hasSameElements: { mooseModel att6 }.

self
assertCollection: (extractor innerEntitiesFor: mooseModel method3)
hasSameElements: { mooseModel att3 . mooseModel att4 . mooseModel att5 }.
]
4 changes: 2 additions & 2 deletions src/MooseIDE-CoUsageMap-Tests/MiCoMenuManagerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Class {
MiCoMenuManagerTest >> testOpenMenu [

| attribute method |
attribute := self specModel getInnerBoxNamed: #var2.
method := self specModel containerBoxNamed: #method1.
attribute := self specModel getInnerBoxNamed: #att3.
method := self specModel containerBoxNamed: #method3.
builder menuManager createMenu: MenuMorph new onBox: attribute.
builder menuManager createMenu: MenuMorph new onBox: method.
builder menuManager
Expand Down
36 changes: 19 additions & 17 deletions src/MooseIDE-CoUsageMap-Tests/MiCoUsageAbstractTest.class.st
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
Class {
#name : 'MiCoUsageAbstractTest',
#superclass : 'TestCase',
#superclass : 'MiAbstractApplicationTest',
#instVars : [
'visualization',
'builder',
'browser',
'application',
'previousApplication'
'mooseModel',
'browser'
],
#category : 'MooseIDE-CoUsageMap-Tests-Browser',
#package : 'MooseIDE-CoUsageMap-Tests',
#tag : 'Browser'
}

{ #category : 'testing' }
MiCoUsageAbstractTest class >> isAbstract [
^self name includesSubstring: 'Abstract'
]

{ #category : 'running' }
MiCoUsageAbstractTest >> browserClass [

^MiCoUsageMapBrowser
]

{ #category : 'running' }
MiCoUsageAbstractTest >> createTag: aName [

Expand All @@ -25,21 +35,13 @@ MiCoUsageAbstractTest >> createTag: aName [
MiCoUsageAbstractTest >> setUp [

super setUp.
previousApplication := MiApplication current.

application := MiTestApplication new.
MiApplication current: application.

browser := MiCoUsageMapBrowser
newApplication: application
model: MiCoUsageMapModel new.
mooseModel := MiCoUsageTestFamixModel new.

browser specModel followEntity:
MiCoUsageTestFamixModel new allMethods.
browser := self browserClass openForTests: application.
browser followEntity: mooseModel allMethods.

visualization := browser mapVisualization.
visualization buildInCanvas: visualization canvas.

builder := visualization mapBuilder
]

Expand All @@ -59,7 +61,7 @@ MiCoUsageAbstractTest >> tagsWithPalette: aCollection [
{ #category : 'running' }
MiCoUsageAbstractTest >> tearDown [

MiApplication reset.
MiApplication current: previousApplication.
browser ifNotNil: [ browser withWindowDo: [ :window | window close ] ].

super tearDown
]
Loading