Author: ygrego Date: 2015-02-19 14:41:17 +0000 (Thu, 19 Feb 2015) New Revision: 830 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/830 Log: The method "testGetCurrentProgram" have been modified to use it in the creation of a promise object. Modified: oipf/js/test/VideoBroadcastTest.js Modified: oipf/js/test/VideoBroadcastTest.js =================================================================== --- oipf/js/test/VideoBroadcastTest.js 2015-02-19 14:13:39 UTC (rev 829) +++ oipf/js/test/VideoBroadcastTest.js 2015-02-19 14:41:17 UTC (rev 830) @@ -15,15 +15,14 @@ * This method test the initialization of video broadcast object. */ testInstanceCreation: function(resolve, reject) { - var state = "Pending"; - console.log("[TEST-RUNNING][Info] Id: vbTestInstanceCreation, Label: Object creation, State: "+state); + console.log("[TEST-RUNNING][Info] Id: vbTestInstanceCreation, Label: Object creation, State: Pending"); this.videoBroadcastObject = oipfObjectFactory.createVideoBroadcastObject(); - if ((this.assertNotNull(this.videoBroadcastObject)) && (this.assertNotUndefined(this.videoBroadcastObject))) { - console.log("[TEST-RUNNING][Info] Id: vbTestInstanceCreation, Label: Object creation, State: "+state); + if (this.assertNotNull(this.videoBroadcastObject) && this.assertNotUndefined(this.videoBroadcastObject)) { + console.log("[TEST-RUNNING][Info] Id: vbTestInstanceCreation, Label: Object creation, State: Successfull"); resolve("Successfull"); } else { - console.log("[TEST-RUNNING][Info] Id: vbTestInstanceCreation, Label: Object creation, State: "+state); + console.log("[TEST-RUNNING][Info] Id: vbTestInstanceCreation, Label: Object creation, State: Failure"); reject("Failure"); } }, @@ -32,17 +31,17 @@ * Descrtiption: * This method test the binding between the video broadcast object and the current program stream. */ - testBindToCurrentChannel: function() { - var state = "Pending"; - console.log("[TEST-RUNNING][Info] Id: vbTestBindToCurrentChannel, Label: Bind the current channel stream with a video broadcast objectBind the current channel stream with a video broadcast object, State: "+state); + testBindToCurrentChannel: function(resolve, reject) { + console.log("[TEST-RUNNING][Info] Id: vbTestBindToCurrentChannel, Label: Bind the current channel stream with a video broadcast objectBind the current channel stream with a video broadcast object, State: Pending"); var currentChann = this.videoBroadcastObject.bindToCurrentChannel(); - - this.assertEquals(this.videoBroadcastObject.currentChannel, currentChann); - - state = "Finished"; - console.log("[TEST-RUNNING][Info] Id: vbTestBindToCurrentChannel, Label: Bind the current channel stream with a video broadcast objectBind the current channel stream with a video broadcast object, State: "+state); - - return true; + + if (this.assertEquals(this.videoBroadcastObject.currentChannel, currentChann)) { + console.log("[TEST-RUNNING][Info] Id: vbTestBindToCurrentChannel, Label: Bind the current channel stream with a video broadcast objectBind the current channel stream with a video broadcast object, State: Successfull"); + resolve("Successfull"); + } else { + console.log("[TEST-RUNNING][Info] Id: vbTestBindToCurrentChannel, Label: Bind the current channel stream with a video broadcast objectBind the current channel stream with a video broadcast object, State: Failure"); + reject("Failure"); + } } }); \ No newline at end of file