SystemOrganization addCategory: #'Transactional-Core'! SystemOrganization addCategory: #'Transactional-Tests'! !ContextPart methodsFor: '*transactional' stamp: 'lr 4/23/2007 13:14'! atomic ^ ACTransaction run: self! ! Object subclass: #ACChange instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Transactional-Core'! ACChange subclass: #ACGlobalChange instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Transactional-Core'! ACChange subclass: #ACInstanceChange instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Transactional-Core'! ACChange subclass: #ACTempChange instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Transactional-Core'! Object subclass: #ACTransaction instanceVariableNames: 'log' classVariableNames: '' poolDictionaries: '' category: 'Transactional-Core'! !ACTransaction class methodsFor: 'instance-creation' stamp: 'lr 4/23/2007 13:15'! run: aBlock ^ self basicNew run: aBlock! ! !ACTransaction methodsFor: 'public' stamp: 'lr 4/23/2007 13:12'! abort log := nil ! ! !ACTransaction methodsFor: 'private' stamp: 'lr 4/23/2007 13:13'! basicRun: aBlock ^ aBlock value! ! !ACTransaction methodsFor: 'public' stamp: 'lr 4/23/2007 13:12'! begin log := OrderedCollection new! ! !ACTransaction methodsFor: 'public' stamp: 'lr 3/16/2007 15:05'! commit ! ! !ACTransaction methodsFor: 'public' stamp: 'lr 4/23/2007 13:13'! run: aBlock | result | self begin. [ result := self basicRun: aBlock ] ifCurtailed: [ self abort ]. self commit. ^ result! ! TestCase subclass: #ACTestCase instanceVariableNames: 'value' classVariableNames: '' poolDictionaries: '' category: 'Transactional-Tests'! !ACTestCase methodsFor: 'testing-basic' stamp: 'lr 4/23/2007 13:17'! testBasicContext self assert: [ thisContext home ] atomic == thisContext! ! !ACTestCase methodsFor: 'testing-basic' stamp: 'lr 4/23/2007 13:16'! testBasicInstRead value := true. self assert: [ value ] atomic! ! !ACTestCase methodsFor: 'testing-basic' stamp: 'lr 4/23/2007 13:16'! testBasicInstWrite [ value := true ] atomic. self assert: value! ! !ACTestCase methodsFor: 'testing-basic' stamp: 'lr 4/23/2007 13:17'! testBasicSelf self assert: [ self ] atomic == self! ! !ACTestCase methodsFor: 'testing-basic' stamp: 'lr 4/23/2007 13:17'! testBasicSuper self assert: [ super ] atomic == self! ! !ACTestCase methodsFor: 'testing-basic' stamp: 'lr 4/23/2007 13:16'! testBasicTempRead | temp | temp := true. self assert: [ temp ] atomic! ! !ACTestCase methodsFor: 'testing-basic' stamp: 'lr 4/23/2007 13:16'! testBasicTempWrite | temp | [ temp := true ] atomic. self assert: temp! !