Fabio Niephaus uploaded a new version of SystemChangeNotification-Tests to project The Trunk:
http://source.squeak.org/trunk/SystemChangeNotification-Tests-fn.27.mcz ==================== Summary ==================== Name: SystemChangeNotification-Tests-fn.27 Author: fn Time: 26 February 2018, 2:06:31.146356 pm UUID: e7f994ba-43f9-4288-8a7f-cbab1f93d380 Ancestors: SystemChangeNotification-Tests-pre.26 Rename SystemChangeErrorHandling to SystemChangeErrorHandlingTest. SystemChangeErrorHandlingTest was there before, but empty. I'm assuming something went wrong when someone wanted to rename the class. === text below is ignored === Ancestors: SystemChangeNotification-Tests-pre.26 SystemChangeNotification-Tests-pre.26: Fixes a test case for the system change notifications. D SystemChangeErrorHandling D SystemChangeErrorHandling>>handleEventWithError: D SystemChangeErrorHandling>>handleEventWithHalt: D SystemChangeErrorHandling>>setUp D SystemChangeErrorHandling>>storeEvent1: D SystemChangeErrorHandling>>storeEvent2: D SystemChangeErrorHandling>>storeEvent3: D SystemChangeErrorHandling>>tearDown D SystemChangeErrorHandling>>testErrorOperation D SystemChangeErrorHandling>>testHaltOperation D SystemChangeErrorHandling>>testUnhandledEventOperation M SystemChangeErrorHandlingTest A SystemChangeErrorHandlingTest>>handleEventWithError: A SystemChangeErrorHandlingTest>>handleEventWithHalt: A SystemChangeErrorHandlingTest>>setUp A SystemChangeErrorHandlingTest>>storeEvent1: A SystemChangeErrorHandlingTest>>storeEvent2: A SystemChangeErrorHandlingTest>>storeEvent3: A SystemChangeErrorHandlingTest>>tearDown A SystemChangeErrorHandlingTest>>testErrorOperation A SystemChangeErrorHandlingTest>>testHaltOperation A SystemChangeErrorHandlingTest>>testUnhandledEventOperation =============== Diff against SystemChangeNotification-Tests-pre.26 =============== Item was removed: - SystemChangeTestRoot subclass: #SystemChangeErrorHandling - instanceVariableNames: 'capturedEvents' - classVariableNames: '' - poolDictionaries: '' - category: 'SystemChangeNotification-Tests'! - - !SystemChangeErrorHandling commentStamp: 'bp 12/4/2009 10:37' prior: 0! - This class tests the error handing of the notification mechanism to ensure that one client that receives a system change cannot lock up the complete system.! Item was removed: - ----- Method: SystemChangeErrorHandling>>handleEventWithError: (in category 'Event Notifications') ----- - handleEventWithError: event - - self error: 'Example of event handling code that throws an error.'! Item was removed: - ----- Method: SystemChangeErrorHandling>>handleEventWithHalt: (in category 'Event Notifications') ----- - handleEventWithHalt: event - - self halt: 'Example of event handling code that contains a halt.'! Item was removed: - ----- Method: SystemChangeErrorHandling>>setUp (in category 'Running') ----- - setUp - - super setUp. - capturedEvents := OrderedCollection new! Item was removed: - ----- Method: SystemChangeErrorHandling>>storeEvent1: (in category 'Event Notifications') ----- - storeEvent1: anEvent - - capturedEvents add: anEvent! Item was removed: - ----- Method: SystemChangeErrorHandling>>storeEvent2: (in category 'Event Notifications') ----- - storeEvent2: anEvent - - capturedEvents add: anEvent! Item was removed: - ----- Method: SystemChangeErrorHandling>>storeEvent3: (in category 'Event Notifications') ----- - storeEvent3: anEvent - - capturedEvents add: anEvent! Item was removed: - ----- Method: SystemChangeErrorHandling>>tearDown (in category 'Running') ----- - tearDown - - capturedEvents := nil. - super tearDown! Item was removed: - ----- Method: SystemChangeErrorHandling>>testErrorOperation (in category 'Testing') ----- - testErrorOperation - - | notifier wasCaptured | - notifier := self systemChangeNotifier. - wasCaptured := false. - notifier notify: self ofSystemChangesOfItem: #class change: #Added using: #storeEvent1:. - notifier notify: self ofSystemChangesOfItem: #class change: #Added using: #storeEvent2:. - notifier notify: self ofSystemChangesOfItem: #class change: #Added using: #handleEventWithError:. - notifier notify: self ofSystemChangesOfItem: #class change: #Added using: #storeEvent3:. - [notifier classAdded: self class inCategory: #FooCat] on: Error do: [:exc | - wasCaptured := true. - self assert: (capturedEvents size = 3)]. - self assert: wasCaptured.! Item was removed: - ----- Method: SystemChangeErrorHandling>>testHaltOperation (in category 'Testing') ----- - testHaltOperation - - | notifier wasCaptured | - notifier := self systemChangeNotifier. - wasCaptured := false. - notifier notify: self ofAllSystemChangesUsing: #storeEvent1:. - notifier notify: self ofAllSystemChangesUsing: #storeEvent2:. - notifier notify: self ofAllSystemChangesUsing: #handleEventWithHalt:. - notifier notify: self ofAllSystemChangesUsing: #storeEvent3:. - [notifier classAdded: self class inCategory: #FooCat] on: Halt do: [:exc | - wasCaptured := true. - self assert: (capturedEvents size = 3)]. - self assert: wasCaptured.! Item was removed: - ----- Method: SystemChangeErrorHandling>>testUnhandledEventOperation (in category 'Testing') ----- - testUnhandledEventOperation - - | notifier wasCaptured | - notifier := self systemChangeNotifier. - wasCaptured := false. - notifier notify: self ofSystemChangesOfItem: #class change: #Added using: #storeEvent1:. - notifier notify: self ofSystemChangesOfItem: #class change: #Added using: #storeEvent2:. - notifier notify: self ofSystemChangesOfItem: #class change: #Added using: #zork:. - notifier notify: self ofSystemChangesOfItem: #class change: #Added using: #storeEvent3:. - [notifier classAdded: self class inCategory: #FooCat] on: MessageNotUnderstood do: [:exc | - wasCaptured := true. - self assert: (capturedEvents size = 3)]. - self assert: wasCaptured.! Item was changed: SystemChangeTestRoot subclass: #SystemChangeErrorHandlingTest instanceVariableNames: 'capturedEvents' classVariableNames: '' poolDictionaries: '' category: 'SystemChangeNotification-Tests'! + + !SystemChangeErrorHandlingTest commentStamp: 'bp 12/4/2009 10:37' prior: 0! + This class tests the error handing of the notification mechanism to ensure that one client that receives a system change cannot lock up the complete system.! Item was added: + ----- Method: SystemChangeErrorHandlingTest>>handleEventWithError: (in category 'Event Notifications') ----- + handleEventWithError: event + + self error: 'Example of event handling code that throws an error.'! Item was added: + ----- Method: SystemChangeErrorHandlingTest>>handleEventWithHalt: (in category 'Event Notifications') ----- + handleEventWithHalt: event + + self halt: 'Example of event handling code that contains a halt.'! Item was added: + ----- Method: SystemChangeErrorHandlingTest>>setUp (in category 'Running') ----- + setUp + + super setUp. + capturedEvents := OrderedCollection new! Item was added: + ----- Method: SystemChangeErrorHandlingTest>>storeEvent1: (in category 'Event Notifications') ----- + storeEvent1: anEvent + + capturedEvents add: anEvent! Item was added: + ----- Method: SystemChangeErrorHandlingTest>>storeEvent2: (in category 'Event Notifications') ----- + storeEvent2: anEvent + + capturedEvents add: anEvent! Item was added: + ----- Method: SystemChangeErrorHandlingTest>>storeEvent3: (in category 'Event Notifications') ----- + storeEvent3: anEvent + + capturedEvents add: anEvent! Item was added: + ----- Method: SystemChangeErrorHandlingTest>>tearDown (in category 'Running') ----- + tearDown + + capturedEvents := nil. + super tearDown! Item was added: + ----- Method: SystemChangeErrorHandlingTest>>testErrorOperation (in category 'Testing') ----- + testErrorOperation + + | notifier wasCaptured | + notifier := self systemChangeNotifier. + wasCaptured := false. + notifier notify: self ofSystemChangesOfItem: #class change: #Added using: #storeEvent1:. + notifier notify: self ofSystemChangesOfItem: #class change: #Added using: #storeEvent2:. + notifier notify: self ofSystemChangesOfItem: #class change: #Added using: #handleEventWithError:. + notifier notify: self ofSystemChangesOfItem: #class change: #Added using: #storeEvent3:. + [notifier classAdded: self class inCategory: #FooCat] on: Error do: [:exc | + wasCaptured := true. + self assert: (capturedEvents size = 3)]. + self assert: wasCaptured.! Item was added: + ----- Method: SystemChangeErrorHandlingTest>>testHaltOperation (in category 'Testing') ----- + testHaltOperation + + | notifier wasCaptured | + notifier := self systemChangeNotifier. + wasCaptured := false. + notifier notify: self ofAllSystemChangesUsing: #storeEvent1:. + notifier notify: self ofAllSystemChangesUsing: #storeEvent2:. + notifier notify: self ofAllSystemChangesUsing: #handleEventWithHalt:. + notifier notify: self ofAllSystemChangesUsing: #storeEvent3:. + [notifier classAdded: self class inCategory: #FooCat] on: Halt do: [:exc | + wasCaptured := true. + self assert: (capturedEvents size = 3)]. + self assert: wasCaptured.! Item was added: + ----- Method: SystemChangeErrorHandlingTest>>testUnhandledEventOperation (in category 'Testing') ----- + testUnhandledEventOperation + + | notifier wasCaptured | + notifier := self systemChangeNotifier. + wasCaptured := false. + notifier notify: self ofSystemChangesOfItem: #class change: #Added using: #storeEvent1:. + notifier notify: self ofSystemChangesOfItem: #class change: #Added using: #storeEvent2:. + notifier notify: self ofSystemChangesOfItem: #class change: #Added using: #zork:. + notifier notify: self ofSystemChangesOfItem: #class change: #Added using: #storeEvent3:. + [notifier classAdded: self class inCategory: #FooCat] on: MessageNotUnderstood do: [:exc | + wasCaptured := true. + self assert: (capturedEvents size = 3)]. + self assert: wasCaptured.! |
Free forum by Nabble | Edit this page |