From 418fec82310c1ac95b244fe202588b5569c0c9c5 Mon Sep 17 00:00:00 2001 From: Mariano Saura Date: Tue, 19 Mar 2024 19:24:25 -0300 Subject: [PATCH 01/14] Currently running application refactoring (code friendly with GS64 dbTransient objects) --- .../CurrentApplicationConfiguration.class.st | 11 +-- ...rentlyRunningLaunchpadApplication.class.st | 66 ++++++++++++++++ .../DebuggingApplicationMode.class.st | 15 ++-- .../LaunchpadApplication.class.st | 77 +++++++++---------- .../LaunchpadApplicationRunningMode.class.st | 17 ++-- .../LaunchpadHelpPrinter.class.st | 25 +++--- .../NullStackTraceDumper.class.st | 9 ++- .../ReleasedApplicationMode.class.st | 15 ++-- .../StackTraceDumper.class.st | 11 +-- source/Launchpad-Applications/package.st | 2 +- 10 files changed, 157 insertions(+), 91 deletions(-) create mode 100644 source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st diff --git a/source/Launchpad-Applications/CurrentApplicationConfiguration.class.st b/source/Launchpad-Applications/CurrentApplicationConfiguration.class.st index a4d89be..c259a85 100644 --- a/source/Launchpad-Applications/CurrentApplicationConfiguration.class.st +++ b/source/Launchpad-Applications/CurrentApplicationConfiguration.class.st @@ -1,16 +1,17 @@ Class { - #name : #CurrentApplicationConfiguration, - #superclass : #DynamicVariable, - #category : #'Launchpad-Applications' + #name : 'CurrentApplicationConfiguration', + #superclass : 'DynamicVariable', + #category : 'Launchpad-Applications', + #package : 'Launchpad-Applications' } -{ #category : #accessing } +{ #category : 'accessing' } CurrentApplicationConfiguration class >> default [ ^ LaunchpadApplication currentlyRunning configuration ] -{ #category : #accessing } +{ #category : 'accessing' } CurrentApplicationConfiguration >> default [ ^ self class default diff --git a/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st b/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st new file mode 100644 index 0000000..bb305b8 --- /dev/null +++ b/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st @@ -0,0 +1,66 @@ +Class { + #name : 'CurrentlyRunningLaunchpadApplication', + #superclass : 'Object', + #instVars : [ + 'application' + ], + #classInstVars : [ + 'uniqueInstance' + ], + #category : 'Launchpad-Applications', + #package : 'Launchpad-Applications' +} + +{ #category : 'initialization' } +CurrentlyRunningLaunchpadApplication class >> initialize [ + + + self initializeUniqueInstance +] + +{ #category : 'initialization' } +CurrentlyRunningLaunchpadApplication class >> initializeUniqueInstance [ + + uniqueInstance := super new initialize +] + +{ #category : 'instance creation' } +CurrentlyRunningLaunchpadApplication class >> new [ + + ^uniqueInstance +] + +{ #category : 'accessing' } +CurrentlyRunningLaunchpadApplication >> currentlyRunning [ + + ^ application content +] + +{ #category : 'initialization' } +CurrentlyRunningLaunchpadApplication >> initialize [ + + + self resetCurrentlyRunning +] + +{ #category : 'accessing' } +CurrentlyRunningLaunchpadApplication >> resetCurrentlyRunning [ + + application := Binding undefinedExplainedBy: + 'There''s no current application running.' +] + +{ #category : 'accessing' } +CurrentlyRunningLaunchpadApplication >> setAsCurrentlyRunning: anApplication [ + + application := Binding to: anApplication +] + +{ #category : 'accessing' } +CurrentlyRunningLaunchpadApplication >> setAsCurrentlyRunning: anApplication during: aBlock [ + + | previousBinding | + previousBinding := application. + application := Binding to: anApplication. + aBlock ensure: [ application := previousBinding ] +] diff --git a/source/Launchpad-Applications/DebuggingApplicationMode.class.st b/source/Launchpad-Applications/DebuggingApplicationMode.class.st index 4cd2d2f..1f15f9b 100644 --- a/source/Launchpad-Applications/DebuggingApplicationMode.class.st +++ b/source/Launchpad-Applications/DebuggingApplicationMode.class.st @@ -1,28 +1,29 @@ Class { - #name : #DebuggingApplicationMode, - #superclass : #LaunchpadApplicationRunningMode, - #category : #'Launchpad-Applications' + #name : 'DebuggingApplicationMode', + #superclass : 'LaunchpadApplicationRunningMode', + #category : 'Launchpad-Applications', + #package : 'Launchpad-Applications' } -{ #category : #utilities } +{ #category : 'utilities' } DebuggingApplicationMode >> exitFailure [ LogRecord emitError: 'Exit application' ] -{ #category : #utilities } +{ #category : 'utilities' } DebuggingApplicationMode >> exitSuccess [ LogRecord emitInfo: 'Exit application' ] -{ #category : #testing } +{ #category : 'testing' } DebuggingApplicationMode >> isDebugMode [ ^ true ] -{ #category : #utilities } +{ #category : 'utilities' } DebuggingApplicationMode >> value: aBlock onErrorDo: errorHandler [ ^ aBlock value diff --git a/source/Launchpad-Applications/LaunchpadApplication.class.st b/source/Launchpad-Applications/LaunchpadApplication.class.st index 9625112..6f4f64e 100644 --- a/source/Launchpad-Applications/LaunchpadApplication.class.st +++ b/source/Launchpad-Applications/LaunchpadApplication.class.st @@ -1,19 +1,17 @@ Class { - #name : #LaunchpadApplication, - #superclass : #Object, + #name : 'LaunchpadApplication', + #superclass : 'Object', #instVars : [ 'configurationCache', 'configurationProvider', 'mode', 'commandServer' ], - #classVars : [ - 'CurrentlyRunningApplicationBinding' - ], - #category : #'Launchpad-Applications' + #category : 'Launchpad-Applications', + #package : 'Launchpad-Applications' } -{ #category : #accessing } +{ #category : 'accessing' } LaunchpadApplication class >> applicationFor: commandName ifFound: aFoundBlock ifNone: aFailBlock [ ^ self availableApplications detect: [ :application | application commandName = commandName ] @@ -21,13 +19,13 @@ LaunchpadApplication class >> applicationFor: commandName ifFound: aFoundBlock i ifNone: aFailBlock ] -{ #category : #accessing } +{ #category : 'accessing' } LaunchpadApplication class >> availableApplications [ ^ self allSubclasses reject: #isAbstract ] -{ #category : #accessing } +{ #category : 'accessing' } LaunchpadApplication class >> commandName [ "Returns the command name to be used for starting this application" @@ -35,38 +33,38 @@ LaunchpadApplication class >> commandName [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } LaunchpadApplication class >> configurationParameters [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } LaunchpadApplication class >> currentlyRunning [ - ^ CurrentlyRunningApplicationBinding content + ^ CurrentlyRunningLaunchpadApplication new currentlyRunning ] -{ #category : #accessing } +{ #category : 'accessing' } LaunchpadApplication class >> description [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } LaunchpadApplication class >> initialize [ self resetCurrentlyRunning ] -{ #category : #testing } +{ #category : 'testing' } LaunchpadApplication class >> isAbstract [ ^ self = LaunchpadApplication ] -{ #category : #printing } +{ #category : 'printing' } LaunchpadApplication class >> printCommandArgumentsOn: stream [ self configurationParameters do: [ :parameter | @@ -75,7 +73,7 @@ LaunchpadApplication class >> printCommandArgumentsOn: stream [ ] ] -{ #category : #printing } +{ #category : 'printing' } LaunchpadApplication class >> printHelpOn: stream [ ( LaunchpadHelpPrinter on: stream ) @@ -84,14 +82,13 @@ LaunchpadApplication class >> printHelpOn: stream [ parametersAndEnvironmentSectionDescribing: self configurationParameters ] -{ #category : #accessing } +{ #category : 'accessing' } LaunchpadApplication class >> resetCurrentlyRunning [ - CurrentlyRunningApplicationBinding := Binding undefinedExplainedBy: - 'There''s no current application running.' + CurrentlyRunningLaunchpadApplication new resetCurrentlyRunning ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } LaunchpadApplication class >> runningIn: anApplicationMode configuredBy: aConfigurationProvider controlledBy: aCommandServer [ ^ self new @@ -100,47 +97,43 @@ LaunchpadApplication class >> runningIn: anApplicationMode configuredBy: aConfig controlledBy: aCommandServer ] -{ #category : #accessing } +{ #category : 'accessing' } LaunchpadApplication class >> setAsCurrentlyRunning: application [ - CurrentlyRunningApplicationBinding := Binding to: application + CurrentlyRunningLaunchpadApplication new setAsCurrentlyRunning: application ] -{ #category : #accessing } +{ #category : 'accessing' } LaunchpadApplication class >> setAsCurrentlyRunning: application during: aBlock [ - | previousBinding | - - previousBinding := CurrentlyRunningApplicationBinding. - CurrentlyRunningApplicationBinding := Binding to: application. - aBlock ensure: [ CurrentlyRunningApplicationBinding := previousBinding ] + CurrentlyRunningLaunchpadApplication new setAsCurrentlyRunning: application during: aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } LaunchpadApplication class >> summary [ ^ '<1s> [<2s>] - <3s>' expandMacrosWith: self commandName with: self version with: self description ] -{ #category : #accessing } +{ #category : 'accessing' } LaunchpadApplication class >> version [ ^ self subclassResponsibility ] -{ #category : #'private - activation/deactivation' } +{ #category : 'private - activation/deactivation' } LaunchpadApplication >> basicStartWithin: context [ self subclassResponsibility ] -{ #category : #'private - activation/deactivation' } +{ #category : 'private - activation/deactivation' } LaunchpadApplication >> basicStop [ commandServer stop ] -{ #category : #accessing } +{ #category : 'accessing' } LaunchpadApplication >> configuration [ configurationCache ifNil: [ @@ -150,21 +143,21 @@ LaunchpadApplication >> configuration [ ^ configurationCache ] -{ #category : #utilities } +{ #category : 'utilities' } LaunchpadApplication >> exitFailure [ self class resetCurrentlyRunning. mode exitFailure ] -{ #category : #utilities } +{ #category : 'utilities' } LaunchpadApplication >> exitSuccess [ self class resetCurrentlyRunning. mode exitSuccess ] -{ #category : #initialization } +{ #category : 'initialization' } LaunchpadApplication >> initializeRunningIn: anApplicationMode configuredBy: aConfigurationProvider controlledBy: aCommandServer [ mode := anApplicationMode. @@ -172,13 +165,13 @@ LaunchpadApplication >> initializeRunningIn: anApplicationMode configuredBy: aCo commandServer := aCommandServer ] -{ #category : #testing } +{ #category : 'testing' } LaunchpadApplication >> isDebugModeEnabled [ ^ mode isDebugMode ] -{ #category : #'private - activation/deactivation' } +{ #category : 'private - activation/deactivation' } LaunchpadApplication >> logConfigurationWithin: context [ LogRecord emitInfo: 'Obtaining configuration' during: [ @@ -189,13 +182,13 @@ LaunchpadApplication >> logConfigurationWithin: context [ ] ] -{ #category : #'error handling' } +{ #category : 'error handling' } LaunchpadApplication >> stackTraceDumper [ ^ self subclassResponsibility ] -{ #category : #'activation/deactivation' } +{ #category : 'activation/deactivation' } LaunchpadApplication >> startWithin: context [ mode @@ -214,7 +207,7 @@ LaunchpadApplication >> startWithin: context [ ] ] -{ #category : #'activation/deactivation' } +{ #category : 'activation/deactivation' } LaunchpadApplication >> stop [ mode value: [ self basicStop ] onErrorDo: [ :error | diff --git a/source/Launchpad-Applications/LaunchpadApplicationRunningMode.class.st b/source/Launchpad-Applications/LaunchpadApplicationRunningMode.class.st index 046ec3e..e3610ca 100644 --- a/source/Launchpad-Applications/LaunchpadApplicationRunningMode.class.st +++ b/source/Launchpad-Applications/LaunchpadApplicationRunningMode.class.st @@ -1,35 +1,36 @@ Class { - #name : #LaunchpadApplicationRunningMode, - #superclass : #Object, - #category : #'Launchpad-Applications' + #name : 'LaunchpadApplicationRunningMode', + #superclass : 'Object', + #category : 'Launchpad-Applications', + #package : 'Launchpad-Applications' } -{ #category : #testing } +{ #category : 'testing' } LaunchpadApplicationRunningMode class >> isAbstract [ ^ self = LaunchpadApplicationRunningMode ] -{ #category : #utilities } +{ #category : 'utilities' } LaunchpadApplicationRunningMode >> exitFailure [ self subclassResponsibility ] -{ #category : #utilities } +{ #category : 'utilities' } LaunchpadApplicationRunningMode >> exitSuccess [ self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } LaunchpadApplicationRunningMode >> isDebugMode [ ^ self subclassResponsibility ] -{ #category : #utilities } +{ #category : 'utilities' } LaunchpadApplicationRunningMode >> value: aBlock onErrorDo: errorHandler [ ^ self subclassResponsibility diff --git a/source/Launchpad-Applications/LaunchpadHelpPrinter.class.st b/source/Launchpad-Applications/LaunchpadHelpPrinter.class.st index fb385fb..dfcf8de 100644 --- a/source/Launchpad-Applications/LaunchpadHelpPrinter.class.st +++ b/source/Launchpad-Applications/LaunchpadHelpPrinter.class.st @@ -1,19 +1,20 @@ Class { - #name : #LaunchpadHelpPrinter, - #superclass : #Object, + #name : 'LaunchpadHelpPrinter', + #superclass : 'Object', #instVars : [ 'stream' ], - #category : #'Launchpad-Applications' + #category : 'Launchpad-Applications', + #package : 'Launchpad-Applications' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } LaunchpadHelpPrinter class >> on: aWriteStream [ ^ self new initializeOn: aWriteStream ] -{ #category : #'printing - sections' } +{ #category : 'printing - sections' } LaunchpadHelpPrinter >> commandsSectionDescribing: subcommands [ subcommands ifNotEmpty: [ @@ -32,25 +33,25 @@ LaunchpadHelpPrinter >> commandsSectionDescribing: subcommands [ ] ] -{ #category : #'printing - sections' } +{ #category : 'printing - sections' } LaunchpadHelpPrinter >> descriptionSectionContaining: contents [ self sectionNamed: 'DESCRIPTION' containing: contents ] -{ #category : #initialization } +{ #category : 'initialization' } LaunchpadHelpPrinter >> initializeOn: aWriteStream [ stream := aWriteStream ] -{ #category : #'printing - sections' } +{ #category : 'printing - sections' } LaunchpadHelpPrinter >> nameSectionContaining: contents [ self sectionNamed: 'NAME' containing: contents ] -{ #category : #'printing - sections' } +{ #category : 'printing - sections' } LaunchpadHelpPrinter >> optionsSectionDescribing: options [ options ifNotEmpty: [ @@ -69,7 +70,7 @@ LaunchpadHelpPrinter >> optionsSectionDescribing: options [ ] ] -{ #category : #'printing - sections' } +{ #category : 'printing - sections' } LaunchpadHelpPrinter >> parametersAndEnvironmentSectionDescribing: parameters [ parameters ifNotEmpty: [ @@ -106,7 +107,7 @@ LaunchpadHelpPrinter >> parametersAndEnvironmentSectionDescribing: parameters [ ] ] -{ #category : #'printing - sections' } +{ #category : 'printing - sections' } LaunchpadHelpPrinter >> sectionNamed: sectionName containing: contents [ stream nextPutAll: sectionName. @@ -119,7 +120,7 @@ LaunchpadHelpPrinter >> sectionNamed: sectionName containing: contents [ ] ] -{ #category : #'printing - sections' } +{ #category : 'printing - sections' } LaunchpadHelpPrinter >> synopsysSectionFor: commandName with: aBlock [ stream diff --git a/source/Launchpad-Applications/NullStackTraceDumper.class.st b/source/Launchpad-Applications/NullStackTraceDumper.class.st index 97933ed..7f6f72c 100644 --- a/source/Launchpad-Applications/NullStackTraceDumper.class.st +++ b/source/Launchpad-Applications/NullStackTraceDumper.class.st @@ -1,10 +1,11 @@ Class { - #name : #NullStackTraceDumper, - #superclass : #StackTraceDumper, - #category : #'Launchpad-Applications' + #name : 'NullStackTraceDumper', + #superclass : 'StackTraceDumper', + #category : 'Launchpad-Applications', + #package : 'Launchpad-Applications' } -{ #category : #'error handling' } +{ #category : 'error handling' } NullStackTraceDumper >> dumpStackTraceFor: anError [ LogRecord emitWarning: 'Ignoring stack trace dumping' diff --git a/source/Launchpad-Applications/ReleasedApplicationMode.class.st b/source/Launchpad-Applications/ReleasedApplicationMode.class.st index 81c54e2..e72b801 100644 --- a/source/Launchpad-Applications/ReleasedApplicationMode.class.st +++ b/source/Launchpad-Applications/ReleasedApplicationMode.class.st @@ -1,28 +1,29 @@ Class { - #name : #ReleasedApplicationMode, - #superclass : #LaunchpadApplicationRunningMode, - #category : #'Launchpad-Applications' + #name : 'ReleasedApplicationMode', + #superclass : 'LaunchpadApplicationRunningMode', + #category : 'Launchpad-Applications', + #package : 'Launchpad-Applications' } -{ #category : #utilities } +{ #category : 'utilities' } ReleasedApplicationMode >> exitFailure [ Exit signalFailure ] -{ #category : #utilities } +{ #category : 'utilities' } ReleasedApplicationMode >> exitSuccess [ Exit signalSuccess ] -{ #category : #testing } +{ #category : 'testing' } ReleasedApplicationMode >> isDebugMode [ ^ false ] -{ #category : #utilities } +{ #category : 'utilities' } ReleasedApplicationMode >> value: aBlock onErrorDo: errorHandler [ ^ aBlock on: Error except: Exit do: errorHandler diff --git a/source/Launchpad-Applications/StackTraceDumper.class.st b/source/Launchpad-Applications/StackTraceDumper.class.st index 9036a51..917c4e1 100644 --- a/source/Launchpad-Applications/StackTraceDumper.class.st +++ b/source/Launchpad-Applications/StackTraceDumper.class.st @@ -1,17 +1,18 @@ Class { - #name : #StackTraceDumper, - #superclass : #Object, - #category : #'Launchpad-Applications' + #name : 'StackTraceDumper', + #superclass : 'Object', + #category : 'Launchpad-Applications', + #package : 'Launchpad-Applications' } -{ #category : #testing } +{ #category : 'testing' } StackTraceDumper class >> isAbstract [ ^ self = StackTraceDumper ] -{ #category : #'error handling' } +{ #category : 'error handling' } StackTraceDumper >> dumpStackTraceFor: anError [ self subclassResponsibility diff --git a/source/Launchpad-Applications/package.st b/source/Launchpad-Applications/package.st index 31af571..1fffb7d 100644 --- a/source/Launchpad-Applications/package.st +++ b/source/Launchpad-Applications/package.st @@ -1 +1 @@ -Package { #name : #'Launchpad-Applications' } +Package { #name : 'Launchpad-Applications' } From b2ca94204c9555ad2f4fc83cde6afd8e39e6abe1 Mon Sep 17 00:00:00 2001 From: Mariano Saura Date: Tue, 19 Mar 2024 19:26:25 -0300 Subject: [PATCH 02/14] Unnecesary initialize method removed --- .../Launchpad-Applications/LaunchpadApplication.class.st | 7 ------- 1 file changed, 7 deletions(-) diff --git a/source/Launchpad-Applications/LaunchpadApplication.class.st b/source/Launchpad-Applications/LaunchpadApplication.class.st index 6f4f64e..a795b77 100644 --- a/source/Launchpad-Applications/LaunchpadApplication.class.st +++ b/source/Launchpad-Applications/LaunchpadApplication.class.st @@ -51,13 +51,6 @@ LaunchpadApplication class >> description [ ^ self subclassResponsibility ] -{ #category : 'accessing' } -LaunchpadApplication class >> initialize [ - - - self resetCurrentlyRunning -] - { #category : 'testing' } LaunchpadApplication class >> isAbstract [ From 90fe1b5db8906ac78b96f9b6100d31910ac3bfb6 Mon Sep 17 00:00:00 2001 From: Mariano Saura Date: Tue, 19 Mar 2024 19:33:57 -0300 Subject: [PATCH 03/14] Simplified initialization --- .../CurrentlyRunningLaunchpadApplication.class.st | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st b/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st index bb305b8..a2cad06 100644 --- a/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st +++ b/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st @@ -21,7 +21,7 @@ CurrentlyRunningLaunchpadApplication class >> initialize [ { #category : 'initialization' } CurrentlyRunningLaunchpadApplication class >> initializeUniqueInstance [ - uniqueInstance := super new initialize + uniqueInstance := super new resetCurrentlyRunning ] { #category : 'instance creation' } @@ -36,13 +36,6 @@ CurrentlyRunningLaunchpadApplication >> currentlyRunning [ ^ application content ] -{ #category : 'initialization' } -CurrentlyRunningLaunchpadApplication >> initialize [ - - - self resetCurrentlyRunning -] - { #category : 'accessing' } CurrentlyRunningLaunchpadApplication >> resetCurrentlyRunning [ From eed87139d044289d0e8ab2a10e2726a68bb1782b Mon Sep 17 00:00:00 2001 From: Mariano Saura Date: Tue, 19 Mar 2024 19:43:25 -0300 Subject: [PATCH 04/14] Test initialize --- .../Launchpad-Applications/LaunchpadApplication.class.st | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/Launchpad-Applications/LaunchpadApplication.class.st b/source/Launchpad-Applications/LaunchpadApplication.class.st index a795b77..6f4f64e 100644 --- a/source/Launchpad-Applications/LaunchpadApplication.class.st +++ b/source/Launchpad-Applications/LaunchpadApplication.class.st @@ -51,6 +51,13 @@ LaunchpadApplication class >> description [ ^ self subclassResponsibility ] +{ #category : 'accessing' } +LaunchpadApplication class >> initialize [ + + + self resetCurrentlyRunning +] + { #category : 'testing' } LaunchpadApplication class >> isAbstract [ From d27dfa69afe1bc41efac2625c9d84a6cf5e7da37 Mon Sep 17 00:00:00 2001 From: Mariano Saura Date: Tue, 19 Mar 2024 19:44:16 -0300 Subject: [PATCH 05/14] Test code reverted --- .../Launchpad-Applications/LaunchpadApplication.class.st | 7 ------- 1 file changed, 7 deletions(-) diff --git a/source/Launchpad-Applications/LaunchpadApplication.class.st b/source/Launchpad-Applications/LaunchpadApplication.class.st index 6f4f64e..a795b77 100644 --- a/source/Launchpad-Applications/LaunchpadApplication.class.st +++ b/source/Launchpad-Applications/LaunchpadApplication.class.st @@ -51,13 +51,6 @@ LaunchpadApplication class >> description [ ^ self subclassResponsibility ] -{ #category : 'accessing' } -LaunchpadApplication class >> initialize [ - - - self resetCurrentlyRunning -] - { #category : 'testing' } LaunchpadApplication class >> isAbstract [ From 42c8efeff18c6df3556e9b6f558805566d86827a Mon Sep 17 00:00:00 2001 From: Mariano Saura Date: Wed, 20 Mar 2024 10:55:13 -0300 Subject: [PATCH 06/14] Lazy initialization so that with GS64 (transient class) works as expected --- ...CurrentlyRunningLaunchpadApplication.class.st | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st b/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st index a2cad06..92f66f4 100644 --- a/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st +++ b/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st @@ -2,7 +2,7 @@ Class { #name : 'CurrentlyRunningLaunchpadApplication', #superclass : 'Object', #instVars : [ - 'application' + 'binding' ], #classInstVars : [ 'uniqueInstance' @@ -21,7 +21,7 @@ CurrentlyRunningLaunchpadApplication class >> initialize [ { #category : 'initialization' } CurrentlyRunningLaunchpadApplication class >> initializeUniqueInstance [ - uniqueInstance := super new resetCurrentlyRunning + uniqueInstance := super new ] { #category : 'instance creation' } @@ -33,27 +33,27 @@ CurrentlyRunningLaunchpadApplication class >> new [ { #category : 'accessing' } CurrentlyRunningLaunchpadApplication >> currentlyRunning [ - ^ application content + ^ (binding ifNil: [ self resetCurrentlyRunning ]) content ] { #category : 'accessing' } CurrentlyRunningLaunchpadApplication >> resetCurrentlyRunning [ - application := Binding undefinedExplainedBy: + binding := Binding undefinedExplainedBy: 'There''s no current application running.' ] { #category : 'accessing' } CurrentlyRunningLaunchpadApplication >> setAsCurrentlyRunning: anApplication [ - application := Binding to: anApplication + binding := Binding to: anApplication ] { #category : 'accessing' } CurrentlyRunningLaunchpadApplication >> setAsCurrentlyRunning: anApplication during: aBlock [ | previousBinding | - previousBinding := application. - application := Binding to: anApplication. - aBlock ensure: [ application := previousBinding ] + previousBinding := binding. + binding := Binding to: anApplication. + aBlock ensure: [ binding := previousBinding ] ] From e8e000c4eb1c1976ec46e73e79f93226d63f9bcf Mon Sep 17 00:00:00 2001 From: Mariano Saura Date: Wed, 20 Mar 2024 11:00:26 -0300 Subject: [PATCH 07/14] Last commit fixed --- .../CurrentlyRunningLaunchpadApplication.class.st | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st b/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st index 92f66f4..2f9baae 100644 --- a/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st +++ b/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st @@ -33,7 +33,8 @@ CurrentlyRunningLaunchpadApplication class >> new [ { #category : 'accessing' } CurrentlyRunningLaunchpadApplication >> currentlyRunning [ - ^ (binding ifNil: [ self resetCurrentlyRunning ]) content + binding ifNil: [ self resetCurrentlyRunning ]. + ^ binding content ] { #category : 'accessing' } From 65186007c2bbbb9877abc54007599bfcdd7aacbd Mon Sep 17 00:00:00 2001 From: Mariano Saura Date: Wed, 20 Mar 2024 11:45:51 -0300 Subject: [PATCH 08/14] Rowan scripts updated --- rowan/components/Deployment.ston | 1 + .../components/scripts/deploymentPostload.st | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 rowan/components/scripts/deploymentPostload.st diff --git a/rowan/components/Deployment.ston b/rowan/components/Deployment.ston index 7e1a583..3a68a2f 100644 --- a/rowan/components/Deployment.ston +++ b/rowan/components/Deployment.ston @@ -1,5 +1,6 @@ RwSimpleProjectLoadComponentV2 { #name : 'Deployment', + #postloadDoitName: 'scripts/deploymentPostload', #projectNames : [ 'Bell', 'Buoy', diff --git a/rowan/components/scripts/deploymentPostload.st b/rowan/components/scripts/deploymentPostload.st new file mode 100644 index 0000000..e95e871 --- /dev/null +++ b/rowan/components/scripts/deploymentPostload.st @@ -0,0 +1,30 @@ +"Recompile LaunchpadApplication and CurrentlyRunningLaunchpadApplication with dbTransient option + so that instances are not persistent because they store session-dependent information only" + +| removeNonTransientVersionsOf | +removeNonTransientVersionsOf := [:class | + | nonTransientVersions | + nonTransientVersions := class classHistory reject: [:classVersion | classVersion instancesDbTransient]. + nonTransientVersions do: [:classVersion | class classHistory removeVersion: classVersion]]. + +Object subclass: 'LaunchpadApplication' + instVarNames: #( configurationCache configurationProvider mode commandServer ) + classVars: #() + classInstVars: #() + poolDictionaries: #() + inDictionary: Launchpad + options: #( dbTransient ). + +removeNonTransientVersionsOf value: LaunchpadApplication. + +Object subclass: 'CurrentlyRunningLaunchpadApplication' + instVarNames: #( binding ) + classVars: #( uniqueInstance ) + classInstVars: #() + poolDictionaries: #() + inDictionary: Launchpad + options: #( dbTransient ). + +removeNonTransientVersionsOf value: CurrentlyRunningLaunchpadApplication. + +CurrentlyRunningLaunchpadApplication initializeUniqueInstance. From b4a943e3b19f91921d622d7b5c13425dd7419af2 Mon Sep 17 00:00:00 2001 From: Mariano Saura Date: Wed, 20 Mar 2024 12:37:47 -0300 Subject: [PATCH 09/14] Tests added for coverage improvement --- ...rrentApplicationConfigurationTest.class.st | 11 ++-- ...lyRunningLaunchpadApplicationTest.class.st | 59 +++++++++++++++++++ .../DebuggingApplicationModeTest.class.st | 15 ++--- .../LaunchpadApplicationTest.class.st | 11 ++-- .../NullStackTraceDumperTest.class.st | 9 +-- .../ReleasedApplicationModeTest.class.st | 15 ++--- .../Launchpad-Applications-Tests/package.st | 2 +- 7 files changed, 93 insertions(+), 29 deletions(-) create mode 100644 source/Launchpad-Applications-Tests/CurrentlyRunningLaunchpadApplicationTest.class.st diff --git a/source/Launchpad-Applications-Tests/CurrentApplicationConfigurationTest.class.st b/source/Launchpad-Applications-Tests/CurrentApplicationConfigurationTest.class.st index ba8134f..1b2d7cf 100644 --- a/source/Launchpad-Applications-Tests/CurrentApplicationConfigurationTest.class.st +++ b/source/Launchpad-Applications-Tests/CurrentApplicationConfigurationTest.class.st @@ -2,12 +2,13 @@ A CurrentApplicationConfigurationTest is a test class for testing the behavior of CurrentApplicationConfiguration " Class { - #name : #CurrentApplicationConfigurationTest, - #superclass : #TestCase, - #category : #'Launchpad-Applications-Tests' + #name : 'CurrentApplicationConfigurationTest', + #superclass : 'TestCase', + #category : 'Launchpad-Applications-Tests', + #package : 'Launchpad-Applications-Tests' } -{ #category : #tests } +{ #category : 'tests' } CurrentApplicationConfigurationTest >> testAccessingConfigurationOfRunningApplication [ | application | @@ -22,7 +23,7 @@ CurrentApplicationConfigurationTest >> testAccessingConfigurationOfRunningApplic during: [ self assert: CurrentApplicationConfiguration value equals: application configuration ] ] -{ #category : #tests } +{ #category : 'tests' } CurrentApplicationConfigurationTest >> testNoApplicationRunning [ self should: [ CurrentApplicationConfiguration value ] diff --git a/source/Launchpad-Applications-Tests/CurrentlyRunningLaunchpadApplicationTest.class.st b/source/Launchpad-Applications-Tests/CurrentlyRunningLaunchpadApplicationTest.class.st new file mode 100644 index 0000000..ed54334 --- /dev/null +++ b/source/Launchpad-Applications-Tests/CurrentlyRunningLaunchpadApplicationTest.class.st @@ -0,0 +1,59 @@ +Class { + #name : 'CurrentlyRunningLaunchpadApplicationTest', + #superclass : 'TestCase', + #instVars : [ + 'currentlyRunningLaunchpadApp' + ], + #category : 'Launchpad-Applications-Tests', + #package : 'Launchpad-Applications-Tests' +} + +{ #category : 'running' } +CurrentlyRunningLaunchpadApplicationTest >> setUp [ + + super setUp. + currentlyRunningLaunchpadApp := CurrentlyRunningLaunchpadApplication new. + currentlyRunningLaunchpadApp resetCurrentlyRunning +] + +{ #category : 'tests' } +CurrentlyRunningLaunchpadApplicationTest >> testCurrentlyRunning [ + + self + should: [ currentlyRunningLaunchpadApp currentlyRunning ] + raise: AssertionFailed + description: 'There''s no current application running.' +] + +{ #category : 'tests' } +CurrentlyRunningLaunchpadApplicationTest >> testResetCurrentlyRunning [ + + currentlyRunningLaunchpadApp setAsCurrentlyRunning: #MockApp. + currentlyRunningLaunchpadApp resetCurrentlyRunning. + self + should: [ currentlyRunningLaunchpadApp currentlyRunning ] + raise: AssertionFailed + description: 'There''s no current application running.' +] + +{ #category : 'tests' } +CurrentlyRunningLaunchpadApplicationTest >> testSetAsCurrentlyRunning [ + + currentlyRunningLaunchpadApp setAsCurrentlyRunning: #MockApp. + self assert: currentlyRunningLaunchpadApp currentlyRunning equals: #MockApp +] + +{ #category : 'tests' } +CurrentlyRunningLaunchpadApplicationTest >> testSetAsCurrentlyRunningDuring [ + + currentlyRunningLaunchpadApp setAsCurrentlyRunning: #MockApp. + currentlyRunningLaunchpadApp + setAsCurrentlyRunning: #MockAppOther + during: [ + self + assert: currentlyRunningLaunchpadApp currentlyRunning + equals: #MockAppOther ]. + self + assert: currentlyRunningLaunchpadApp currentlyRunning + equals: #MockApp +] diff --git a/source/Launchpad-Applications-Tests/DebuggingApplicationModeTest.class.st b/source/Launchpad-Applications-Tests/DebuggingApplicationModeTest.class.st index af12ddc..2ea844f 100644 --- a/source/Launchpad-Applications-Tests/DebuggingApplicationModeTest.class.st +++ b/source/Launchpad-Applications-Tests/DebuggingApplicationModeTest.class.st @@ -2,12 +2,13 @@ A DebuggingApplicationModeTest is a test class for testing the behavior of DebuggingApplicationMode " Class { - #name : #DebuggingApplicationModeTest, - #superclass : #LaunchpadTest, - #category : #'Launchpad-Applications-Tests' + #name : 'DebuggingApplicationModeTest', + #superclass : 'LaunchpadTest', + #category : 'Launchpad-Applications-Tests', + #package : 'Launchpad-Applications-Tests' } -{ #category : #tests } +{ #category : 'tests' } DebuggingApplicationModeTest >> testExitFailure [ self @@ -15,7 +16,7 @@ DebuggingApplicationModeTest >> testExitFailure [ assertingLogRecordsMatch: #( '[ERROR] Exit application' ) ] -{ #category : #tests } +{ #category : 'tests' } DebuggingApplicationModeTest >> testExitSuccess [ self @@ -23,13 +24,13 @@ DebuggingApplicationModeTest >> testExitSuccess [ assertingLogRecordsMatch: #( '[INFO] Exit application' ) ] -{ #category : #test } +{ #category : 'test' } DebuggingApplicationModeTest >> testIsDebugMode [ self assert: DebuggingApplicationMode new isDebugMode ] -{ #category : #tests } +{ #category : 'tests' } DebuggingApplicationModeTest >> testValueOnErrorDo [ DebuggingApplicationMode new value: [ ] onErrorDo: [ self fail ]. diff --git a/source/Launchpad-Applications-Tests/LaunchpadApplicationTest.class.st b/source/Launchpad-Applications-Tests/LaunchpadApplicationTest.class.st index 9073366..9259955 100644 --- a/source/Launchpad-Applications-Tests/LaunchpadApplicationTest.class.st +++ b/source/Launchpad-Applications-Tests/LaunchpadApplicationTest.class.st @@ -2,12 +2,13 @@ A LaunchpadApplicationTest is a test class for testing the behavior of LaunchpadApplication " Class { - #name : #LaunchpadApplicationTest, - #superclass : #TestCase, - #category : #'Launchpad-Applications-Tests' + #name : 'LaunchpadApplicationTest', + #superclass : 'TestCase', + #category : 'Launchpad-Applications-Tests', + #package : 'Launchpad-Applications-Tests' } -{ #category : #tests } +{ #category : 'tests' } LaunchpadApplicationTest >> testIsDebugModeEnabled [ | application | @@ -19,7 +20,7 @@ LaunchpadApplicationTest >> testIsDebugModeEnabled [ self assert: application isDebugModeEnabled ] -{ #category : #tests } +{ #category : 'tests' } LaunchpadApplicationTest >> testIsDebugModeNotEnabled [ | application | diff --git a/source/Launchpad-Applications-Tests/NullStackTraceDumperTest.class.st b/source/Launchpad-Applications-Tests/NullStackTraceDumperTest.class.st index 144f747..b8e8985 100644 --- a/source/Launchpad-Applications-Tests/NullStackTraceDumperTest.class.st +++ b/source/Launchpad-Applications-Tests/NullStackTraceDumperTest.class.st @@ -2,12 +2,13 @@ A NullStackTraceDumperTest is a test class for testing the behavior of NullStackTraceDumper " Class { - #name : #NullStackTraceDumperTest, - #superclass : #LaunchpadTest, - #category : #'Launchpad-Applications-Tests' + #name : 'NullStackTraceDumperTest', + #superclass : 'LaunchpadTest', + #category : 'Launchpad-Applications-Tests', + #package : 'Launchpad-Applications-Tests' } -{ #category : #tests } +{ #category : 'tests' } NullStackTraceDumperTest >> testDumpStackTraceFor [ self diff --git a/source/Launchpad-Applications-Tests/ReleasedApplicationModeTest.class.st b/source/Launchpad-Applications-Tests/ReleasedApplicationModeTest.class.st index 4a06e65..9979bf2 100644 --- a/source/Launchpad-Applications-Tests/ReleasedApplicationModeTest.class.st +++ b/source/Launchpad-Applications-Tests/ReleasedApplicationModeTest.class.st @@ -2,12 +2,13 @@ A ReleasedApplicationModeTest is a test class for testing the behavior of ReleasedApplicationMode " Class { - #name : #ReleasedApplicationModeTest, - #superclass : #TestCase, - #category : #'Launchpad-Applications-Tests' + #name : 'ReleasedApplicationModeTest', + #superclass : 'TestCase', + #category : 'Launchpad-Applications-Tests', + #package : 'Launchpad-Applications-Tests' } -{ #category : #tests } +{ #category : 'tests' } ReleasedApplicationModeTest >> testExitFailure [ self should: [ ReleasedApplicationMode new exitFailure ] @@ -15,7 +16,7 @@ ReleasedApplicationModeTest >> testExitFailure [ withExceptionDo: [ :exit | self deny: exit isSuccess ] ] -{ #category : #tests } +{ #category : 'tests' } ReleasedApplicationModeTest >> testExitSuccess [ self should: [ ReleasedApplicationMode new exitSuccess ] @@ -23,13 +24,13 @@ ReleasedApplicationModeTest >> testExitSuccess [ withExceptionDo: [ :exit | self assert: exit isSuccess ] ] -{ #category : #tests } +{ #category : 'tests' } ReleasedApplicationModeTest >> testIsDebugMode [ self deny: ReleasedApplicationMode new isDebugMode ] -{ #category : #tests } +{ #category : 'tests' } ReleasedApplicationModeTest >> testValueOnErrorDo [ | errorWasHandled | diff --git a/source/Launchpad-Applications-Tests/package.st b/source/Launchpad-Applications-Tests/package.st index 42a4fa6..3bd1c62 100644 --- a/source/Launchpad-Applications-Tests/package.st +++ b/source/Launchpad-Applications-Tests/package.st @@ -1 +1 @@ -Package { #name : #'Launchpad-Applications-Tests' } +Package { #name : 'Launchpad-Applications-Tests' } From a8593ff17f916802b4b206fb26b58d4f6fa55624 Mon Sep 17 00:00:00 2001 From: Mariano Saura Date: Wed, 20 Mar 2024 13:16:59 -0300 Subject: [PATCH 10/14] Rowan post load script fixes --- .../components/scripts/deploymentPostload.st | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/rowan/components/scripts/deploymentPostload.st b/rowan/components/scripts/deploymentPostload.st index e95e871..b997697 100644 --- a/rowan/components/scripts/deploymentPostload.st +++ b/rowan/components/scripts/deploymentPostload.st @@ -7,24 +7,32 @@ removeNonTransientVersionsOf := [:class | nonTransientVersions := class classHistory reject: [:classVersion | classVersion instancesDbTransient]. nonTransientVersions do: [:classVersion | class classHistory removeVersion: classVersion]]. -Object subclass: 'LaunchpadApplication' - instVarNames: #( configurationCache configurationProvider mode commandServer ) - classVars: #() - classInstVars: #() - poolDictionaries: #() - inDictionary: Launchpad - options: #( dbTransient ). +LaunchpadApplication instancesDbTransient + ifFalse: [ + Object subclass: 'LaunchpadApplication' + instVarNames: #( configurationCache configurationProvider mode commandServer ) + classVars: #() + classInstVars: #() + poolDictionaries: #() + inDictionary: Launchpad + options: #( dbTransient ). + (OrderedCollection new + add: LaunchpadApplication; + addAll: LaunchpadApplication allSubclasses; + yourself) + do: [:applicationClass | removeNonTransientVersionsOf value: applicationClass]. + ]. -removeNonTransientVersionsOf value: LaunchpadApplication. - -Object subclass: 'CurrentlyRunningLaunchpadApplication' - instVarNames: #( binding ) - classVars: #( uniqueInstance ) - classInstVars: #() - poolDictionaries: #() - inDictionary: Launchpad - options: #( dbTransient ). - -removeNonTransientVersionsOf value: CurrentlyRunningLaunchpadApplication. +CurrentlyRunningLaunchpadApplication instancesDbTransient + ifFalse: [ + Object subclass: 'CurrentlyRunningLaunchpadApplication' + instVarNames: #( binding ) + classVars: #( uniqueInstance ) + classInstVars: #() + poolDictionaries: #() + inDictionary: Launchpad + options: #( dbTransient ). + removeNonTransientVersionsOf value: CurrentlyRunningLaunchpadApplication. + ]. CurrentlyRunningLaunchpadApplication initializeUniqueInstance. From 4de7ae89af8b06d3e95ff9b19980e1f45ec29368 Mon Sep 17 00:00:00 2001 From: Mariano Saura Date: Wed, 20 Mar 2024 14:03:55 -0300 Subject: [PATCH 11/14] Coverage --- .../CurrentlyRunningLaunchpadApplicationTest.class.st | 1 + 1 file changed, 1 insertion(+) diff --git a/source/Launchpad-Applications-Tests/CurrentlyRunningLaunchpadApplicationTest.class.st b/source/Launchpad-Applications-Tests/CurrentlyRunningLaunchpadApplicationTest.class.st index ed54334..67007a1 100644 --- a/source/Launchpad-Applications-Tests/CurrentlyRunningLaunchpadApplicationTest.class.st +++ b/source/Launchpad-Applications-Tests/CurrentlyRunningLaunchpadApplicationTest.class.st @@ -12,6 +12,7 @@ Class { CurrentlyRunningLaunchpadApplicationTest >> setUp [ super setUp. + CurrentlyRunningLaunchpadApplication initialize. currentlyRunningLaunchpadApp := CurrentlyRunningLaunchpadApplication new. currentlyRunningLaunchpadApp resetCurrentlyRunning ] From 09724c239265dec68e3c48a1406e0d34e685c711 Mon Sep 17 00:00:00 2001 From: Mariano Saura Date: Wed, 20 Mar 2024 16:07:07 -0300 Subject: [PATCH 12/14] Code review suggestions --- .../CurrentlyRunningLaunchpadApplicationTest.class.st | 4 ++-- .../CurrentlyRunningLaunchpadApplication.class.st | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Launchpad-Applications-Tests/CurrentlyRunningLaunchpadApplicationTest.class.st b/source/Launchpad-Applications-Tests/CurrentlyRunningLaunchpadApplicationTest.class.st index 67007a1..a941f21 100644 --- a/source/Launchpad-Applications-Tests/CurrentlyRunningLaunchpadApplicationTest.class.st +++ b/source/Launchpad-Applications-Tests/CurrentlyRunningLaunchpadApplicationTest.class.st @@ -23,7 +23,7 @@ CurrentlyRunningLaunchpadApplicationTest >> testCurrentlyRunning [ self should: [ currentlyRunningLaunchpadApp currentlyRunning ] raise: AssertionFailed - description: 'There''s no current application running.' + withMessageText: 'There''s no current application running.' ] { #category : 'tests' } @@ -34,7 +34,7 @@ CurrentlyRunningLaunchpadApplicationTest >> testResetCurrentlyRunning [ self should: [ currentlyRunningLaunchpadApp currentlyRunning ] raise: AssertionFailed - description: 'There''s no current application running.' + withMessageText: 'There''s no current application running.' ] { #category : 'tests' } diff --git a/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st b/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st index 2f9baae..ac9662a 100644 --- a/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st +++ b/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st @@ -4,7 +4,7 @@ Class { #instVars : [ 'binding' ], - #classInstVars : [ + #classVars : [ 'uniqueInstance' ], #category : 'Launchpad-Applications', From 403e0be73d93b86cbe15664d8372bab0e7b037fc Mon Sep 17 00:00:00 2001 From: Mariano Saura Date: Wed, 20 Mar 2024 16:09:02 -0300 Subject: [PATCH 13/14] Code review suggestions --- rowan/components/scripts/deploymentPostload.st | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rowan/components/scripts/deploymentPostload.st b/rowan/components/scripts/deploymentPostload.st index b997697..5757f5c 100644 --- a/rowan/components/scripts/deploymentPostload.st +++ b/rowan/components/scripts/deploymentPostload.st @@ -10,10 +10,10 @@ removeNonTransientVersionsOf := [:class | LaunchpadApplication instancesDbTransient ifFalse: [ Object subclass: 'LaunchpadApplication' - instVarNames: #( configurationCache configurationProvider mode commandServer ) - classVars: #() - classInstVars: #() - poolDictionaries: #() + instVarNames: LaunchpadApplication instVarNames + classVars: LaunchpadApplication classVarNames + classInstVars: LaunchpadApplication class instVarNames + poolDictionaries: LaunchpadApplication _poolDictionaries inDictionary: Launchpad options: #( dbTransient ). (OrderedCollection new @@ -26,10 +26,10 @@ LaunchpadApplication instancesDbTransient CurrentlyRunningLaunchpadApplication instancesDbTransient ifFalse: [ Object subclass: 'CurrentlyRunningLaunchpadApplication' - instVarNames: #( binding ) - classVars: #( uniqueInstance ) - classInstVars: #() - poolDictionaries: #() + instVarNames: CurrentlyRunningLaunchpadApplication instVarNames + classVars: CurrentlyRunningLaunchpadApplication classVarNames + classInstVars: CurrentlyRunningLaunchpadApplication class instVarNames + poolDictionaries: CurrentlyRunningLaunchpadApplication _poolDictionaries inDictionary: Launchpad options: #( dbTransient ). removeNonTransientVersionsOf value: CurrentlyRunningLaunchpadApplication. From 457319a0875218ba70d23d738ece1489f344efc7 Mon Sep 17 00:00:00 2001 From: Mariano Saura Date: Wed, 20 Mar 2024 16:51:16 -0300 Subject: [PATCH 14/14] added instead of reinitialize from test --- .../CurrentlyRunningLaunchpadApplicationTest.class.st | 1 - .../CurrentlyRunningLaunchpadApplication.class.st | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Launchpad-Applications-Tests/CurrentlyRunningLaunchpadApplicationTest.class.st b/source/Launchpad-Applications-Tests/CurrentlyRunningLaunchpadApplicationTest.class.st index a941f21..6be12f5 100644 --- a/source/Launchpad-Applications-Tests/CurrentlyRunningLaunchpadApplicationTest.class.st +++ b/source/Launchpad-Applications-Tests/CurrentlyRunningLaunchpadApplicationTest.class.st @@ -12,7 +12,6 @@ Class { CurrentlyRunningLaunchpadApplicationTest >> setUp [ super setUp. - CurrentlyRunningLaunchpadApplication initialize. currentlyRunningLaunchpadApp := CurrentlyRunningLaunchpadApplication new. currentlyRunningLaunchpadApp resetCurrentlyRunning ] diff --git a/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st b/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st index ac9662a..753a38c 100644 --- a/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st +++ b/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st @@ -21,6 +21,7 @@ CurrentlyRunningLaunchpadApplication class >> initialize [ { #category : 'initialization' } CurrentlyRunningLaunchpadApplication class >> initializeUniqueInstance [ + uniqueInstance := super new ]