Author: ygrego Date: 2015-05-20 14:59:01 +0000 (Wed, 20 May 2015) New Revision: 1418 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1418 Log: Deletion of files "newjavascript" and "test". Removed: oipf/js/test/newjavascript.js oipf/js/test/test.js Deleted: oipf/js/test/newjavascript.js =================================================================== --- oipf/js/test/newjavascript.js 2015-05-20 14:56:19 UTC (rev 1417) +++ oipf/js/test/newjavascript.js 2015-05-20 14:59:01 UTC (rev 1418) @@ -1,58 +0,0 @@ -/* - * To change license header, choose License Headers in Project Properties. - * To change template file, choose Tools | Templates - * and open the template in the editor. - */ -var SCHEDULED = 7; -var STARTED = 1; -var BEFORE_STARTED = 9; -var COMPLETED = 2; -var transitions = []; -var currentIndex; -var vidBroadObj = oipfObjectFactory.createVideoBroadcastObject(); -var recordingSchedulerObject = - oipfObjectFactory.createRecordingSchedulerObject(); -var previousState; - -function addTransitionWithError(begin, end, error, callback) { - transitions.push({ - begin: begin, - end: end, - error: error, - callback: callback - }); -}; - -function addTransition(begin, end, callback) { - addTransitionWithError(begin, end, null, callback); -}; - -recordingSchedulerObject.onPVREvent = function(newState, recordings) { - if (currentIndex < transitions.length) { - console.log("PVREvent received: State:", newState); - var currentTransition = transitions[currentIndex]; - var begin = currentTransition.begin; - var end = currentTransition.end; - - if (begin == previousState && end == newState) { - currentTransition.callback && currentTransition.callback(); - previousState = newState; - currentIndex++; - } else { - reject("Invalid state."); - } - } else { - console.log("Any others transitions have been set."); - } -}; - -addTransition(null, SCHEDULED); -addTransition(SCHEDULED, BEFORE_STARTED); -addTransition(BEFORE_STARTED, STARTED); -addTransition(STARTED, COMPLETED); -var channel = vidBroadObj.currentChannel; -var currentTime = Math.round(Date.now()/1000); -recording = recordingSchedulerObject.recordAt(currentTime, - 1*60, 0x00, channel.ccid); -console.log(recording); - Deleted: oipf/js/test/test.js =================================================================== --- oipf/js/test/test.js 2015-05-20 14:56:19 UTC (rev 1417) +++ oipf/js/test/test.js 2015-05-20 14:59:01 UTC (rev 1418) @@ -1,141 +0,0 @@ -function testCreatingVidBroadObj(){ - console.log("[TEST-RUNNING][Info] Creating of video/brodacast oipf object."); - - videoBroadcastObject=oipfObjectFactory.createVideoBroadcastObject(); - console.assert(videoBroadcastObject!=null,"The object video/broadcast is null."); - - console.log("[TEST-RUNNING][Result] Creating of video/brodacast oipf object [SUCESSFULL]."); -} - -function testCreatingSearchManagerObj(){ - - console.log("[TEST-RUNNING][Info] Creating of searchManager oipf object."); - - searchManagerObject=oipfObjectFactory.createSearchManagerObject(); - console.assert(searchManagerObject!=null,"The object searchManager is null."); - - console.log("[TEST-RUNNING][Result] Creating of searchManager oipf object [SUCESSFULL]."); - -} - -function testCreatingChannelConfigObj(){ - - console.log("[TEST-RUNNING][Info] Creating of channelConfig oipf object."); - currentChannelType = "TYPE_TV"; - currentChannelName = "ARTE"; - - currentchannel = new Channel(currentChannelName, currentChannelType); - console.assert(currentchannel != null,"The object currentChannel is null."); - console.assert(currentchannel.name == currentChannelName, "The current channel name don't match the affected name previously."); - console.assert(currentchannel.channelType == CHANNEL_CONSTANT[currentChannelType], "The current channel type don't match the affected type previously."); - - channelConfigObject=oipfObjectFactory.createChannelConfig(); - console.assert(channelConfigObject!=null,"The object channelConfig is null."); - - channelConfigObject.currentChannel = currentchannel; - console.assert(channelConfigObject.currentChannel == currentchannel, "Unconsistency about the current channel."); - - console.log("[TEST-RUNNING][Result] Creating of channelConfig oipf object [SUCESSFULL]."); - -} - -function testCreatingConfigurationObj(){ - - console.log("[TEST-RUNNING][Info] Creating of configuration oipf object."); - ///////////////////////////////////////////Before test: init//////////////////////////////// - tunerMain = new Tuner(); - tunerMain.name = "tnt"; - tunerArray = [tunerMain]; - - tunerCollection = new TunerCollection(tunerTab); - - configuration = new Configuration(); - - localsystem = new LocalSystem(); - localsystem.tuners=tunerCollection; - - ///////////////////////////////////////////Before test: init//////////////////////////////// - - currentchannel = new Channel(currentChannelName, currentChannelType); - console.assert(currentchannel != null,"The object currentChannel is null."); - console.assert(currentchannel.name == currentChannelName, "The current channel name don't match the affected name previously."); - console.assert(currentchannel.channelType == CHANNEL_CONSTANT[currentChannelType], "The current channel type don't match the affected type previously."); - - channelConfigObject=oipfObjectFactory.createChannelConfig(); - console.assert(channelConfigObject!=null,"The object channelConfig is null."); - - channelConfigObject.currentChannel = currentchannel; - console.assert(channelConfigObject.currentChannel == currentchannel, "Unconsistency about the current channel."); - - console.log("[TEST-RUNNING][Result] Creating of channelConfig oipf object [SUCESSFULL]."); - -} - -function testGetCurrentProgram(searchTarget, channel, startTime, offset, count){ - - var searchManagerObject = oipfObjectFactory.createSearchManagerObject(); - searchManagerObject.onMetadataSearch = function(search, state) { - - console.log("[INFO]: onMetadataSearch called"); - - switch(state) { - - case 0: - - console.log("[INFO] Result found."); - console.log(search.result[0]); - //for (var keys = Object.keys(search.result) in search.result) { - for (var i = 0; i< search.result.length; i++) { - var obj = search.result[i]; - console.log(obj); - var keys = Object.keys(obj); - console.log(keys); - //for (var j = 0; j< keys.length; j++) { - for (keys in obj){ - if (obj[keys] instanceof Object) { - - continue; - } - ////Test kind of obj - var h2 = document.createElement("H2"); - var t = document.createTextNode(keys); - h2.appendChild(t); - document.getElementById("prog").appendChild(h2); - var hr = document.createElement("HR"); - var p = document.createElement("P"); - t = document.createTextNode(obj[keys]); - p.appendChild(t); - document.getElementById("prog").appendChild(p); - document.getElementById("prog").appendChild(hr); - //break; - } - break; - } - document.getElementById("prog").style.visibility = "visible"; - - 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); - break; - - case 4: - - message = "[INFO] The search cannot be complete because of lack of ressources or any other reason."; - console.log(message); - break; - - default: - console.log("Unknow state"); - - } - } - var channelConfig = oipfObjectFactory.createChannelConfig(); - var metaDataSearch = searchManagerObject.createSearch(searchTarget); - console.log(metaDataSearch); - metaDataSearch.findProgrammesFromStream(channelConfig.currentChannel, null); - metaDataSearch.result.getResults(offset, count); - console.log(">>>>>>>>>>>>>>>>>>>>>><<", metaDataSearch.result[0], ">>>>"); -} \ No newline at end of file