Author: ygrego Date: 2015-02-16 17:13:37 +0000 (Mon, 16 Feb 2015) New Revision: 808 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/808 Log: Just return a boolean in methods tests. Deletion of object testCase. Modified: oipf/js/test/SearchManagerTest.js Modified: oipf/js/test/SearchManagerTest.js =================================================================== --- oipf/js/test/SearchManagerTest.js 2015-02-16 17:12:21 UTC (rev 807) +++ oipf/js/test/SearchManagerTest.js 2015-02-16 17:13:37 UTC (rev 808) @@ -3,7 +3,25 @@ * This class gather a set of method necessary to test a search manager object. * */ -var SearchManagerTest = Class.extend({ +var SearchManagerTest = TestCase.extend({ + + testsDescriptions: [{ + name : SearchManagerTest, + object : this, + tests : [{ + id : METH_ID_TEST_SM_INSTANCE_CREATION, + label : LABEL_TEST_SM_TEST_INSTANCE_CREATION, + method : METH_NAME_TEST_SM_INSTANCE_CREATION, + result : "" + }, + { + id : METH_ID_TEST_GET_CURRENT_PROGRAM, + label : LABEL_TEST_GET_CURRENT_PROGRAM, + method :METH_NAME_TEST_GET_CURRENT_PROGRAM, + result : "" + } + ] + }], searchManagerTest: null, @@ -11,12 +29,11 @@ }, - instanceCreation: function() { - var METHOD_NAME = "instanceCreation"; - var ID = INSTANCE_CREATION_TEST_CONSTANTS+" :SM"; + testInstanceCreation: function() { var state = "Pending"; - console.log("[TEST-RUNNING][Info] "+"Id: "+ID+", Label: "+INSTANCE_CREATION_TEST_CONSTANTS+", State: "+state); + console.log("[TEST-RUNNING][Info] "+"Id: "+METH_NAME_TEST_SM_INSTANCE_CREATION+", Label: "+LABEL_TEST_SM_TEST_INSTANCE_CREATION+", State: "+state); this.searchManagerTest = oipfObjectFactory.createSearchManagerObject(); + if ((this.videoBroadcastObject !== null) && (this.videoBroadcastObject !== undefined)) { var result = "Success"; @@ -24,26 +41,16 @@ result = "Failed"; } state = "Finished"; - console.log("[TEST-RUNNING][Info] "+"Id: "+ID+", Label: "+this.INSTANCE_CREATION+", State: "+state); - - var testCase = [{ - "id" : ID, - "label" : this.INSTANCE_CREATION, - "method" : METHOD_NAME, - "result" : result - }]; - - return testCase; + console.log("[TEST-RUNNING][Info] "+"Id: "+METH_NAME_TEST_SM_INSTANCE_CREATION+", Label: "+LABEL_TEST_SM_TEST_INSTANCE_CREATION+", State: "+state); + + return true; }, - getCurrentProgram: function(searchTarget, channel, startTime, offset, count) { - - var searchManagerObject = oipfObjectFactory.createSearchManagerObject(); - var METHOD_NAME = "instanceCreation"; - var ID = GET_CURR_PROG_TEST_CONSTANTS+" :SM"; + testGetCurrentProgram: function(searchTarget, channel, startTime, offset, count) { + var searchManagerObject = oipfObjectFactory.createSearchManagerObject(); var state = "Pending"; - console.log("[TEST-RUNNING][Info] "+"Id: "+ID+", Label: "+INSTANCE_CREATION_TEST_CONSTANTS+", State: "+state); - searchManagerObject.onMetadataSearch = function(search, state) { + console.log("[TEST-RUNNING][Info] "+"Id: "+METH_ID_TEST_GET_CURRENT_PROGRAM+", Label: "+LABEL_TEST_GET_CURRENT_PROGRAM+", State: "+state); + searchManagerObject.onMetadataSearch = function(search, state) { console.log("[INFO]: onMetadataSearch called"); @@ -107,5 +114,4 @@ metaDataSearch.result[0];//Must return undefined else wrong behaviour of this method } -}); - +}); \ No newline at end of file