Skip to content

Commit ac6ad67

Browse files
committed
Changed notes to notification
1 parent 964f5e9 commit ac6ad67

File tree

12 files changed

+94
-94
lines changed

12 files changed

+94
-94
lines changed

test/bin/puremvc-typescript-multicore-1.0-unit-tests.js

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,21 @@ if( typeof define === "function" )
7474
var controller = puremvc.Controller.getInstance('ControllerTestKey2');
7575
controller.registerCommand('ControllerTest', test.ControllerTestCommand);
7676
var vo = new test.ControllerTestVO(12);
77-
var note = new puremvc.Notification('ControllerTest', vo);
78-
controller.executeCommand(note);
77+
var notification = new puremvc.Notification('ControllerTest', vo);
78+
controller.executeCommand(notification);
7979
YUITest.Assert.areEqual(24, vo.result, "Expecting vo.result == 24");
8080
puremvc.Controller.removeController('ControllerTestKey2');
8181
};
8282
ControllerTest.prototype.testRegisterAndRemoveCommand = function () {
8383
var controller = puremvc.Controller.getInstance('ControllerTestKey3');
8484
controller.registerCommand('ControllerRemoveTest', test.ControllerTestCommand);
8585
var vo = new test.ControllerTestVO(12);
86-
var note = new puremvc.Notification('ControllerRemoveTest', vo);
87-
controller.executeCommand(note);
86+
var notification = new puremvc.Notification('ControllerRemoveTest', vo);
87+
controller.executeCommand(notification);
8888
YUITest.Assert.areEqual(24, vo.result, "Expecting vo.result == 24");
8989
vo.result = 0;
9090
controller.removeCommand('ControllerRemoveTest');
91-
controller.executeCommand(note);
91+
controller.executeCommand(notification);
9292
YUITest.Assert.areEqual(0, vo.result, "Expecting vo.result == 0");
9393
puremvc.Controller.removeController('ControllerTestKey3');
9494
};
@@ -106,11 +106,11 @@ if( typeof define === "function" )
106106
controller.removeCommand('ControllerTest2');
107107
controller.registerCommand('ControllerTest2', test.ControllerTestCommand2);
108108
var vo = new test.ControllerTestVO(12);
109-
var note = new puremvc.Notification('ControllerTest2', vo);
109+
var notification = new puremvc.Notification('ControllerTest2', vo);
110110
var view = puremvc.View.getInstance('ControllerTestKey5');
111-
view.notifyObservers(note);
111+
view.notifyObservers(notification);
112112
YUITest.Assert.areEqual(24, vo.result, "Expecting vo.result == 24");
113-
view.notifyObservers(note);
113+
view.notifyObservers(notification);
114114
YUITest.Assert.areEqual(48, vo.result, "Expecting vo.result == 48");
115115
puremvc.Controller.removeController('ControllerTestKey5');
116116
};
@@ -400,8 +400,8 @@ if( typeof define === "function" )
400400
var view = puremvc.View.getInstance('ViewTestKey2');
401401
var observer = new puremvc.Observer(this.viewTestMethod, this);
402402
view.registerObserver(test.ViewTestNote.NAME, observer);
403-
var note = test.ViewTestNote.create(10);
404-
view.notifyObservers(note);
403+
var notification = test.ViewTestNote.create(10);
404+
view.notifyObservers(notification);
405405
YUITest.Assert.areEqual(10, this.viewTestVar, "Expecting viewTestVar = 10");
406406
puremvc.View.removeView('ViewTestKey2');
407407
};
@@ -578,8 +578,8 @@ if( typeof define === "function" )
578578
_super.apply(this, arguments);
579579

