Andreas Raab uploaded a new version of Exceptions to project The Trunk:
http://source.squeak.org/trunk/Exceptions-ar.18.mcz ==================== Summary ==================== Name: Exceptions-ar.18 Author: ar Time: 4 January 2010, 4:28:21 am UUID: 77ef8c78-423a-cd4a-af2b-a50cc1df0930 Ancestors: Exceptions-nice.17 Making Tests unloadable: Move Exceptions-Tests to Tests-Exceptions. =============== Diff against Exceptions-nice.17 =============== Item was changed: SystemOrganization addCategory: #'Exceptions-Kernel'! SystemOrganization addCategory: #'Exceptions-Extensions'! - SystemOrganization addCategory: #'Exceptions-Tests'! Item was removed: - TestCase subclass: #ExceptionTests - instanceVariableNames: '' - classVariableNames: '' - poolDictionaries: '' - category: 'Exceptions-Tests'! Item was removed: - ----- Method: ExceptionTester>>simpleEnsureTestResults (in category 'results') ----- - simpleEnsureTestResults - - ^OrderedCollection new - add: self doSomethingString; - add: self doSomethingElseString; - add: self doYetAnotherThingString; - yourself! Item was removed: - ----- Method: ExceptionTester>>doYetAnotherThingString (in category 'accessing') ----- - doYetAnotherThingString - - ^'Do yet another thing.'! Item was removed: - ----- Method: ExceptionTester>>runTest: (in category 'testing') ----- - runTest: aSelector - - | actualResult expectedResult | - [ self - logTest: aSelector; - clearLog; - perform: aSelector ] - on: MyTestError do: - [ :ex | self log: 'Unhandled Exception'. - ex return: nil ]. - - actualResult := self log. - expectedResult := self perform: (aSelector, #Results) asSymbol. - - actualResult = expectedResult - ifTrue: [self logTestResult: 'succeeded'] - ifFalse: [self logTestResult: 'failed' ]. - ! Item was removed: - ----- Method: ExceptionTester>>doSomethingElse (in category 'pseudo actions') ----- - doSomethingElse - - self log: self doSomethingElseString! Item was removed: - ----- Method: ExceptionTester>>doSomethingExceptionalString (in category 'accessing') ----- - doSomethingExceptionalString - - ^'Do something exceptional.'! Item was removed: - ----- Method: ExceptionTests>>testResumablePass (in category 'testing-outer') ----- - testResumablePass - - | result | - result := [Notification signal. 4] - on: Notification - do: [:ex | ex pass. ex return: 5]. - self assert: result == 4 - ! Item was removed: - Error subclass: #MyTestError - instanceVariableNames: '' - classVariableNames: '' - poolDictionaries: '' - category: 'Exceptions-Tests'! Item was removed: - ----- Method: ExceptionTester>>simpleEnsureTestWithErrorResults (in category 'results') ----- - simpleEnsureTestWithErrorResults - - ^OrderedCollection new - add: self doSomethingString; - add: 'Unhandled Exception'; - add: self doYetAnotherThingString; - yourself! Item was removed: - ----- Method: ExceptionTester>>simpleEnsureTestWithNotification (in category 'tests') ----- - simpleEnsureTestWithNotification - - [self doSomething. - self methodWithNotification. - self doSomethingElse] - ensure: - [self doYetAnotherThing]. - ! Item was removed: - ----- Method: ExceptionTests>>testNoTimeout (in category 'testing') ----- - testNoTimeout - self assertSuccess: (ExceptionTester new runTest: #simpleNoTimeoutTest ) ! Item was removed: - ----- Method: ExceptionTests>>testSimplePass (in category 'testing-ExceptionTester') ----- - testSimplePass - self assertSuccess: (ExceptionTester new runTest: #simplePassTest ) ! Item was removed: - ----- Method: ProcessTerminateBug>>testUnwindFromForeignProcess (in category 'tests') ----- - testUnwindFromForeignProcess - | sema process | - sema := Semaphore forMutualExclusion. - self assert: sema isSignaled. - process := [ - sema critical:[ - self deny: sema isSignaled. - sema wait. "deadlock" - ] - ] forkAt: Processor userInterruptPriority. - self deny: sema isSignaled. - "This is for illustration only - the BlockCannotReturn cannot - be handled here (it's truncated already)" - self shouldnt: [process terminate] raise: BlockCannotReturn. - self assert: sema isSignaled. - ! Item was removed: - ----- Method: ExceptionTester>>simpleResignalAsTest (in category 'signaledException tests') ----- - simpleResignalAsTest - "ExceptionTester new simpleResignalAsTest" - - [self doSomething. - MyTestNotification signal. - self doSomethingElse] - on: MyTestNotification - do: - [:ex | ex resignalAs: MyTestError new]! Item was removed: - ----- Method: ExceptionTester>>simpleTimeoutTestResults (in category 'results') ----- - simpleTimeoutTestResults - - | things | - things := OrderedCollection new: self iterationsBeforeTimeout. - - self iterationsBeforeTimeout timesRepeat: [ things add: self doSomethingString ]. - things add: self doSomethingElseString. - - ^ things! Item was removed: - ----- Method: ExceptionTester>>contents (in category 'logging') ----- - contents - - ^( self log - inject: (WriteStream on: (String new: 80)) - into: - [:result :item | - result - cr; - nextPutAll: item; - yourself] ) contents! Item was removed: - ----- Method: ExceptionTester>>resumableFallOffTheEndHandler (in category 'tests') ----- - resumableFallOffTheEndHandler - - [self doSomething. - MyTestNotification signal. - self doSomethingElse] - on: MyTestNotification - do: [:ex | self doSomethingExceptional]. - self doYetAnotherThing! Item was removed: - ----- Method: ExceptionTester>>signalFromHandlerActionTestResults (in category 'results') ----- - signalFromHandlerActionTestResults - - ^OrderedCollection new - add: self doSomethingString; - add: self doYetAnotherThingString; - add: 'Unhandled Exception'; - yourself! Item was removed: - ----- Method: ExceptionTester>>simpleResignalAsTestResults (in category 'signaledException results') ----- - simpleResignalAsTestResults - - ^OrderedCollection new - add: self doSomethingString; - add: 'Unhandled Exception'; - yourself! Item was removed: - Object subclass: #ExceptionTester - instanceVariableNames: 'log suiteLog iterationsBeforeTimeout' - classVariableNames: '' - poolDictionaries: '' - category: 'Exceptions-Tests'! Item was removed: - ----- Method: ExceptionTester>>methodWithError (in category 'pseudo actions') ----- - methodWithError - - MyTestError signal: self testString! Item was removed: - ----- Method: ExceptionTester>>simpleRetryUsingTestResults (in category 'signaledException results') ----- - simpleRetryUsingTestResults - - ^OrderedCollection new - add: self doSomethingString; - add: self doYetAnotherThingString; - yourself! Item was removed: - ----- Method: ExceptionTests>>testSimpleEnsureTestWithError (in category 'testing-ExceptionTester') ----- - testSimpleEnsureTestWithError - self assertSuccess: (ExceptionTester new runTest: #simpleEnsureTestWithError ) ! Item was removed: - ----- Method: ExceptionTester>>simplePassTestResults (in category 'signaledException results') ----- - simplePassTestResults - - ^OrderedCollection new - add: self doSomethingString; - add: self doYetAnotherThingString; - add: 'Unhandled Exception'; - yourself! Item was removed: - ----- Method: MyResumableTestError>>isResumable (in category 'exceptionDescription') ----- - isResumable - - ^true! Item was removed: - ----- Method: ExceptionTester>>iterationsBeforeTimeout: (in category 'accessing') ----- - iterationsBeforeTimeout: anInteger - - iterationsBeforeTimeout := anInteger! Item was removed: - ----- Method: ExceptionTests>>testNonResumablePass (in category 'testing-outer') ----- - testNonResumablePass - - self should: [ - [Error signal. 4] - on: Error - do: [:ex | ex pass. ex return: 5] - ] raise: Error - ! Item was removed: - ----- Method: ExceptionTester>>runBasicTests (in category 'suites') ----- - runBasicTests - - self basicTestSelectors - do: - [:eachTestSelector | - self runTest: eachTestSelector]! Item was removed: - ----- Method: ExceptionTester>>simpleResumeTest (in category 'signaledException tests') ----- - simpleResumeTest - "see if we can resume twice" - - [ | it | - self doSomething. - it := MyResumableTestError signal. - it = 3 ifTrue: [self doSomethingElse]. - it := MyResumableTestError signal. - it = 3 ifTrue: [self doSomethingElse]. - ] - on: MyResumableTestError - do: - [:ex | - self doYetAnotherThing. - ex resume: 3]! Item was removed: - ----- Method: ExceptionTests>>testSimpleResume (in category 'testing-ExceptionTester') ----- - testSimpleResume - self assertSuccess: (ExceptionTester new runTest: #simpleResumeTest ) ! Item was removed: - ----- Method: ExceptionTester>>simpleEnsureTest (in category 'tests') ----- - simpleEnsureTest - - [self doSomething. - self doSomethingElse] - ensure: - [self doYetAnotherThing]. - ! Item was removed: - ----- Method: ExceptionTester>>iterationsBeforeTimeout (in category 'accessing') ----- - iterationsBeforeTimeout - - ^ iterationsBeforeTimeout! Item was removed: - ----- Method: ExceptionTests>>testSimpleEnsureTestWithNotification (in category 'testing-ExceptionTester') ----- - testSimpleEnsureTestWithNotification - self assertSuccess: (ExceptionTester new runTest: #simpleEnsureTestWithNotification ) ! Item was removed: - ----- Method: ExceptionTester>>doSomethingString (in category 'accessing') ----- - doSomethingString - - ^'Do something.'! Item was removed: - ----- Method: ExceptionTester>>simpleResumeTestResults (in category 'signaledException results') ----- - simpleResumeTestResults - - "see if we can resume twice" - - ^OrderedCollection new - add: self doSomethingString; - add: self doYetAnotherThingString; - add: self doSomethingElseString; - add: self doYetAnotherThingString; - add: self doSomethingElseString; - yourself! Item was removed: - ----- Method: ExceptionTests>>testSimpleRetry (in category 'testing-ExceptionTester') ----- - testSimpleRetry - self assertSuccess: (ExceptionTester new runTest: #simpleRetryTest ) ! Item was removed: - ----- Method: ExceptionTester>>simpleTimeoutWithZeroDurationTest (in category 'tests') ----- - simpleTimeoutWithZeroDurationTest - - [ self doSomething ] - valueWithin: 0 seconds onTimeout: - [ self doSomethingElse ]. - ! Item was removed: - ----- Method: ExceptionTester>>simpleReturnTestResults (in category 'signaledException results') ----- - simpleReturnTestResults - - ^OrderedCollection new - add: self doSomethingString; - add: self doYetAnotherThingString; - yourself! Item was removed: - ----- Method: ExceptionTester>>doSomethingExceptional (in category 'pseudo actions') ----- - doSomethingExceptional - - self log: self doSomethingExceptionalString! Item was removed: - Notification subclass: #MyTestNotification - instanceVariableNames: '' - classVariableNames: '' - poolDictionaries: '' - category: 'Exceptions-Tests'! Item was removed: - ----- Method: ExceptionTester>>simpleOuterTestResults (in category 'signaledException results') ----- - simpleOuterTestResults - - ^OrderedCollection new - add: self doSomethingString; - add: self doYetAnotherThingString; - add: self doSomethingElseString; - yourself! Item was removed: - ----- Method: ExceptionTester>>methodWithNotification (in category 'pseudo actions') ----- - methodWithNotification - - MyTestNotification signal: self testString! Item was removed: - ----- Method: ExceptionTests>>testResumableFallOffTheEndHandler (in category 'testing-ExceptionTester') ----- - testResumableFallOffTheEndHandler - self assertSuccess: (ExceptionTester new runTest: #resumableFallOffTheEndHandler ) ! Item was removed: - ----- Method: ExceptionTester>>simpleEnsureTestWithNotificationResults (in category 'results') ----- - simpleEnsureTestWithNotificationResults - - ^OrderedCollection new - add: self doSomethingString; - add: self doSomethingElseString; - add: self doYetAnotherThingString; - yourself! Item was removed: - ----- Method: ExceptionTester>>runAllTests (in category 'suites') ----- - runAllTests - "ExceptionTester new runAllTests" - - self - runBasicTests; - runBasicANSISignaledExceptionTests! Item was removed: - ----- Method: ExceptionTester>>simpleRetryTest (in category 'signaledException tests') ----- - simpleRetryTest - - | theMeaningOfLife | - theMeaningOfLife := nil. - [self doSomething. - theMeaningOfLife == nil - ifTrue: [MyTestError signal] - ifFalse: [self doSomethingElse]] - on: MyTestError - do: - [:ex | - theMeaningOfLife := 42. - self doYetAnotherThing. - ex retry]! Item was removed: - ----- Method: ExceptionTester>>doublePassOuterTest (in category 'signaledException tests') ----- - doublePassOuterTest - "uses #resume" - - [[[self doSomething. - MyTestNotification signal. - self doSomethingExceptional] - on: MyTestNotification - do: [:ex | ex pass. - self doSomethingExceptional]] - on: MyTestNotification - do: [:ex | ex outer. - self doSomethingElse]] - on: MyTestNotification - do: [:ex | self doYetAnotherThing. ex resume]! Item was removed: - ----- Method: ExceptionTester>>basicTestSelectors (in category 'accessing') ----- - basicTestSelectors - ^ #(#simpleEnsureTest #simpleEnsureTestWithNotification #simpleEnsureTestWithUparrow #simpleEnsureTestWithError #signalFromHandlerActionTest #resumableFallOffTheEndHandler #nonResumableFallOffTheEndHandler #doubleResumeTest #simpleTimeoutWithZeroDurationTest #simpleTimeoutTest simpleNoTimeoutTest)! Item was removed: - ----- Method: ExceptionTester>>simpleIsNestedTestResults (in category 'signaledException results') ----- - simpleIsNestedTestResults - - ^OrderedCollection new - add: self doSomethingString; - add: self doYetAnotherThingString; - add: self doSomethingElseString; - yourself! Item was removed: - ----- Method: ExceptionTester>>doSomething (in category 'pseudo actions') ----- - doSomething - - self log: self doSomethingString! Item was removed: - ----- Method: ExceptionTests>>testDoublePassOuter (in category 'testing-ExceptionTester') ----- - testDoublePassOuter - self assertSuccess: (ExceptionTester new runTest: #doublePassOuterTest ) ! Item was removed: - ----- Method: ExceptionTester>>log (in category 'accessing') ----- - log - - log == nil - ifTrue: [log := OrderedCollection new]. - ^log! Item was removed: - ----- Method: ExceptionTests>>testSimpleRetryUsing (in category 'testing-ExceptionTester') ----- - testSimpleRetryUsing - self assertSuccess: (ExceptionTester new runTest: #simpleRetryUsingTest ) ! Item was removed: - ----- Method: ExceptionTester>>nonResumableFallOffTheEndHandlerResults (in category 'results') ----- - nonResumableFallOffTheEndHandlerResults - - ^OrderedCollection new - add: self doSomethingString; - add: self doSomethingExceptionalString; - add: self doYetAnotherThingString; - yourself! Item was removed: - ----- Method: ExceptionTests>>testDoubleOuterPass (in category 'testing-ExceptionTester') ----- - testDoubleOuterPass - self assertSuccess: (ExceptionTester new runTest: #doubleOuterPassTest ) ! Item was removed: - ----- Method: ExceptionTester>>warningTest (in category 'tests') ----- - warningTest - - self log: 'About to signal warning.'. - Warning signal: 'Ouch'. - self log: 'Warning signal handled and resumed.'! Item was removed: - ----- Method: ExceptionTests>>testSimpleReturn (in category 'testing-ExceptionTester') ----- - testSimpleReturn - self assertSuccess: (ExceptionTester new runTest: #simpleReturnTest ) ! Item was removed: - TestCase subclass: #ProcessTerminateBug - instanceVariableNames: '' - classVariableNames: '' - poolDictionaries: '' - category: 'Exceptions-Tests'! Item was removed: - ----- Method: ExceptionTester>>simpleEnsureTestWithError (in category 'tests') ----- - simpleEnsureTestWithError - - [self doSomething. - MyTestError signal. - self doSomethingElse] - ensure: - [self doYetAnotherThing]. - ! Item was removed: - ----- Method: ExceptionTester>>signalFromHandlerActionTest (in category 'tests') ----- - signalFromHandlerActionTest - - [self doSomething. - MyTestError signal. - self doSomethingElse] - on: MyTestError - do: - [self doYetAnotherThing. - MyTestError signal]! Item was removed: - ----- Method: ExceptionTester>>nonResumableFallOffTheEndHandler (in category 'tests') ----- - nonResumableFallOffTheEndHandler - - [self doSomething. - MyTestError signal. - self doSomethingElse] - on: MyTestError - do: [:ex | self doSomethingExceptional]. - self doYetAnotherThing! Item was removed: - ----- Method: ExceptionTests>>testDoubleResume (in category 'testing-ExceptionTester') ----- - testDoubleResume - self assertSuccess: (ExceptionTester new runTest: #doubleResumeTest ) ! Item was removed: - ----- Method: ExceptionTester>>simpleTimeoutWithZeroDurationTestResults (in category 'results') ----- - simpleTimeoutWithZeroDurationTestResults - - ^OrderedCollection new - add: self doSomethingElseString; - yourself! Item was removed: - ----- Method: ExceptionTester>>simpleIsNestedTest (in category 'signaledException tests') ----- - simpleIsNestedTest - "uses resignalAs:" - - [self doSomething. - MyTestError signal. - self doSomethingElse] - on: MyTestError - do: - [:ex | - ex isNested "expecting to detect handler in #runTest:" - ifTrue: - [self doYetAnotherThing. - ex resignalAs: MyTestNotification new]]! Item was removed: - Notification subclass: #ParserRemovedUnusedTemps - instanceVariableNames: '' - classVariableNames: '' - poolDictionaries: '' - category: 'Exceptions-Tests'! Item was removed: - ----- Method: ExceptionTester>>simpleNoTimeoutTestResults (in category 'results') ----- - simpleNoTimeoutTestResults - - ^OrderedCollection new - add: self doSomethingString; - yourself! Item was removed: - ----- Method: ExceptionTester>>simpleNoTimeoutTest (in category 'tests') ----- - simpleNoTimeoutTest - - [ self doSomething ] - valueWithin: 1 day onTimeout: - [ self doSomethingElse ]. - ! Item was removed: - ----- Method: ExceptionTester>>doubleResumeTestResults (in category 'results') ----- - doubleResumeTestResults - - ^OrderedCollection new - add: self doSomethingString; - add: self doSomethingElseString; - add: self doYetAnotherThingString; - yourself! Item was removed: - ----- Method: ExceptionTests>>testResumableOuter (in category 'testing-outer') ----- - testResumableOuter - - | result | - result := [Notification signal. 4] - on: Notification - do: [:ex | ex outer. ex return: 5]. - self assert: result == 5 - ! Item was removed: - ----- Method: ExceptionTester>>simpleReturnTest (in category 'signaledException tests') ----- - simpleReturnTest - - | it | - it := - [self doSomething. - MyTestError signal. - self doSomethingElse] - on: MyTestError - do: [:ex | ex return: 3]. - it = 3 ifTrue: [self doYetAnotherThing]! Item was removed: - ----- Method: ExceptionTests>>testSimpleResignalAs (in category 'testing-ExceptionTester') ----- - testSimpleResignalAs - self assertSuccess: (ExceptionTester new runTest: #simpleResignalAsTest ) ! Item was removed: - ----- Method: ExceptionTester>>doSomethingElseString (in category 'accessing') ----- - doSomethingElseString - - ^'Do something else.'! Item was removed: - ----- Method: ExceptionTester>>simpleEnsureTestWithUparrowResults (in category 'results') ----- - simpleEnsureTestWithUparrowResults - - ^OrderedCollection new - add: self doSomethingString; - " add: self doSomethingElseString;" - add: self doYetAnotherThingString; - yourself! Item was removed: - ----- Method: ExceptionTester>>suiteLog (in category 'accessing') ----- - suiteLog - - suiteLog == nil - ifTrue: [suiteLog := OrderedCollection new]. - ^suiteLog! Item was removed: - ----- Method: ProcessTerminateBug>>testSchedulerTermination (in category 'tests') ----- - testSchedulerTermination - | process sema gotHere sema2 | - gotHere := false. - sema := Semaphore new. - sema2 := Semaphore new. - process := [ - sema signal. - sema2 wait. - "will be suspended here" - gotHere := true. "e.g., we must *never* get here" - ] forkAt: Processor activeProcess priority. - sema wait. "until process gets scheduled" - process terminate. - sema2 signal. - Processor yield. "will give process a chance to continue and - horribly screw up" - self assert: gotHere not. - ! Item was removed: - ----- Method: ExceptionTester>>doubleOuterPassTestResults (in category 'signaledException results') ----- - doubleOuterPassTestResults - - ^OrderedCollection new - add: self doSomethingString; - add: self doYetAnotherThingString; - add: self doSomethingElseString; - yourself! Item was removed: - ----- Method: ExceptionTester>>doublePassOuterTestResults (in category 'signaledException results') ----- - doublePassOuterTestResults - - ^OrderedCollection new - add: self doSomethingString; - add: self doYetAnotherThingString; - add: self doSomethingElseString; - yourself! Item was removed: - ----- Method: ExceptionTests>>assertSuccess: (in category 'private') ----- - assertSuccess: anExceptionTester - self should: [ ( anExceptionTester suiteLog first) endsWith: 'succeeded'].! Item was removed: - ----- Method: ExceptionTests>>testSimpleIsNested (in category 'testing-ExceptionTester') ----- - testSimpleIsNested - self assertSuccess: (ExceptionTester new runTest: #simpleIsNestedTest ) ! Item was removed: - ----- Method: ExceptionTests>>testNonResumableFallOffTheEndHandler (in category 'testing-ExceptionTester') ----- - testNonResumableFallOffTheEndHandler - self assertSuccess: (ExceptionTester new runTest: #nonResumableFallOffTheEndHandler ) ! Item was removed: - ----- Method: ExceptionTester>>simpleOuterTest (in category 'signaledException tests') ----- - simpleOuterTest - "uses #resume" - - [[self doSomething. - MyTestNotification signal. - "self doSomethingElse" - self doSomethingExceptional] - on: MyTestNotification - do: [:ex | ex outer. self doSomethingElse]] - on: MyTestNotification - do: [:ex | self doYetAnotherThing. ex resume]! Item was removed: - ----- Method: ExceptionTester>>testString (in category 'accessing') ----- - testString - - ^'This is only a test.'! Item was removed: - ----- Method: ExceptionTester>>doYetAnotherThing (in category 'pseudo actions') ----- - doYetAnotherThing - - self log: self doYetAnotherThingString! Item was removed: - ----- Method: ExceptionTests>>testSimpleEnsure (in category 'testing-ExceptionTester') ----- - testSimpleEnsure - self assertSuccess: (ExceptionTester new runTest: #simpleEnsureTest ) ! Item was removed: - ----- Method: ExceptionTests>>testTimeoutWithZeroDuration (in category 'testing') ----- - testTimeoutWithZeroDuration - self assertSuccess: (ExceptionTester new runTest: #simpleTimeoutWithZeroDurationTest ) ! Item was removed: - ----- Method: ExceptionTester>>simpleRetryTestResults (in category 'signaledException results') ----- - simpleRetryTestResults - - ^OrderedCollection new - add: self doSomethingString; - add: self doYetAnotherThingString; - add: self doSomethingString; - add: self doSomethingElseString; - yourself! Item was removed: - ----- Method: ExceptionTester>>simplePassTest (in category 'signaledException tests') ----- - simplePassTest - - [self doSomething. - MyTestError signal. - self doSomethingElse] - on: MyTestError - do: - [:ex | - self doYetAnotherThing. - ex pass "expecting handler in #runTest:"]! Item was removed: - ----- Method: ExceptionTester>>basicANSISignaledExceptionTestSelectors (in category 'accessing') ----- - basicANSISignaledExceptionTestSelectors - - ^#( simpleIsNestedTest simpleOuterTest doubleOuterTest doubleOuterPassTest doublePassOuterTest simplePassTest simpleResignalAsTest simpleResumeTest simpleRetryTest simpleRetryUsingTest simpleReturnTest)! Item was removed: - ----- Method: ExceptionTester>>resumableFallOffTheEndHandlerResults (in category 'results') ----- - resumableFallOffTheEndHandlerResults - - ^OrderedCollection new - add: self doSomethingString; - add: self doSomethingExceptionalString; - add: self doYetAnotherThingString; - yourself! Item was removed: - ----- Method: ExceptionTester>>runBasicANSISignaledExceptionTests (in category 'suites') ----- - runBasicANSISignaledExceptionTests - - self basicANSISignaledExceptionTestSelectors - do: - [:eachTestSelector | - self runTest: eachTestSelector]! Item was removed: - ----- Method: ProcessTerminateBug>>testUnwindFromActiveProcess (in category 'tests') ----- - testUnwindFromActiveProcess - | sema process | - sema := Semaphore forMutualExclusion. - self assert:(sema isSignaled). - process := [ - sema critical:[ - self deny: sema isSignaled. - Processor activeProcess terminate. - ] - ] forkAt: Processor userInterruptPriority. - self assert: sema isSignaled.! Item was removed: - ----- Method: ExceptionTester>>clearLog (in category 'logging') ----- - clearLog - - log := nil! Item was removed: - ----- Method: ExceptionTests>>testSignalFromHandlerActionTest (in category 'testing-ExceptionTester') ----- - testSignalFromHandlerActionTest - self assertSuccess: (ExceptionTester new runTest: #signalFromHandlerActionTest ) ! Item was removed: - ----- Method: ExceptionTests>>testNonResumableOuter (in category 'testing-outer') ----- - testNonResumableOuter - - self should: [ - [Error signal. 4] - on: Error - do: [:ex | ex outer. ex return: 5] - ] raise: Error - ! Item was removed: - ----- Method: ExceptionTester>>logTestResult: (in category 'logging') ----- - logTestResult: aString - - | index | - index := self suiteLog size. - self suiteLog - at: index - put: ((self suiteLog at: index), ' ', aString)! Item was removed: - ----- Method: ExceptionTester>>log: (in category 'logging') ----- - log: aString - - self log add: aString! Item was removed: - ----- Method: ExceptionTester>>doubleResumeTest (in category 'tests') ----- - doubleResumeTest - - [self doSomething. - MyResumableTestError signal. - self doSomethingElse. - MyResumableTestError signal. - self doYetAnotherThing] - on: MyResumableTestError - do: [:ex | ex resume].! Item was removed: - ----- Method: ExceptionTests>>testSimpleEnsureTestWithUparrow (in category 'testing-ExceptionTester') ----- - testSimpleEnsureTestWithUparrow - self assertSuccess: (ExceptionTester new runTest: #simpleEnsureTestWithUparrow ) ! Item was removed: - ----- Method: ExceptionTester>>simpleEnsureTestWithUparrow (in category 'tests') ----- - simpleEnsureTestWithUparrow - - [self doSomething. - true ifTrue: [^nil]. - self doSomethingElse] - ensure: - [self doYetAnotherThing]. - ! Item was removed: - ----- Method: ExceptionTester>>simpleRetryUsingTest (in category 'signaledException tests') ----- - simpleRetryUsingTest - - [self doSomething. - MyTestError signal. - self doSomethingElse] - on: MyTestError - do: - [:ex | ex retryUsing: [self doYetAnotherThing]]! Item was removed: - ----- Method: ExceptionTester>>logTest: (in category 'logging') ----- - logTest: aSelector - - self suiteLog add: aSelector! Item was removed: - Error subclass: #MyResumableTestError - instanceVariableNames: '' - classVariableNames: '' - poolDictionaries: '' - category: 'Exceptions-Tests'! Item was removed: - ----- Method: ExceptionTester>>doubleOuterPassTest (in category 'signaledException tests') ----- - doubleOuterPassTest - "uses #resume" - - [[[self doSomething. - MyTestNotification signal. - self doSomethingExceptional] - on: MyTestNotification - do: [:ex | ex outer. - self doSomethingElse]] - on: MyTestNotification - do: [:ex | ex pass. - self doSomethingExceptional]] - on: MyTestNotification - do: [:ex | self doYetAnotherThing. ex resume]! Item was removed: - ----- Method: ExceptionTester>>doubleOuterTest (in category 'signaledException tests') ----- - doubleOuterTest - "uses #resume" - - [[[self doSomething. - MyTestNotification signal. - self doSomethingExceptional] - on: MyTestNotification - do: [:ex | ex outer. - self doSomethingExceptional]] - on: MyTestNotification - do: [:ex | ex outer. - self doSomethingElse]] - on: MyTestNotification - do: [:ex | self doYetAnotherThing. ex resume]! Item was removed: - ----- Method: ExceptionTests>>testSimpleOuter (in category 'testing-ExceptionTester') ----- - testSimpleOuter - self assertSuccess: (ExceptionTester new runTest: #simpleOuterTest ) ! Item was removed: - ----- Method: ExceptionTester>>simpleTimeoutTest (in category 'tests') ----- - simpleTimeoutTest - - | n | - [1 to: 1000000 do: [ :i | n := i. self doSomething ] ] - valueWithin: 50 milliSeconds onTimeout: - [ self iterationsBeforeTimeout: n. - self doSomethingElse ]! |
Free forum by Nabble | Edit this page |