diff --git a/rowan/components/scripts/deploymentPostload.st b/rowan/components/scripts/deploymentPostload.st index 5757f5c..239e73a 100644 --- a/rowan/components/scripts/deploymentPostload.st +++ b/rowan/components/scripts/deploymentPostload.st @@ -1,38 +1 @@ -"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]]. - -LaunchpadApplication instancesDbTransient - ifFalse: [ - Object subclass: 'LaunchpadApplication' - instVarNames: LaunchpadApplication instVarNames - classVars: LaunchpadApplication classVarNames - classInstVars: LaunchpadApplication class instVarNames - poolDictionaries: LaunchpadApplication _poolDictionaries - inDictionary: Launchpad - options: #( dbTransient ). - (OrderedCollection new - add: LaunchpadApplication; - addAll: LaunchpadApplication allSubclasses; - yourself) - do: [:applicationClass | removeNonTransientVersionsOf value: applicationClass]. - ]. - -CurrentlyRunningLaunchpadApplication instancesDbTransient - ifFalse: [ - Object subclass: 'CurrentlyRunningLaunchpadApplication' - instVarNames: CurrentlyRunningLaunchpadApplication instVarNames - classVars: CurrentlyRunningLaunchpadApplication classVarNames - classInstVars: CurrentlyRunningLaunchpadApplication class instVarNames - poolDictionaries: CurrentlyRunningLaunchpadApplication _poolDictionaries - inDictionary: Launchpad - options: #( dbTransient ). - removeNonTransientVersionsOf value: CurrentlyRunningLaunchpadApplication. - ]. - CurrentlyRunningLaunchpadApplication initializeUniqueInstance. diff --git a/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st b/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st index 753a38c..f4a5c0e 100644 --- a/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st +++ b/source/Launchpad-Applications/CurrentlyRunningLaunchpadApplication.class.st @@ -7,6 +7,9 @@ Class { #classVars : [ 'uniqueInstance' ], + #gs_options : [ + 'dbTransient' + ], #category : 'Launchpad-Applications', #package : 'Launchpad-Applications' } diff --git a/source/Launchpad-Applications/LaunchpadApplication.class.st b/source/Launchpad-Applications/LaunchpadApplication.class.st index a795b77..9235b29 100644 --- a/source/Launchpad-Applications/LaunchpadApplication.class.st +++ b/source/Launchpad-Applications/LaunchpadApplication.class.st @@ -7,6 +7,9 @@ Class { 'mode', 'commandServer' ], + #gs_options : [ + 'dbTransient' + ], #category : 'Launchpad-Applications', #package : 'Launchpad-Applications' } diff --git a/source/Launchpad-GS64-Extensions-Tests/LaunchpadApplicationTransientTest.class.st b/source/Launchpad-GS64-Extensions-Tests/LaunchpadApplicationTransientTest.class.st new file mode 100644 index 0000000..0412042 --- /dev/null +++ b/source/Launchpad-GS64-Extensions-Tests/LaunchpadApplicationTransientTest.class.st @@ -0,0 +1,30 @@ +" +That class tests the API given by AbstractUserInput. Since that class is obviously abstract, it can't be instantiated, the tests are running on CommandLine (which inherits from AbstractUserInput) +" +Class { + #name : #LaunchpadApplicationTransientTest, + #superclass : #TestCase, + #instVars : [ ], + #category : #'Launchpad-GS64-Extensions-Tests' +} + +{ #category : #tests } +LaunchpadApplicationTransientTest >> testAccessingRunningApplication [ + | application | + + application := LaunchpadBrokenApplication + runningIn: DebuggingApplicationMode new + configuredBy: NullConfigurationProvider new + controlledBy: NullCommandServer new. + + LaunchpadApplication setAsCurrentlyRunning: application. + System abortTransaction. + self assert: LaunchpadApplication currentlyRunning equals: application +] + +{ #category : #running } +LaunchpadApplicationTransientTest >> tearDown [ + + CurrentlyRunningLaunchpadApplication new resetCurrentlyRunning + super tearDown. +]