Author: ygrego Date: 2015-02-19 13:53:14 +0000 (Thu, 19 Feb 2015) New Revision: 827 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/827 Log: Make "testInstanceCreation" acceptable to the creation of promise.(See Promise mdn) Modified: oipf/js/test/VideoBroadcastTest.js Modified: oipf/js/test/VideoBroadcastTest.js =================================================================== --- oipf/js/test/VideoBroadcastTest.js 2015-02-19 13:22:19 UTC (rev 826) +++ oipf/js/test/VideoBroadcastTest.js 2015-02-19 13:53:14 UTC (rev 827) @@ -14,18 +14,20 @@ * Descrtiption: * This method test the initialization of video broadcast object. */ - testInstanceCreation: function() { + testInstanceCreation: function(resolve, reject) { var state = "Pending"; console.log("[TEST-RUNNING][Info] Id: vbTestInstanceCreation, Label: Object creation, State: "+state); this.videoBroadcastObject = oipfObjectFactory.createVideoBroadcastObject(); - this.assertNotNull(this.videoBroadcastObject); - this.assertNotUndefined(this.videoBroadcastObject); - - state = "Finished"; - console.log("[TEST-RUNNING][Info] Id: vbTestInstanceCreation, Label: Object creation, State: "+state); - - return true; + if ((this.assertNotNull(this.searchManagerTest) === true) && (this.assertNotUndefined(this.searchManagerTest))) { + state = "Successfull"; + console.log("[TEST-RUNNING][Info] Id: vbTestInstanceCreation, Label: Object creation, State: "+state); + resolve(state); + } else { + state = "Failure"; + console.log("[TEST-RUNNING][Info] Id: vbTestInstanceCreation, Label: Object creation, State: "+state); + reject(new Error(state)); + } }, /*