580580
}
581-
MacroCommandTestSub1Command.prototype.execute = function (note) {
582-
var vo = note.getBody();
581+
MacroCommandTestSub1Command.prototype.execute = function (notification) {
582+
var vo = notification.getBody();
583583
vo.result1 = 2 * vo.input;
584584
};
585585
return MacroCommandTestSub1Command;
@@ -637,9 +637,9 @@ if( typeof define === "function" )
637637
};
638638
MacroCommandTest.prototype.testMacroCommandExecute = function () {
639639
var vo = new test.MacroCommandTestVO(5);
640-
var note = new puremvc.Notification('MacroCommandTest', vo);
640+
var notification = new puremvc.Notification('MacroCommandTest', vo);
641641
var command = new test.MacroCommandTestCommand();
642-
command.execute(note);
642+
command.execute(notification);
643643
YUITest.Assert.areEqual(10, vo.result1, "Expecting vo.result1 == 10");
644644
YUITest.Assert.areEqual(25, vo.result2, "Expecting vo.result2 == 25");
645645
};
@@ -711,9 +711,9 @@ if( typeof define === "function" )
711711
};
712712
SimpleCommandTest.prototype.testSimpleCommandExecute = function () {
713713
var vo = new test.SimpleCommandTestVO(5);
714-
var note = new puremvc.Notification('SimpleCommandTestNote', vo);
714+
var notification = new puremvc.Notification('SimpleCommandTestNote', vo);
715715
var command = new test.SimpleCommandTestCommand();
716-
command.execute(note);
716+
command.execute(notification);
717717
YUITest.Assert.areEqual(10, vo.result, "Expecting vo.result == 10");
718718
};
719719
return SimpleCommandTest;
@@ -904,28 +904,28 @@ if( typeof define === "function" )
904904
this.name = "PureMVC Notification class tests";
905905
}
906906
NotificationTest.prototype.testNameAccessors = function () {
907-
var note = new puremvc.Notification('TestNote');
908-
YUITest.Assert.areEqual('TestNote', note.getName(), "Expecting note.getName() == 'TestNote'");
907+
var notification = new puremvc.Notification('TestNote');
908+
YUITest.Assert.areEqual('TestNote', notification.getName(), "Expecting notification.getName() == 'TestNote'");
909909
};
910910
NotificationTest.prototype.testBodyAccessors = function () {
911-
var note = new puremvc.Notification(null);
912-
note.setBody(5);
913-
YUITest.Assert.areSame(5, note.getBody(), "Expecting note.getBody() === 5");
911+
var notification = new puremvc.Notification(null);
912+
notification.setBody(5);
913+
YUITest.Assert.areSame(5, notification.getBody(), "Expecting notification.getBody() === 5");
914914
};
915915
NotificationTest.prototype.testConstructor = function () {
916-
var note = new puremvc.Notification('TestNote', 5, 'TestNoteType');
917-
YUITest.Assert.areEqual("TestNote", note.getName(), "Expecting note.getName() == 'TestNote'");
918-
YUITest.Assert.areSame(5, note.getBody(), "Expecting note.getBody() === 5");
919-
YUITest.Assert.areEqual("TestNoteType", note.getType(), "Expecting note.getType() == 'TestNoteType'");
916+
var notification = new puremvc.Notification('TestNote', 5, 'TestNoteType');
917+
YUITest.Assert.areEqual("TestNote", notification.getName(), "Expecting notification.getName() == 'TestNote'");
918+
YUITest.Assert.areSame(5, notification.getBody(), "Expecting notification.getBody() === 5");
919+
YUITest.Assert.areEqual("TestNoteType", notification.getType(), "Expecting notification.getType() == 'TestNoteType'");
920920
};
921921
NotificationTest.prototype.testToString = function () {
922-
var note = new puremvc.Notification('TestNote', [
922+
var notification = new puremvc.Notification('TestNote', [
923923
1,
924924
3,
925925
5
926926
], 'TestType');
927927
var ts = "Notification Name: TestNote\nBody:1,3,5\nType:TestType";
928-
YUITest.Assert.areEqual(ts, note.toString(), "Expecting note.testToString() == '" + ts + "'");
928+
YUITest.Assert.areEqual(ts, notification.toString(), "Expecting notification.testToString() == '" + ts + "'");
929929
};
930930
return NotificationTest;
931931
})();
@@ -1017,14 +1017,14 @@ if( typeof define === "function" )
10171017
var observer = new puremvc.Observer(null, null);
10181018
observer.setNotifyContext(this);
10191019
observer.setNotifyMethod(this.observerTestMethod);
1020-
var note = new puremvc.Notification('ObserverTestNote', 10);
1021-
observer.notifyObserver(note);
1020+
var notification = new puremvc.Notification('ObserverTestNote', 10);
1021+
observer.notifyObserver(notification);
10221022
YUITest.Assert.areSame(10, this.observerTestVar, "Expecting observerTestVar === 10");
10231023
};
10241024
ObserverTest.prototype.testObserverConstructor = function () {
10251025
var observer = new puremvc.Observer(this.observerTestMethod, this);
1026-
var note = new puremvc.Notification('ObserverTestNote', 5);
1027-
observer.notifyObserver(note);
1026+
var notification = new puremvc.Notification('ObserverTestNote', 5);
1027+
observer.notifyObserver(notification);
10281028
YUITest.Assert.areSame(5, this.observerTestVar, "Expecting observerTestVar === 5");
10291029
};
10301030
ObserverTest.prototype.testCompareNotifyContext = function () {

test/src/org/puremvc/typescript/multicore/core/ControllerTest.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,18 @@ module test
5858
*/
5959
testRegisterAndExecuteCommand():void
6060
{
61-
// Create the controller, register the ControllerTestCommand to handle 'ControllerTest' notes
61+
// Create the controller, register the ControllerTestCommand to handle 'ControllerTest' notifications
6262
var controller:puremvc.IController = puremvc.Controller.getInstance('ControllerTestKey2');
6363
controller.registerCommand( 'ControllerTest', ControllerTestCommand );
6464

65-
// Create a 'ControllerTest' note
65+
// Create a 'ControllerTest' notification
6666
var vo:ControllerTestVO = new ControllerTestVO(12);
67-
var note:puremvc.INotification = new puremvc.Notification( 'ControllerTest', vo );
67+
var notification:puremvc.INotification = new puremvc.Notification( 'ControllerTest', vo );
6868

69-
// Tell the controller to execute the Command associated with the note
69+
// Tell the controller to execute the Command associated with the notification
7070
// the ControllerTestCommand invoked will multiply the vo.input value
7171
// by 2 and set the result on vo.result
72-
controller.executeCommand(note);
72+
controller.executeCommand(notification);
7373

7474
// test assertions
7575
YUITest.Assert.areEqual
@@ -90,18 +90,18 @@ module test
9090
*/
9191
testRegisterAndRemoveCommand():void
9292
{
93-
// Create the controller, register the ControllerTestCommand to handle 'ControllerTest' notes
93+
// Create the controller, register the ControllerTestCommand to handle 'ControllerTest' notifications
9494
var controller:puremvc.IController = puremvc.Controller.getInstance('ControllerTestKey3');
9595
controller.registerCommand( 'ControllerRemoveTest', ControllerTestCommand );
9696

97-
// Create a 'ControllerTest' note
97+
// Create a 'ControllerTest' notification
9898
var vo:ControllerTestVO = new ControllerTestVO(12) ;
99-
var note:puremvc.INotification = new puremvc.Notification( 'ControllerRemoveTest', vo );
99+
var notification:puremvc.INotification = new puremvc.Notification( 'ControllerRemoveTest', vo );
100100

101-
// Tell the controller to execute the Command associated with the note
101+
// Tell the controller to execute the Command associated with the notification
102102
// the ControllerTestCommand invoked will multiply the vo.input value
103103
// by 2 and set the result on vo.result
104-
controller.executeCommand(note);
104+
controller.executeCommand(notification);
105105

106106
// test assertions
107107
YUITest.Assert.areEqual
@@ -118,9 +118,9 @@ module test
118118
controller.removeCommand('ControllerRemoveTest');
119119

120120
// Tell the controller to execute the Command associated with the
121-
// note. This time, it should not be registered, and our vo result
121+
// notification. This time, it should not be registered, and our vo result
122122
// will not change
123-
controller.executeCommand(note);
123+
controller.executeCommand(notification);
124124

125125
// test assertions
126126
YUITest.Assert.areEqual
@@ -138,7 +138,7 @@ module test
138138
*/
139139
testHasCommand():void
140140
{
141-
// register the ControllerTestCommand to handle 'hasCommandTest' notes
141+
// register the ControllerTestCommand to handle 'hasCommandTest' notifications
142142
var controller:puremvc.IController = puremvc.Controller.getInstance('ControllerTestKey4');
143143
controller.registerCommand( 'hasCommandTest', ControllerTestCommand );
144144

@@ -172,7 +172,7 @@ module test
172172
*/
173173
testReregisterAndExecuteCommand():void
174174
{
175-
// Fetch the controller, register the ControllerTestCommand2 to handle 'ControllerTest2' notes
175+
// Fetch the controller, register the ControllerTestCommand2 to handle 'ControllerTest2' notifications
176176
var controller:puremvc.IController = puremvc.Controller.getInstance('ControllerTestKey5');
177177
controller.registerCommand( 'ControllerTest2', ControllerTestCommand2 );
178178

@@ -182,15 +182,15 @@ module test
182182
// Re-register the Command with the Controller
183183
controller.registerCommand( 'ControllerTest2', ControllerTestCommand2 );
184184

185-
// Create a 'ControllerTest2' note
185+
// Create a 'ControllerTest2' notification
186186
var vo:ControllerTestVO = new ControllerTestVO( 12 );
187-
var note:puremvc.INotification = new puremvc.Notification( 'ControllerTest2', vo );
187+
var notification:puremvc.INotification = new puremvc.Notification( 'ControllerTest2', vo );
188188

189189
// retrieve a reference to the View.
190190
var view:puremvc.IView = puremvc.View.getInstance('ControllerTestKey5');
191191

192192
// send the Notification
193-
view.notifyObservers(note);
193+
view.notifyObservers(notification);
194194

195195
// test assertions
196196
// if the command is executed once the value will be 24
@@ -202,7 +202,7 @@ module test
202202
);
203203

204204
// Prove that accumulation works in the VO by sending the notification again
205-
view.notifyObservers(note);
205+
view.notifyObservers(notification);
206206

207207
// if the command is executed twice the value will be 48
208208
YUITest.Assert.areEqual

test/src/org/puremvc/typescript/multicore/core/ControllerTestCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module test
1717
* Fabricate a result by multiplying the input by 2.
1818
*
1919
* @param notification
20-
* The note carrying the ControllerTestVO
20+
* The notification carrying the ControllerTestVO
2121
*/
2222
execute( notification:puremvc.INotification )
2323
{

test/src/org/puremvc/typescript/multicore/core/ControllerTestCommand2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module test
2020
* once.
2121
*
2222
* @param notification
23-
* The note carrying the ControllerTestVO.
23+
* The notification carrying the ControllerTestVO.
2424
*/
2525
execute( notification:puremvc.INotification )
2626
{

test/src/org/puremvc/typescript/multicore/core/ViewTest.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ module test
110110
// and the notification method is viewTestMethod,
111111
// successful notification will result in our local
112112
// viewTestVar being set to the value we pass in
113-
// on the note body.
114-
var note:puremvc.INotification = ViewTestNote.create(10);
115-
view.notifyObservers(note);
113+
// on the notification body.
114+
var notification:puremvc.INotification = ViewTestNote.create(10);
115+
view.notifyObservers(notification);
116116

117117
// test assertions
118118
YUITest.Assert.areEqual
@@ -129,7 +129,7 @@ module test
129129
* A utility method to test the notification of Observers by the view.
130130
*
131131
* @param notification
132-
* The note to test.
132+
* The notification to test.
133133
*/
134134
viewTestMethod( notification:puremvc.INotification )
135135
{

test/src/org/puremvc/typescript/multicore/core/ViewTestNote.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module test
3434
* Factory method.
3535
*
3636
* This method creates new instances of the ViewTestNote class,
37-
* automatically setting the note name so you don't have to. Use
37+
* automatically setting the notification name so you don't have to. Use
3838
* this as an alternative to the constructor.
3939
*
4040
* @param body

test/src/org/puremvc/typescript/multicore/patterns/command/MacroCommandTest.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ module test
6767
// Create the VO
6868
var vo:MacroCommandTestVO = new MacroCommandTestVO(5);
6969

70-
// Create the Notification (note)
71-
var note:puremvc.INotification = new puremvc.Notification( 'MacroCommandTest', vo );
70+
// Create the Notification (notification)
71+
var notification:puremvc.INotification = new puremvc.Notification( 'MacroCommandTest', vo );
7272

7373
// Create the MacroCommand
7474
var command:puremvc.ICommand = new MacroCommandTestCommand();
7575

7676
// Execute the MacroCommand
77-
command.execute(note);
77+
command.execute(notification);
7878

7979
// test assertions
8080
YUITest.Assert.areEqual

test/src/org/puremvc/typescript/multicore/patterns/command/MacroCommandTestSub1Command.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ module test
1616
/**
1717
* Fabricate a result by multiplying the input by 2.
1818
*
19-
* @param note
19+
* @param notification
2020
* The <code>Notification</code> carrying the <code>MacroCommandTestVO</code>.
2121
*/
22-
execute( note:puremvc.INotification )
22+
execute( notification:puremvc.INotification )
2323
{
24-
var vo:MacroCommandTestVO = note.getBody();
24+
var vo:MacroCommandTestVO = notification.getBody();
2525

2626
// Fabricate a result
2727
vo.result1 = 2 * vo.input;

test/src/org/puremvc/typescript/multicore/patterns/command/SimpleCommandTest.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module test
4444
* This test creates a new <code>Notification</code>, adding a
4545
* <code>SimpleCommandTestVO</code> as the body. It then creates a
4646
* <code>SimpleCommandTestCommand</code> and invokes its <code>execute</code> method,
47-
* passing in the note.
47+
* passing in the notification.
4848
*
4949
* Success is determined by evaluating a property on the object that was passed on the
5050
* <code>Notification</code> body, which will be modified by the SimpleCommand.
@@ -54,14 +54,14 @@ module test
5454
// Create the VO
5555
var vo:SimpleCommandTestVO = new SimpleCommandTestVO(5);
5656

57-
// Create the Notification (note)
58-
var note:puremvc.INotification = new puremvc.Notification( 'SimpleCommandTestNote', vo );
57+
// Create the Notification (notification)
58+
var notification:puremvc.INotification = new puremvc.Notification( 'SimpleCommandTestNote', vo );
5959

6060
// Create the SimpleCommand
6161
var command:puremvc.ICommand = new SimpleCommandTestCommand();
6262

6363
// Execute the SimpleCommand
64-
command.execute(note);
64+
command.execute(notification);
6565

6666
// test assertions
6767
YUITest.Assert.areEqual

test/src/org/puremvc/typescript/multicore/patterns/facade/FacadeTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ module test
292292
*/
293293
testHasCommand():void
294294
{
295-
// register the ControllerTestCommand to handle 'hasCommandTest' notes
295+
// register the ControllerTestCommand to handle 'hasCommandTest' notifications
296296
var facade:puremvc.IFacade = puremvc.Facade.getInstance('FacadeTestKey10');
297297
facade.registerCommand( 'facadeHasCommandTest', FacadeTestCommand );
298298

0 commit comments

Comments
 (0)