Author: ygrego Date: 2015-04-21 15:46:59 +0000 (Tue, 21 Apr 2015) New Revision: 1241 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1241 Log: Deletion of properties "timerManager", "timeout" because there are inherited from "TestCase". The current timer is cleared in method "afterTest". Modified: oipf/js/test/SearchManagerTest.js oipf/js/test/VideoBroadcastTest.js Modified: oipf/js/test/SearchManagerTest.js =================================================================== --- oipf/js/test/SearchManagerTest.js 2015-04-21 15:37:53 UTC (rev 1240) +++ oipf/js/test/SearchManagerTest.js 2015-04-21 15:46:59 UTC (rev 1241) @@ -20,9 +20,7 @@ searchManagerObj: null, init: function () { - this.timerManager = new TimerManager(); - this.timeout = this.timerManager.createTimer.bind(this.timerManager); - }, + }, beforeTest: function(resolve, reject) { this.searchManagerObj = oipfObjectFactory.createSearchManagerObject(); @@ -86,6 +84,7 @@ this.onPlayStateChange); this.searchManagerObj.removeEventListener("MetadataSearch", this.onPlayStateChange); + this.timerManager.clearTimer(); }, testGetCurrentProgrammeFromStream: function (resolve, reject) { @@ -148,11 +147,11 @@ testSearchingForASpecificProgrammeByName: function(resolve, reject) { var self = this; - var value = "Des dinos sous la glace"; + var value = "X:ENIUS"; - this.addTransition(this.UNREALIZED, this.CONNECTING); +// this.addTransition(this.UNREALIZED, this.CONNECTING); - this.addTransition(this.CONNECTING, this.PRESENTING, function() { +// this.addTransition(this.CONNECTING, this.PRESENTING, function() { var stat = "Pending"; logTest("State: " + stat); @@ -168,7 +167,7 @@ metadataSearch.result.getResults(offset, count); // //Must return undefined else wrong implementation of getResults method // console.log(metaDataSearch.result[0]); - }); +// }); this.searchManagerObj.onMetadataSearch = function(search, state) { @@ -206,7 +205,7 @@ } }; - this.vidBroadObj.bindToCurrentChannel(); +// this.vidBroadObj.bindToCurrentChannel(); }, @@ -647,7 +646,69 @@ reject(); } + }, + + testProgrammePropertiesImplementationState: function() { + var self = this; + var value = "X:ENIUS"; + + this.addTransition(this.UNREALIZED, this.CONNECTING); + + this.addTransition(this.CONNECTING, this.PRESENTING, function() { + + var stat = "Pending"; + logTest("State: " + stat); + var metadataSearch = self.searchManagerObj. + createSearch(self.SCHEDULED_CONTENT); + + var query = metadataSearch.createQuery("Programme.name", 0, + value); + metadataSearch.setQuery(query); + + var offset = 0; + var count = 1; + metadataSearch.result.getResults(offset, count); +// //Must return undefined else wrong implementation of getResults method +// console.log(metaDataSearch.result[0]); + }); + + this.searchManagerObj.onMetadataSearch = function(search, state) { + + console.log("[INFO]: onMetadataSearch called"); + + switch (state) { + + case 0: + if (self.assertNotNull(search.result[0]) && + self.assertEquals(search.result[0].name, value)) { + console.log("[TEST-RUNNING][Info] Label: Obtain current program according to oipf norm, State: found"); + resolve(); + } else { + console.log("[TEST-RUNNING][Info] Label: Obtain current program according to oipf norm, State: not found"); + reject(); + } + break; + + case 3: + var message = "[INFO] MetadataSearch in Idle state because of either search abort or parameters have been modified (query, constraints or search target)"; + console.log(message); + reject(); + break; + + case 4: + message = "[INFO] The search cannot be complete because of lack of ressources or any other reason."; + console.log(message); + reject(); + break; + + default: + console.log("Unknow state"); + reject(); + + } + }; + + this.vidBroadObj.bindToCurrentChannel(); } - }); \ No newline at end of file Modified: oipf/js/test/VideoBroadcastTest.js =================================================================== --- oipf/js/test/VideoBroadcastTest.js 2015-04-21 15:37:53 UTC (rev 1240) +++ oipf/js/test/VideoBroadcastTest.js 2015-04-21 15:46:59 UTC (rev 1241) @@ -47,14 +47,13 @@ this.previousState = this.vidBroadObj.playState; this.currentIndex = 0; this.channel = null; - this.timerManager = new TimerManager(); - this.timeout = this.timerManager.createTimer.bind(this.timerManager); logTest("State: Pending"); }, afterTest: function() { // this.vidBroadObj.release(); //Useful for test on tv plateform this.vidBroadObj.removeEventListener("PlayStateChange", this.onPlayStateChange); + this.timerManager.clearTimer(); }, getChannel: function(channelCollection){
participants (1)
-
ygregoï¼ users.nuiton.org