-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from ba-st/33-Add-time-and-event-notification-…
…modules Added time and event notification modules
- Loading branch information
Showing
19 changed files
with
242 additions
and
21 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
source/Kepler-Notifications-Tests/EventNotificationModuleTest.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
" | ||
An EventNotificationModuleTest is a test class for testing the behavior of EventNotificationModule | ||
" | ||
Class { | ||
#name : #EventNotificationModuleTest, | ||
#superclass : #SystemBasedUserStoryTest, | ||
#category : #'Kepler-Notifications-Tests' | ||
} | ||
|
||
{ #category : #'private - accessing' } | ||
EventNotificationModuleTest >> installedModuleRegistrationSystem [ | ||
|
||
^ rootSystem >> #InstalledModuleRegistrationSystem | ||
] | ||
|
||
{ #category : #'private - configuring' } | ||
EventNotificationModuleTest >> requireEventNotificationModule [ | ||
|
||
self requireInstallationOf: EventNotificationModule | ||
] | ||
|
||
{ #category : #'private - running' } | ||
EventNotificationModuleTest >> setUpRequirements [ | ||
|
||
self requireEventNotificationModule | ||
] | ||
|
||
{ #category : #tests } | ||
EventNotificationModuleTest >> testAccessing [ | ||
|
||
| eventNotificationModule | | ||
|
||
eventNotificationModule := self installedModuleRegistrationSystem | ||
installedModuleRegisteringSystemImplementing: #EventNotificationSystemInterface. | ||
|
||
self | ||
assert: eventNotificationModule name equals: 'Event notification'; | ||
assert: eventNotificationModule systemInterfacesToInstall | ||
equals: #(#EventNotificationSystemInterface) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
source/Kepler-Notifications/EventNotificationModule.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
" | ||
I'm system module installing the event notification system | ||
" | ||
Class { | ||
#name : #EventNotificationModule, | ||
#superclass : #SystemModule, | ||
#instVars : [ | ||
'rootSystem' | ||
], | ||
#category : #'Kepler-Notifications' | ||
} | ||
|
||
{ #category : #'instance creation' } | ||
EventNotificationModule class >> toInstallOn: aCompositeSystem [ | ||
|
||
^ self new initializeToInstallOn: aCompositeSystem | ||
] | ||
|
||
{ #category : #initialization } | ||
EventNotificationModule >> initializeToInstallOn: aCompositeSystem [ | ||
|
||
rootSystem := aCompositeSystem | ||
] | ||
|
||
{ #category : #private } | ||
EventNotificationModule >> name [ | ||
|
||
^ 'Event notification' | ||
] | ||
|
||
{ #category : #private } | ||
EventNotificationModule >> registerEventNotificationSystemForInstallationIn: systems [ | ||
|
||
^ self register: [ EventNotificationSystem new ] in: systems | ||
] | ||
|
||
{ #category : #private } | ||
EventNotificationModule >> rootSystem [ | ||
|
||
^ rootSystem | ||
] | ||
|
||
{ #category : #private } | ||
EventNotificationModule >> systemInterfacesToInstall [ | ||
|
||
^ #(#EventNotificationSystemInterface) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
" | ||
I'm a notifiable event. | ||
The event notification system notifies subscribers that you have received me. | ||
" | ||
Class { | ||
#name : #NotifiableEvent, | ||
#superclass : #Object, | ||
#category : 'Kepler-Notifications' | ||
#category : #'Kepler-Notifications' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
" | ||
A TimeModuleTest is a test class for testing the behavior of TimeModule | ||
" | ||
Class { | ||
#name : #TimeModuleTest, | ||
#superclass : #SystemBasedUserStoryTest, | ||
#category : #'Kepler-Time-Tests' | ||
} | ||
|
||
{ #category : #'private - accessing' } | ||
TimeModuleTest >> installedModuleRegistrationSystem [ | ||
|
||
^ rootSystem >> #InstalledModuleRegistrationSystem | ||
] | ||
|
||
{ #category : #'private - configuring' } | ||
TimeModuleTest >> requireTimeModule [ | ||
|
||
self requireInstallationOf: TimeModule | ||
] | ||
|
||
{ #category : #'private - running' } | ||
TimeModuleTest >> setUpRequirements [ | ||
|
||
self requireTimeModule | ||
] | ||
|
||
{ #category : #tests } | ||
TimeModuleTest >> testAccessing [ | ||
|
||
| eventNotificationModule | | ||
|
||
eventNotificationModule := self installedModuleRegistrationSystem | ||
installedModuleRegisteringSystemImplementing: #TimeSystemInterface. | ||
|
||
self | ||
assert: eventNotificationModule name equals: 'Time'; | ||
assert: eventNotificationModule systemInterfacesToInstall | ||
equals: #(#TimeSystemInterface) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
" | ||
I'm SytemModule. | ||
I'm a system module installing the time system. | ||
" | ||
Class { | ||
#name : #TimeModule, | ||
#superclass : #SystemModule, | ||
#instVars : [ | ||
'rootSystem' | ||
], | ||
#category : #'Kepler-Time' | ||
} | ||
|
||
{ #category : #'instance creation' } | ||
TimeModule class >> toInstallOn: aCompositeSystem [ | ||
|
||
^ self new initializeToInstallOn: aCompositeSystem | ||
] | ||
|
||
{ #category : #initialization } | ||
TimeModule >> initializeToInstallOn: aCompositeSystem [ | ||
|
||
rootSystem := aCompositeSystem | ||
] | ||
|
||
{ #category : #private } | ||
TimeModule >> name [ | ||
|
||
^ 'Time' | ||
] | ||
|
||
{ #category : #private } | ||
TimeModule >> registerTimeSystemForInstallationIn: systems [ | ||
|
||
^ self register: [ TimeSystem using: SystemTimeSource new ] in: systems | ||
] | ||
|
||
{ #category : #private } | ||
TimeModule >> rootSystem [ | ||
|
||
^ rootSystem | ||
] | ||
|
||
{ #category : #private } | ||
TimeModule >> systemInterfacesToInstall [ | ||
|
||
^ #(#TimeSystemInterface) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters