Metadata
- Source
- FLUID-5496
- Type
- Improvement
- Priority
- Major
- Status
- Closed
- Resolution
- Fixed
- Assignee
- Antranig Basman
- Reporter
- Antranig Basman
- Created
2014-08-19T11:55:45.550-0400 - Updated
2015-06-26T10:11:56.500-0400 - Versions
-
- 1.5
- Fixed Versions
-
- 1.9
- Component
-
- IoC System
- Testing Infrastructure
Description
The IoC Testing framework seems to have been designed before "listener boiling" was a commonplace feature of the IoC framework itself. As a result, it has a peculiar syntax for supplying varying arguments to "event" fixtures, involving the "listenerMaker" and "makerArgs" values. For example, from the metadata component's tests, we have the following:
gpii.tests.bindDialog.makeEventChecker = function (eventName) {
return function () {
jqUnit.assert("The " + eventName + " event was fired.");
};
};
with a fixture entry
{
listenerMaker: "gpii.tests.bindDialog.makeEventChecker",
makerArgs: ["onBindDialogHandlers"],
event: "{bindDialog}.events.onBindDialogHandlers"
}
There's no good reason for this unusual record naming, as well as the redundant level of "return function () {}" in the fixture entry - this should instead be
gpii.tests.bindDialog.checkEvent = function (eventName) {
jqUnit.assert("The " + eventName + " event was fired.");
};
with
{
event: "{bindDialog}.events.onBindDialogHandlers"
listener: "gpii.tests.bindDialog.checkEvent",
args: "onBindDialogHandlers"
}
Comments
-
Antranig Basman commented
2014-11-20T19:02:27.214-0500 Merged into trunk at revision https://github.com/fluid-project/infusion/commit/d591ebe6e5f2475dffda1ffbdd12d4247de9de09 Aug 22 2014
-
Justin Obara commented
2015-06-26T09:51:21.129-0400 Reopening to change the fix version to 1.9