Skip to content

Commit

Permalink
Tests: removed testGarbageCollect, modified testFlushComponents and o…
Browse files Browse the repository at this point in the history
…ther methods to make testDeepCleanUpGarbageCollect work
  • Loading branch information
Eliott Guevel committed Apr 3, 2024
1 parent c8b5d0c commit 0b0b35b
Show file tree
Hide file tree
Showing 127 changed files with 1,486 additions and 1,246 deletions.
16 changes: 9 additions & 7 deletions src/Molecule-IDE/MolClassesCmdCommand.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Class {
#name : #MolClassesCmdCommand,
#superclass : #MolCmdCommand,
#category : #'Molecule-IDE-Menus'
#name : 'MolClassesCmdCommand',
#superclass : 'MolCmdCommand',
#category : 'Molecule-IDE-Menus',
#package : 'Molecule-IDE',
#tag : 'Menus'
}

{ #category : #testing }
{ #category : 'testing' }
MolClassesCmdCommand class >> canBeExecutedInContext: aToolContext [
| list selectedItem selected |

Expand All @@ -23,19 +25,19 @@ MolClassesCmdCommand class >> canBeExecutedInContext: aToolContext [
^list includes: (self class environment at: selected asSymbol) .
]

{ #category : #testing }
{ #category : 'testing' }
MolClassesCmdCommand class >> isAbstract [

^ self = MolClassesCmdCommand
]

{ #category : #execution }
{ #category : 'execution' }
MolClassesCmdCommand >> selectedClasses [

^ selectedItems collect:[ :p | p browserItem actualObject ]
]

{ #category : #execution }
{ #category : 'execution' }
MolClassesCmdCommand >> selectedComponentClasses [

^ self selectedClasses select:[ :c | c isComponentClass ].
Expand Down
20 changes: 11 additions & 9 deletions src/Molecule-IDE/MolCmdCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,50 @@
super class for menu system browser
"
Class {
#name : #MolCmdCommand,
#superclass : #CmdCommand,
#name : 'MolCmdCommand',
#superclass : 'CmdCommand',
#instVars : [
'selectedItems',
'items',
'executionResult'
],
#category : #'Molecule-IDE-Menus'
#category : 'Molecule-IDE-Menus',
#package : 'Molecule-IDE',
#tag : 'Menus'
}

{ #category : #activation }
{ #category : 'activation' }
MolCmdCommand class >> browserMenuActivation [
<classAnnotation>
^self class subclassResponsibility.
]

{ #category : #activation }
{ #category : 'activation' }
MolCmdCommand class >> isAbstract [

^ self = MolCmdCommand
]

{ #category : #accessing }
{ #category : 'accessing' }
MolCmdCommand >> executionResult [

^ executionResult
]

{ #category : #accessing }
{ #category : 'accessing' }
MolCmdCommand >> executionResult: anObject [

executionResult := anObject
]

{ #category : #execution }
{ #category : 'execution' }
MolCmdCommand >> prepareFullExecutionInContext: aToolContext [

super prepareFullExecutionInContext: aToolContext.
selectedItems := aToolContext selectedItems
]

{ #category : #execution }
{ #category : 'execution' }
MolCmdCommand >> readParametersFromContext: aToolContext [

super readParametersFromContext: aToolContext
Expand Down
18 changes: 10 additions & 8 deletions src/Molecule-IDE/MolCmdMenuGroup.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,39 @@
Class for the menu => right click on a component
"
Class {
#name : #MolCmdMenuGroup,
#superclass : #CmdMenuGroup,
#category : #'Molecule-IDE-Menus'
#name : 'MolCmdMenuGroup',
#superclass : 'CmdMenuGroup',
#category : 'Molecule-IDE-Menus',
#package : 'Molecule-IDE',
#tag : 'Menus'
}

{ #category : #accessing }
{ #category : 'accessing' }
MolCmdMenuGroup >> buildContextMenu: aMenu [

aMenu addLine.
super buildContextMenu: aMenu
]

{ #category : #accessing }
{ #category : 'accessing' }
MolCmdMenuGroup >> description [

^ 'Molecule contextual menu'
]

{ #category : #accessing }
{ #category : 'accessing' }
MolCmdMenuGroup >> icon [

^ MolIcon moleculeIcon
]

{ #category : #accessing }
{ #category : 'accessing' }
MolCmdMenuGroup >> name [

^ 'Molecule'
]

{ #category : #accessing }
{ #category : 'accessing' }
MolCmdMenuGroup >> order [
"Idea to put molecule group to the end of menu"

Expand Down
22 changes: 12 additions & 10 deletions src/Molecule-IDE/MolCodeMetricsCmdCommand.class.st
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
Class {
#name : #MolCodeMetricsCmdCommand,
#superclass : #MolPackagesCmdCommand,
#category : #'Molecule-IDE-Menus'
#name : 'MolCodeMetricsCmdCommand',
#superclass : 'MolPackagesCmdCommand',
#category : 'Molecule-IDE-Menus',
#package : 'Molecule-IDE',
#tag : 'Menus'
}

{ #category : #activation }
{ #category : 'activation' }
MolCodeMetricsCmdCommand class >> browserMenuActivation [
<classAnnotation>
^ CmdContextMenuActivation byItemOf: MolCmdMenuGroup for: ClyFullBrowserPackageContext
]

{ #category : #private }
{ #category : 'private' }
MolCodeMetricsCmdCommand >> aboutText [

^ 'Molecule metrics'
]

{ #category : #accessing }
{ #category : 'accessing' }
MolCodeMetricsCmdCommand >> defaultMenuIconName [

^'smallLanguage'
]

{ #category : #accessing }
{ #category : 'accessing' }
MolCodeMetricsCmdCommand >> defaultMenuItemName [

^ 'Metrics'
]

{ #category : #accessing }
{ #category : 'accessing' }
MolCodeMetricsCmdCommand >> description [

^'Display metrics about Molecule entities from selected packages'
]

{ #category : #accessing }
{ #category : 'accessing' }
MolCodeMetricsCmdCommand >> execute [
| presenter stream metrics |
presenter := SpTextPresenter new.
Expand All @@ -54,7 +56,7 @@ MolCodeMetricsCmdCommand >> execute [
presenter withWindowDo: [ :w | w title: self titleForSelectedItems; aboutText: self aboutText ].
]

{ #category : #private }
{ #category : 'private' }
MolCodeMetricsCmdCommand >> titleForSelectedItems [

| nbPackages |
Expand Down
18 changes: 10 additions & 8 deletions src/Molecule-IDE/MolDefineComponentCmdCommand.class.st
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
Class {
#name : #MolDefineComponentCmdCommand,
#superclass : #MolClassesCmdCommand,
#category : #'Molecule-IDE-Menus'
#name : 'MolDefineComponentCmdCommand',
#superclass : 'MolClassesCmdCommand',
#category : 'Molecule-IDE-Menus',
#package : 'Molecule-IDE',
#tag : 'Menus'
}

{ #category : #activation }
{ #category : 'activation' }
MolDefineComponentCmdCommand class >> browserMenuActivation [
<classAnnotation>
^CmdContextMenuActivation byItemOf: MolCmdMenuGroup for: ClyFullBrowserClassContext.
]

{ #category : #accessing }
{ #category : 'accessing' }
MolDefineComponentCmdCommand >> defaultMenuIconName [

^ 'smallUpdate'
]

{ #category : #accessing }
{ #category : 'accessing' }
MolDefineComponentCmdCommand >> defaultMenuItemName [

^ 'Define'
]

{ #category : #accessing }
{ #category : 'accessing' }
MolDefineComponentCmdCommand >> description [

^'Define this component: force to generate methods from contract definition'
]

{ #category : #accessing }
{ #category : 'accessing' }
MolDefineComponentCmdCommand >> execute [
| componentsToDefine nbOfDefinedComponents |

Expand Down
20 changes: 11 additions & 9 deletions src/Molecule-IDE/MolIcon.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,41 @@ To encode icons :
(Base64MimeConverter mimeEncode: 'moleculeIcon.png' asFileReference binaryReadStream) contents.
"
Class {
#name : #MolIcon,
#superclass : #Object,
#name : 'MolIcon',
#superclass : 'Object',
#classInstVars : [
'moleculeIcon',
'moleculeComponentIcon',
'icons'
],
#category : #'Molecule-IDE-Assets'
#category : 'Molecule-IDE-Assets',
#package : 'Molecule-IDE',
#tag : 'Assets'
}

{ #category : #tools }
{ #category : 'tools' }
MolIcon class >> cleanIcons [
<script>

icons := Dictionary new.
]

{ #category : #accessing }
{ #category : 'accessing' }
MolIcon class >> icons [

<script: 'self icons inspect'>
icons ifNil: [ icons := Dictionary new ].
^ icons
]

{ #category : #accessing }
{ #category : 'accessing' }
MolIcon class >> moleculeComponentIcon [
<script: 'self moleculeComponentIcon inspect'>

^ self icons at: #component ifAbsentPut: [ Form fromBinaryStream: self moleculeComponentIconEncoding base64Decoded readStream ]
]

{ #category : #encoding }
{ #category : 'encoding' }
MolIcon class >> moleculeComponentIconEncoding [

^ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAPCAYAAADtc08vAAAACXBIWXMAAAKxAAACsQFSNozK
Expand All @@ -56,14 +58,14 @@ bm7Gnt7ei7uPHNaSkpZh09XWZmBkRA3P5y9eMDS0tX6XEBa67+frp3bnzp1PT548mcXY09Nz
PsLAwMBLSiAiAwC1tUwQC5xQzwAAAABJRU5ErkJggg=='
]

{ #category : #accessing }
{ #category : 'accessing' }
MolIcon class >> moleculeIcon [
<script: 'self moleculeIcon inspect'>

^ self icons at: #molecule ifAbsentPut: [ Form fromBinaryStream: self moleculeIconEncoding base64Decoded readStream ]
]

{ #category : #encoding }
{ #category : 'encoding' }
MolIcon class >> moleculeIconEncoding [

^ 'iVBORw0KGgoAAAANSUhEUgAAABAAAAASCAYAAABSO15qAAAACXBIWXMAAAMnAAADJwEZpzWL
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
Class {
#name : #MolInspectComponentRunningInstancesCmdCommand,
#superclass : #MolClassesCmdCommand,
#category : #'Molecule-IDE-Menus'
#name : 'MolInspectComponentRunningInstancesCmdCommand',
#superclass : 'MolClassesCmdCommand',
#category : 'Molecule-IDE-Menus',
#package : 'Molecule-IDE',
#tag : 'Menus'
}

{ #category : #activation }
{ #category : 'activation' }
MolInspectComponentRunningInstancesCmdCommand class >> browserMenuActivation [
<classAnnotation>
^CmdContextMenuActivation byItemOf: MolCmdMenuGroup for: ClyFullBrowserClassContext.
]

{ #category : #accessing }
{ #category : 'accessing' }
MolInspectComponentRunningInstancesCmdCommand >> defaultMenuIconName [

^ 'glamorousInspect'
]

{ #category : #accessing }
{ #category : 'accessing' }
MolInspectComponentRunningInstancesCmdCommand >> defaultMenuItemName [

^ 'Inspect running components'
]

{ #category : #accessing }
{ #category : 'accessing' }
MolInspectComponentRunningInstancesCmdCommand >> description [

^'Show a list of actually running component instances of this component'
]

{ #category : #accessing }
{ #category : 'accessing' }
MolInspectComponentRunningInstancesCmdCommand >> execute [
| selectedComponents instanceList |

Expand Down
Loading

0 comments on commit 0b0b35b

Please sign in to comment.